Skip to content

Commit 10b8f80

Browse files
committed
fix: vscode.extensions.all API doesn't include any disabled extensions
VS Code's `extensions.all` API only gets enabled extensions and doesn't include disabled ones, which could prevent language configs being found. To fix, we completely remove getting the extensions from the vscode API, and instead get the extensions directly from the directories. - Added the ability to get the built-in and user extensions directly from the directory on non-WSL systems (eg. Windows), but using the same way it gets extensions on WSL using the extension data path keys and `readExtensionsFromDirectory` method. - Removed `vscode.extensions.all` API call from `findAllLanguageConfigFilePaths` method.
1 parent 397fba1 commit 10b8f80

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/configuration.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,16 @@ export class Configuration {
306306
extensions.push(...windowsBuiltInExtensions, ...windowsUserExtensions);
307307
}
308308

309+
const userExtensionsPath = this.extensionData.get("userExtensionsPath");
310+
const builtInExtensionsPath = this.extensionData.get("builtInExtensionsPath");
311+
312+
// Read the paths and create arrays of the extensions.
313+
const userExtensions = this.readExtensionsFromDirectory(userExtensionsPath);
314+
const builtInExtensions = this.readExtensionsFromDirectory(builtInExtensionsPath);
315+
309316
// Add all installed extensions (including built-in ones) into the extensions array.
310317
// If running WSL, these will be the WSL-installed extensions.
311-
extensions.push(...vscode.extensions.all);
318+
extensions.push(...builtInExtensions, ...userExtensions);
312319

313320
// Loop through all installed extensions, including built-in extensions
314321
for (let extension of extensions) {

0 commit comments

Comments
 (0)