You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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.
Copy file name to clipboardExpand all lines: README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,12 @@ There are 3 conditions in which a language is officially supported:
61
61
2. The language is not defined in the `skip-languages` config file; and
62
62
3. The language config has either `lineComment` or `blockComment` keys defined.
63
63
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:
@@ -124,7 +129,7 @@ Use `/*!` in all file types that support the normal `/*` comments to start a QDo
124
129
125
130
#### Normal comment blocks
126
131
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.
@@ -156,18 +161,16 @@ Reload the extension after changing any settings.
156
161
157
162
-`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']`"
158
163
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': '/*!'}`
160
165
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.
162
167
163
168
## Known Issues
164
169
165
170
- Sometimes multi-line completion/asterisk insertion doesn't work. The reason is still unknown. It may go away if you reload your workspace.
166
171
167
172
- 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.
168
173
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
-
171
174
Please [report an issue](https://github.com/yCodeTech/auto-comment-blocks/issues/new) if you find any bugs, or have questions or feature requests.
172
175
173
176
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.
Copy file name to clipboardExpand all lines: package.json
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "automatic-comment-blocks",
3
3
"displayName": "Automatic Comment Blocks",
4
4
"description": "Provides block comment completion for Javadoc-style multi-line comments and single-line comment blocks for most officially supported languages.",
"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': '/*!'}`"
75
75
},
76
76
"auto-comment-blocks.bladeOverrideComments": {
77
77
"scope": "resource",
78
78
"type": "boolean",
79
79
"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."
0 commit comments