Skip to content

Commit fd91d44

Browse files
committed
Improve default extensionKind detection
1 parent 2fa41fb commit fd91d44

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

resources/serverless/code-web.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async function getDefaultExtensionInfos() {
124124

125125
let extensionArg = args['extension'];
126126
if (!extensionArg) {
127-
return { extensions, locations }
127+
return { extensions, locations };
128128
}
129129

130130
const extensionPaths = Array.isArray(extensionArg) ? extensionArg : [extensionArg];
@@ -164,7 +164,6 @@ async function getExtensionPackageJSON(extensionPath) {
164164
fancyLog(`${ansiColors.yellow('Warning')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn gulp watch-web')} to build the built-in extensions.`);
165165
}
166166
}
167-
packageJSON.extensionKind = ['web']; // enable for Web
168167

169168
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
170169
const packageNLSExists = await exists(packageNLSPath);

src/vs/workbench/services/extensions/common/extensionsUtil.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,31 @@ export function getExtensionKind(manifest: IExtensionManifest, productService: I
6161

6262
// Not an UI extension if it has main
6363
if (manifest.main) {
64+
if (manifest.browser) {
65+
return ['workspace', 'web'];
66+
}
6467
return ['workspace'];
6568
}
6669

67-
// Not an UI extension if it has dependencies or an extension pack
70+
if (manifest.browser) {
71+
return ['web'];
72+
}
73+
74+
// Not an UI nor web extension if it has dependencies or an extension pack
6875
if (isNonEmptyArray(manifest.extensionDependencies) || isNonEmptyArray(manifest.extensionPack)) {
6976
return ['workspace'];
7077
}
7178

7279
if (manifest.contributes) {
73-
// Not an UI extension if it has no ui contributions
80+
// Not an UI nor web extension if it has no ui contributions
7481
for (const contribution of Object.keys(manifest.contributes)) {
7582
if (!isUIExtensionPoint(contribution)) {
7683
return ['workspace'];
7784
}
7885
}
7986
}
8087

81-
return ['ui', 'workspace'];
88+
return ['ui', 'workspace', 'web'];
8289
}
8390

8491
let _uiExtensionPoints: Set<string> | null = null;

0 commit comments

Comments
 (0)