microsoft / microsoft/vscode-makefile-tools

fix comment toggling

Open
#453 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Language Service
Dominant language
TypeScript
Stars
242
Forks
78
PR merge metrics
No merged PRs in 30d

Description

When I toggle on comments in makefile tasks with editor.action.commentLine, then I want the # to appear at the very start of the line, not nested after a tab.

make, unlike other common scripting languages, treats /^\t#...$/ as an actual command to send to the shell interpreter. Which produces ugly traces on UNIX terminals, and syntax errors on Command Prompt terminals.

When enabling comments for commands in a makefile rule, please stop the usual indentation and whitespace behavior, and just insert #\t at the very start of the line. When disabling comments, drop the # prefix from the start of the line.

Examples

Bad:

all:
	# @rustup component add clippy

Good:

all:
#	@rustup component add clippy

Commenting other regions of a makefile are probably fine with the existing behavior.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the handling of editor.action.commentLine for Makefile task commands and reproduce the issue with the provided makefile examples. Ensure enabling comments produces #\t at the line start and disabling comments removes that prefix, while other Makefile regions retain existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.