diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index 15e27de02028e..03232b7c29700 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -144,16 +144,14 @@ export interface ICustomViewDescriptor extends ITreeViewDescriptor { type ViewContainerExtensionPointType = { [loc: string]: IUserFriendlyViewsContainerDescriptor[] }; const viewsContainersExtensionPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'viewsContainers', - jsonSchema: viewsContainersContribution, - isDynamic: true + jsonSchema: viewsContainersContribution }); type ViewExtensionPointType = { [loc: string]: IUserFriendlyViewDescriptor[] }; const viewsExtensionPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'views', deps: [viewsContainersExtensionPoint], - jsonSchema: viewsContribution, - isDynamic: true + jsonSchema: viewsContribution }); const TEST_VIEW_CONTAINER_ORDER = 6; diff --git a/src/vs/workbench/api/common/configurationExtensionPoint.ts b/src/vs/workbench/api/common/configurationExtensionPoint.ts index 596500d9c4c1d..65003a65a7153 100644 --- a/src/vs/workbench/api/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/api/common/configurationExtensionPoint.ts @@ -91,8 +91,7 @@ const defaultConfigurationExtPoint = ExtensionsRegistry.registerExtensionPoint { if (removed.length) { @@ -134,8 +133,7 @@ const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint = new Map(); diff --git a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts index 487ca13bedadf..8e20f407866f0 100644 --- a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts +++ b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts @@ -15,7 +15,6 @@ interface IJSONValidationExtensionPoint { const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'jsonValidation', - isDynamic: true, jsonSchema: { description: nls.localize('contributes.jsonValidation', 'Contributes json schema configuration.'), type: 'array', diff --git a/src/vs/workbench/api/common/menusExtensionPoint.ts b/src/vs/workbench/api/common/menusExtensionPoint.ts index ce30b27bfbe2c..74406c0ef9c61 100644 --- a/src/vs/workbench/api/common/menusExtensionPoint.ts +++ b/src/vs/workbench/api/common/menusExtensionPoint.ts @@ -282,8 +282,7 @@ let _commandRegistrations: IDisposable[] = []; ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'commands', - jsonSchema: schema.commandsContribution, - isDynamic: true + jsonSchema: schema.commandsContribution }).setHandler(extensions => { function handleCommand(userFriendlyCommand: schema.IUserFriendlyCommand, extension: IExtensionPointUser, disposables: IDisposable[]) { @@ -332,8 +331,7 @@ let _menuRegistrations: IDisposable[] = []; ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyMenuItem[] }>({ extensionPoint: 'menus', - jsonSchema: schema.menusContribtion, - isDynamic: true + jsonSchema: schema.menusContribtion }).setHandler(extensions => { // remove all previous menu registrations diff --git a/src/vs/workbench/contrib/debug/common/debugSchemas.ts b/src/vs/workbench/contrib/debug/common/debugSchemas.ts index 1969ba6b5b963..d7740637af513 100644 --- a/src/vs/workbench/contrib/debug/common/debugSchemas.ts +++ b/src/vs/workbench/contrib/debug/common/debugSchemas.ts @@ -13,7 +13,6 @@ import { inputsSchema } from 'vs/workbench/services/configurationResolver/common // debuggers extension point export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'debuggers', - isDynamic: true, jsonSchema: { description: nls.localize('vscode.extension.contributes.debuggers', 'Contributes debug adapters.'), type: 'array', @@ -112,7 +111,6 @@ export interface IRawBreakpointContribution { // breakpoints extension point #9037 export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'breakpoints', - isDynamic: true, jsonSchema: { description: nls.localize('vscode.extension.contributes.breakpoints', 'Contributes breakpoints.'), type: 'array', diff --git a/src/vs/workbench/contrib/snippets/browser/snippetsService.ts b/src/vs/workbench/contrib/snippets/browser/snippetsService.ts index 797c5f36c9a32..fc45860254cdb 100644 --- a/src/vs/workbench/contrib/snippets/browser/snippetsService.ts +++ b/src/vs/workbench/contrib/snippets/browser/snippetsService.ts @@ -107,7 +107,6 @@ namespace snippetExt { }; export const point = ExtensionsRegistry.registerExtensionPoint({ - isDynamic: true, extensionPoint: 'snippets', deps: [languagesExtPoint], jsonSchema: snippetExt.snippetsContribution diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts index 62198ca45a0c0..57ece428c2c75 100644 --- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts @@ -1093,8 +1093,7 @@ const problemPatternExtPoint = ExtensionsRegistry.registerExtensionPoint { export class ExtensionPoint implements IExtensionPoint { public readonly name: string; - public readonly isDynamic: boolean; private _handler: IExtensionPointHandler | null; - private _handlerCalled: boolean; private _users: IExtensionPointUser[] | null; private _delta: ExtensionPointUserDelta | null; - constructor(name: string, isDynamic: boolean) { + constructor(name: string) { this.name = name; - this.isDynamic = isDynamic; this._handler = null; - this._handlerCalled = false; this._users = null; this._delta = null; } @@ -140,12 +136,7 @@ export class ExtensionPoint implements IExtensionPoint { return; } - if (this._handlerCalled && !this.isDynamic) { - throw new Error('The extension point is not dynamic!'); - } - try { - this._handlerCalled = true; this._handler(this._users, this._delta); } catch (err) { onUnexpectedError(err); @@ -367,7 +358,6 @@ export const schema = { }; export interface IExtensionPointDescriptor { - isDynamic?: boolean; extensionPoint: string; deps?: IExtensionPoint[]; jsonSchema: IJSONSchema; @@ -385,7 +375,7 @@ export class ExtensionsRegistryImpl { if (hasOwnProperty.call(this._extensionPoints, desc.extensionPoint)) { throw new Error('Duplicate extension point: ' + desc.extensionPoint); } - let result = new ExtensionPoint(desc.extensionPoint, desc.isDynamic || false); + let result = new ExtensionPoint(desc.extensionPoint); this._extensionPoints[desc.extensionPoint] = result; schema.properties['contributes'].properties[desc.extensionPoint] = desc.jsonSchema; diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index d09b440a24725..2c2f9c7f3c047 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -197,8 +197,8 @@ export class ExtensionService extends Disposable implements IExtensionService { } const extensionDescription = await this._extensionScanner.scanSingleExtension(extension.location.fsPath, extension.type === ExtensionType.System, this.createLogger()); - if (!extensionDescription || !this._usesOnlyDynamicExtensionPoints(extensionDescription)) { - // uses non-dynamic extension point + if (!extensionDescription) { + // could not scan extension... continue; } @@ -271,22 +271,6 @@ export class ExtensionService extends Disposable implements IExtensionService { } } - private _usesOnlyDynamicExtensionPoints(extension: IExtensionDescription): boolean { - const extensionPoints = ExtensionsRegistry.getExtensionPointsMap(); - if (extension.contributes) { - for (let extPointName in extension.contributes) { - if (hasOwnProperty.call(extension.contributes, extPointName)) { - const extPoint = extensionPoints[extPointName]; - if (extPoint && !extPoint.isDynamic) { - return false; - } - } - } - } - - return true; - } - public canAddExtension(extension: IExtensionDescription): boolean { if (this._windowService.getConfiguration().remoteAuthority) { return false; @@ -304,7 +288,7 @@ export class ExtensionService extends Disposable implements IExtensionService { } } - return this._usesOnlyDynamicExtensionPoints(extension); + return true; } public canRemoveExtension(extension: IExtensionDescription): boolean { @@ -331,7 +315,7 @@ export class ExtensionService extends Disposable implements IExtensionService { return false; } - return this._usesOnlyDynamicExtensionPoints(extension); + return true; } private async _activateAddedExtensionIfNeeded(extensionDescription: IExtensionDescription): Promise { diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index c8f4664630bd3..3c7899079ab48 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -237,7 +237,6 @@ let keybindingType: IJSONSchema = { }; const keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint({ - isDynamic: true, extensionPoint: 'keybindings', jsonSchema: { description: nls.localize('vscode.extension.contributes.keybindings', "Contributes keybindings."), diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts index 661c5bcb24296..b4f6aabb6c5b1 100644 --- a/src/vs/workbench/services/label/common/labelService.ts +++ b/src/vs/workbench/services/label/common/labelService.ts @@ -24,7 +24,6 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'resourceLabelFormatters', - isDynamic: true, jsonSchema: { description: localize('vscode.extension.contributes.resourceLabelFormatters', 'Contributes resource label formatting rules.'), type: 'array', diff --git a/src/vs/workbench/services/mode/common/workbenchModeService.ts b/src/vs/workbench/services/mode/common/workbenchModeService.ts index 739bd17c643f6..2c4b733b2fbdd 100644 --- a/src/vs/workbench/services/mode/common/workbenchModeService.ts +++ b/src/vs/workbench/services/mode/common/workbenchModeService.ts @@ -28,7 +28,6 @@ export interface IRawLanguageExtensionPoint { } export const languagesExtPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint({ - isDynamic: true, extensionPoint: 'languages', jsonSchema: { description: nls.localize('vscode.extension.contributes.languages', 'Contributes language declarations.'), diff --git a/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts b/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts index 5ff125a0a6df5..6cc44b7ac1216 100644 --- a/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts +++ b/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts @@ -25,7 +25,6 @@ export interface ITMSyntaxExtensionPoint { } export const grammarsExtPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint({ - isDynamic: true, extensionPoint: 'grammars', deps: [languagesExtPoint], jsonSchema: { diff --git a/src/vs/workbench/services/themes/browser/colorThemeStore.ts b/src/vs/workbench/services/themes/browser/colorThemeStore.ts index 960bb54ec3a96..dcf92ce0e62c6 100644 --- a/src/vs/workbench/services/themes/browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/browser/colorThemeStore.ts @@ -16,7 +16,6 @@ import { URI } from 'vs/base/common/uri'; const themesExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'themes', - isDynamic: true, jsonSchema: { description: nls.localize('vscode.extension.contributes.themes', 'Contributes textmate color themes.'), type: 'array', diff --git a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts index b810fdfd67f93..9ed134bb638cc 100644 --- a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts +++ b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts @@ -22,7 +22,6 @@ const colorIdPattern = '^\\w+[.\\w+]*$'; const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'colors', - isDynamic: true, jsonSchema: { description: nls.localize('contributes.color', 'Contributes extension defined themable colors'), type: 'array', diff --git a/src/vs/workbench/services/themes/common/fileIconThemeStore.ts b/src/vs/workbench/services/themes/common/fileIconThemeStore.ts index 0f204325a2baa..05f50261a9352 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeStore.ts @@ -16,7 +16,6 @@ import { URI } from 'vs/base/common/uri'; const iconThemeExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'iconThemes', - isDynamic: true, jsonSchema: { description: nls.localize('vscode.extension.contributes.iconThemes', 'Contributes file icon themes.'), type: 'array',