Skip to content

Commit f383ad1

Browse files
authored
Merge pull request #12 from yCodeTech/patch/v1.1.10
Release v1.1.10
2 parents fbbeafa + 8b7a087 commit f383ad1

File tree

10 files changed

+627
-297
lines changed

10 files changed

+627
-297
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ indent_size = 4
1313

1414
[*.md]
1515
trim_trailing_whitespace = false
16+
indent_style = space
1617

1718
[*.yml]
1819
indent_style = space

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,51 @@ All notable changes to this extension will be documented in this file.
44

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

7+
## [1.1.10](https://github.com/yCodeTech/auto-comment-blocks/releases/tag/v1.1.10) - 2025-07-21
8+
9+
#### Fixed:
10+
11+
- Fixes yCodeTech/auto-comment-blocks#6 and indirectly yCodeTech/auto-comment-blocks#7
12+
13+
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.
14+
15+
The workaround fix is to manually read the Windows extensions directories when running in WSL and merge them with the WSL-installed extensions.
16+
17+
- Fixed language support detection to properly respect disabled language settings.
18+
19+
Custom language configurations now correctly check if a language is disabled before applying support, preventing unwanted language activation.
20+
21+
- 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.
22+
23+
#### Added:
24+
25+
- 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.
26+
27+
- Removed `vscode.extensions.all` API call from `findAllLanguageConfigFilePaths` method in favour of getting the extensions directly from the directories.
28+
29+
- Added new dependencies:
30+
31+
- `is-wsl` for detecting WSL environments.
32+
- `package-json-type` for TypeScript type definitions of package.json.
33+
34+
- Added macOS keybinding support (`cmd+shift+m`) for the Blade override comments command.
35+
36+
#### Changed:
37+
38+
- Refactored extension architecture with improved separation of concerns.
39+
40+
Major code reorganisation including extraction of utility functions, centralised extension data management, and improved debugging capabilities.
41+
42+
- Added new `ExtensionData` class to centralize extension metadata management.
43+
44+
This new class provides a clean interface for accessing extension details like ID, name, version, and various system paths, improving code organisation and maintainability.
45+
46+
- Added new `utils.ts` file with shared utility functions.
47+
48+
Extracted common functionality into reusable utility functions including JSON file operations, regex reconstruction, array merging, and data conversion utilities.
49+
50+
- 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.
51+
752
## [1.1.9](https://github.com/yCodeTech/auto-comment-blocks/releases/tag/v1.1.9) - 2025-07-12
853

954
#### Fixed:

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ There are 3 conditions in which a language is officially supported:
6161
2. The language is not defined in the `skip-languages` config file; and
6262
3. The language config has either `lineComment` or `blockComment` keys defined.
6363

64-
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.
64+
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.
65+
66+
For a full list of auto-supported VScode default languages, please view the auto-generated definition files:
67+
68+
- [Multi-line languages](https://github.com/yCodeTech/auto-comment-blocks/blob/master/auto-generated-language-definitions/multi-line-languages.json)
69+
- [Single-line languages](https://github.com/yCodeTech/auto-comment-blocks/blob/master/auto-generated-language-definitions/single-line-languages.json)
6570

6671
---
6772

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

125130
#### Normal comment blocks
126131

127-
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.
132+
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.
128133

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

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

157162
- `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']`"
158163

159-
- `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': '/*!'}`
164+
- `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': '/*!'}`
160165

161-
- `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.
166+
- `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.
162167

163168
## Known Issues
164169

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

167172
- 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.
168173

169-
- 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))
170-
171174
Please [report an issue](https://github.com/yCodeTech/auto-comment-blocks/issues/new) if you find any bugs, or have questions or feature requests.
172175

173176
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.

auto-generated-language-definitions/multi-line-languages.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@
3030
"typescript",
3131
"typescriptreact"
3232
],
33-
"customSupportedLanguages": [
34-
"blade",
35-
"html"
36-
]
33+
"customSupportedLanguages": []
3734
}

auto-generated-language-definitions/single-line-languages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"git-commit",
1212
"git-rebase",
1313
"github-actions-workflow",
14-
"http",
1514
"ignore",
1615
"julia",
1716
"makefile",
@@ -58,7 +57,8 @@
5857
],
5958
";": [
6059
"clojure",
61-
"ini"
60+
"ini",
61+
"wat"
6262
]
6363
},
6464
"customSupportedLanguages": {}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "automatic-comment-blocks",
33
"displayName": "Automatic Comment Blocks",
44
"description": "Provides block comment completion for Javadoc-style multi-line comments and single-line comment blocks for most officially supported languages.",
5-
"version": "1.1.9",
5+
"version": "1.1.10",
66
"publisher": "ycodetech",
77
"homepage": "https://github.com/ycodetech/auto-comment-blocks",
88
"repository": {
@@ -71,13 +71,13 @@
7171
"auto-comment-blocks.overrideDefaultLanguageMultiLineComments": {
7272
"type": "object",
7373
"default": {},
74-
"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': '/*!'}`"
74+
"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': '/*!'}`"
7575
},
7676
"auto-comment-blocks.bladeOverrideComments": {
7777
"scope": "resource",
7878
"type": "boolean",
7979
"default": false,
80-
"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."
80+
"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."
8181
}
8282
}
8383
},
@@ -90,6 +90,7 @@
9090
{
9191
"command": "auto-comment-blocks.changeBladeMultiLineBlock",
9292
"key": "ctrl+shift+m",
93+
"mac": "cmd+shift+m",
9394
"when": "editorTextFocus"
9495
}
9596
]
@@ -108,6 +109,8 @@
108109
"typescript": "^5.7"
109110
},
110111
"dependencies": {
111-
"jsonc-parser": "^3.3.1"
112+
"is-wsl": "^3.1.0",
113+
"jsonc-parser": "^3.3.1",
114+
"package-json-type": "^1.0.3"
112115
}
113116
}

0 commit comments

Comments
 (0)