Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
51264fa
refactor: extract debug logging from `constructor` into new method
yCodeTech Jul 3, 2025
e057eda
build: add new dependency to detect if WSL is being used.
yCodeTech Jul 9, 2025
6d6e6f1
feat: add the ability to get all Windows extensions when running on WSL.
yCodeTech Jul 10, 2025
c97dbdb
refactor: `logDebugInfo` method to log different stuff when on WSL.
yCodeTech Jul 10, 2025
3fea208
fix: keybindings, docs, and paths to enable usage on macOS.
yCodeTech Jul 10, 2025
ff8e4f5
refactor: create a uniform way of obtaining this extension's details.
yCodeTech Jul 10, 2025
14717e6
fix: `logDebugInfo` user extensions path to use `getExtensionData`.
yCodeTech Jul 10, 2025
a658abd
feat: set the built-in extensions path into `extensionDetails`
yCodeTech Jul 10, 2025
140cba1
change: extension logger info to log the `extensionDetails` Map instead.
yCodeTech Jul 11, 2025
f46d01d
feat: add WSL paths to `setExtensionData` method.
yCodeTech Jul 11, 2025
9bb5ebb
fix: `readExtensionsFromDirectory` to skip directories starting with …
yCodeTech Jul 11, 2025
8790f84
fix: TS compile error: Cannot find name 'isWSL'. Did you mean 'isWsl'?
yCodeTech Jul 12, 2025
1ecabcc
remove: unused variables which the usages were removed in commit 140cba1
yCodeTech Jul 16, 2025
f15cfe0
refactor: move utility functions to a new `utils` file.
yCodeTech Jul 17, 2025
e6214cd
refactor: "directory exists" code in `writeJsonFile` into a new function
yCodeTech Jul 17, 2025
e5063bc
refactor: replace `mergeConfigProperty` with `mergeArraysBy` utils fu…
yCodeTech Jul 17, 2025
b0a40aa
refactor: retrieval of extension data into a new `ExtensionData` class.
yCodeTech Jul 17, 2025
f08044b
fix: `vscode.extensions.all` API doesn't include any disabled extensions
yCodeTech Jul 17, 2025
e2f3701
fix: TS compile error: Cannot find name 'id'.
yCodeTech Jul 17, 2025
1a56d6b
refactor: extract debug logging from `constructor` into new method
yCodeTech Jul 3, 2025
00952ac
build: add new dependency to detect if WSL is being used.
yCodeTech Jul 9, 2025
b313aa8
feat: add the ability to get all Windows extensions when running on WSL.
yCodeTech Jul 10, 2025
4e790c8
refactor: `logDebugInfo` method to log different stuff when on WSL.
yCodeTech Jul 10, 2025
338587e
fix: keybindings, docs, and paths to enable usage on macOS.
yCodeTech Jul 10, 2025
423fc58
refactor: create a uniform way of obtaining this extension's details.
yCodeTech Jul 10, 2025
03c856c
fix: `logDebugInfo` user extensions path to use `getExtensionData`.
yCodeTech Jul 10, 2025
5d76d3b
feat: set the built-in extensions path into `extensionDetails`
yCodeTech Jul 10, 2025
f7811d2
change: extension logger info to log the `extensionDetails` Map instead.
yCodeTech Jul 11, 2025
bf96ee3
feat: add WSL paths to `setExtensionData` method.
yCodeTech Jul 11, 2025
64f7962
fix: `readExtensionsFromDirectory` to skip directories starting with …
yCodeTech Jul 11, 2025
99cac65
fix: TS compile error: Cannot find name 'isWSL'. Did you mean 'isWsl'?
yCodeTech Jul 12, 2025
89db523
remove: unused variables which the usages were removed in commit 140cba1
yCodeTech Jul 16, 2025
7aafe37
refactor: move utility functions to a new `utils` file.
yCodeTech Jul 17, 2025
813e3c9
refactor: "directory exists" code in `writeJsonFile` into a new function
yCodeTech Jul 17, 2025
0ea1609
refactor: replace `mergeConfigProperty` with `mergeArraysBy` utils fu…
yCodeTech Jul 17, 2025
397fba1
refactor: retrieval of extension data into a new `ExtensionData` class.
yCodeTech Jul 17, 2025
10b8f80
fix: `vscode.extensions.all` API doesn't include any disabled extensions
yCodeTech Jul 17, 2025
518bfea
fix: TS compile error: Cannot find name 'id'.
yCodeTech Jul 17, 2025
87ef56d
Merge branch 'patch/v1.1.10' of https://github.com/yCodeTech/auto-com…
yCodeTech Jul 17, 2025
027c0da
fix: update the rest of `packageJSON` variable typings to `IPackageJson`
yCodeTech Jul 17, 2025
3f8784b
remove: unused `context` param.
yCodeTech Jul 17, 2025
13cca39
style: formatting and adding docblocks
yCodeTech Jul 17, 2025
a46651b
fix: `disabledLanguages` are not being disabled
yCodeTech Jul 18, 2025
9800b70
docs: update language definition files
yCodeTech Jul 21, 2025
692895e
fix: `languageConfigFilePaths` to support multiple config paths per lang
yCodeTech Jul 21, 2025
90eb99d
chore: version bump
yCodeTech Jul 21, 2025
1135d57
docs: remove known issue about not working in WSL2. This is now fixed.
yCodeTech Jul 21, 2025
e179f18
chore(editorconfig): add auto indent style for `.md` to `space`
yCodeTech Jul 21, 2025
8b7a087
docs: updated changelog
yCodeTech Jul 21, 2025
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ indent_size = 4

