Skip to content

Commit fd3136e

Browse files
committed
expose setting to customise extension kind
1 parent ea743f5 commit fd3136e

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

src/vs/platform/extensions/node/extensionsUtil.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import product from 'vs/platform/product/node/product';
1111

1212
export function isUIExtension(manifest: IExtensionManifest, uiContributions: string[], configurationService: IConfigurationService): boolean {
1313
const extensionId = getGalleryExtensionId(manifest.publisher, manifest.name);
14-
const configuredUIExtensions = configurationService.getValue<string[]>('_workbench.uiExtensions') || [];
15-
if (configuredUIExtensions.some(id => areSameExtensions({ id }, { id: extensionId }))) {
16-
return true;
17-
}
18-
if (configuredUIExtensions.some(id => areSameExtensions({ id }, { id: `-${extensionId}` }))) {
14+
const { ui, workspace } = configurationService.getValue<{ ui: string[], workspace: string[] }>('extensions.extensionKind') || { ui: [], workspace: [] };
15+
if (isNonEmptyArray(workspace) && workspace.some(id => areSameExtensions({ id }, { id: extensionId }))) {
1916
return false;
2017
}
18+
if (isNonEmptyArray(ui) && ui.some(id => areSameExtensions({ id }, { id: extensionId }))) {
19+
return true;
20+
}
2121
switch (manifest.extensionKind) {
2222
case 'ui': return true;
2323
case 'workspace': return false;

src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,30 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
242242
description: localize('extensionsCloseExtensionDetailsOnViewChange', "When enabled, editors with extension details will be automatically closed upon navigating away from the Extensions View."),
243243
default: false
244244
},
245+
'extensions.extensionKind': {
246+
type: 'object',
247+
description: localize('extensions.extensionKind', "Configure ui or workspace extensions and allow them to run locally or remotely in a remote window."),
248+
properties: {
249+
'ui': {
250+
type: 'array',
251+
items: {
252+
type: 'string',
253+
pattern: '^([a-z0-9A-Z][a-z0-9\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\-A-Z]*)$',
254+
}
255+
},
256+
'workspace': {
257+
type: 'array',
258+
items: {
259+
type: 'string',
260+
pattern: '^([a-z0-9A-Z][a-z0-9\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\-A-Z]*)$',
261+
}
262+
}
263+
},
264+
default: {
265+
ui: [],
266+
workspace: []
267+
}
268+
},
245269
'extensions.showInstalledExtensionsByDefault': {
246270
type: 'boolean',
247271
description: localize('extensions.showInstalledExtensionsByDefault', "When enabled, extensions view shows installed extensions view by default."),

0 commit comments

Comments
 (0)