Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this extension will be documented in this file.

This Changelog uses the [Keep a Changelog](http://keepachangelog.com/) structure.

## [1.1.9](https://github.com/yCodeTech/auto-comment-blocks/releases/tag/v1.1.9) - 2025-07-12

#### Fixed:

- Fixes yCodeTech/auto-comment-blocks#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`.

## [1.1.8](https://github.com/yCodeTech/auto-comment-blocks/releases/tag/v1.1.8) - 2025-06-19

#### Fixed:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "automatic-comment-blocks",
"displayName": "Automatic Comment Blocks",
"description": "Provides block comment completion for Javadoc-style multi-line comments and single-line comment blocks for most officially supported languages.",
"version": "1.1.8",
"version": "1.1.9",
"publisher": "ycodetech",
"homepage": "https://github.com/ycodetech/auto-comment-blocks",
"repository": {
Expand Down
14 changes: 11 additions & 3 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,24 @@ export class Configuration {
// If the config object has own property of comments AND the comments key has
// own property of lineComment...
if (Object.hasOwn(config, "comments") && Object.hasOwn(config.comments, "lineComment")) {
let lineComment = config.comments.lineComment;

// Line comments can be a string or an object with a "comment" key.
// If the lineComment is an object, get the "comment" key value.
if (Object.hasOwn(lineComment, "comment")) {
lineComment = lineComment.comment;
}

// If the lineComment is "//"...
if (config.comments.lineComment === "//") {
if (lineComment === "//") {
style = "//";
}
// If the lineComment is "#"...
else if (config.comments.lineComment === "#") {
else if (lineComment === "#") {
style = "#";
}
// If the lineComment includes a ";" (; or ;;)...
else if (config.comments.lineComment.includes(";")) {
else if (lineComment.includes(";")) {
style = ";";
}

Expand Down
Loading