[*.md]
trim_trailing_whitespace = false
indent_style = space

[*.yml]
indent_style = space
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@ 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.10](https://github.com/yCodeTech/auto-comment-blocks/releases/tag/v1.1.10) - 2025-07-21

#### Fixed:

- Fixes yCodeTech/auto-comment-blocks#6 and indirectly yCodeTech/auto-comment-blocks#7

VS Code's `vscode.extensions.all` API doesn't find any built-in extensions on the Windows-side when running in WSL. It only gets the WSL-installed extensions, which causes the extension not to work at all because the language configuration file is not found.

The workaround fix is to manually read the Windows extensions directories when running in WSL and merge them with the WSL-installed extensions.

- Fixed language support detection to properly respect disabled language settings.

Custom language configurations now correctly check if a language is disabled before applying support, preventing unwanted language activation.

- Fixed support for languages with multiple extension configuration files by merging their configurations instead of overwriting them, ensuring complete language support. Also improved language configuration merging by properly handling comment configurations.

#### Added:

- Added the ability to get the all extensions directly from the directory on non-WSL systems (eg. Windows) because VS Code's `extensions.all` API only gets enabled extensions and doesn't include disabled ones, which could prevent language configs being found.

- Removed `vscode.extensions.all` API call from `findAllLanguageConfigFilePaths` method in favour of getting the extensions directly from the directories.

- Added new dependencies:

- `is-wsl` for detecting WSL environments.
- `package-json-type` for TypeScript type definitions of package.json.

- Added macOS keybinding support (`cmd+shift+m`) for the Blade override comments command.

#### Changed:

- Refactored extension architecture with improved separation of concerns.

Major code reorganisation including extraction of utility functions, centralised extension data management, and improved debugging capabilities.

- Added new `ExtensionData` class to centralize extension metadata management.

This new class provides a clean interface for accessing extension details like ID, name, version, and various system paths, improving code organisation and maintainability.

- Added new `utils.ts` file with shared utility functions.

Extracted common functionality into reusable utility functions including JSON file operations, regex reconstruction, array merging, and data conversion utilities.

- Updated debug logging to provide more comprehensive environment and configuration information. Enhanced diagnostic output now includes detailed extension paths for both WSL and native environments, making troubleshooting easier.

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

#### Fixed:
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ There are 3 conditions in which a language is officially supported:
2. The language is not defined in the `skip-languages` config file; and
3. The language config has either `lineComment` or `blockComment` keys defined.

Most of the officially VScode-supported languages (as defined in the [docs](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers)) pass these conditions.
Most of the officially VScode default languages (as defined in the [docs](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers)) pass these conditions.

For a full list of auto-supported VScode default languages, please view the auto-generated definition files:

- [Multi-line languages](https://github.com/yCodeTech/auto-comment-blocks/blob/master/auto-generated-language-definitions/multi-line-languages.json)
- [Single-line languages](https://github.com/yCodeTech/auto-comment-blocks/blob/master/auto-generated-language-definitions/single-line-languages.json)

---

Expand Down Expand Up @@ -124,7 +129,7 @@ Use `/*!` in all file types that support the normal `/*` comments to start a QDo

#### Normal comment blocks

Using the normal comment block `/* */` either typing manually or the native VScode command "Toggle Block Comment" (`editor.action.blockComment`, native keybinding `shift + alt + a`), the block will have the same on enter functionality as described above.
Using the normal comment block `/* */` either typing manually or the native VScode command "Toggle Block Comment" (`editor.action.blockComment`, native keybinding <kbd>shift + alt + a</kbd> (macOS: <kbd>shift + option + a</kbd>)), the block will have the same on enter functionality as described above.

![block-comments](https://raw.githubusercontent.com/yCodeTech/auto-comment-blocks/master/img/block-comments.gif)

Expand Down Expand Up @@ -156,18 +161,16 @@ Reload the extension after changing any settings.

- `auto-comment-blocks.multiLineStyleBlocks`: Add language IDs here to enable multi-line comment blocks support for that language, allowing unsupported languages to have comment completion. The default is `['blade', 'html']`"

- `auto-comment-blocks.overrideDefaultLanguageMultiLineComments`: A key : value pairing of language IDs and the beginning portion of a multi-line comment style, to override the default comment style for the vscode "Toggle Block Comment" `editor.action.blockComment` command (native Keybinding `shift + alt + a`). eg. `{'php': '/*!'}`
- `auto-comment-blocks.overrideDefaultLanguageMultiLineComments`: A key : value pairing of language IDs and the beginning portion of a multi-line comment style, to override the default comment style for the vscode "Toggle Block Comment" `editor.action.blockComment` command (native Keybinding <kbd>shift + alt + a</kbd> (macOS: <kbd>shift + option + a</kbd>)). eg. `{'php': '/*!'}`

- `auto-comment-blocks.bladeOverrideComments`: When enabled, Blade-style block comments will be used in Blade contexts. Ie. `{{-- --}}` comments will be used instead of the HTML `<!-- -->` comments. Keybinding to enable/disable, default `ctrl + shift + m`. If `blade` language ID is set in the disabledLanguages, then the HTML `<!-- -->` comments will be used.
- `auto-comment-blocks.bladeOverrideComments`: When enabled, Blade-style block comments will be used in Blade contexts. Ie. `{{-- --}}` comments will be used instead of the HTML `<!-- -->` comments. Keybinding to enable/disable, default <kbd>ctrl + shift + m</kbd> (macOS: <kbd>cmd + shift + m</kbd>). If `blade` language ID is set in the disabledLanguages, then the HTML `<!-- -->` comments will be used.

## Known Issues

- Sometimes multi-line completion/asterisk insertion doesn't work. The reason is still unknown. It may go away if you reload your workspace.

- Currently, VS Code only allows extensions to overwrite, instead of modify, existing language configurations. This means that this extension may clash with another extension that overwrites the same language configurations, causing one or both not to work. In that case, uninstalling this extension is the only option for now.

- Doesn't work properly on Windows Linux WSL2. VScode API only finds language configs that are installed only on WSL2, and not also on Windows. That means all the normal built-in as well as 3rd party extensions won't have auto comment blocks support in WSL2. (Related issue: [#6](https://github.com/yCodeTech/auto-comment-blocks/issues/6))

Please [report an issue](https://github.com/yCodeTech/auto-comment-blocks/issues/new) if you find any bugs, or have questions or feature requests.

As of v1.1.7, debugging information is now logged to a dedicated `Auto Comment Blocks` Output channel. Please save the entire log to file using the `Save Output As` button in the Output's "3-dot menu", and attach the file to any new issue.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@
"typescript",
"typescriptreact"
],
"customSupportedLanguages": [
"blade",
"html"
]
"customSupportedLanguages": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"git-commit",
"git-rebase",
"github-actions-workflow",
"http",
"ignore",
"julia",
"makefile",
Expand Down Expand Up @@ -58,7 +57,8 @@
],
";": [
"clojure",
"ini"
"ini",
"wat"
]
},
"customSupportedLanguages": {}
Expand Down
11 changes: 7 additions & 4 deletions 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.9",
"version": "1.1.10",
"publisher": "ycodetech",
"homepage": "https://github.com/ycodetech/auto-comment-blocks",
"repository": {
Expand Down Expand Up @@ -71,13 +71,13 @@
"auto-comment-blocks.overrideDefaultLanguageMultiLineComments": {
"type": "object",
"default": {},
"markdownDescription": "A key : value pairing of language IDs and the beginning portion of a multi-line comment style, to override the default comment style for the vscode `command editor.action.blockComment` (native Keybinding `shift + alt + a`). eg. `{'php': '/*!'}`"
"markdownDescription": "A key : value pairing of language IDs and the beginning portion of a multi-line comment style, to override the default comment style for the vscode `command editor.action.blockComment` (native Keybinding `shift + alt + a` (macOS: `shift + option + a`)). eg. `{'php': '/*!'}`"
},
"auto-comment-blocks.bladeOverrideComments": {
"scope": "resource",
"type": "boolean",
"default": false,
"markdownDescription": "When enabled, Blade style block comments will be used in Blade contexts. Ie. `{{-- --}}` comments will be used instead of the HTML `<!-- -->` comments. Keybinding to enable/disable, default `ctrl + shift + m`. If `blade` language ID is set in the disabledLanguages, then the HTML `<!-- -->` comments will be used."
"markdownDescription": "When enabled, Blade style block comments will be used in Blade contexts. Ie. `{{-- --}}` comments will be used instead of the HTML `<!-- -->` comments. Keybinding to enable/disable, default `ctrl + shift + m` (macOS: `cmd + shift + m`). If `blade` language ID is set in the disabledLanguages, then the HTML `<!-- -->` comments will be used."
}
}
},
Expand All @@ -90,6 +90,7 @@
{
"command": "auto-comment-blocks.changeBladeMultiLineBlock",
"key": "ctrl+shift+m",
"mac": "cmd+shift+m",
"when": "editorTextFocus"
}
]
Expand All @@ -108,6 +109,8 @@
"typescript": "^5.7"
},
"dependencies": {
"jsonc-parser": "^3.3.1"
"is-wsl": "^3.1.0",
"jsonc-parser": "^3.3.1",
"package-json-type": "^1.0.3"
}
}
Loading