Skip to content

Conversation

@yCodeTech
Copy link
Owner

@yCodeTech yCodeTech commented Jul 12, 2025

Fixes #10

The lineComment language config key has changed to be either a string or an object. With the object having comment and noIndent keys, which was introduced in VS Code's June 2025 release. This breaks the extension when encountering the makefile language, and an error occurs:

lineComment.includes is not a function

To fix:

  • Added a check to see if the lineComment is an object with a comment key inside, if it does then use the string value of the comment key. Otherwise, it will use the string value of the lineComment.

Fixes #10

In the `setSingleLineCommentLanguageDefinitions` method, it uses the `String.includes` method to detect when the `lineComment` string `includes` a semi-colon - ;.  The `lineComment` the language config has changed to be either a string or an object. The object has a `comment` and `noIndent` keys.

The `includes` method fails due to it being an object and errors out with "lineComment.includes is not a function".

To fix:

- Added a check to see if the `lineComment` is an object with a `comment` key inside, if it does then use the string value of the `comment` key. Otherwise, it will use the string value of the `lineComment`.
@yCodeTech yCodeTech changed the title Fix single-line comment config change in vscode june 2025 release Fix single-line comment config changes in vscode june 2025 release Jul 12, 2025
@yCodeTech yCodeTech changed the title Fix single-line comment config changes in vscode june 2025 release Fix single-line comment config changes in VS Code June 2025 release Jul 12, 2025
@yCodeTech yCodeTech merged commit 3ac9569 into master Jul 12, 2025
2 checks passed
@yCodeTech yCodeTech deleted the fix/single-line-comment-config-change-in-vscode-june-2025-release branch July 12, 2025 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: single-line comment fails in VS Code June release

2 participants