From 47f9ed5d22a635ef202880b50e0dda2dd65b9684 Mon Sep 17 00:00:00 2001 From: masliu <37888489+masliu@users.noreply.github.com> Date: Thu, 4 Jul 2019 21:37:28 -0400 Subject: [PATCH 001/190] Save source viewColumn for previews, fixes #74008 --- .../src/commands/showSource.ts | 8 +++++--- .../markdown-language-features/src/features/preview.ts | 10 ++++++++++ .../src/features/previewManager.ts | 5 +++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/extensions/markdown-language-features/src/commands/showSource.ts b/extensions/markdown-language-features/src/commands/showSource.ts index a916bccefc0..fb28397440b 100644 --- a/extensions/markdown-language-features/src/commands/showSource.ts +++ b/extensions/markdown-language-features/src/commands/showSource.ts @@ -15,9 +15,11 @@ export class ShowSourceCommand implements Command { ) { } public execute() { - if (this.previewManager.activePreviewResource) { - return vscode.workspace.openTextDocument(this.previewManager.activePreviewResource) - .then(document => vscode.window.showTextDocument(document)); + const { activePreviewResource, activePreviewSourceViewColumn } = this.previewManager; + if (activePreviewResource && activePreviewSourceViewColumn) { + return vscode.workspace.openTextDocument(activePreviewResource).then(document => { + vscode.window.showTextDocument(document, activePreviewSourceViewColumn); + }); } return undefined; } diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 1479a6ea112..596c86e81b7 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -101,11 +101,13 @@ export class MarkdownPreview extends Disposable { const resource = vscode.Uri.parse(state.resource); const locked = state.locked; const line = state.line; + const sourceViewColumn = state.sourceViewColumn; const preview = new MarkdownPreview( webview, resource, locked, + sourceViewColumn, contentProvider, previewConfigurations, logger, @@ -124,6 +126,7 @@ export class MarkdownPreview extends Disposable { public static create( resource: vscode.Uri, previewColumn: vscode.ViewColumn, + resourceColumn: vscode.ViewColumn, locked: boolean, contentProvider: MarkdownContentProvider, previewConfigurations: MarkdownPreviewConfigurationManager, @@ -143,6 +146,7 @@ export class MarkdownPreview extends Disposable { webview, resource, locked, + resourceColumn, contentProvider, previewConfigurations, logger, @@ -154,6 +158,7 @@ export class MarkdownPreview extends Disposable { webview: vscode.WebviewPanel, resource: vscode.Uri, locked: boolean, + private readonly _sourceViewColumn: vscode.ViewColumn, private readonly _contentProvider: MarkdownContentProvider, private readonly _previewConfigurations: MarkdownPreviewConfigurationManager, private readonly _logger: Logger, @@ -248,11 +253,16 @@ export class MarkdownPreview extends Disposable { return this._resource; } + public get sourceViewColumn(): vscode.ViewColumn { + return this._sourceViewColumn; + } + public get state() { return { resource: this.resource.toString(), locked: this._locked, line: this.line, + sourceViewColumn: this.sourceViewColumn, imageInfo: this.imageInfo }; } diff --git a/extensions/markdown-language-features/src/features/previewManager.ts b/extensions/markdown-language-features/src/features/previewManager.ts index dda56c87172..db09c2aaa11 100644 --- a/extensions/markdown-language-features/src/features/previewManager.ts +++ b/extensions/markdown-language-features/src/features/previewManager.ts @@ -65,6 +65,10 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview return this._activePreview && this._activePreview.resource; } + public get activePreviewSourceViewColumn() { + return this._activePreview && this._activePreview.sourceViewColumn; + } + public toggleLock() { const preview = this._activePreview; if (preview) { @@ -110,6 +114,7 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview const preview = MarkdownPreview.create( resource, previewSettings.previewColumn, + previewSettings.resourceColumn, previewSettings.locked, this._contentProvider, this._previewConfigurations, From 173d010b0a40f0dd74339fb7eb39be530169b06a Mon Sep 17 00:00:00 2001 From: masliu <37888489+masliu@users.noreply.github.com> Date: Thu, 4 Jul 2019 22:29:23 -0400 Subject: [PATCH 002/190] Rename sourceViewColumn to resourceColumn --- .../src/commands/showSource.ts | 6 +++--- .../src/features/preview.ts | 12 ++++++------ .../src/features/previewManager.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extensions/markdown-language-features/src/commands/showSource.ts b/extensions/markdown-language-features/src/commands/showSource.ts index fb28397440b..d61a3211e8c 100644 --- a/extensions/markdown-language-features/src/commands/showSource.ts +++ b/extensions/markdown-language-features/src/commands/showSource.ts @@ -15,10 +15,10 @@ export class ShowSourceCommand implements Command { ) { } public execute() { - const { activePreviewResource, activePreviewSourceViewColumn } = this.previewManager; - if (activePreviewResource && activePreviewSourceViewColumn) { + const { activePreviewResource, activePreviewResourceColumn } = this.previewManager; + if (activePreviewResource && activePreviewResourceColumn) { return vscode.workspace.openTextDocument(activePreviewResource).then(document => { - vscode.window.showTextDocument(document, activePreviewSourceViewColumn); + vscode.window.showTextDocument(document, activePreviewResourceColumn); }); } return undefined; diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 596c86e81b7..8822b8d4a61 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -101,13 +101,13 @@ export class MarkdownPreview extends Disposable { const resource = vscode.Uri.parse(state.resource); const locked = state.locked; const line = state.line; - const sourceViewColumn = state.sourceViewColumn; + const resourceColumn = state.resourceColumn; const preview = new MarkdownPreview( webview, resource, locked, - sourceViewColumn, + resourceColumn, contentProvider, previewConfigurations, logger, @@ -158,7 +158,7 @@ export class MarkdownPreview extends Disposable { webview: vscode.WebviewPanel, resource: vscode.Uri, locked: boolean, - private readonly _sourceViewColumn: vscode.ViewColumn, + private readonly _resourceColumn: vscode.ViewColumn, private readonly _contentProvider: MarkdownContentProvider, private readonly _previewConfigurations: MarkdownPreviewConfigurationManager, private readonly _logger: Logger, @@ -253,8 +253,8 @@ export class MarkdownPreview extends Disposable { return this._resource; } - public get sourceViewColumn(): vscode.ViewColumn { - return this._sourceViewColumn; + public get resourceColumn(): vscode.ViewColumn { + return this._resourceColumn; } public get state() { @@ -262,7 +262,7 @@ export class MarkdownPreview extends Disposable { resource: this.resource.toString(), locked: this._locked, line: this.line, - sourceViewColumn: this.sourceViewColumn, + resourceColumn: this.resourceColumn, imageInfo: this.imageInfo }; } diff --git a/extensions/markdown-language-features/src/features/previewManager.ts b/extensions/markdown-language-features/src/features/previewManager.ts index db09c2aaa11..3fc8106908b 100644 --- a/extensions/markdown-language-features/src/features/previewManager.ts +++ b/extensions/markdown-language-features/src/features/previewManager.ts @@ -65,8 +65,8 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview return this._activePreview && this._activePreview.resource; } - public get activePreviewSourceViewColumn() { - return this._activePreview && this._activePreview.sourceViewColumn; + public get activePreviewResourceColumn() { + return this._activePreview && this._activePreview.resourceColumn; } public toggleLock() { From b840bc0475d8caea27ae0f00444089a11be6d9ef Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Mon, 8 Jul 2019 10:50:22 +0530 Subject: [PATCH 003/190] Added Reveal in Side Bar Menu to search --- .../contrib/search/browser/search.contribution.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index 8c46d8864bc..1bfee39db9e 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -55,6 +55,8 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_CONTAINER, VIEW_ID } from 'vs/workbench/services/search/common/search'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +import { REVEAL_IN_EXPLORER_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileCommands'; +import { ResourceContextKey } from 'vs/workbench/common/resources'; registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true); @@ -212,6 +214,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); +MenuRegistry.appendMenuItem(MenuId.SearchContext, { + command: { + id: REVEAL_IN_EXPLORER_COMMAND_ID, + title: nls.localize('revealInSideBar', "Reveal in Side Bar") + }, + when: ResourceContextKey.IsFileSystemResource && Constants.HasSearchResults, + group: '2_files', +}); + MenuRegistry.appendMenuItem(MenuId.SearchContext, { command: { id: Constants.ReplaceActionId, From 9c2dd0f232f41631d8c00703de4aadd4eaa59571 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Thu, 11 Jul 2019 18:57:55 +0530 Subject: [PATCH 004/190] Added a new command for reveal in side bar for search results --- .../search/browser/search.contribution.ts | 40 ++++++++++++++----- .../contrib/search/common/constants.ts | 1 + 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index 1bfee39db9e..ce34ac3aeb6 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -5,7 +5,7 @@ import { Action } from 'vs/base/common/actions'; import { distinct } from 'vs/base/common/arrays'; -import { illegalArgument } from 'vs/base/common/errors'; +import { illegalArgument, onUnexpectedError } from 'vs/base/common/errors'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import * as objects from 'vs/base/common/objects'; import * as platform from 'vs/base/common/platform'; @@ -38,7 +38,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { Extensions as ViewExtensions, IViewsRegistry } from 'vs/workbench/common/views'; import { getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/files'; -import { ExplorerFolderContext, ExplorerRootContext, FilesExplorerFocusCondition } from 'vs/workbench/contrib/files/common/files'; +import { ExplorerFolderContext, ExplorerRootContext, FilesExplorerFocusCondition, IExplorerService, VIEWLET_ID as VIEWLET_ID_FILES } from 'vs/workbench/contrib/files/common/files'; import { OpenAnythingHandler } from 'vs/workbench/contrib/search/browser/openAnythingHandler'; import { OpenSymbolHandler } from 'vs/workbench/contrib/search/browser/openSymbolHandler'; import { registerContributions as replaceContributions } from 'vs/workbench/contrib/search/browser/replaceContributions'; @@ -50,14 +50,14 @@ import { registerContributions as searchWidgetContributions } from 'vs/workbench import * as Constants from 'vs/workbench/contrib/search/common/constants'; import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search'; import { ISearchHistoryService, SearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService'; -import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService } from 'vs/workbench/contrib/search/common/searchModel'; +import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService, FileMatch, FolderMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_CONTAINER, VIEW_ID } from 'vs/workbench/services/search/common/search'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { REVEAL_IN_EXPLORER_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileCommands'; import { ResourceContextKey } from 'vs/workbench/common/resources'; - +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { ExplorerViewlet } from 'vs/workbench/contrib/files/browser/explorerViewlet'; registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true); registerSingleton(ISearchHistoryService, SearchHistoryService, true); @@ -214,11 +214,33 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); +CommandsRegistry.registerCommand({ + id: Constants.RevealInSideBarForSearchResults, + handler: (accessor, fileMatch: FileMatch | FolderMatch) => { + const viewletService = accessor.get(IViewletService); + const explorerService = accessor.get(IExplorerService); + const contextService = accessor.get(IWorkspaceContextService); + const uri = fileMatch.resource(); + + viewletService.openViewlet(VIEWLET_ID_FILES, false).then((viewlet: ExplorerViewlet) => { + if (uri && contextService.isInsideWorkspace(uri)) { + const explorerView = viewlet.getExplorerView(); + if (explorerView) { + explorerView.setExpanded(true); + explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError); + } + } + }); + } +}); + +const RevealInSideBarForSearchResultsCommand: ICommandAction = { + id: Constants.RevealInSideBarForSearchResults, + title: nls.localize('revealInSideBar', "Reveal in Side Bar") +}; + MenuRegistry.appendMenuItem(MenuId.SearchContext, { - command: { - id: REVEAL_IN_EXPLORER_COMMAND_ID, - title: nls.localize('revealInSideBar', "Reveal in Side Bar") - }, + command: RevealInSideBarForSearchResultsCommand, when: ResourceContextKey.IsFileSystemResource && Constants.HasSearchResults, group: '2_files', }); diff --git a/src/vs/workbench/contrib/search/common/constants.ts b/src/vs/workbench/contrib/search/common/constants.ts index 59a452d404e..a13dfb10def 100644 --- a/src/vs/workbench/contrib/search/common/constants.ts +++ b/src/vs/workbench/contrib/search/common/constants.ts @@ -24,6 +24,7 @@ export const CloseReplaceWidgetActionId = 'closeReplaceInFilesWidget'; export const ToggleCaseSensitiveCommandId = 'toggleSearchCaseSensitive'; export const ToggleWholeWordCommandId = 'toggleSearchWholeWord'; export const ToggleRegexCommandId = 'toggleSearchRegex'; +export const RevealInSideBarForSearchResults = 'search.action.revealInSideBar'; export const ToggleSearchViewPositionCommandId = 'search.action.toggleSearchViewPosition'; From 572e1c5ecd889c26615a267718de375b16798074 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 10 Jul 2019 17:00:47 -0700 Subject: [PATCH 005/190] First cut for #62440 --- .vscode/launch.json | 5 +- .../preferences/browser/settingsEditor2.ts | 1 + .../preferences/browser/settingsTree.ts | 93 ++++++++++++++++++- .../preferences/browser/settingsTreeModels.ts | 2 + .../preferences/common/preferences.ts | 1 + 5 files changed, 96 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d8207865fd..e5befa773ac 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -139,7 +139,10 @@ "urlFilter": "*workbench.html*", "runtimeArgs": [ "--inspect=5875", - "--no-cached-data" + "--no-cached-data", + "--extensionDevelopmentPath", + "/Users/octref/Code/work/vscode-extension-samples/helloworld-minimal-sample", + "/Users/octref/Code/work/vscode-extension-samples/helloworld-minimal-sample" ], "webRoot": "${workspaceFolder}" }, diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 44acebf1ed4..727a871c994 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -79,6 +79,7 @@ export class SettingsEditor2 extends BaseEditor { return false; } return type === SettingValueType.Enum || + type === SettingValueType.Array || type === SettingValueType.Complex || type === SettingValueType.Boolean || type === SettingValueType.Exclude; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 68a62920e9a..ab1cac10284 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -68,6 +68,14 @@ function getExcludeDisplayValue(element: SettingsTreeSettingElement): IExcludeDa }); } +function getListDisplayValue(element: SettingsTreeSettingElement): IExcludeDataItem[] { + return element.value.map((key: string) => { + return { + pattern: key + }; + }); +} + export function resolveSettingsTree(tocData: ITOCEntry, coreSettingsGroups: ISettingsGroup[]): { tree: ITOCEntry, leftoverSettings: Set } { const allSettings = getFlatSettings(coreSettingsGroups); return { @@ -229,6 +237,7 @@ const SETTINGS_TEXT_TEMPLATE_ID = 'settings.text.template'; const SETTINGS_NUMBER_TEMPLATE_ID = 'settings.number.template'; const SETTINGS_ENUM_TEMPLATE_ID = 'settings.enum.template'; const SETTINGS_BOOL_TEMPLATE_ID = 'settings.bool.template'; +const SETTINGS_ARRAY_TEMPLATE_ID = 'settings.array.template'; const SETTINGS_EXCLUDE_TEMPLATE_ID = 'settings.exclude.template'; const SETTINGS_COMPLEX_TEMPLATE_ID = 'settings.complex.template'; const SETTINGS_NEW_EXTENSIONS_TEMPLATE_ID = 'settings.newExtensions.template'; @@ -656,6 +665,75 @@ export class SettingComplexRenderer extends AbstractSettingRenderer implements I } } +export class SettingArrayRenderer extends AbstractSettingRenderer implements ITreeRenderer { + templateId = SETTINGS_ARRAY_TEMPLATE_ID; + + renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { + const common = this.renderCommonTemplate(null, container, 'exclude'); + + const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, common.controlElement); + excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); + common.toDispose.push(excludeWidget); + + const template: ISettingExcludeItemTemplate = { + ...common, + excludeWidget + }; + + this.addSettingElementFocusHandler(template); + + common.toDispose.push(excludeWidget.onDidChangeExclude(e => this.onDidChangeExclude(template, e))); + + return template; + } + + private onDidChangeExclude(template: ISettingExcludeItemTemplate, e: IExcludeChangeEvent): void { + if (template.context) { + const newValue = [...template.context.scopeValue]; + + // Add pattern + if (e.pattern && !e.originalPattern) { + newValue.push(e.pattern); + } + // Delete pattern + else if (!e.pattern && e.originalPattern) { + const patternIndex = newValue.indexOf(e.originalPattern); + if (patternIndex > -1) { + newValue.splice(patternIndex, 1); + } + } + // Update pattern + else if (e.pattern && e.originalPattern) { + const patternIndex = newValue.indexOf(e.originalPattern); + if (patternIndex > -1) { + newValue[patternIndex] = e.pattern; + } + // For some reason, we are updating and cannot find original pattern + // Just append the value in this case + else { + newValue.push(e.pattern); + } + } + + this._onDidChangeSetting.fire({ + key: template.context.setting.key, + value: newValue, + type: template.context.valueType + }); + } + } + + renderElement(element: ITreeNode, index: number, templateData: ISettingExcludeItemTemplate): void { + super.renderSettingElement(element, index, templateData); + } + + protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingExcludeItemTemplate, onChange: (value: string) => void): void { + const value = getListDisplayValue(dataElement); + template.excludeWidget.setValue(value); + template.context = dataElement; + } +} + export class SettingExcludeRenderer extends AbstractSettingRenderer implements ITreeRenderer { templateId = SETTINGS_EXCLUDE_TEMPLATE_ID; @@ -1056,6 +1134,7 @@ export class SettingTreeRenderers { this._instantiationService.createInstance(SettingBoolRenderer, this.settingActions), this._instantiationService.createInstance(SettingNumberRenderer, this.settingActions), this._instantiationService.createInstance(SettingBoolRenderer, this.settingActions), + this._instantiationService.createInstance(SettingArrayRenderer, this.settingActions), this._instantiationService.createInstance(SettingComplexRenderer, this.settingActions), this._instantiationService.createInstance(SettingTextRenderer, this.settingActions), this._instantiationService.createInstance(SettingExcludeRenderer, this.settingActions), @@ -1254,23 +1333,27 @@ class SettingsTreeDelegate implements IListVirtualDelegate -1 && this.setting.type.length === 2) { if (this.setting.type.indexOf(SettingValueType.Integer) > -1) { this.valueType = SettingValueType.NullableInteger; diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index 008d85de813..d07704d78af 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -25,6 +25,7 @@ export enum SettingValueType { Integer = 'integer', Number = 'number', Boolean = 'boolean', + Array = 'array', Exclude = 'exclude', Complex = 'complex', NullableInteger = 'nullable-integer', From 4eb9433ac2acc51ef57f316882ac3804afbd4073 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 11 Jul 2019 10:56:05 -0700 Subject: [PATCH 006/190] Render & Edit for complex object --- .../preferences/browser/settingsTree.ts | 5 ++- .../preferences/browser/settingsWidgets.ts | 33 +++++++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index ab1cac10284..0c54a5910e4 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -46,6 +46,7 @@ import { ExcludeSettingWidget, IExcludeChangeEvent, IExcludeDataItem, settingsHe import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences'; import { ISetting, ISettingsGroup, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { isArray } from 'vs/base/common/types'; const $ = DOM.$; @@ -689,7 +690,9 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr private onDidChangeExclude(template: ISettingExcludeItemTemplate, e: IExcludeChangeEvent): void { if (template.context) { - const newValue = [...template.context.scopeValue]; + const newValue = isArray(template.context.scopeValue) + ? [...template.context.scopeValue] + : [...template.context.value]; // Add pattern if (e.pattern && !e.originalPattern) { diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index c14cb52118c..75f548a9004 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -20,6 +20,7 @@ import { foreground, inputBackground, inputBorder, inputForeground, listActiveSe import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { disposableTimeout } from 'vs/base/common/async'; +import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; const $ = DOM.$; export const settingsHeaderForeground = registerColor('settings.headerForeground', { light: '#444444', dark: '#e7e7e7', hc: '#ffffff' }, localize('headerForeground', "(For settings editor preview) The foreground color for a section header or active title.")); @@ -213,7 +214,8 @@ export class ExcludeSettingWidget extends Disposable { constructor( private container: HTMLElement, @IThemeService private readonly themeService: IThemeService, - @IContextViewService private readonly contextViewService: IContextViewService + @IContextViewService private readonly contextViewService: IContextViewService, + @IPreferencesService private readonly preferenceService: IPreferencesService ) { super(); @@ -339,6 +341,18 @@ export class ExcludeSettingWidget extends Disposable { }; } + private createComplexEditAction(key: string): IAction { + return { + class: 'setting-excludeAction-edit', + enabled: true, + id: 'workbench.action.editExcludeItemSettingsJson', + tooltip: localize('editExcludeItem', "Edit Exclude Item"), + run: () => { + this.preferenceService.openSettings(true, undefined); + } + }; + } + private editSetting(key: string): void { this.model.setEditKey(key); this.renderList(); @@ -361,13 +375,20 @@ export class ExcludeSettingWidget extends Disposable { const patternElement = DOM.append(rowElement, $('.setting-exclude-pattern')); const siblingElement = DOM.append(rowElement, $('.setting-exclude-sibling')); - patternElement.textContent = item.pattern; siblingElement.textContent = item.sibling ? ('when: ' + item.sibling) : null; - actionBar.push([ - this.createEditAction(item.pattern), - this.createDeleteAction(item.pattern) - ], { icon: true, label: false }); + if (typeof item.pattern === 'string') { + patternElement.textContent = item.pattern; + actionBar.push([ + this.createEditAction(item.pattern), + this.createDeleteAction(item.pattern) + ], { icon: true, label: false }); + } else { + patternElement.textContent = '(Complex Object)'; + actionBar.push([ + this.createComplexEditAction(item.pattern) + ], { icon: true, label: false }); + } rowElement.title = item.sibling ? localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", item.pattern, item.sibling) : From ebfff19936383232e19d352d527e0b554420257e Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 10:35:43 -0700 Subject: [PATCH 007/190] Use different label for array/exclude widget --- .../preferences/browser/settingsTree.ts | 4 +- .../preferences/browser/settingsWidgets.ts | 38 +++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 0c54a5910e4..3ac6dc83fe2 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -672,7 +672,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { const common = this.renderCommonTemplate(null, container, 'exclude'); - const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, common.controlElement); + const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'array-of-string', common.controlElement); excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(excludeWidget); @@ -743,7 +743,7 @@ export class SettingExcludeRenderer extends AbstractSettingRenderer implements I renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { const common = this.renderCommonTemplate(null, container, 'exclude'); - const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, common.controlElement); + const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'exclude', common.controlElement); excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(excludeWidget); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index 75f548a9004..ee288976e21 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -212,6 +212,7 @@ export class ExcludeSettingWidget extends Disposable { } constructor( + private type: 'exclude' | 'array-of-string', private container: HTMLElement, @IThemeService private readonly themeService: IThemeService, @IContextViewService private readonly contextViewService: IContextViewService, @@ -242,6 +243,29 @@ export class ExcludeSettingWidget extends Disposable { })); } + /** + * All localized strings except those related to `siblings`, which are only present when used as Exclude widget. + */ + private getLocalizedStrings() { + if (this.type === 'exclude') { + return { + deleteActionTooltip: localize('removeExcludeItem', "Remove Exclude Item"), + editActionTooltip: localize('editExcludeItem', "Edit Exclude Item"), + complexEditActionTooltip: localize('editExcludeItemInSettingsJson', "Edit Exclude Item in settings.json"), + addButtonLabel: localize('addPattern', "Add Pattern"), + inputPlaceholder: localize('excludePatternInputPlaceholder', "Exclude Pattern...") + }; + } else { + return { + deleteActionTooltip: localize('removeItem', "Remove Item"), + editActionTooltip: localize('editItem', "Edit Item"), + complexEditActionTooltip: localize('editItemInSettingsJson', "Edit Item in settings.json"), + addButtonLabel: localize('addItem', "Add Item"), + inputPlaceholder: localize('itemInputPlaceholder', "String Item...") + }; + } + } + setValue(excludeData: IExcludeDataItem[]): void { this.model.setValue(excludeData); this.renderList(); @@ -324,7 +348,7 @@ export class ExcludeSettingWidget extends Disposable { class: 'setting-excludeAction-remove', enabled: true, id: 'workbench.action.removeExcludeItem', - tooltip: localize('removeExcludeItem', "Remove Exclude Item"), + tooltip: this.getLocalizedStrings().deleteActionTooltip, run: () => this._onDidChangeExclude.fire({ originalPattern: key, pattern: undefined }) }; } @@ -334,19 +358,19 @@ export class ExcludeSettingWidget extends Disposable { class: 'setting-excludeAction-edit', enabled: true, id: 'workbench.action.editExcludeItem', - tooltip: localize('editExcludeItem', "Edit Exclude Item"), + tooltip: this.getLocalizedStrings().editActionTooltip, run: () => { this.editSetting(key); } }; } - private createComplexEditAction(key: string): IAction { + private createComplexEditAction(): IAction { return { class: 'setting-excludeAction-edit', enabled: true, id: 'workbench.action.editExcludeItemSettingsJson', - tooltip: localize('editExcludeItem', "Edit Exclude Item"), + tooltip: this.getLocalizedStrings().complexEditActionTooltip, run: () => { this.preferenceService.openSettings(true, undefined); } @@ -386,7 +410,7 @@ export class ExcludeSettingWidget extends Disposable { } else { patternElement.textContent = '(Complex Object)'; actionBar.push([ - this.createComplexEditAction(item.pattern) + this.createComplexEditAction() ], { icon: true, label: false }); } @@ -409,7 +433,7 @@ export class ExcludeSettingWidget extends Disposable { const rowElement = $('.setting-exclude-new-row'); const startAddButton = this._register(new Button(rowElement)); - startAddButton.label = localize('addPattern', "Add Pattern"); + startAddButton.label = this.getLocalizedStrings().addButtonLabel; startAddButton.element.classList.add('setting-exclude-addButton'); this._register(attachButtonStyler(startAddButton, this.themeService)); @@ -447,7 +471,7 @@ export class ExcludeSettingWidget extends Disposable { }; const patternInput = new InputBox(rowElement, this.contextViewService, { - placeholder: localize('excludePatternInputPlaceholder', "Exclude Pattern...") + placeholder: this.getLocalizedStrings().inputPlaceholder }); patternInput.element.classList.add('setting-exclude-patternInput'); this.listDisposables.add(attachInputBoxStyler(patternInput, this.themeService, { From 1aa47639528feb473f60c26806ae728394b22e6c Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 10:37:22 -0700 Subject: [PATCH 008/190] Clean up --- .vscode/launch.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e5befa773ac..1d8207865fd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -139,10 +139,7 @@ "urlFilter": "*workbench.html*", "runtimeArgs": [ "--inspect=5875", - "--no-cached-data", - "--extensionDevelopmentPath", - "/Users/octref/Code/work/vscode-extension-samples/helloworld-minimal-sample", - "/Users/octref/Code/work/vscode-extension-samples/helloworld-minimal-sample" + "--no-cached-data" ], "webRoot": "${workspaceFolder}" }, From e1e421f1e428dcb896809d37462faac05da55371 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 12:48:31 -0700 Subject: [PATCH 009/190] Add in listItemType --- .../contrib/preferences/browser/settingsEditor2.ts | 2 +- .../workbench/contrib/preferences/browser/settingsTree.ts | 4 ++-- .../contrib/preferences/browser/settingsTreeModels.ts | 4 ++-- .../contrib/preferences/browser/settingsWidgets.ts | 2 +- .../workbench/services/preferences/common/preferences.ts | 3 ++- .../services/preferences/common/preferencesModels.ts | 7 ++++++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 727a871c994..b09fc277833 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -79,7 +79,7 @@ export class SettingsEditor2 extends BaseEditor { return false; } return type === SettingValueType.Enum || - type === SettingValueType.Array || + type === SettingValueType.ListOfString || type === SettingValueType.Complex || type === SettingValueType.Boolean || type === SettingValueType.Exclude; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 3ac6dc83fe2..ae46a885caf 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -672,7 +672,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { const common = this.renderCommonTemplate(null, container, 'exclude'); - const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'array-of-string', common.controlElement); + const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'list-of-string', common.controlElement); excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(excludeWidget); @@ -1352,7 +1352,7 @@ class SettingsTreeDelegate implements IListVirtualDelegate -1 && this.setting.type.length === 2) { if (this.setting.type.indexOf(SettingValueType.Integer) > -1) { this.valueType = SettingValueType.NullableInteger; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index ee288976e21..c28ff0045e8 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -212,7 +212,7 @@ export class ExcludeSettingWidget extends Disposable { } constructor( - private type: 'exclude' | 'array-of-string', + private type: 'exclude' | 'list-of-string', private container: HTMLElement, @IThemeService private readonly themeService: IThemeService, @IContextViewService private readonly contextViewService: IContextViewService, diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index d07704d78af..86cc3f43947 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -25,7 +25,7 @@ export enum SettingValueType { Integer = 'integer', Number = 'number', Boolean = 'boolean', - Array = 'array', + ListOfString = 'list-of-string', Exclude = 'exclude', Complex = 'complex', NullableInteger = 'nullable-integer', @@ -62,6 +62,7 @@ export interface ISetting { scope?: ConfigurationScope; type?: string | string[]; + listItemType?: string; enum?: string[]; enumDescriptions?: string[]; enumDescriptionsAreMarkdown?: boolean; diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index 121cfeb9f37..a883ee05f41 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -22,7 +22,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorModel } from 'vs/workbench/common/editor'; import { IFilterMetadata, IFilterResult, IGroupFilter, IKeybindingsEditorModel, ISearchResultGroup, ISetting, ISettingMatch, ISettingMatcher, ISettingsEditorModel, ISettingsGroup } from 'vs/workbench/services/preferences/common/preferences'; -import { withNullAsUndefined } from 'vs/base/common/types'; +import { withNullAsUndefined, isArray } from 'vs/base/common/types'; export const nullRange: IRange = { startLineNumber: -1, startColumn: -1, endLineNumber: -1, endColumn: -1 }; export function isNullRange(range: IRange): boolean { return range.startLineNumber === -1 && range.startColumn === -1 && range.endLineNumber === -1 && range.endColumn === -1; } @@ -613,6 +613,10 @@ export class DefaultSettings extends Disposable { const value = prop.default; const description = (prop.description || prop.markdownDescription || '').split('\n'); const overrides = OVERRIDE_PROPERTY_PATTERN.test(key) ? this.parseOverrideSettings(prop.default) : []; + const listItemType = prop.type === 'array' && prop.items && !isArray(prop.items) && prop.items.type && !isArray(prop.items.type) + ? prop.items.type + : undefined; + result.push({ key, value, @@ -625,6 +629,7 @@ export class DefaultSettings extends Disposable { overrides, scope: prop.scope, type: prop.type, + listItemType, enum: prop.enum, enumDescriptions: prop.enumDescriptions || prop.markdownEnumDescriptions, enumDescriptionsAreMarkdown: !prop.enumDescriptions, From 84977b9211e7dd286371820c4047a843b08f4d98 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 13:30:27 -0700 Subject: [PATCH 010/190] F2s to rename exclude -> list --- .../browser/media/settingsWidgets.css | 48 +++---- .../preferences/browser/settingsEditor2.ts | 2 +- .../preferences/browser/settingsTree.ts | 48 +++---- .../preferences/browser/settingsWidgets.ts | 122 ++++++++---------- 4 files changed, 102 insertions(+), 118 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css b/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css index fddde991821..8fb11451f06 100644 --- a/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css +++ b/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css @@ -3,105 +3,105 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-item-value > .setting-item-control { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-item-value > .setting-item-control { width: 100%; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-pattern { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-pattern { margin-right: 3px; margin-left: 2px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-pattern, -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-sibling { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-pattern, +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-sibling { display: inline-block; line-height: 22px; font-family: var(--monaco-monospace-font); } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-sibling { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-sibling { opacity: 0.7; margin-left: 0.5em; font-size: 0.9em; white-space: pre; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar { display: none; position: absolute; right: 0px; margin-top: 1px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row { position: relative; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row:focus { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row:focus { outline: none; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row:hover .monaco-action-bar, -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected .monaco-action-bar { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row:hover .monaco-action-bar, +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row.selected .monaco-action-bar { display: block; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .action-label { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .action-label { width: 16px; height: 16px; padding: 2px; margin-right: 2px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .setting-excludeAction-edit { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .setting-listAction-edit { margin-right: 4px; } -.vs .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .setting-excludeAction-edit { +.vs .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .setting-listAction-edit { background: url("edit-light.svg") center center no-repeat; } -.vs-dark .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .setting-excludeAction-edit { +.vs-dark .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .setting-listAction-edit { background: url("edit-dark.svg") center center no-repeat; } -.vs .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .setting-excludeAction-remove { +.vs .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .setting-listAction-remove { background: url("remove-light.svg") center center no-repeat; } -.vs-dark .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row .monaco-action-bar .setting-excludeAction-remove { +.vs-dark .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row .monaco-action-bar .setting-listAction-remove { background: url("remove-dark.svg") center center no-repeat; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .monaco-text-button { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .monaco-text-button { width: initial; padding: 2px 14px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-item-control.setting-exclude-new-mode .setting-exclude-new-row { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-item-control.setting-list-new-mode .setting-list-new-row { display: none; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .monaco-text-button.setting-exclude-addButton { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .monaco-text-button.setting-list-addButton { margin-right: 10px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-edit-row { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-edit-row { display: flex } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-patternInput, -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-siblingInput { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-patternInput, +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-siblingInput { height: 22px; max-width: 320px; flex: 1; margin-right: 10px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-okButton { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-okButton { margin-right: 10px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-widget { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-widget { margin-bottom: 1px; } diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index b09fc277833..65f7c744981 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -969,7 +969,7 @@ export class SettingsEditor2 extends BaseEditor { if (key) { const focusedKey = focusedSetting.getAttribute(AbstractSettingRenderer.SETTING_KEY_ATTR); if (focusedKey === key && - !DOM.hasClass(focusedSetting, 'setting-item-exclude')) { // update `exclude`s live, as they have a separate "submit edit" step built in before this + !DOM.hasClass(focusedSetting, 'setting-item-list')) { // update `exclude`s live, as they have a separate "submit edit" step built in before this this.updateModifiedLabelForKey(key); this.scheduleRefresh(focusedSetting, key); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index ae46a885caf..f983b42c551 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -42,7 +42,7 @@ import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler, attach import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { ITOCEntry } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; import { ISettingsEditorViewState, settingKeyToDisplayFormat, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeNewExtensionsElement, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; -import { ExcludeSettingWidget, IExcludeChangeEvent, IExcludeDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; +import { ListSettingWidget, IListChangeEvent, IListDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences'; import { ISetting, ISettingsGroup, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -50,7 +50,7 @@ import { isArray } from 'vs/base/common/types'; const $ = DOM.$; -function getExcludeDisplayValue(element: SettingsTreeSettingElement): IExcludeDataItem[] { +function getExcludeDisplayValue(element: SettingsTreeSettingElement): IListDataItem[] { const data = element.isConfigured ? { ...element.defaultValue, ...element.scopeValue } : element.defaultValue; @@ -69,7 +69,7 @@ function getExcludeDisplayValue(element: SettingsTreeSettingElement): IExcludeDa }); } -function getListDisplayValue(element: SettingsTreeSettingElement): IExcludeDataItem[] { +function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem[] { return element.value.map((key: string) => { return { pattern: key @@ -220,8 +220,12 @@ interface ISettingComplexItemTemplate extends ISettingItemTemplate { button: Button; } +interface ISettingListItemTemplate extends ISettingItemTemplate { + listWidget: ListSettingWidget; +} + interface ISettingExcludeItemTemplate extends ISettingItemTemplate { - excludeWidget: ExcludeSettingWidget; + excludeWidget: ListSettingWidget; } interface ISettingNewExtensionsTemplate extends IDisposableTemplate { @@ -666,31 +670,31 @@ export class SettingComplexRenderer extends AbstractSettingRenderer implements I } } -export class SettingArrayRenderer extends AbstractSettingRenderer implements ITreeRenderer { +export class SettingArrayRenderer extends AbstractSettingRenderer implements ITreeRenderer { templateId = SETTINGS_ARRAY_TEMPLATE_ID; - renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { - const common = this.renderCommonTemplate(null, container, 'exclude'); + renderTemplate(container: HTMLElement): ISettingListItemTemplate { + const common = this.renderCommonTemplate(null, container, 'list'); - const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'list-of-string', common.controlElement); - excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); - common.toDispose.push(excludeWidget); + const listWidget = this._instantiationService.createInstance(ListSettingWidget, 'list-of-string', common.controlElement); + listWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); + common.toDispose.push(listWidget); - const template: ISettingExcludeItemTemplate = { + const template: ISettingListItemTemplate = { ...common, - excludeWidget + listWidget }; this.addSettingElementFocusHandler(template); - common.toDispose.push(excludeWidget.onDidChangeExclude(e => this.onDidChangeExclude(template, e))); + common.toDispose.push(listWidget.onDidChangeList(e => this.onDidChangeList(template, e))); return template; } - private onDidChangeExclude(template: ISettingExcludeItemTemplate, e: IExcludeChangeEvent): void { + private onDidChangeList(template: ISettingListItemTemplate, e: IListChangeEvent): void { if (template.context) { - const newValue = isArray(template.context.scopeValue) + const newValue: any[] | undefined = isArray(template.context.scopeValue) ? [...template.context.scopeValue] : [...template.context.value]; @@ -726,13 +730,13 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr } } - renderElement(element: ITreeNode, index: number, templateData: ISettingExcludeItemTemplate): void { + renderElement(element: ITreeNode, index: number, templateData: ISettingListItemTemplate): void { super.renderSettingElement(element, index, templateData); } - protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingExcludeItemTemplate, onChange: (value: string) => void): void { + protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingListItemTemplate, onChange: (value: string) => void): void { const value = getListDisplayValue(dataElement); - template.excludeWidget.setValue(value); + template.listWidget.setValue(value); template.context = dataElement; } } @@ -741,9 +745,9 @@ export class SettingExcludeRenderer extends AbstractSettingRenderer implements I templateId = SETTINGS_EXCLUDE_TEMPLATE_ID; renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { - const common = this.renderCommonTemplate(null, container, 'exclude'); + const common = this.renderCommonTemplate(null, container, 'list'); - const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, 'exclude', common.controlElement); + const excludeWidget = this._instantiationService.createInstance(ListSettingWidget, 'exclude', common.controlElement); excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(excludeWidget); @@ -754,12 +758,12 @@ export class SettingExcludeRenderer extends AbstractSettingRenderer implements I this.addSettingElementFocusHandler(template); - common.toDispose.push(excludeWidget.onDidChangeExclude(e => this.onDidChangeExclude(template, e))); + common.toDispose.push(excludeWidget.onDidChangeList(e => this.onDidChangeExclude(template, e))); return template; } - private onDidChangeExclude(template: ISettingExcludeItemTemplate, e: IExcludeChangeEvent): void { + private onDidChangeExclude(template: ISettingExcludeItemTemplate, e: IListChangeEvent): void { if (template.context) { const newValue = { ...template.context.scopeValue }; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index c28ff0045e8..4d40d30bf31 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -20,7 +20,6 @@ import { foreground, inputBackground, inputBorder, inputForeground, listActiveSe import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { disposableTimeout } from 'vs/base/common/async'; -import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; const $ = DOM.$; export const settingsHeaderForeground = registerColor('settings.headerForeground', { light: '#444444', dark: '#e7e7e7', hc: '#ffffff' }, localize('headerForeground', "(For settings editor preview) The foreground color for a section header or active title.")); @@ -88,35 +87,35 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { collector.addRule(`.settings-editor > .settings-header > .settings-header-controls .settings-tabs-widget .action-label { color: ${foregroundColor}; }`); } - // Exclude control + // List control const listHoverBackgroundColor = theme.getColor(listHoverBackground); if (listHoverBackgroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row:hover { background-color: ${listHoverBackgroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row:hover { background-color: ${listHoverBackgroundColor}; }`); } const listHoverForegroundColor = theme.getColor(listHoverForeground); if (listHoverForegroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row:hover { color: ${listHoverForegroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row:hover { color: ${listHoverForegroundColor}; }`); } const listSelectBackgroundColor = theme.getColor(listActiveSelectionBackground); if (listSelectBackgroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:focus { background-color: ${listSelectBackgroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row.selected:focus { background-color: ${listSelectBackgroundColor}; }`); } const listInactiveSelectionBackgroundColor = theme.getColor(listInactiveSelectionBackground); if (listInactiveSelectionBackgroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:not(:focus) { background-color: ${listInactiveSelectionBackgroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row.selected:not(:focus) { background-color: ${listInactiveSelectionBackgroundColor}; }`); } const listInactiveSelectionForegroundColor = theme.getColor(listInactiveSelectionForeground); if (listInactiveSelectionForegroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:not(:focus) { color: ${listInactiveSelectionForegroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row.selected:not(:focus) { color: ${listInactiveSelectionForegroundColor}; }`); } const listSelectForegroundColor = theme.getColor(listActiveSelectionForeground); if (listSelectForegroundColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-exclude .setting-exclude-row.selected:focus { color: ${listSelectForegroundColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-row.selected:focus { color: ${listSelectForegroundColor}; }`); } const codeTextForegroundColor = theme.getColor(textPreformatForeground); @@ -132,15 +131,15 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { } }); -export class ExcludeSettingListModel { - private _dataItems: IExcludeDataItem[] = []; +export class ListSettingListModel { + private _dataItems: IListDataItem[] = []; private _editKey: string | null; private _selectedIdx: number | null; - get items(): IExcludeViewItem[] { + get items(): IListViewItem[] { const items = this._dataItems.map((item, i) => { const editing = item.pattern === this._editKey; - return { + return { ...item, editing, selected: i === this._selectedIdx || editing @@ -163,8 +162,8 @@ export class ExcludeSettingListModel { this._editKey = key; } - setValue(excludeData: IExcludeDataItem[]): void { - this._dataItems = excludeData; + setValue(listData: IListDataItem[]): void { + this._dataItems = listData; } select(idx: number): void { @@ -192,20 +191,20 @@ export class ExcludeSettingListModel { } } -export interface IExcludeChangeEvent { +export interface IListChangeEvent { originalPattern: string; pattern?: string; sibling?: string; } -export class ExcludeSettingWidget extends Disposable { +export class ListSettingWidget extends Disposable { private listElement: HTMLElement; private readonly listDisposables = this._register(new DisposableStore()); - private model = new ExcludeSettingListModel(); + private model = new ListSettingListModel(); - private readonly _onDidChangeExclude = this._register(new Emitter()); - readonly onDidChangeExclude: Event = this._onDidChangeExclude.event; + private readonly _onDidChangeList = this._register(new Emitter()); + readonly onDidChangeList: Event = this._onDidChangeList.event; get domNode(): HTMLElement { return this.listElement; @@ -215,12 +214,11 @@ export class ExcludeSettingWidget extends Disposable { private type: 'exclude' | 'list-of-string', private container: HTMLElement, @IThemeService private readonly themeService: IThemeService, - @IContextViewService private readonly contextViewService: IContextViewService, - @IPreferencesService private readonly preferenceService: IPreferencesService + @IContextViewService private readonly contextViewService: IContextViewService ) { super(); - this.listElement = DOM.append(container, $('.setting-exclude-widget')); + this.listElement = DOM.append(container, $('.setting-list-widget')); this.listElement.setAttribute('tabindex', '0'); DOM.append(container, this.renderAddButton()); this.renderList(); @@ -266,8 +264,8 @@ export class ExcludeSettingWidget extends Disposable { } } - setValue(excludeData: IExcludeDataItem[]): void { - this.model.setValue(excludeData); + setValue(listData: IListDataItem[]): void { + this.model.setValue(listData); this.renderList(); } @@ -312,7 +310,7 @@ export class ExcludeSettingWidget extends Disposable { return -1; } - const element = DOM.findParentWithClass((e.target), 'setting-exclude-row'); + const element = DOM.findParentWithClass((e.target), 'setting-list-row'); if (!element) { return -1; } @@ -333,7 +331,7 @@ export class ExcludeSettingWidget extends Disposable { this.listDisposables.clear(); const newMode = this.model.items.some(item => !!(item.editing && !item.pattern)); - DOM.toggleClass(this.container, 'setting-exclude-new-mode', newMode); + DOM.toggleClass(this.container, 'setting-list-new-mode', newMode); this.model.items .map((item, i) => this.renderItem(item, i, focused)) @@ -345,19 +343,19 @@ export class ExcludeSettingWidget extends Disposable { private createDeleteAction(key: string): IAction { return { - class: 'setting-excludeAction-remove', + class: 'setting-listAction-remove', enabled: true, - id: 'workbench.action.removeExcludeItem', + id: 'workbench.action.removeListItem', tooltip: this.getLocalizedStrings().deleteActionTooltip, - run: () => this._onDidChangeExclude.fire({ originalPattern: key, pattern: undefined }) + run: () => this._onDidChangeList.fire({ originalPattern: key, pattern: undefined }) }; } private createEditAction(key: string): IAction { return { - class: 'setting-excludeAction-edit', + class: 'setting-listAction-edit', enabled: true, - id: 'workbench.action.editExcludeItem', + id: 'workbench.action.editListItem', tooltip: this.getLocalizedStrings().editActionTooltip, run: () => { this.editSetting(key); @@ -365,31 +363,19 @@ export class ExcludeSettingWidget extends Disposable { }; } - private createComplexEditAction(): IAction { - return { - class: 'setting-excludeAction-edit', - enabled: true, - id: 'workbench.action.editExcludeItemSettingsJson', - tooltip: this.getLocalizedStrings().complexEditActionTooltip, - run: () => { - this.preferenceService.openSettings(true, undefined); - } - }; - } - private editSetting(key: string): void { this.model.setEditKey(key); this.renderList(); } - private renderItem(item: IExcludeViewItem, idx: number, listFocused: boolean): HTMLElement { + private renderItem(item: IListViewItem, idx: number, listFocused: boolean): HTMLElement { return item.editing ? this.renderEditItem(item) : this.renderDataItem(item, idx, listFocused); } - private renderDataItem(item: IExcludeViewItem, idx: number, listFocused: boolean): HTMLElement { - const rowElement = $('.setting-exclude-row'); + private renderDataItem(item: IListViewItem, idx: number, listFocused: boolean): HTMLElement { + const rowElement = $('.setting-list-row'); rowElement.setAttribute('data-index', idx + ''); rowElement.setAttribute('tabindex', item.selected ? '0' : '-1'); DOM.toggleClass(rowElement, 'selected', item.selected); @@ -397,22 +383,15 @@ export class ExcludeSettingWidget extends Disposable { const actionBar = new ActionBar(rowElement); this.listDisposables.add(actionBar); - const patternElement = DOM.append(rowElement, $('.setting-exclude-pattern')); - const siblingElement = DOM.append(rowElement, $('.setting-exclude-sibling')); + const patternElement = DOM.append(rowElement, $('.setting-list-pattern')); + const siblingElement = DOM.append(rowElement, $('.setting-list-sibling')); + patternElement.textContent = item.pattern; siblingElement.textContent = item.sibling ? ('when: ' + item.sibling) : null; - if (typeof item.pattern === 'string') { - patternElement.textContent = item.pattern; - actionBar.push([ - this.createEditAction(item.pattern), - this.createDeleteAction(item.pattern) - ], { icon: true, label: false }); - } else { - patternElement.textContent = '(Complex Object)'; - actionBar.push([ - this.createComplexEditAction() - ], { icon: true, label: false }); - } + actionBar.push([ + this.createEditAction(item.pattern), + this.createDeleteAction(item.pattern) + ], { icon: true, label: false }); rowElement.title = item.sibling ? localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", item.pattern, item.sibling) : @@ -430,11 +409,11 @@ export class ExcludeSettingWidget extends Disposable { } private renderAddButton(): HTMLElement { - const rowElement = $('.setting-exclude-new-row'); + const rowElement = $('.setting-list-new-row'); const startAddButton = this._register(new Button(rowElement)); startAddButton.label = this.getLocalizedStrings().addButtonLabel; - startAddButton.element.classList.add('setting-exclude-addButton'); + startAddButton.element.classList.add('setting-list-addButton'); this._register(attachButtonStyler(startAddButton, this.themeService)); this._register(startAddButton.onDidClick(() => { @@ -445,14 +424,14 @@ export class ExcludeSettingWidget extends Disposable { return rowElement; } - private renderEditItem(item: IExcludeViewItem): HTMLElement { - const rowElement = $('.setting-exclude-edit-row'); + private renderEditItem(item: IListViewItem): HTMLElement { + const rowElement = $('.setting-list-edit-row'); const onSubmit = (edited: boolean) => { this.model.setEditKey(null); const pattern = patternInput.value.trim(); if (edited && pattern) { - this._onDidChangeExclude.fire({ + this._onDidChangeList.fire({ originalPattern: item.pattern, pattern, sibling: siblingInput && siblingInput.value.trim() @@ -473,7 +452,8 @@ export class ExcludeSettingWidget extends Disposable { const patternInput = new InputBox(rowElement, this.contextViewService, { placeholder: this.getLocalizedStrings().inputPlaceholder }); - patternInput.element.classList.add('setting-exclude-patternInput'); + + patternInput.element.classList.add('setting-list-patternInput'); this.listDisposables.add(attachInputBoxStyler(patternInput, this.themeService, { inputBackground: settingsTextInputBackground, inputForeground: settingsTextInputForeground, @@ -488,7 +468,7 @@ export class ExcludeSettingWidget extends Disposable { siblingInput = new InputBox(rowElement, this.contextViewService, { placeholder: localize('excludeSiblingInputPlaceholder', "When Pattern Is Present...") }); - siblingInput.element.classList.add('setting-exclude-siblingInput'); + siblingInput.element.classList.add('setting-list-siblingInput'); this.listDisposables.add(siblingInput); this.listDisposables.add(attachInputBoxStyler(siblingInput, this.themeService, { inputBackground: settingsTextInputBackground, @@ -501,13 +481,13 @@ export class ExcludeSettingWidget extends Disposable { const okButton = this._register(new Button(rowElement)); okButton.label = localize('okButton', "OK"); - okButton.element.classList.add('setting-exclude-okButton'); + okButton.element.classList.add('setting-list-okButton'); this.listDisposables.add(attachButtonStyler(okButton, this.themeService)); this.listDisposables.add(okButton.onDidClick(() => onSubmit(true))); const cancelButton = this._register(new Button(rowElement)); cancelButton.label = localize('cancelButton', "Cancel"); - cancelButton.element.classList.add('setting-exclude-cancelButton'); + cancelButton.element.classList.add('setting-list-okButton'); this.listDisposables.add(attachButtonStyler(cancelButton, this.themeService)); this.listDisposables.add(cancelButton.onDidClick(() => onSubmit(false))); @@ -521,12 +501,12 @@ export class ExcludeSettingWidget extends Disposable { } } -export interface IExcludeDataItem { +export interface IListDataItem { pattern: string; sibling?: string; } -interface IExcludeViewItem extends IExcludeDataItem { +interface IListViewItem extends IListDataItem { editing?: boolean; selected?: boolean; } From e5eabc588329e9c6e3e639bc0324f3997c6520f4 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 14:12:55 -0700 Subject: [PATCH 011/190] Final cleanup --- .../preferences/browser/settingsTree.ts | 6 +- .../preferences/browser/settingsWidgets.ts | 62 +++++++++++-------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index f983b42c551..c1cff63cb0a 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -42,7 +42,7 @@ import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler, attach import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { ITOCEntry } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; import { ISettingsEditorViewState, settingKeyToDisplayFormat, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeNewExtensionsElement, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; -import { ListSettingWidget, IListChangeEvent, IListDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; +import { ListSettingWidget, IListChangeEvent, IListDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground, ExcludeSettingWidget } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences'; import { ISetting, ISettingsGroup, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -676,7 +676,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr renderTemplate(container: HTMLElement): ISettingListItemTemplate { const common = this.renderCommonTemplate(null, container, 'list'); - const listWidget = this._instantiationService.createInstance(ListSettingWidget, 'list-of-string', common.controlElement); + const listWidget = this._instantiationService.createInstance(ListSettingWidget, common.controlElement); listWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(listWidget); @@ -747,7 +747,7 @@ export class SettingExcludeRenderer extends AbstractSettingRenderer implements I renderTemplate(container: HTMLElement): ISettingExcludeItemTemplate { const common = this.renderCommonTemplate(null, container, 'list'); - const excludeWidget = this._instantiationService.createInstance(ListSettingWidget, 'exclude', common.controlElement); + const excludeWidget = this._instantiationService.createInstance(ExcludeSettingWidget, common.controlElement); excludeWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); common.toDispose.push(excludeWidget); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index 4d40d30bf31..f9401587c6c 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -211,7 +211,6 @@ export class ListSettingWidget extends Disposable { } constructor( - private type: 'exclude' | 'list-of-string', private container: HTMLElement, @IThemeService private readonly themeService: IThemeService, @IContextViewService private readonly contextViewService: IContextViewService @@ -241,27 +240,21 @@ export class ListSettingWidget extends Disposable { })); } - /** - * All localized strings except those related to `siblings`, which are only present when used as Exclude widget. - */ - private getLocalizedStrings() { - if (this.type === 'exclude') { - return { - deleteActionTooltip: localize('removeExcludeItem', "Remove Exclude Item"), - editActionTooltip: localize('editExcludeItem', "Edit Exclude Item"), - complexEditActionTooltip: localize('editExcludeItemInSettingsJson', "Edit Exclude Item in settings.json"), - addButtonLabel: localize('addPattern', "Add Pattern"), - inputPlaceholder: localize('excludePatternInputPlaceholder', "Exclude Pattern...") - }; - } else { - return { - deleteActionTooltip: localize('removeItem', "Remove Item"), - editActionTooltip: localize('editItem', "Edit Item"), - complexEditActionTooltip: localize('editItemInSettingsJson', "Edit Item in settings.json"), - addButtonLabel: localize('addItem', "Add Item"), - inputPlaceholder: localize('itemInputPlaceholder', "String Item...") - }; - } + protected getLocalizedStrings() { + return { + deleteActionTooltip: localize('removeItem', "Remove Item"), + editActionTooltip: localize('editItem', "Edit Item"), + complexEditActionTooltip: localize('editItemInSettingsJson', "Edit Item in settings.json"), + addButtonLabel: localize('addItem', "Add Item"), + inputPlaceholder: localize('itemInputPlaceholder', "String Item...") + }; + } + + protected getSettingListRowLocalizedStrings(pattern?: string, sibling?: string) { + return { + settingListRowPatternHintLabel: localize('listPatternHintLabel', "List item `{0}`", pattern), + settingListRowSiblingHintLabel: localize('listSiblingHintLabel', "List item `{0}` with sibling `${1}`", pattern) + }; } setValue(listData: IListDataItem[]): void { @@ -393,9 +386,9 @@ export class ListSettingWidget extends Disposable { this.createDeleteAction(item.pattern) ], { icon: true, label: false }); - rowElement.title = item.sibling ? - localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", item.pattern, item.sibling) : - localize('excludePatternHintLabel', "Exclude files matching `{0}`", item.pattern); + rowElement.title = item.sibling + ? this.getSettingListRowLocalizedStrings(item.pattern, item.sibling).settingListRowSiblingHintLabel + : this.getSettingListRowLocalizedStrings(item.pattern, item.sibling).settingListRowPatternHintLabel; if (item.selected) { if (listFocused) { @@ -501,6 +494,25 @@ export class ListSettingWidget extends Disposable { } } +export class ExcludeSettingWidget extends ListSettingWidget { + protected getLocalizedStrings() { + return { + deleteActionTooltip: localize('removeExcludeItem', "Remove Exclude Item"), + editActionTooltip: localize('editExcludeItem', "Edit Exclude Item"), + complexEditActionTooltip: localize('editExcludeItemInSettingsJson', "Edit Exclude Item in settings.json"), + addButtonLabel: localize('addPattern', "Add Pattern"), + inputPlaceholder: localize('excludePatternInputPlaceholder', "Exclude Pattern...") + }; + } + + protected getSettingListRowLocalizedStrings(pattern?: string, sibling?: string) { + return { + settingListRowPatternHintLabel: localize('excludePatternHintLabel', "Exclude files matching `{0}`", pattern), + settingListRowSiblingHintLabel: localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", pattern, sibling) + }; + } +} + export interface IListDataItem { pattern: string; sibling?: string; From 7a127f44abfc6224d58a1d19e1e0750a2721731e Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 12 Jul 2019 14:20:49 -0700 Subject: [PATCH 012/190] :lipstick: --- .../contrib/preferences/browser/settingsEditor2.ts | 2 +- .../contrib/preferences/browser/settingsWidgets.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 65f7c744981..4f6209c550d 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -969,7 +969,7 @@ export class SettingsEditor2 extends BaseEditor { if (key) { const focusedKey = focusedSetting.getAttribute(AbstractSettingRenderer.SETTING_KEY_ATTR); if (focusedKey === key && - !DOM.hasClass(focusedSetting, 'setting-item-list')) { // update `exclude`s live, as they have a separate "submit edit" step built in before this + !DOM.hasClass(focusedSetting, 'setting-item-list')) { // update `list`s live, as they have a separate "submit edit" step built in before this this.updateModifiedLabelForKey(key); this.scheduleRefresh(focusedSetting, key); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index f9401587c6c..847214766a4 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -246,7 +246,8 @@ export class ListSettingWidget extends Disposable { editActionTooltip: localize('editItem', "Edit Item"), complexEditActionTooltip: localize('editItemInSettingsJson', "Edit Item in settings.json"), addButtonLabel: localize('addItem', "Add Item"), - inputPlaceholder: localize('itemInputPlaceholder', "String Item...") + inputPlaceholder: localize('itemInputPlaceholder', "String Item..."), + siblingInputPlaceholder: localize('listSiblingInputPlaceholder', "Sibling...") }; } @@ -459,7 +460,7 @@ export class ListSettingWidget extends Disposable { let siblingInput: InputBox; if (item.sibling) { siblingInput = new InputBox(rowElement, this.contextViewService, { - placeholder: localize('excludeSiblingInputPlaceholder', "When Pattern Is Present...") + placeholder: this.getLocalizedStrings().siblingInputPlaceholder }); siblingInput.element.classList.add('setting-list-siblingInput'); this.listDisposables.add(siblingInput); @@ -501,7 +502,8 @@ export class ExcludeSettingWidget extends ListSettingWidget { editActionTooltip: localize('editExcludeItem', "Edit Exclude Item"), complexEditActionTooltip: localize('editExcludeItemInSettingsJson', "Edit Exclude Item in settings.json"), addButtonLabel: localize('addPattern', "Add Pattern"), - inputPlaceholder: localize('excludePatternInputPlaceholder', "Exclude Pattern...") + inputPlaceholder: localize('excludePatternInputPlaceholder', "Exclude Pattern..."), + siblingInputPlaceholder: localize('excludeSiblingInputPlaceholder', "When Pattern Is Present...") }; } From b6de8aaa629784641605d24ac476d1056dd5f5c4 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Sun, 14 Jul 2019 10:23:26 -0700 Subject: [PATCH 013/190] list-of-string -> array --- src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts | 2 +- src/vs/workbench/contrib/preferences/browser/settingsTree.ts | 2 +- .../workbench/contrib/preferences/browser/settingsTreeModels.ts | 2 +- src/vs/workbench/services/preferences/common/preferences.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 4f6209c550d..59d20315dca 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -79,7 +79,7 @@ export class SettingsEditor2 extends BaseEditor { return false; } return type === SettingValueType.Enum || - type === SettingValueType.ListOfString || + type === SettingValueType.Array || type === SettingValueType.Complex || type === SettingValueType.Boolean || type === SettingValueType.Exclude; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index c1cff63cb0a..83ee125b6f2 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -1356,7 +1356,7 @@ class SettingsTreeDelegate implements IListVirtualDelegate -1 && this.setting.type.length === 2) { if (this.setting.type.indexOf(SettingValueType.Integer) > -1) { this.valueType = SettingValueType.NullableInteger; diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index 86cc3f43947..cce1918207f 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -25,7 +25,7 @@ export enum SettingValueType { Integer = 'integer', Number = 'number', Boolean = 'boolean', - ListOfString = 'list-of-string', + Array = 'array', Exclude = 'exclude', Complex = 'complex', NullableInteger = 'nullable-integer', From dbdb4da2f237acd87c855ee059f40187e03ae663 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Sun, 14 Jul 2019 10:39:10 -0700 Subject: [PATCH 014/190] pattern -> value --- .../browser/media/settingsWidgets.css | 6 +- .../preferences/browser/settingsTree.ts | 50 ++++++++-------- .../preferences/browser/settingsWidgets.ts | 60 +++++++++---------- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css b/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css index 8fb11451f06..fe32e55ab66 100644 --- a/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css +++ b/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css @@ -7,12 +7,12 @@ width: 100%; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-pattern { +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-value { margin-right: 3px; margin-left: 2px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-pattern, +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-value, .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-sibling { display: inline-block; line-height: 22px; @@ -90,7 +90,7 @@ display: flex } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-patternInput, +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-valueInput, .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-list-siblingInput { height: 22px; max-width: 320px; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 83ee125b6f2..26086217bf3 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -63,7 +63,7 @@ function getExcludeDisplayValue(element: SettingsTreeSettingElement): IListDataI return { id: key, - pattern: key, + value: key, sibling }; }); @@ -72,7 +72,7 @@ function getExcludeDisplayValue(element: SettingsTreeSettingElement): IListDataI function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem[] { return element.value.map((key: string) => { return { - pattern: key + value: key }; }); } @@ -698,27 +698,27 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr ? [...template.context.scopeValue] : [...template.context.value]; - // Add pattern - if (e.pattern && !e.originalPattern) { - newValue.push(e.pattern); + // Add value + if (e.value && !e.originalValue) { + newValue.push(e.value); } - // Delete pattern - else if (!e.pattern && e.originalPattern) { - const patternIndex = newValue.indexOf(e.originalPattern); - if (patternIndex > -1) { - newValue.splice(patternIndex, 1); + // Delete value + else if (!e.value && e.originalValue) { + const valueIndex = newValue.indexOf(e.originalValue); + if (valueIndex > -1) { + newValue.splice(valueIndex, 1); } } - // Update pattern - else if (e.pattern && e.originalPattern) { - const patternIndex = newValue.indexOf(e.originalPattern); - if (patternIndex > -1) { - newValue[patternIndex] = e.pattern; + // Update value + else if (e.value && e.originalValue) { + const valueIndex = newValue.indexOf(e.originalValue); + if (valueIndex > -1) { + newValue[valueIndex] = e.value; } - // For some reason, we are updating and cannot find original pattern + // For some reason, we are updating and cannot find original value // Just append the value in this case else { - newValue.push(e.pattern); + newValue.push(e.value); } } @@ -768,22 +768,22 @@ export class SettingExcludeRenderer extends AbstractSettingRenderer implements I const newValue = { ...template.context.scopeValue }; // first delete the existing entry, if present - if (e.originalPattern) { - if (e.originalPattern in template.context.defaultValue) { + if (e.originalValue) { + if (e.originalValue in template.context.defaultValue) { // delete a default by overriding it - newValue[e.originalPattern] = false; + newValue[e.originalValue] = false; } else { - delete newValue[e.originalPattern]; + delete newValue[e.originalValue]; } } // then add the new or updated entry, if present - if (e.pattern) { - if (e.pattern in template.context.defaultValue && !e.sibling) { + if (e.value) { + if (e.value in template.context.defaultValue && !e.sibling) { // add a default by deleting its override - delete newValue[e.pattern]; + delete newValue[e.value]; } else { - newValue[e.pattern] = e.sibling ? { when: e.sibling } : true; + newValue[e.value] = e.sibling ? { when: e.sibling } : true; } } diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index 847214766a4..cfb889e755c 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -138,7 +138,7 @@ export class ListSettingListModel { get items(): IListViewItem[] { const items = this._dataItems.map((item, i) => { - const editing = item.pattern === this._editKey; + const editing = item.value === this._editKey; return { ...item, editing, @@ -150,7 +150,7 @@ export class ListSettingListModel { items.push({ editing: true, selected: true, - pattern: '', + value: '', sibling: '' }); } @@ -192,8 +192,8 @@ export class ListSettingListModel { } export interface IListChangeEvent { - originalPattern: string; - pattern?: string; + originalValue: string; + value?: string; sibling?: string; } @@ -251,10 +251,10 @@ export class ListSettingWidget extends Disposable { }; } - protected getSettingListRowLocalizedStrings(pattern?: string, sibling?: string) { + protected getSettingListRowLocalizedStrings(value?: string, sibling?: string) { return { - settingListRowPatternHintLabel: localize('listPatternHintLabel', "List item `{0}`", pattern), - settingListRowSiblingHintLabel: localize('listSiblingHintLabel', "List item `{0}` with sibling `${1}`", pattern) + settingListRowValueHintLabel: localize('listValueHintLabel', "List item `{0}`", value), + settingListRowSiblingHintLabel: localize('listSiblingHintLabel', "List item `{0}` with sibling `${1}`", value) }; } @@ -287,7 +287,7 @@ export class ListSettingWidget extends Disposable { const item = this.model.items[targetIdx]; if (item) { - this.editSetting(item.pattern); + this.editSetting(item.value); e.preventDefault(); e.stopPropagation(); } @@ -324,7 +324,7 @@ export class ListSettingWidget extends Disposable { DOM.clearNode(this.listElement); this.listDisposables.clear(); - const newMode = this.model.items.some(item => !!(item.editing && !item.pattern)); + const newMode = this.model.items.some(item => !!(item.editing && !item.value)); DOM.toggleClass(this.container, 'setting-list-new-mode', newMode); this.model.items @@ -341,7 +341,7 @@ export class ListSettingWidget extends Disposable { enabled: true, id: 'workbench.action.removeListItem', tooltip: this.getLocalizedStrings().deleteActionTooltip, - run: () => this._onDidChangeList.fire({ originalPattern: key, pattern: undefined }) + run: () => this._onDidChangeList.fire({ originalValue: key, value: undefined }) }; } @@ -377,19 +377,19 @@ export class ListSettingWidget extends Disposable { const actionBar = new ActionBar(rowElement); this.listDisposables.add(actionBar); - const patternElement = DOM.append(rowElement, $('.setting-list-pattern')); + const valueElement = DOM.append(rowElement, $('.setting-list-value')); const siblingElement = DOM.append(rowElement, $('.setting-list-sibling')); - patternElement.textContent = item.pattern; + valueElement.textContent = item.value; siblingElement.textContent = item.sibling ? ('when: ' + item.sibling) : null; actionBar.push([ - this.createEditAction(item.pattern), - this.createDeleteAction(item.pattern) + this.createEditAction(item.value), + this.createDeleteAction(item.value) ], { icon: true, label: false }); rowElement.title = item.sibling - ? this.getSettingListRowLocalizedStrings(item.pattern, item.sibling).settingListRowSiblingHintLabel - : this.getSettingListRowLocalizedStrings(item.pattern, item.sibling).settingListRowPatternHintLabel; + ? this.getSettingListRowLocalizedStrings(item.value, item.sibling).settingListRowSiblingHintLabel + : this.getSettingListRowLocalizedStrings(item.value, item.sibling).settingListRowValueHintLabel; if (item.selected) { if (listFocused) { @@ -423,11 +423,11 @@ export class ListSettingWidget extends Disposable { const onSubmit = (edited: boolean) => { this.model.setEditKey(null); - const pattern = patternInput.value.trim(); - if (edited && pattern) { + const value = valueInput.value.trim(); + if (edited && value) { this._onDidChangeList.fire({ - originalPattern: item.pattern, - pattern, + originalValue: item.value, + value: value, sibling: siblingInput && siblingInput.value.trim() }); } @@ -443,19 +443,19 @@ export class ListSettingWidget extends Disposable { } }; - const patternInput = new InputBox(rowElement, this.contextViewService, { + const valueInput = new InputBox(rowElement, this.contextViewService, { placeholder: this.getLocalizedStrings().inputPlaceholder }); - patternInput.element.classList.add('setting-list-patternInput'); - this.listDisposables.add(attachInputBoxStyler(patternInput, this.themeService, { + valueInput.element.classList.add('setting-list-valueInput'); + this.listDisposables.add(attachInputBoxStyler(valueInput, this.themeService, { inputBackground: settingsTextInputBackground, inputForeground: settingsTextInputForeground, inputBorder: settingsTextInputBorder })); - this.listDisposables.add(patternInput); - patternInput.value = item.pattern; - this.listDisposables.add(DOM.addStandardDisposableListener(patternInput.inputElement, DOM.EventType.KEY_DOWN, onKeydown)); + this.listDisposables.add(valueInput); + valueInput.value = item.value; + this.listDisposables.add(DOM.addStandardDisposableListener(valueInput.inputElement, DOM.EventType.KEY_DOWN, onKeydown)); let siblingInput: InputBox; if (item.sibling) { @@ -487,8 +487,8 @@ export class ListSettingWidget extends Disposable { this.listDisposables.add( disposableTimeout(() => { - patternInput.focus(); - patternInput.select(); + valueInput.focus(); + valueInput.select(); })); return rowElement; @@ -509,14 +509,14 @@ export class ExcludeSettingWidget extends ListSettingWidget { protected getSettingListRowLocalizedStrings(pattern?: string, sibling?: string) { return { - settingListRowPatternHintLabel: localize('excludePatternHintLabel', "Exclude files matching `{0}`", pattern), + settingListRowValueHintLabel: localize('excludePatternHintLabel', "Exclude files matching `{0}`", pattern), settingListRowSiblingHintLabel: localize('excludeSiblingHintLabel', "Exclude files matching `{0}`, only when a file matching `{1}` is present", pattern, sibling) }; } } export interface IListDataItem { - pattern: string; + value: string; sibling?: string; } From be7d344cd0c22934afee471d8d4222c2192487a4 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Sun, 14 Jul 2019 10:48:32 -0700 Subject: [PATCH 015/190] remove item of correct index --- .../contrib/preferences/browser/settingsTree.ts | 15 +++++++-------- .../preferences/browser/settingsWidgets.ts | 7 ++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 26086217bf3..5f75432ca6a 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -698,17 +698,16 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr ? [...template.context.scopeValue] : [...template.context.value]; - // Add value - if (e.value && !e.originalValue) { - newValue.push(e.value); - } // Delete value - else if (!e.value && e.originalValue) { - const valueIndex = newValue.indexOf(e.originalValue); - if (valueIndex > -1) { - newValue.splice(valueIndex, 1); + if (e.removeIndex) { + if (!e.value && e.originalValue && e.removeIndex > -1) { + newValue.splice(e.removeIndex, 1); } } + // Add value + else if (e.value && !e.originalValue) { + newValue.push(e.value); + } // Update value else if (e.value && e.originalValue) { const valueIndex = newValue.indexOf(e.originalValue); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index cfb889e755c..6f38e066dd4 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -195,6 +195,7 @@ export interface IListChangeEvent { originalValue: string; value?: string; sibling?: string; + removeIndex?: number; } export class ListSettingWidget extends Disposable { @@ -335,13 +336,13 @@ export class ListSettingWidget extends Disposable { this.listElement.style.height = listHeight + 'px'; } - private createDeleteAction(key: string): IAction { + private createDeleteAction(key: string, idx: number): IAction { return { class: 'setting-listAction-remove', enabled: true, id: 'workbench.action.removeListItem', tooltip: this.getLocalizedStrings().deleteActionTooltip, - run: () => this._onDidChangeList.fire({ originalValue: key, value: undefined }) + run: () => this._onDidChangeList.fire({ originalValue: key, value: undefined, removeIndex: idx }) }; } @@ -384,7 +385,7 @@ export class ListSettingWidget extends Disposable { actionBar.push([ this.createEditAction(item.value), - this.createDeleteAction(item.value) + this.createDeleteAction(item.value, idx) ], { icon: true, label: false }); rowElement.title = item.sibling From ff9dd18e0e36b438d1fbc638aea5ac0dd443b840 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Mon, 15 Jul 2019 15:09:42 +0530 Subject: [PATCH 016/190] Added Constants.FileMatchOrFolderMatchFocusKey filter --- .../workbench/contrib/search/browser/search.contribution.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index ce34ac3aeb6..cc180c7f64c 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -55,7 +55,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_CONTAINER, VIEW_ID } from 'vs/workbench/services/search/common/search'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { ResourceContextKey } from 'vs/workbench/common/resources'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ExplorerViewlet } from 'vs/workbench/contrib/files/browser/explorerViewlet'; @@ -236,12 +235,12 @@ CommandsRegistry.registerCommand({ const RevealInSideBarForSearchResultsCommand: ICommandAction = { id: Constants.RevealInSideBarForSearchResults, - title: nls.localize('revealInSideBar', "Reveal in Side Bar") + title: nls.localize('revealInSideBar', "Reveal in Explorer") }; MenuRegistry.appendMenuItem(MenuId.SearchContext, { command: RevealInSideBarForSearchResultsCommand, - when: ResourceContextKey.IsFileSystemResource && Constants.HasSearchResults, + when: ContextKeyExpr.and(Constants.FileMatchOrFolderMatchFocusKey, Constants.HasSearchResults), group: '2_files', }); From 1d4dc5dcf98fae61368e030e3052ed2b7f421f7c Mon Sep 17 00:00:00 2001 From: Howard Hung Date: Mon, 15 Jul 2019 23:31:48 +0800 Subject: [PATCH 017/190] Fix typos --- src/vs/workbench/api/common/extHostFileSystem.ts | 12 ++++++------ .../contrib/debug/browser/rawDebugSession.ts | 4 ++-- .../workbench/contrib/files/browser/fileActions.ts | 6 +++--- .../contrib/files/browser/views/explorerViewer.ts | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/api/common/extHostFileSystem.ts b/src/vs/workbench/api/common/extHostFileSystem.ts index c73831e687e..9f0519b636f 100644 --- a/src/vs/workbench/api/common/extHostFileSystem.ts +++ b/src/vs/workbench/api/common/extHostFileSystem.ts @@ -192,23 +192,23 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { this._usedSchemes.add(scheme); this._fsProvider.set(handle, provider); - let capabilites = files.FileSystemProviderCapabilities.FileReadWrite; + let capabilities = files.FileSystemProviderCapabilities.FileReadWrite; if (options.isCaseSensitive) { - capabilites += files.FileSystemProviderCapabilities.PathCaseSensitive; + capabilities += files.FileSystemProviderCapabilities.PathCaseSensitive; } if (options.isReadonly) { - capabilites += files.FileSystemProviderCapabilities.Readonly; + capabilities += files.FileSystemProviderCapabilities.Readonly; } if (typeof provider.copy === 'function') { - capabilites += files.FileSystemProviderCapabilities.FileFolderCopy; + capabilities += files.FileSystemProviderCapabilities.FileFolderCopy; } if (typeof provider.open === 'function' && typeof provider.close === 'function' && typeof provider.read === 'function' && typeof provider.write === 'function' ) { - capabilites += files.FileSystemProviderCapabilities.FileOpenReadWriteClose; + capabilities += files.FileSystemProviderCapabilities.FileOpenReadWriteClose; } - this._proxy.$registerFileSystemProvider(handle, scheme, capabilites); + this._proxy.$registerFileSystemProvider(handle, scheme, capabilities); const subscription = provider.onDidChangeFile(event => { const mapped: IFileChangeDto[] = []; diff --git a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts index 471ccf86d9c..0550ddd64e9 100644 --- a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts @@ -126,8 +126,8 @@ export class RawDebugSession { break; case 'capabilities': if (event.body) { - const capabilites = (event).body.capabilities; - this.mergeCapabilities(capabilites); + const capabilities = (event).body.capabilities; + this.mergeCapabilities(capabilities); } break; case 'stopped': diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 419ea0f902b..4bde241c886 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -328,11 +328,11 @@ function containsBothDirectoryAndFile(distinctElements: ExplorerItem[]): boolean } -export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste: { resource: URI, isDirectory?: boolean, allowOverwirte: boolean }): URI { +export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste: { resource: URI, isDirectory?: boolean, allowOverwrite: boolean }): URI { let name = resources.basenameOrAuthority(fileToPaste.resource); let candidate = resources.joinPath(targetFolder.resource, name); - while (true && !fileToPaste.allowOverwirte) { + while (true && !fileToPaste.allowOverwrite) { if (!targetFolder.root.find(candidate)) { break; } @@ -1030,7 +1030,7 @@ export const pasteFileHandler = async (accessor: ServicesAccessor) => { target = element.isDirectory ? element : element.parent!; } - const targetFile = findValidPasteFileTarget(target, { resource: fileToPaste, isDirectory: fileToPasteStat.isDirectory, allowOverwirte: pasteShouldMove }); + const targetFile = findValidPasteFileTarget(target, { resource: fileToPaste, isDirectory: fileToPasteStat.isDirectory, allowOverwrite: pasteShouldMove }); // Move/Copy File if (pasteShouldMove) { diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index 98e5b29f07b..6543070e81c 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -809,7 +809,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { // Reuse duplicate action if user copies if (isCopy) { - return this.fileService.copy(source.resource, findValidPasteFileTarget(target, { resource: source.resource, isDirectory: source.isDirectory, allowOverwirte: false })).then(stat => { + return this.fileService.copy(source.resource, findValidPasteFileTarget(target, { resource: source.resource, isDirectory: source.isDirectory, allowOverwrite: false })).then(stat => { if (!stat.isDirectory) { return this.editorService.openEditor({ resource: stat.resource, options: { pinned: true } }).then(() => undefined); } From 590f42ccdf5241ad35a6a7abfe6b9a55e3594357 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Mon, 15 Jul 2019 10:58:05 -0700 Subject: [PATCH 018/190] Address feedback --- .../workbench/contrib/preferences/browser/settingsEditor2.ts | 2 +- src/vs/workbench/contrib/preferences/browser/settingsTree.ts | 2 +- .../contrib/preferences/browser/settingsTreeModels.ts | 4 ++-- src/vs/workbench/services/preferences/common/preferences.ts | 4 ++-- .../services/preferences/common/preferencesModels.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 59d20315dca..70f8cfc7188 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -79,7 +79,7 @@ export class SettingsEditor2 extends BaseEditor { return false; } return type === SettingValueType.Enum || - type === SettingValueType.Array || + type === SettingValueType.ArrayOfString || type === SettingValueType.Complex || type === SettingValueType.Boolean || type === SettingValueType.Exclude; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 5f75432ca6a..63571356cc2 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -1355,7 +1355,7 @@ class SettingsTreeDelegate implements IListVirtualDelegate -1 && this.setting.type.length === 2) { if (this.setting.type.indexOf(SettingValueType.Integer) > -1) { this.valueType = SettingValueType.NullableInteger; diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index cce1918207f..a5eb1902bae 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -25,7 +25,7 @@ export enum SettingValueType { Integer = 'integer', Number = 'number', Boolean = 'boolean', - Array = 'array', + ArrayOfString = 'array-of-string', Exclude = 'exclude', Complex = 'complex', NullableInteger = 'nullable-integer', @@ -62,7 +62,7 @@ export interface ISetting { scope?: ConfigurationScope; type?: string | string[]; - listItemType?: string; + arrayItemType?: string; enum?: string[]; enumDescriptions?: string[]; enumDescriptionsAreMarkdown?: boolean; diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index a883ee05f41..0241619be50 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -629,7 +629,7 @@ export class DefaultSettings extends Disposable { overrides, scope: prop.scope, type: prop.type, - listItemType, + arrayItemType: listItemType, enum: prop.enum, enumDescriptions: prop.enumDescriptions || prop.markdownEnumDescriptions, enumDescriptionsAreMarkdown: !prop.enumDescriptions, From 194a7006bf6ac7d5da67093e957e075602c2cc38 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 11:14:38 -0700 Subject: [PATCH 019/190] Fix icon references and remove unused icons --- .../codeAction/lightbulb-autofix-hc.svg | 4 --- .../contrib/codeAction/lightbulb-autofix.svg | 10 -------- .../contrib/codeAction/lightbulb-hc.svg | 3 --- .../editor/contrib/codeAction/lightbulb.svg | 1 - .../documentSymbols/media/symbol-icons.css | 2 +- .../find/images/expando-collapsed-dark.svg | 1 - .../contrib/find/images/expando-collapsed.svg | 1 - .../find/images/expando-expanded-dark.svg | 1 - .../contrib/find/images/expando-expanded.svg | 1 - .../referenceSearch/media/chevron-down-hc.svg | 10 -------- .../media/chevron-down-inverse.svg | 10 -------- .../referenceSearch/media/chevron-down.svg | 10 -------- .../referenceSearch/media/chevron-up-hc.svg | 10 -------- .../media/chevron-up-inverse-hc.svg | 10 -------- .../media/chevron-up-inverse.svg | 10 -------- .../referenceSearch/media/chevron-up.svg | 10 -------- .../referenceSearch/media/close-inverse.svg | 1 - .../contrib/referenceSearch/media/close.svg | 1 - .../editor/contrib/suggest/media/Misc_16x.svg | 1 - .../suggest/media/Misc_inverse_16x.svg | 1 - .../contrib/suggest/media/boolean-dark.svg | 3 --- .../contrib/suggest/media/boolean-light.svg | 3 --- .../contrib/suggest/media/indexer-dark.svg | 3 --- .../contrib/suggest/media/indexer-light.svg | 3 --- .../contrib/suggest/media/numeric-dark.svg | 3 --- .../contrib/suggest/media/numeric-light.svg | 3 --- .../editor/contrib/suggest/media/suggest.css | 4 --- .../parts/notifications/media/error.svg | 25 ------------------- .../parts/notifications/media/info.svg | 17 ------------- .../parts/notifications/media/warning.svg | 15 ----------- 30 files changed, 1 insertion(+), 176 deletions(-) delete mode 100644 src/vs/editor/contrib/codeAction/lightbulb-autofix-hc.svg delete mode 100644 src/vs/editor/contrib/codeAction/lightbulb-autofix.svg delete mode 100644 src/vs/editor/contrib/codeAction/lightbulb-hc.svg delete mode 100644 src/vs/editor/contrib/codeAction/lightbulb.svg delete mode 100644 src/vs/editor/contrib/find/images/expando-collapsed-dark.svg delete mode 100644 src/vs/editor/contrib/find/images/expando-collapsed.svg delete mode 100644 src/vs/editor/contrib/find/images/expando-expanded-dark.svg delete mode 100644 src/vs/editor/contrib/find/images/expando-expanded.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-down-hc.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-down-inverse.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-down.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-up-hc.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse-hc.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/chevron-up.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/close-inverse.svg delete mode 100644 src/vs/editor/contrib/referenceSearch/media/close.svg delete mode 100755 src/vs/editor/contrib/suggest/media/Misc_16x.svg delete mode 100755 src/vs/editor/contrib/suggest/media/Misc_inverse_16x.svg delete mode 100644 src/vs/editor/contrib/suggest/media/boolean-dark.svg delete mode 100644 src/vs/editor/contrib/suggest/media/boolean-light.svg delete mode 100644 src/vs/editor/contrib/suggest/media/indexer-dark.svg delete mode 100644 src/vs/editor/contrib/suggest/media/indexer-light.svg delete mode 100644 src/vs/editor/contrib/suggest/media/numeric-dark.svg delete mode 100644 src/vs/editor/contrib/suggest/media/numeric-light.svg delete mode 100755 src/vs/workbench/browser/parts/notifications/media/error.svg delete mode 100755 src/vs/workbench/browser/parts/notifications/media/info.svg delete mode 100755 src/vs/workbench/browser/parts/notifications/media/warning.svg diff --git a/src/vs/editor/contrib/codeAction/lightbulb-autofix-hc.svg b/src/vs/editor/contrib/codeAction/lightbulb-autofix-hc.svg deleted file mode 100644 index 34d4f3aedf6..00000000000 --- a/src/vs/editor/contrib/codeAction/lightbulb-autofix-hc.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/vs/editor/contrib/codeAction/lightbulb-autofix.svg b/src/vs/editor/contrib/codeAction/lightbulb-autofix.svg deleted file mode 100644 index a4b4858e4dc..00000000000 --- a/src/vs/editor/contrib/codeAction/lightbulb-autofix.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/codeAction/lightbulb-hc.svg b/src/vs/editor/contrib/codeAction/lightbulb-hc.svg deleted file mode 100644 index d2b6e1287a1..00000000000 --- a/src/vs/editor/contrib/codeAction/lightbulb-hc.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/codeAction/lightbulb.svg b/src/vs/editor/contrib/codeAction/lightbulb.svg deleted file mode 100644 index b3596046616..00000000000 --- a/src/vs/editor/contrib/codeAction/lightbulb.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css b/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css index 2579de84f34..4e312f7dfe6 100644 --- a/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css +++ b/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css @@ -170,7 +170,7 @@ } .vs-dark .monaco-workbench .symbol-icon.keyword, .hc-black .monaco-workbench .symbol-icon.keyword { - background-image: url('keyword-light.svg'); + background-image: url('keyword-dark.svg'); } /* interface */ diff --git a/src/vs/editor/contrib/find/images/expando-collapsed-dark.svg b/src/vs/editor/contrib/find/images/expando-collapsed-dark.svg deleted file mode 100644 index 6f3abfce784..00000000000 --- a/src/vs/editor/contrib/find/images/expando-collapsed-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/find/images/expando-collapsed.svg b/src/vs/editor/contrib/find/images/expando-collapsed.svg deleted file mode 100644 index 5dcb87c772c..00000000000 --- a/src/vs/editor/contrib/find/images/expando-collapsed.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/find/images/expando-expanded-dark.svg b/src/vs/editor/contrib/find/images/expando-expanded-dark.svg deleted file mode 100644 index 22dfac04f15..00000000000 --- a/src/vs/editor/contrib/find/images/expando-expanded-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/find/images/expando-expanded.svg b/src/vs/editor/contrib/find/images/expando-expanded.svg deleted file mode 100644 index e55ccd923e5..00000000000 --- a/src/vs/editor/contrib/find/images/expando-expanded.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-down-hc.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-down-hc.svg deleted file mode 100644 index eca0994a743..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-down-hc.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-down-inverse.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-down-inverse.svg deleted file mode 100644 index 0671cba2ff4..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-down-inverse.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-down.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-down.svg deleted file mode 100644 index 9514d8f3172..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-down.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-up-hc.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-up-hc.svg deleted file mode 100644 index 1c668f52b4c..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-up-hc.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse-hc.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse-hc.svg deleted file mode 100644 index 1c668f52b4c..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse-hc.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse.svg deleted file mode 100644 index 31bdf3deebe..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-up-inverse.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/chevron-up.svg b/src/vs/editor/contrib/referenceSearch/media/chevron-up.svg deleted file mode 100644 index 7e38887f57d..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/chevron-up.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/vs/editor/contrib/referenceSearch/media/close-inverse.svg b/src/vs/editor/contrib/referenceSearch/media/close-inverse.svg deleted file mode 100644 index 751e89b3b02..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/close-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/referenceSearch/media/close.svg b/src/vs/editor/contrib/referenceSearch/media/close.svg deleted file mode 100644 index fde34404d4e..00000000000 --- a/src/vs/editor/contrib/referenceSearch/media/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/media/Misc_16x.svg b/src/vs/editor/contrib/suggest/media/Misc_16x.svg deleted file mode 100755 index 13ff00b2347..00000000000 --- a/src/vs/editor/contrib/suggest/media/Misc_16x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/media/Misc_inverse_16x.svg b/src/vs/editor/contrib/suggest/media/Misc_inverse_16x.svg deleted file mode 100755 index 50a038657b2..00000000000 --- a/src/vs/editor/contrib/suggest/media/Misc_inverse_16x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/media/boolean-dark.svg b/src/vs/editor/contrib/suggest/media/boolean-dark.svg deleted file mode 100644 index e009568b131..00000000000 --- a/src/vs/editor/contrib/suggest/media/boolean-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/boolean-light.svg b/src/vs/editor/contrib/suggest/media/boolean-light.svg deleted file mode 100644 index 06613f8bedd..00000000000 --- a/src/vs/editor/contrib/suggest/media/boolean-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/indexer-dark.svg b/src/vs/editor/contrib/suggest/media/indexer-dark.svg deleted file mode 100644 index e92131d3d02..00000000000 --- a/src/vs/editor/contrib/suggest/media/indexer-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/indexer-light.svg b/src/vs/editor/contrib/suggest/media/indexer-light.svg deleted file mode 100644 index 207899642c8..00000000000 --- a/src/vs/editor/contrib/suggest/media/indexer-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/numeric-dark.svg b/src/vs/editor/contrib/suggest/media/numeric-dark.svg deleted file mode 100644 index a1573df0107..00000000000 --- a/src/vs/editor/contrib/suggest/media/numeric-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/numeric-light.svg b/src/vs/editor/contrib/suggest/media/numeric-light.svg deleted file mode 100644 index ea0e56e0225..00000000000 --- a/src/vs/editor/contrib/suggest/media/numeric-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/contrib/suggest/media/suggest.css b/src/vs/editor/contrib/suggest/media/suggest.css index 23f9e36ad30..09594abb493 100644 --- a/src/vs/editor/contrib/suggest/media/suggest.css +++ b/src/vs/editor/contrib/suggest/media/suggest.css @@ -179,7 +179,6 @@ .monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.suggest-icon::before { content: ' '; - background-image: url('Misc_16x.svg'); background-repeat: no-repeat; background-position: center; background-size: 75%; @@ -306,9 +305,6 @@ background-image: url('./info-dark.svg'); } -.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon::before, -.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon::before { background-image: url('Misc_inverse_16x.svg'); } - .monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method::before, .monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method::before, .monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function::before, diff --git a/src/vs/workbench/browser/parts/notifications/media/error.svg b/src/vs/workbench/browser/parts/notifications/media/error.svg deleted file mode 100755 index 04b66689011..00000000000 --- a/src/vs/workbench/browser/parts/notifications/media/error.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/vs/workbench/browser/parts/notifications/media/info.svg b/src/vs/workbench/browser/parts/notifications/media/info.svg deleted file mode 100755 index 3c603528a74..00000000000 --- a/src/vs/workbench/browser/parts/notifications/media/info.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/src/vs/workbench/browser/parts/notifications/media/warning.svg b/src/vs/workbench/browser/parts/notifications/media/warning.svg deleted file mode 100755 index 6d8cffe913e..00000000000 --- a/src/vs/workbench/browser/parts/notifications/media/warning.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - -StatusWarning_16x - - - - - From 08e8d4633f5284de9a1115bccb314620d0a5a06b Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 15 Jul 2019 11:25:57 -0700 Subject: [PATCH 020/190] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eea7bad8051..46ab96c10c0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "a76f8ddb784119243aa004071cea17c5a74b1e60", + "distro": "d679b3a96ff63c9a5bdf13c8da3659810fbc2a2d", "author": { "name": "Microsoft Corporation" }, From afe2da7ed6bfa7b8208d713667f870132940fbef Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:02:49 -0700 Subject: [PATCH 021/190] Use a map instead of a object to store editors --- .../browser/mainThreadDocumentsAndEditors.ts | 18 +++++----- .../api/browser/mainThreadEditors.ts | 35 +++++++++++-------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts index 575e7448869..804349ee484 100644 --- a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts @@ -306,7 +306,7 @@ export class MainThreadDocumentsAndEditors { private readonly _toDispose = new DisposableStore(); private readonly _proxy: ExtHostDocumentsAndEditorsShape; - private _textEditors = <{ [id: string]: MainThreadTextEditor }>Object.create(null); + private readonly _textEditors = new Map(); private _onTextEditorAdd = new Emitter(); private _onTextEditorRemove = new Emitter(); @@ -368,16 +368,16 @@ export class MainThreadDocumentsAndEditors { const mainThreadEditor = new MainThreadTextEditor(apiEditor.id, apiEditor.editor.getModel(), apiEditor.editor, { onGainedFocus() { }, onLostFocus() { } }, this._modelService); - this._textEditors[apiEditor.id] = mainThreadEditor; + this._textEditors.set(apiEditor.id, mainThreadEditor); addedEditors.push(mainThreadEditor); } // removed editors for (const { id } of delta.removedEditors) { - const mainThreadEditor = this._textEditors[id]; + const mainThreadEditor = this._textEditors.get(id); if (mainThreadEditor) { mainThreadEditor.dispose(); - delete this._textEditors[id]; + this._textEditors.delete(id); removedEditors.push(id); } } @@ -448,16 +448,16 @@ export class MainThreadDocumentsAndEditors { return undefined; } - findTextEditorIdFor(editor: IWorkbenchEditor): string | undefined { - for (const id in this._textEditors) { - if (this._textEditors[id].matches(editor)) { + findTextEditorIdFor(inputEditor: IWorkbenchEditor): string | undefined { + for (const [id, editor] of this._textEditors) { + if (editor.matches(inputEditor)) { return id; } } return undefined; } - getEditor(id: string): MainThreadTextEditor { - return this._textEditors[id]; + getEditor(id: string): MainThreadTextEditor | undefined { + return this._textEditors.get(id); } } diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index 25f4a8e1e9c..c63aa1bb7a6 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -160,52 +160,58 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { } $trySetSelections(id: string, selections: ISelection[]): Promise { - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - this._documentsAndEditors.getEditor(id).setSelections(selections); + editor.setSelections(selections); return Promise.resolve(undefined); } $trySetDecorations(id: string, key: string, ranges: IDecorationOptions[]): Promise { key = `${this._instanceId}-${key}`; - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - this._documentsAndEditors.getEditor(id).setDecorations(key, ranges); + editor.setDecorations(key, ranges); return Promise.resolve(undefined); } $trySetDecorationsFast(id: string, key: string, ranges: number[]): Promise { key = `${this._instanceId}-${key}`; - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - this._documentsAndEditors.getEditor(id).setDecorationsFast(key, ranges); + editor.setDecorationsFast(key, ranges); return Promise.resolve(undefined); } $tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): Promise { - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - this._documentsAndEditors.getEditor(id).revealRange(range, revealType); + editor.revealRange(range, revealType); return Promise.resolve(); } $trySetOptions(id: string, options: ITextEditorConfigurationUpdate): Promise { - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - this._documentsAndEditors.getEditor(id).setConfiguration(options); + editor.setConfiguration(options); return Promise.resolve(undefined); } $tryApplyEdits(id: string, modelVersionId: number, edits: ISingleEditOperation[], opts: IApplyEditsOptions): Promise { - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - return Promise.resolve(this._documentsAndEditors.getEditor(id).applyEdits(modelVersionId, edits, opts)); + return Promise.resolve(editor.applyEdits(modelVersionId, edits, opts)); } $tryApplyWorkspaceEdit(dto: WorkspaceEditDto): Promise { @@ -214,10 +220,11 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { } $tryInsertSnippet(id: string, template: string, ranges: readonly IRange[], opts: IUndoStopOptions): Promise { - if (!this._documentsAndEditors.getEditor(id)) { + const editor = this._documentsAndEditors.getEditor(id); + if (!editor) { return Promise.reject(disposed(`TextEditor(${id})`)); } - return Promise.resolve(this._documentsAndEditors.getEditor(id).insertSnippet(template, ranges, opts)); + return Promise.resolve(editor.insertSnippet(template, ranges, opts)); } $registerTextEditorDecorationType(key: string, options: IDecorationRenderOptions): void { From 6ae3384011cd3a838a2c5f78705012796af8874a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:13:42 -0700 Subject: [PATCH 022/190] getEditor() return null instead of undefined --- .../workbench/browser/parts/editor/editorCommands.ts | 4 ++-- .../workbench/browser/parts/editor/editorGroupView.ts | 2 +- .../workbench/browser/parts/editor/tabsTitleControl.ts | 2 +- src/vs/workbench/common/editor/editorGroup.ts | 10 +++++----- .../services/editor/common/editorGroupsService.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index ae8928e6b49..638c44e147e 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -443,11 +443,11 @@ export function splitEditor(editorGroupService: IEditorGroupsService, direction: const newGroup = editorGroupService.addGroup(sourceGroup, direction); // Split editor (if it can be split) - let editorToCopy: IEditorInput | null; + let editorToCopy: IEditorInput | undefined; if (context && typeof context.editorIndex === 'number') { editorToCopy = sourceGroup.getEditor(context.editorIndex); } else { - editorToCopy = sourceGroup.activeEditor; + editorToCopy = types.withNullAsUndefined(sourceGroup.activeEditor); } if (editorToCopy && (editorToCopy as EditorInput).supportsSplitEditor()) { diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index a1c4176be56..1f25c41cb90 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -729,7 +729,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { return this.editors; } - getEditor(index: number): EditorInput | null { + getEditor(index: number): EditorInput | undefined { return this._group.getEditor(index); } diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 7af89021113..00f4b30dc1e 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -695,7 +695,7 @@ export class TabsTitleControl extends TitleControl { private updateDropFeedback(element: HTMLElement, isDND: boolean, index?: number): void { const isTab = (typeof index === 'number'); - const editor = typeof index === 'number' ? this.group.getEditor(index) : null; + const editor = typeof index === 'number' ? this.group.getEditor(index) : undefined; const isActiveTab = isTab && !!editor && this.group.isActive(editor); // Background diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index 7d4ca0c5e52..e5b47924916 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -138,16 +138,16 @@ export class EditorGroup extends Disposable { return mru ? this.mru.slice(0) : this.editors.slice(0); } - getEditor(index: number): EditorInput | null; - getEditor(resource: URI): EditorInput | null; - getEditor(arg1: number | URI): EditorInput | null { + getEditor(index: number): EditorInput | undefined; + getEditor(resource: URI): EditorInput | undefined; + getEditor(arg1: number | URI): EditorInput | undefined { if (typeof arg1 === 'number') { return this.editors[arg1]; } const resource: URI = arg1; if (!this.contains(resource)) { - return null; // fast check for resource opened or not + return undefined; // fast check for resource opened or not } for (const editor of this.editors) { @@ -157,7 +157,7 @@ export class EditorGroup extends Disposable { } } - return null; + return undefined; } get activeEditor(): EditorInput | null { diff --git a/src/vs/workbench/services/editor/common/editorGroupsService.ts b/src/vs/workbench/services/editor/common/editorGroupsService.ts index ac6ff2b537c..c91173e5514 100644 --- a/src/vs/workbench/services/editor/common/editorGroupsService.ts +++ b/src/vs/workbench/services/editor/common/editorGroupsService.ts @@ -411,7 +411,7 @@ export interface IEditorGroup { /** * Returns the editor at a specific index of the group. */ - getEditor(index: number): IEditorInput | null; + getEditor(index: number): IEditorInput | undefined; /** * Get all editors that are currently opened in the group optionally From 38439280fcf970f121029eb0701c3392a5c87157 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:28:32 -0700 Subject: [PATCH 023/190] Use set instead of object literal to track activation events --- .../extensions/common/abstractExtensionService.ts | 11 +++++------ .../extensions/electron-browser/extensionService.ts | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts index d57fa8b1801..f19abf44e9b 100644 --- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts @@ -51,7 +51,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx private readonly _installedExtensionsReady: Barrier; protected readonly _isDev: boolean; private readonly _extensionsMessages: Map; - protected readonly _allRequestedActivateEvents: { [activationEvent: string]: boolean; }; + protected readonly _allRequestedActivateEvents = new Set(); private readonly _proposedApiController: ProposedApiController; private readonly _isExtensionDevHost: boolean; protected readonly _isExtensionDevTestFromCli: boolean; @@ -82,7 +82,6 @@ export abstract class AbstractExtensionService extends Disposable implements IEx this._installedExtensionsReady = new Barrier(); this._isDev = !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment; this._extensionsMessages = new Map(); - this._allRequestedActivateEvents = Object.create(null); this._proposedApiController = new ProposedApiController(this._environmentService, this._productService); this._extensionHostProcessManagers = []; @@ -168,11 +167,11 @@ export abstract class AbstractExtensionService extends Disposable implements IEx public restartExtensionHost(): void { this._stopExtensionHostProcess(); - this._startExtensionHostProcess(false, Object.keys(this._allRequestedActivateEvents)); + this._startExtensionHostProcess(false, Array.from(this._allRequestedActivateEvents.keys())); } public startExtensionHost(): void { - this._startExtensionHostProcess(false, Object.keys(this._allRequestedActivateEvents)); + this._startExtensionHostProcess(false, Array.from(this._allRequestedActivateEvents.keys())); } public stopExtensionHost(): void { @@ -184,7 +183,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx // Extensions have been scanned and interpreted // Record the fact that this activationEvent was requested (in case of a restart) - this._allRequestedActivateEvents[activationEvent] = true; + this._allRequestedActivateEvents.add(activationEvent); if (!this._registry.containsActivationEvent(activationEvent)) { // There is no extension that is interested in this activation event @@ -196,7 +195,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx // Extensions have not been scanned yet. // Record the fact that this activationEvent was requested (in case of a restart) - this._allRequestedActivateEvents[activationEvent] = true; + this._allRequestedActivateEvents.add(activationEvent); return this._installedExtensionsReady.wait().then(() => this._activateByEvent(activationEvent)); } diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index 98b5cf01ba1..4d8357796eb 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -294,7 +294,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten activationEvent = `onUri:${ExtensionIdentifier.toKey(extensionDescription.identifier)}`; } - if (this._allRequestedActivateEvents[activationEvent]) { + if (this._allRequestedActivateEvents.has(activationEvent)) { // This activation event was fired before the extension was added shouldActivate = true; shouldActivateReason = activationEvent; From 7ed88bd70c970c665c74d53a182a763e786af07e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:39:10 -0700 Subject: [PATCH 024/190] Use set to track synced values instead of object literal --- .../workbench/api/browser/mainThreadDocuments.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadDocuments.ts b/src/vs/workbench/api/browser/mainThreadDocuments.ts index adfef42555b..30c8a366e90 100644 --- a/src/vs/workbench/api/browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/browser/mainThreadDocuments.ts @@ -76,7 +76,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { private readonly _toDispose = new DisposableStore(); private _modelToDisposeMap: { [modelUrl: string]: IDisposable; }; private readonly _proxy: ExtHostDocumentsShape; - private readonly _modelIsSynced: { [modelId: string]: boolean; }; + private readonly _modelIsSynced = new Set(); private _modelReferenceCollection = new BoundModelReferenceCollection(); constructor( @@ -98,7 +98,6 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { this._environmentService = environmentService; this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocuments); - this._modelIsSynced = {}; this._toDispose.add(documentsAndEditors.onDocumentAdd(models => models.forEach(this._onModelAdded, this))); this._toDispose.add(documentsAndEditors.onDocumentRemove(urls => urls.forEach(this._onModelRemoved, this))); @@ -144,7 +143,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { return; } const modelUrl = model.uri; - this._modelIsSynced[modelUrl.toString()] = true; + this._modelIsSynced.add(modelUrl.toString()); this._modelToDisposeMap[modelUrl.toString()] = model.onDidChangeContent((e) => { this._proxy.$acceptModelChanged(modelUrl, e, this._textFileService.isDirty(modelUrl)); }); @@ -153,7 +152,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { private _onModelModeChanged(event: { model: ITextModel; oldModeId: string; }): void { let { model, oldModeId } = event; const modelUrl = model.uri; - if (!this._modelIsSynced[modelUrl.toString()]) { + if (!this._modelIsSynced.has(modelUrl.toString())) { return; } this._proxy.$acceptModelModeChanged(model.uri, oldModeId, model.getLanguageIdentifier().language); @@ -161,10 +160,10 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { private _onModelRemoved(modelUrl: URI): void { const strModelUrl = modelUrl.toString(); - if (!this._modelIsSynced[strModelUrl]) { + if (!this._modelIsSynced.has(strModelUrl)) { return; } - delete this._modelIsSynced[strModelUrl]; + this._modelIsSynced.delete(strModelUrl); this._modelToDisposeMap[strModelUrl].dispose(); delete this._modelToDisposeMap[strModelUrl]; } @@ -195,7 +194,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { return promise.then(success => { if (!success) { return Promise.reject(new Error('cannot open ' + uri.toString())); - } else if (!this._modelIsSynced[uri.toString()]) { + } else if (!this._modelIsSynced.has(uri.toString())) { return Promise.reject(new Error('cannot open ' + uri.toString() + '. Detail: Files above 50MB cannot be synchronized with extensions.')); } else { return undefined; @@ -236,7 +235,7 @@ export class MainThreadDocuments implements MainThreadDocumentsShape { }).then(model => { const resource = model.getResource(); - if (!this._modelIsSynced[resource.toString()]) { + if (!this._modelIsSynced.has(resource.toString())) { throw new Error(`expected URI ${resource.toString()} to have come to LIFE`); } From f729a996c603a5f96aed0ffb8740b47dcba4fc13 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:46:11 -0700 Subject: [PATCH 025/190] Use map to track registrations --- .../api/browser/mainThreadLanguageFeatures.ts | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index d54e01d9a9b..75af9eebf01 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -27,7 +27,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha private readonly _proxy: ExtHostLanguageFeaturesShape; private readonly _modeService: IModeService; - private readonly _registrations: { [handle: number]: IDisposable; } = Object.create(null); + private readonly _registrations = new Map(); constructor( extHostContext: IExtHostContext, @@ -38,16 +38,17 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha } dispose(): void { - for (const key in this._registrations) { - this._registrations[key].dispose(); + for (const registration of this._registrations.values()) { + registration.dispose(); } + this._registrations.clear(); } $unregister(handle: number): void { - const registration = this._registrations[handle]; + const registration = this._registrations.get(handle); if (registration) { registration.dispose(); - delete this._registrations[handle]; + this._registrations.delete(handle); } } @@ -122,12 +123,12 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha // --- outline $registerDocumentSymbolProvider(handle: number, selector: ISerializedDocumentFilter[], displayName: string): void { - this._registrations[handle] = modes.DocumentSymbolProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DocumentSymbolProviderRegistry.register(selector, { displayName, provideDocumentSymbols: (model: ITextModel, token: CancellationToken): Promise => { return this._proxy.$provideDocumentSymbols(handle, model.uri, token); } - }); + })); } // --- code lens @@ -153,15 +154,15 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha if (typeof eventHandle === 'number') { const emitter = new Emitter(); - this._registrations[eventHandle] = emitter; + this._registrations.set(eventHandle, emitter); provider.onDidChange = emitter.event; } - this._registrations[handle] = modes.CodeLensProviderRegistry.register(selector, provider); + this._registrations.set(handle, modes.CodeLensProviderRegistry.register(selector, provider)); } $emitCodeLensEvent(eventHandle: number, event?: any): void { - const obj = this._registrations[eventHandle]; + const obj = this._registrations.get(eventHandle); if (obj instanceof Emitter) { obj.fire(event); } @@ -170,71 +171,71 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha // --- declaration $registerDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.DefinitionProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DefinitionProviderRegistry.register(selector, { provideDefinition: (model, position, token): Promise => { return this._proxy.$provideDefinition(handle, model.uri, position, token).then(MainThreadLanguageFeatures._reviveLocationLinkDto); } - }); + })); } $registerDeclarationSupport(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.DeclarationProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DeclarationProviderRegistry.register(selector, { provideDeclaration: (model, position, token) => { return this._proxy.$provideDeclaration(handle, model.uri, position, token).then(MainThreadLanguageFeatures._reviveLocationLinkDto); } - }); + })); } $registerImplementationSupport(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.ImplementationProviderRegistry.register(selector, { + this._registrations.set(handle, modes.ImplementationProviderRegistry.register(selector, { provideImplementation: (model, position, token): Promise => { return this._proxy.$provideImplementation(handle, model.uri, position, token).then(MainThreadLanguageFeatures._reviveLocationLinkDto); } - }); + })); } $registerTypeDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.TypeDefinitionProviderRegistry.register(selector, { + this._registrations.set(handle, modes.TypeDefinitionProviderRegistry.register(selector, { provideTypeDefinition: (model, position, token): Promise => { return this._proxy.$provideTypeDefinition(handle, model.uri, position, token).then(MainThreadLanguageFeatures._reviveLocationLinkDto); } - }); + })); } // --- extra info $registerHoverProvider(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.HoverProviderRegistry.register(selector, { + this._registrations.set(handle, modes.HoverProviderRegistry.register(selector, { provideHover: (model: ITextModel, position: EditorPosition, token: CancellationToken): Promise => { return this._proxy.$provideHover(handle, model.uri, position, token); } - }); + })); } // --- occurrences $registerDocumentHighlightProvider(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.DocumentHighlightProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DocumentHighlightProviderRegistry.register(selector, { provideDocumentHighlights: (model: ITextModel, position: EditorPosition, token: CancellationToken): Promise => { return this._proxy.$provideDocumentHighlights(handle, model.uri, position, token); } - }); + })); } // --- references $registerReferenceSupport(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.ReferenceProviderRegistry.register(selector, { + this._registrations.set(handle, modes.ReferenceProviderRegistry.register(selector, { provideReferences: (model: ITextModel, position: EditorPosition, context: modes.ReferenceContext, token: CancellationToken): Promise => { return this._proxy.$provideReferences(handle, model.uri, position, context, token).then(MainThreadLanguageFeatures._reviveLocationDto); } - }); + })); } // --- quick fix $registerQuickFixSupport(handle: number, selector: ISerializedDocumentFilter[], providedCodeActionKinds?: string[]): void { - this._registrations[handle] = modes.CodeActionProviderRegistry.register(selector, { + this._registrations.set(handle, modes.CodeActionProviderRegistry.register(selector, { provideCodeActions: async (model: ITextModel, rangeOrSelection: EditorRange | Selection, context: modes.CodeActionContext, token: CancellationToken): Promise => { const listDto = await this._proxy.$provideCodeActions(handle, model.uri, rangeOrSelection, context, token); if (!listDto) { @@ -250,46 +251,46 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha }; }, providedCodeActionKinds - }); + })); } // --- formatting $registerDocumentFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], extensionId: ExtensionIdentifier, displayName: string): void { - this._registrations[handle] = modes.DocumentFormattingEditProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DocumentFormattingEditProviderRegistry.register(selector, { extensionId, displayName, provideDocumentFormattingEdits: (model: ITextModel, options: modes.FormattingOptions, token: CancellationToken): Promise => { return this._proxy.$provideDocumentFormattingEdits(handle, model.uri, options, token); } - }); + })); } $registerRangeFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], extensionId: ExtensionIdentifier, displayName: string): void { - this._registrations[handle] = modes.DocumentRangeFormattingEditProviderRegistry.register(selector, { + this._registrations.set(handle, modes.DocumentRangeFormattingEditProviderRegistry.register(selector, { extensionId, displayName, provideDocumentRangeFormattingEdits: (model: ITextModel, range: EditorRange, options: modes.FormattingOptions, token: CancellationToken): Promise => { return this._proxy.$provideDocumentRangeFormattingEdits(handle, model.uri, range, options, token); } - }); + })); } $registerOnTypeFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], autoFormatTriggerCharacters: string[], extensionId: ExtensionIdentifier): void { - this._registrations[handle] = modes.OnTypeFormattingEditProviderRegistry.register(selector, { + this._registrations.set(handle, modes.OnTypeFormattingEditProviderRegistry.register(selector, { extensionId, autoFormatTriggerCharacters, provideOnTypeFormattingEdits: (model: ITextModel, position: EditorPosition, ch: string, options: modes.FormattingOptions, token: CancellationToken): Promise => { return this._proxy.$provideOnTypeFormattingEdits(handle, model.uri, position, ch, options, token); } - }); + })); } // --- navigate type $registerNavigateTypeSupport(handle: number): void { let lastResultId: number | undefined; - this._registrations[handle] = search.WorkspaceSymbolProviderRegistry.register({ + this._registrations.set(handle, search.WorkspaceSymbolProviderRegistry.register({ provideWorkspaceSymbols: (search: string, token: CancellationToken): Promise => { return this._proxy.$provideWorkspaceSymbols(handle, search, token).then(result => { if (lastResultId !== undefined) { @@ -307,21 +308,20 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return undefined; }); } - }); + })); } // --- rename $registerRenameSupport(handle: number, selector: ISerializedDocumentFilter[], supportResolveLocation: boolean): void { - - this._registrations[handle] = modes.RenameProviderRegistry.register(selector, { + this._registrations.set(handle, modes.RenameProviderRegistry.register(selector, { provideRenameEdits: (model: ITextModel, position: EditorPosition, newName: string, token: CancellationToken): Promise => { return this._proxy.$provideRenameEdits(handle, model.uri, position, newName, token).then(reviveWorkspaceEditDto); }, resolveRenameLocation: supportResolveLocation ? (model: ITextModel, position: EditorPosition, token: CancellationToken): Promise => this._proxy.$resolveRenameLocation(handle, model.uri, position, token) : undefined - }); + })); } // --- suggest @@ -374,13 +374,13 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha }); }; } - this._registrations[handle] = modes.CompletionProviderRegistry.register(selector, provider); + this._registrations.set(handle, modes.CompletionProviderRegistry.register(selector, provider)); } // --- parameter hints $registerSignatureHelpProvider(handle: number, selector: ISerializedDocumentFilter[], metadata: ISerializedSignatureHelpProviderMetadata): void { - this._registrations[handle] = modes.SignatureHelpProviderRegistry.register(selector, { + this._registrations.set(handle, modes.SignatureHelpProviderRegistry.register(selector, { signatureHelpTriggerCharacters: metadata.triggerCharacters, signatureHelpRetriggerCharacters: metadata.retriggerCharacters, @@ -397,7 +397,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha } }; } - }); + })); } // --- links @@ -431,14 +431,14 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha }); }; } - this._registrations[handle] = modes.LinkProviderRegistry.register(selector, provider); + this._registrations.set(handle, modes.LinkProviderRegistry.register(selector, provider)); } // --- colors $registerDocumentColorProvider(handle: number, selector: ISerializedDocumentFilter[]): void { const proxy = this._proxy; - this._registrations[handle] = modes.ColorProviderRegistry.register(selector, { + this._registrations.set(handle, modes.ColorProviderRegistry.register(selector, { provideDocumentColors: (model, token) => { return proxy.$provideDocumentColors(handle, model.uri, token) .then(documentColors => { @@ -465,34 +465,34 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha range: colorInfo.range }, token); } - }); + })); } // --- folding $registerFoldingRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void { const proxy = this._proxy; - this._registrations[handle] = modes.FoldingRangeProviderRegistry.register(selector, { + this._registrations.set(handle, modes.FoldingRangeProviderRegistry.register(selector, { provideFoldingRanges: (model, context, token) => { return proxy.$provideFoldingRanges(handle, model.uri, context, token); } - }); + })); } // -- smart select $registerSelectionRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = modes.SelectionRangeRegistry.register(selector, { + this._registrations.set(handle, modes.SelectionRangeRegistry.register(selector, { provideSelectionRanges: (model, positions, token) => { return this._proxy.$provideSelectionRanges(handle, model.uri, positions, token); } - }); + })); } // --- call hierarchy $registerCallHierarchyProvider(handle: number, selector: ISerializedDocumentFilter[]): void { - this._registrations[handle] = callh.CallHierarchyProviderRegistry.register(selector, { + this._registrations.set(handle, callh.CallHierarchyProviderRegistry.register(selector, { provideCallHierarchyItem: (document, position, token) => { return this._proxy.$provideCallHierarchyItem(handle, document.uri, position, token).then(MainThreadLanguageFeatures._reviveCallHierarchyItemDto); }, @@ -510,7 +510,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return data as [callh.CallHierarchyItem, modes.Location[]][]; }); } - }); + })); } // --- configuration @@ -571,7 +571,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha const languageIdentifier = this._modeService.getLanguageIdentifier(languageId); if (languageIdentifier) { - this._registrations[handle] = LanguageConfigurationRegistry.register(languageIdentifier, configuration); + this._registrations.set(handle, LanguageConfigurationRegistry.register(languageIdentifier, configuration)); } } From f907a8c987b43aeaacdf18458212059f567be371 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 11:46:51 -0700 Subject: [PATCH 026/190] Update js/ts grammar --- .../syntaxes/JavaScript.tmLanguage.json | 64 +++++++++--------- .../syntaxes/JavaScriptReact.tmLanguage.json | 64 +++++++++--------- extensions/typescript-basics/cgmanifest.json | 2 +- .../syntaxes/TypeScript.tmLanguage.json | 66 +++++++++---------- .../syntaxes/TypeScriptReact.tmLanguage.json | 64 +++++++++--------- 5 files changed, 130 insertions(+), 130 deletions(-) diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index 9ea6c3cec1b..71cf0a91c20 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/3508c88a4ac6112934e0c34de7942c67682b2321", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f698a9826cad8235e92b7c298a5f8c9c298d8ada", "name": "JavaScript (with React support)", "scopeName": "source.js", "patterns": [ @@ -286,7 +286,7 @@ { "name": "meta.var.expr.js", "begin": "(?=(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.js entity.name.function.js" @@ -435,7 +435,7 @@ "name": "keyword.operator.definiteassignment.js" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.js variable.other.constant.js entity.name.function.js" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.js" @@ -1108,7 +1108,7 @@ "include": "#comment" }, { - "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.js entity.name.function.js" @@ -1144,7 +1144,7 @@ "name": "keyword.operator.assignment.js" } }, - "end": "(?=$|^|[,);}\\]]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.js" @@ -1318,7 +1318,7 @@ }, { "name": "meta.method.declaration.js", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.js" @@ -1350,7 +1350,7 @@ }, "object-literal-method-declaration": { "name": "meta.method.declaration.js", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -1371,7 +1371,7 @@ "include": "#function-body" }, { - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -1431,7 +1431,7 @@ }, { "name": "meta.arrow.js", - "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -2604,7 +2604,7 @@ }, { "name": "meta.object.member.js", - "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "0": { "name": "meta.object-literal.key.js" @@ -2695,7 +2695,7 @@ "end": "(?=,|\\})", "patterns": [ { - "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -2869,7 +2869,7 @@ "paren-expression-possibly-arrow": { "patterns": [ { - "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -2883,7 +2883,7 @@ ] }, { - "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\()|(<))\\s*$)", + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -2953,7 +2953,7 @@ } }, { - "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.js" @@ -3469,7 +3469,7 @@ } }, { - "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", "captures": { "1": { "name": "punctuation.accessor.js" @@ -3541,7 +3541,7 @@ "include": "#object-identifiers" }, { - "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", "captures": { "1": { "name": "punctuation.accessor.js" diff --git a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json index 627882de1e0..2f830d70beb 100644 --- a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/3508c88a4ac6112934e0c34de7942c67682b2321", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f698a9826cad8235e92b7c298a5f8c9c298d8ada", "name": "JavaScript (with React support)", "scopeName": "source.js.jsx", "patterns": [ @@ -286,7 +286,7 @@ { "name": "meta.var.expr.js.jsx", "begin": "(?=(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.js.jsx entity.name.function.js.jsx" @@ -435,7 +435,7 @@ "name": "keyword.operator.definiteassignment.js.jsx" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.js.jsx variable.other.constant.js.jsx entity.name.function.js.jsx" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.js.jsx" @@ -1108,7 +1108,7 @@ "include": "#comment" }, { - "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.js.jsx entity.name.function.js.jsx" @@ -1144,7 +1144,7 @@ "name": "keyword.operator.assignment.js.jsx" } }, - "end": "(?=$|^|[,);}\\]]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.js.jsx" @@ -1318,7 +1318,7 @@ }, { "name": "meta.method.declaration.js.jsx", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.js.jsx" @@ -1350,7 +1350,7 @@ }, "object-literal-method-declaration": { "name": "meta.method.declaration.js.jsx", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -1371,7 +1371,7 @@ "include": "#function-body" }, { - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -1431,7 +1431,7 @@ }, { "name": "meta.arrow.js.jsx", - "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -2604,7 +2604,7 @@ }, { "name": "meta.object.member.js.jsx", - "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "0": { "name": "meta.object-literal.key.js.jsx" @@ -2695,7 +2695,7 @@ "end": "(?=,|\\})", "patterns": [ { - "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -2869,7 +2869,7 @@ "paren-expression-possibly-arrow": { "patterns": [ { - "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -2883,7 +2883,7 @@ ] }, { - "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\()|(<))\\s*$)", + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.js.jsx" @@ -2953,7 +2953,7 @@ } }, { - "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.js.jsx" @@ -3469,7 +3469,7 @@ } }, { - "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", "captures": { "1": { "name": "punctuation.accessor.js.jsx" @@ -3541,7 +3541,7 @@ "include": "#object-identifiers" }, { - "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", "captures": { "1": { "name": "punctuation.accessor.js.jsx" diff --git a/extensions/typescript-basics/cgmanifest.json b/extensions/typescript-basics/cgmanifest.json index ffd4150e68a..0f20c256fda 100644 --- a/extensions/typescript-basics/cgmanifest.json +++ b/extensions/typescript-basics/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "TypeScript-TmLanguage", "repositoryUrl": "https://github.com/Microsoft/TypeScript-TmLanguage", - "commitHash": "3508c88a4ac6112934e0c34de7942c67682b2321" + "commitHash": "f698a9826cad8235e92b7c298a5f8c9c298d8ada" } }, "license": "MIT", diff --git a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json index a3d9b24fe96..0f5c3ba241e 100644 --- a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/3508c88a4ac6112934e0c34de7942c67682b2321", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f698a9826cad8235e92b7c298a5f8c9c298d8ada", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -283,7 +283,7 @@ { "name": "meta.var.expr.ts", "begin": "(?=(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.ts entity.name.function.ts" @@ -432,7 +432,7 @@ "name": "keyword.operator.definiteassignment.ts" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.ts" @@ -1105,7 +1105,7 @@ "include": "#comment" }, { - "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.ts entity.name.function.ts" @@ -1141,7 +1141,7 @@ "name": "keyword.operator.assignment.ts" } }, - "end": "(?=$|^|[,);}\\]]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.ts" @@ -1315,7 +1315,7 @@ }, { "name": "meta.method.declaration.ts", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.ts" @@ -1347,7 +1347,7 @@ }, "object-literal-method-declaration": { "name": "meta.method.declaration.ts", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -1368,7 +1368,7 @@ "include": "#function-body" }, { - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -1428,7 +1428,7 @@ }, { "name": "meta.arrow.ts", - "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -2601,7 +2601,7 @@ }, { "name": "meta.object.member.ts", - "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "0": { "name": "meta.object-literal.key.ts" @@ -2692,7 +2692,7 @@ "end": "(?=,|\\})", "patterns": [ { - "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -2866,7 +2866,7 @@ "paren-expression-possibly-arrow": { "patterns": [ { - "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -2880,7 +2880,7 @@ ] }, { - "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\()|(<))\\s*$)", + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -2950,7 +2950,7 @@ } }, { - "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.ts" @@ -3518,7 +3518,7 @@ } }, { - "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", "captures": { "1": { "name": "punctuation.accessor.ts" @@ -3590,7 +3590,7 @@ "include": "#object-identifiers" }, { - "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", "captures": { "1": { "name": "punctuation.accessor.ts" @@ -4103,7 +4103,7 @@ }, "patterns": [ { - "match": "(?x)(?:(?)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))))", + "match": "(?x)(?:(?)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*([\\{\\[]\\s*)?$))))", "captures": { "1": { "name": "storage.modifier.ts" diff --git a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json index 3560a374b9d..59f4e80a93c 100644 --- a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/3508c88a4ac6112934e0c34de7942c67682b2321", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f698a9826cad8235e92b7c298a5f8c9c298d8ada", "name": "TypeScriptReact", "scopeName": "source.tsx", "patterns": [ @@ -286,7 +286,7 @@ { "name": "meta.var.expr.tsx", "begin": "(?=(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.tsx entity.name.function.tsx" @@ -435,7 +435,7 @@ "name": "keyword.operator.definiteassignment.tsx" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "beginCaptures": { "1": { "name": "meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx" } }, - "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.tsx" @@ -1108,7 +1108,7 @@ "include": "#comment" }, { - "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.tsx entity.name.function.tsx" @@ -1144,7 +1144,7 @@ "name": "keyword.operator.assignment.tsx" } }, - "end": "(?=$|^|[,);}\\]]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.tsx" @@ -1318,7 +1318,7 @@ }, { "name": "meta.method.declaration.tsx", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.tsx" @@ -1350,7 +1350,7 @@ }, "object-literal-method-declaration": { "name": "meta.method.declaration.tsx", - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -1371,7 +1371,7 @@ "include": "#function-body" }, { - "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?[\\(])", + "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -1431,7 +1431,7 @@ }, { "name": "meta.arrow.tsx", - "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -2604,7 +2604,7 @@ }, { "name": "meta.object.member.tsx", - "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "0": { "name": "meta.object-literal.key.tsx" @@ -2695,7 +2695,7 @@ "end": "(?=,|\\})", "patterns": [ { - "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*([\\{\\[]\\s*)?$)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -2869,7 +2869,7 @@ "paren-expression-possibly-arrow": { "patterns": [ { - "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*[\\{\\[]\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -2883,7 +2883,7 @@ ] }, { - "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*))?\\()|(<))\\s*$)", + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -2953,7 +2953,7 @@ } }, { - "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "storage.modifier.tsx" @@ -3469,7 +3469,7 @@ } }, { - "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", "captures": { "1": { "name": "punctuation.accessor.tsx" @@ -3541,7 +3541,7 @@ "include": "#object-identifiers" }, { - "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*([\\{\\[]\\s*)?$)) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<[^<>]+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", "captures": { "1": { "name": "punctuation.accessor.tsx" From 3589100317a9b6f6e06b60080e931e8b8233e41c Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 11:51:44 -0700 Subject: [PATCH 027/190] Update Win menu icons --- src/vs/base/browser/ui/menu/check.svg | 4 +++- src/vs/base/browser/ui/menu/ellipsis.svg | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/menu/check.svg b/src/vs/base/browser/ui/menu/check.svg index 3f365c4800e..865cc83c347 100644 --- a/src/vs/base/browser/ui/menu/check.svg +++ b/src/vs/base/browser/ui/menu/check.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/vs/base/browser/ui/menu/ellipsis.svg b/src/vs/base/browser/ui/menu/ellipsis.svg index e3f85623356..2c52e359f61 100644 --- a/src/vs/base/browser/ui/menu/ellipsis.svg +++ b/src/vs/base/browser/ui/menu/ellipsis.svg @@ -1 +1,5 @@ -Ellipsis_bold_16x \ No newline at end of file + + + + + From b7fbc3e35cb88932801605b5c8e575e5e4fdd41b Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 11:52:04 -0700 Subject: [PATCH 028/190] Update diff close icons --- src/vs/editor/browser/widget/media/close-dark.svg | 3 +++ src/vs/editor/browser/widget/media/close-inverse.svg | 1 - src/vs/editor/browser/widget/media/close-light.svg | 3 +++ src/vs/editor/browser/widget/media/close.svg | 1 - src/vs/editor/browser/widget/media/diffReview.css | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 src/vs/editor/browser/widget/media/close-dark.svg delete mode 100644 src/vs/editor/browser/widget/media/close-inverse.svg create mode 100644 src/vs/editor/browser/widget/media/close-light.svg delete mode 100644 src/vs/editor/browser/widget/media/close.svg diff --git a/src/vs/editor/browser/widget/media/close-dark.svg b/src/vs/editor/browser/widget/media/close-dark.svg new file mode 100644 index 00000000000..6d16d212ae5 --- /dev/null +++ b/src/vs/editor/browser/widget/media/close-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/editor/browser/widget/media/close-inverse.svg b/src/vs/editor/browser/widget/media/close-inverse.svg deleted file mode 100644 index 751e89b3b02..00000000000 --- a/src/vs/editor/browser/widget/media/close-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/browser/widget/media/close-light.svg b/src/vs/editor/browser/widget/media/close-light.svg new file mode 100644 index 00000000000..742fcae4ae7 --- /dev/null +++ b/src/vs/editor/browser/widget/media/close-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/editor/browser/widget/media/close.svg b/src/vs/editor/browser/widget/media/close.svg deleted file mode 100644 index fde34404d4e..00000000000 --- a/src/vs/editor/browser/widget/media/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/browser/widget/media/diffReview.css b/src/vs/editor/browser/widget/media/diffReview.css index edb9317dd80..4cf9f7b83a4 100644 --- a/src/vs/editor/browser/widget/media/diffReview.css +++ b/src/vs/editor/browser/widget/media/diffReview.css @@ -62,9 +62,9 @@ margin: 2px 0; } .monaco-diff-editor .action-label.icon.close-diff-review { - background: url('close.svg') center center no-repeat; + background: url('close-light.svg') center center no-repeat; } .monaco-diff-editor.hc-black .action-label.icon.close-diff-review, .monaco-diff-editor.vs-dark .action-label.icon.close-diff-review { - background: url('close-inverse.svg') center center no-repeat; + background: url('close-dark.svg') center center no-repeat; } \ No newline at end of file From ca98b5994f0f71433f5d1fb7800b5bc47d16b66c Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 11:54:35 -0700 Subject: [PATCH 029/190] Remove unused icons --- src/vs/workbench/contrib/files/browser/media/CollapseAll.svg | 1 - .../contrib/files/browser/media/CollapseAll_inverse.svg | 1 - 2 files changed, 2 deletions(-) delete mode 100644 src/vs/workbench/contrib/files/browser/media/CollapseAll.svg delete mode 100644 src/vs/workbench/contrib/files/browser/media/CollapseAll_inverse.svg diff --git a/src/vs/workbench/contrib/files/browser/media/CollapseAll.svg b/src/vs/workbench/contrib/files/browser/media/CollapseAll.svg deleted file mode 100644 index 7d11a30f6e0..00000000000 --- a/src/vs/workbench/contrib/files/browser/media/CollapseAll.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/files/browser/media/CollapseAll_inverse.svg b/src/vs/workbench/contrib/files/browser/media/CollapseAll_inverse.svg deleted file mode 100644 index 46a65fff71a..00000000000 --- a/src/vs/workbench/contrib/files/browser/media/CollapseAll_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 618da5875289281ea2b243c17d6d51e8fe532335 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 12:00:37 -0700 Subject: [PATCH 030/190] Use map instead of object literals in mainThreadTerminalService Replaces a few uses of object literals with regular maps, which better enforce type correctness --- .../api/browser/mainThreadTerminalService.ts | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadTerminalService.ts b/src/vs/workbench/api/browser/mainThreadTerminalService.ts index bc8349ab47c..ab865cc5224 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalService.ts @@ -18,10 +18,10 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape private _proxy: ExtHostTerminalServiceShape; private _remoteAuthority: string | null; private readonly _toDispose = new DisposableStore(); - private _terminalProcesses: { [id: number]: Promise } = {}; - private _terminalProcessesReady: { [id: number]: (proxy: ITerminalProcessExtHostProxy) => void } = {}; - private _terminalOnDidWriteDataListeners: { [id: number]: IDisposable } = {}; - private _terminalOnDidAcceptInputListeners: { [id: number]: IDisposable } = {}; + private readonly _terminalProcesses = new Map>(); + private readonly _terminalProcessesReady = new Map void>(); + private readonly _terminalOnDidWriteDataListeners = new Map(); + private readonly _terminalOnDidAcceptInputListeners = new Map(); constructor( extHostContext: IExtHostContext, @@ -93,7 +93,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape isVirtualProcess: launchConfig.isVirtualProcess }; const terminal = this._terminalService.createTerminal(shellLaunchConfig); - this._terminalProcesses[terminal.id] = new Promise(r => this._terminalProcessesReady[terminal.id] = r); + this._terminalProcesses.set(terminal.id, new Promise(r => this._terminalProcessesReady.set(terminal.id, r))); return Promise.resolve({ id: terminal.id, name: terminal.title @@ -155,13 +155,14 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } // Listener already registered - if (this._terminalOnDidAcceptInputListeners.hasOwnProperty(terminalId)) { + if (this._terminalOnDidAcceptInputListeners.has(terminalId)) { return; } // Register - this._terminalOnDidAcceptInputListeners[terminalId] = terminalInstance.onRendererInput(data => this._onTerminalRendererInput(terminalId, data)); - terminalInstance.addDisposable(this._terminalOnDidAcceptInputListeners[terminalId]); + const listener = terminalInstance.onRendererInput(data => this._onTerminalRendererInput(terminalId, data)); + this._terminalOnDidAcceptInputListeners.set(terminalId, listener); + terminalInstance.addDisposable(listener); } public $sendText(terminalId: number, text: string, addNewLine: boolean): void { @@ -178,15 +179,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } // Listener already registered - if (this._terminalOnDidWriteDataListeners[terminalId]) { + if (this._terminalOnDidWriteDataListeners.has(terminalId)) { return; } // Register - this._terminalOnDidWriteDataListeners[terminalId] = terminalInstance.onData(data => { + const listener = terminalInstance.onData(data => { this._onTerminalData(terminalId, data); }); - terminalInstance.addDisposable(this._terminalOnDidWriteDataListeners[terminalId]); + this._terminalOnDidWriteDataListeners.set(terminalId, listener); + terminalInstance.addDisposable(listener); } private _onActiveTerminalChanged(terminalId: number | null): void { @@ -245,12 +247,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } const proxy = request.proxy; - const ready = this._terminalProcessesReady[proxy.terminalId]; + const ready = this._terminalProcessesReady.get(proxy.terminalId); if (ready) { ready(proxy); - delete this._terminalProcessesReady[proxy.terminalId]; + this._terminalProcessesReady.delete(proxy.terminalId); } else { - this._terminalProcesses[proxy.terminalId] = Promise.resolve(proxy); + this._terminalProcesses.set(proxy.terminalId, Promise.resolve(proxy)); } const shellLaunchConfigDto: ShellLaunchConfigDto = { name: request.shellLaunchConfig.name, @@ -270,12 +272,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape private _onTerminalRequestVirtualProcess(request: ITerminalVirtualProcessRequest): void { const proxy = request.proxy; - const ready = this._terminalProcessesReady[proxy.terminalId]; + const ready = this._terminalProcessesReady.get(proxy.terminalId); if (!ready) { - this._terminalProcesses[proxy.terminalId] = Promise.resolve(proxy); + this._terminalProcesses.set(proxy.terminalId, Promise.resolve(proxy)); } else { ready(proxy); - delete this._terminalProcessesReady[proxy.terminalId]; + this._terminalProcessesReady.delete(proxy.terminalId); } // Note that onReisze is not being listened to here as it needs to fire when max dimensions @@ -293,32 +295,32 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } public $sendProcessTitle(terminalId: number, title: string): void { - this._terminalProcesses[terminalId].then(e => e.emitTitle(title)); + this._getTerminalProcess(terminalId).then(e => e.emitTitle(title)); } public $sendProcessData(terminalId: number, data: string): void { - this._terminalProcesses[terminalId].then(e => e.emitData(data)); + this._getTerminalProcess(terminalId).then(e => e.emitData(data)); } public $sendProcessReady(terminalId: number, pid: number, cwd: string): void { - this._terminalProcesses[terminalId].then(e => e.emitReady(pid, cwd)); + this._getTerminalProcess(terminalId).then(e => e.emitReady(pid, cwd)); } public $sendProcessExit(terminalId: number, exitCode: number): void { - this._terminalProcesses[terminalId].then(e => e.emitExit(exitCode)); - delete this._terminalProcesses[terminalId]; + this._getTerminalProcess(terminalId).then(e => e.emitExit(exitCode)); + this._terminalProcesses.delete(terminalId); } public $sendOverrideDimensions(terminalId: number, dimensions: ITerminalDimensions | undefined): void { - this._terminalProcesses[terminalId].then(e => e.emitOverrideDimensions(dimensions)); + this._getTerminalProcess(terminalId).then(e => e.emitOverrideDimensions(dimensions)); } public $sendProcessInitialCwd(terminalId: number, initialCwd: string): void { - this._terminalProcesses[terminalId].then(e => e.emitInitialCwd(initialCwd)); + this._getTerminalProcess(terminalId).then(e => e.emitInitialCwd(initialCwd)); } public $sendProcessCwd(terminalId: number, cwd: string): void { - this._terminalProcesses[terminalId].then(e => e.emitCwd(cwd)); + this._getTerminalProcess(terminalId).then(e => e.emitCwd(cwd)); } private async _onRequestLatency(terminalId: number): Promise { @@ -330,7 +332,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape sw.stop(); sum += sw.elapsed(); } - this._terminalProcesses[terminalId].then(e => e.emitLatency(sum / COUNT)); + this._getTerminalProcess(terminalId).then(e => e.emitLatency(sum / COUNT)); } private _isPrimaryExtHost(): boolean { @@ -353,4 +355,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape this._proxy.$requestDefaultShellAndArgs().then(e => request(e.shell, e.args)); } } + + private _getTerminalProcess(terminalId: number): Promise { + const terminal = this._terminalProcesses.get(terminalId); + if (!terminal) { + throw new Error(`Unknown terminal: ${terminalId}`); + } + return terminal; + } } From 7db5f72fff7c783f3607ed5da2826c38e23eb3cc Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 12:47:31 -0700 Subject: [PATCH 031/190] Update keyboard icon --- .../browser/iPadShowKeyboard/iPadShowKeyboard.css | 4 ++-- .../browser/iPadShowKeyboard/keyboard-dark.svg | 10 ++++++++++ .../browser/iPadShowKeyboard/keyboard-inverse.svg | 1 - .../browser/iPadShowKeyboard/keyboard-light.svg | 10 ++++++++++ .../standalone/browser/iPadShowKeyboard/keyboard.svg | 1 - 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-dark.svg delete mode 100644 src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg create mode 100644 src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-light.svg delete mode 100644 src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css index 34cb14546d3..7579f789060 100644 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css @@ -13,12 +13,12 @@ position: absolute; resize: none; overflow: hidden; - background: url('keyboard.svg') center center no-repeat; + background: url('keyboard-light.svg') center center no-repeat; border: 4px solid #F6F6F6; border-radius: 4px; } .monaco-editor.vs-dark .iPadShowKeyboard { - background: url('keyboard-inverse.svg') center center no-repeat; + background: url('keyboard-dark.svg') center center no-repeat; border: 4px solid #252526; } \ No newline at end of file diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-dark.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-dark.svg new file mode 100644 index 00000000000..308c5331695 --- /dev/null +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg deleted file mode 100644 index 40bfc47424e..00000000000 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-light.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-light.svg new file mode 100644 index 00000000000..152bf777f62 --- /dev/null +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-light.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg deleted file mode 100644 index bd13224272a..00000000000 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From fdf1a1aa5605687badd6ddb97571ccb0c65500ff Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 Jul 2019 18:16:55 +0200 Subject: [PATCH 032/190] wip --- src/vs/base/browser/ui/grid/grid.ts | 14 +- src/vs/base/browser/ui/grid/gridview.ts | 45 +++++- src/vs/base/browser/ui/splitview/splitview.ts | 116 ++++++++++----- .../browser/parts/panel/panelPart.ts | 1 - .../browser/parts/sidebar/sidebarPart.ts | 1 - test/splitview/public/index.html | 132 +++++++++++++----- 6 files changed, 229 insertions(+), 80 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 8297b231ced..602d60e844c 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -12,7 +12,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { $ } from 'vs/base/browser/dom'; import { LayoutPriority } from 'vs/base/browser/ui/splitview/splitview'; -export { Orientation } from './gridview'; +export { Orientation, Sizing as GridViewSizing } from './gridview'; export const enum Direction { Up, @@ -317,6 +317,16 @@ export class Grid extends Disposable { this.gridview.distributeViewSizes(); } + isViewVisible(view: T): boolean { + const location = this.getViewLocation(view); + return this.gridview.isViewVisible(location); + } + + setViewVisible(view: T, visible: boolean): void { + const location = this.getViewLocation(view); + this.gridview.setViewVisible(location, visible); + } + getViews(): GridBranchNode { return this.gridview.getViews() as GridBranchNode; } @@ -653,7 +663,7 @@ export class View implements IView { readonly onDidChange: Event<{ width: number; height: number; } | undefined>; get priority(): LayoutPriority | undefined { return this.view.priority; } - get snapSize(): number | undefined { return this.visible ? this.view.snapSize : undefined; } + get snap(): boolean | undefined { return this.view.snap; } constructor(private view: IView) { this.show(); diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index 8b1a39d02d9..de91f923dc7 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -28,8 +28,9 @@ export interface IView { readonly maximumHeight: number; readonly onDidChange: Event; readonly priority?: LayoutPriority; - readonly snapSize?: number; + readonly snap?: boolean; layout(width: number, height: number, orientation: Orientation): void; + setVisible?(visible: boolean): void; } export function orthogonal(orientation: Orientation): Orientation { @@ -304,6 +305,22 @@ class BranchNode implements ISplitView, IDisposable { return this.splitview.getViewSize(index); } + isChildVisible(index: number): boolean { + if (index < 0 || index >= this.children.length) { + throw new Error('Invalid index'); + } + + return this.splitview.isViewVisible(index); + } + + setChildVisible(index: number, visible: boolean): void { + if (index < 0 || index >= this.children.length) { + throw new Error('Invalid index'); + } + + this.splitview.setViewVisible(index, visible); + } + private onDidChildrenChange(): void { const onDidChildrenChange = Event.map(Event.any(...this.children.map(c => c.onDidChange)), () => undefined); this.childrenChangeDisposable.dispose(); @@ -463,8 +480,8 @@ class LeafNode implements ISplitView, IDisposable { return this.view.priority; } - get snapSize(): number | undefined { - return this.view.snapSize; + get snap(): boolean | undefined { + return this.view.snap; } get minimumOrthogonalSize(): number { @@ -810,6 +827,28 @@ export class GridView implements IDisposable { node.distributeViewSizes(); } + isViewVisible(location: number[]): boolean { + const [rest, index] = tail(location); + const [, parent] = this.getNode(rest); + + if (!(parent instanceof BranchNode)) { + throw new Error('Invalid from location'); + } + + return parent.isChildVisible(index); + } + + setViewVisible(location: number[], visible: boolean): void { + const [rest, index] = tail(location); + const [, parent] = this.getNode(rest); + + if (!(parent instanceof BranchNode)) { + throw new Error('Invalid from location'); + } + + parent.setChildVisible(index, visible); + } + getViews(): GridBranchNode { return this._getViews(this.root, this.orientation, { top: 0, left: 0, width: this.width, height: this.height }) as GridBranchNode; } diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 278366152b4..979d0d9694b 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -97,8 +97,10 @@ abstract class ViewItem { get minimumSize(): number { return this.visible ? this.view.minimumSize : 0; } get viewMinimumSize(): number { return this.view.minimumSize; } + get maximumSize(): number { return this.visible ? this.view.maximumSize : 0; } get viewMaximumSize(): number { return this.view.maximumSize; } + get priority(): LayoutPriority | undefined { return this.view.priority; } get snap(): boolean { return !!this.view.snap; } @@ -139,6 +141,11 @@ interface ISashItem { disposable: IDisposable; } +interface ISashDragSnapState { + readonly index: number; + readonly limitDelta: number; +} + interface ISashDragState { index: number; start: number; @@ -147,8 +154,8 @@ interface ISashDragState { minDelta: number; maxDelta: number; alt: boolean; - snapIndex: number | undefined; - snapLimitDelta: number | undefined; + snapBefore: ISashDragSnapState | undefined; + snapAfter: ISashDragSnapState | undefined; disposable: IDisposable; } @@ -486,55 +493,78 @@ export class SplitView extends Disposable { } } - let snapIndex: number | undefined; - let snapLimitDelta: number | undefined; + let snapBefore: ISashDragSnapState | undefined; + let snapAfter: ISashDragSnapState | undefined; if (!alt) { const upIndexes = range(index, -1); const downIndexes = range(index + 1, this.viewItems.length); const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0); - const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0); + const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0); const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0); - const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0); + const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0); const minDelta = Math.max(minDeltaUp, minDeltaDown); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp); - const snapBefore = this.viewItems[index].snap; - const snapAfter = this.viewItems[index + 1].snap; + const findSnapIndex = (indexes: number[]): number | undefined => { + // visible views first + for (const index of indexes) { + if (!this.viewItems[index].visible) { + continue; + } - if (snapBefore && snapAfter) { - snapIndex = index + 1 < (this.viewItems.length - index - 1) ? index : index + 1; - } else if (snapBefore) { - snapIndex = index; - } else if (snapAfter) { - snapIndex = index + 1; + if (this.viewItems[index].snap) { + return index; + } + } + + // then, hidden views + for (const index of indexes) { + if (!this.viewItems[index].visible && this.viewItems[index].snap) { + return index; + } + } + + return undefined; + }; + + const snapBeforeIndex = findSnapIndex(upIndexes); + + if (typeof snapBeforeIndex === 'number') { + const viewItem = this.viewItems[snapBeforeIndex]; + const halfSize = Math.floor(viewItem.viewMinimumSize / 2); + + snapBefore = { + index: snapBeforeIndex, + limitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize + }; } - if (typeof snapIndex === 'number') { - if (this.viewItems[snapIndex].visible) { - snapLimitDelta = snapIndex === index - ? minDelta - (this.viewItems[index].viewMinimumSize / 2) - : maxDelta + (this.viewItems[index + 1].viewMinimumSize / 2); - } else { - snapLimitDelta = snapIndex === index - ? minDelta + (this.viewItems[index].viewMinimumSize / 2) - : maxDelta - (this.viewItems[index + 1].viewMinimumSize / 2); - } + const snapAfterIndex = findSnapIndex(downIndexes); + + if (typeof snapAfterIndex === 'number') { + const viewItem = this.viewItems[snapAfterIndex]; + const halfSize = Math.floor(viewItem.viewMinimumSize / 2); + + snapAfter = { + index: snapAfterIndex, + limitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize + }; } } - this.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapIndex, snapLimitDelta, disposable }; + this.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable }; }; resetSashDragState(start, alt); } private onSashChange({ current }: ISashEvent): void { - const { index, start, sizes, alt, minDelta, maxDelta, snapIndex, snapLimitDelta } = this.sashDragState; + const { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState; this.sashDragState.current = current; const delta = current - start; - const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapIndex, snapLimitDelta); + const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter); if (alt) { const isLastSash = index === this.sashItems.length - 1; @@ -645,8 +675,8 @@ export class SplitView extends Disposable { highPriorityIndexes?: number[], overloadMinDelta: number = Number.NEGATIVE_INFINITY, overloadMaxDelta: number = Number.POSITIVE_INFINITY, - snapIndex?: number, - snapLimitDelta?: number + snapBefore?: ISashDragSnapState, + snapAfter?: ISashDragSnapState ): number { if (index < 0 || index >= this.viewItems.length) { return 0; @@ -682,13 +712,23 @@ export class SplitView extends Disposable { const minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta); - if (typeof snapIndex === 'number' && typeof snapLimitDelta === 'number') { - const snapView = this.viewItems[snapIndex]; + let snapped = false; - snapView.visible = snapIndex === index - ? delta >= snapLimitDelta // up - : delta < snapLimitDelta; // down + if (snapBefore) { + const snapView = this.viewItems[snapBefore.index]; + const visible = delta >= snapBefore.limitDelta; + snapped = visible !== snapView.visible; + snapView.visible = visible; + } + if (!snapped && snapAfter) { + const snapView = this.viewItems[snapAfter.index]; + const visible = delta < snapAfter.limitDelta; + snapped = visible !== snapView.visible; + snapView.visible = visible; + } + + if (snapped) { return this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta); } @@ -759,9 +799,15 @@ export class SplitView extends Disposable { previous = false; const expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse(); + const firstVisibleViewIndex = firstIndex(this.viewItems, viewItem => viewItem.visible); + this.sashItems.forEach((s, i) => { if (!this.viewItems[i].visible) { - s.sash.state = SashState.Disabled; + if (i === firstVisibleViewIndex - 1) { + s.sash.state = SashState.Minimum; + } else { + s.sash.state = SashState.Disabled; + } } else { const min = !(collapsesDown[i] && expandsUp[i + 1]); const max = !(expandsDown[i] && collapsesUp[i + 1]); diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 506e6f876d7..d20c01e6620 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -58,7 +58,6 @@ export class PanelPart extends CompositePart implements IPanelService { readonly minimumHeight: number = 77; readonly maximumHeight: number = Number.POSITIVE_INFINITY; - readonly snapSize: number = 50; readonly priority: LayoutPriority = LayoutPriority.Low; //#endregion diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index e8bc995e65a..ef0d2b4890f 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -46,7 +46,6 @@ export class SidebarPart extends CompositePart implements IViewletServi readonly minimumHeight: number = 0; readonly maximumHeight: number = Number.POSITIVE_INFINITY; - readonly snapSize: number = 50; readonly priority: LayoutPriority = LayoutPriority.Low; //#endregion diff --git a/test/splitview/public/index.html b/test/splitview/public/index.html index 73ced374c02..81bec11778f 100644 --- a/test/splitview/public/index.html +++ b/test/splitview/public/index.html @@ -5,7 +5,7 @@ Splitview @@ -31,51 +31,107 @@ From c836dfa08083858eb42eedd9e5a84827ceaf74a1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 Jul 2019 20:44:40 +0200 Subject: [PATCH 033/190] grid: propagate setVisible --- src/vs/base/browser/ui/grid/gridview.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index de91f923dc7..bb1d17a1687 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -179,6 +179,12 @@ class BranchNode implements ISplitView, IDisposable { } } + setVisible(visible: boolean): void { + for (const child of this.children) { + child.setVisible(visible); + } + } + orthogonalLayout(size: number): void { this._size = size; this.splitview.layout(size); @@ -505,6 +511,12 @@ class LeafNode implements ISplitView, IDisposable { return this.view.layout(this.width, this.height, orthogonal(this.orientation)); } + setVisible(visible: boolean): void { + if (this.view.setVisible) { + this.view.setVisible(visible); + } + } + orthogonalLayout(size: number): void { this._orthogonalSize = size; return this.view.layout(this.width, this.height, orthogonal(this.orientation)); From cfdc5898cb8f8db9f9b8cdd90d334ea6ba93fba9 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 Jul 2019 21:45:22 +0200 Subject: [PATCH 034/190] splitview: fix snap enablement --- src/vs/base/browser/ui/splitview/splitview.ts | 97 +++++++++---------- test/splitview/public/index.html | 2 +- 2 files changed, 45 insertions(+), 54 deletions(-) diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 979d0d9694b..9584ce7d4ae 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -505,30 +505,8 @@ export class SplitView extends Disposable { const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0); const minDelta = Math.max(minDeltaUp, minDeltaDown); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp); - - const findSnapIndex = (indexes: number[]): number | undefined => { - // visible views first - for (const index of indexes) { - if (!this.viewItems[index].visible) { - continue; - } - - if (this.viewItems[index].snap) { - return index; - } - } - - // then, hidden views - for (const index of indexes) { - if (!this.viewItems[index].visible && this.viewItems[index].snap) { - return index; - } - } - - return undefined; - }; - - const snapBeforeIndex = findSnapIndex(upIndexes); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); if (typeof snapBeforeIndex === 'number') { const viewItem = this.viewItems[snapBeforeIndex]; @@ -540,8 +518,6 @@ export class SplitView extends Disposable { }; } - const snapAfterIndex = findSnapIndex(downIndexes); - if (typeof snapAfterIndex === 'number') { const viewItem = this.viewItems[snapAfterIndex]; const halfSize = Math.floor(viewItem.viewMinimumSize / 2); @@ -799,38 +775,31 @@ export class SplitView extends Disposable { previous = false; const expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse(); - const firstVisibleViewIndex = firstIndex(this.viewItems, viewItem => viewItem.visible); + this.sashItems.forEach(({ sash }, index) => { + const min = !(collapsesDown[index] && expandsUp[index + 1]); + const max = !(expandsDown[index] && collapsesUp[index + 1]); - this.sashItems.forEach((s, i) => { - if (!this.viewItems[i].visible) { - if (i === firstVisibleViewIndex - 1) { - s.sash.state = SashState.Minimum; + if (min && max) { + const upIndexes = range(index, -1); + const downIndexes = range(index + 1, this.viewItems.length); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); + + if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { + sash.state = SashState.Minimum; + } else if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { + sash.state = SashState.Maximum; } else { - s.sash.state = SashState.Disabled; + sash.state = SashState.Disabled; } + } else if (min && !max) { + sash.state = SashState.Minimum; + } else if (!min && max) { + sash.state = SashState.Maximum; } else { - const min = !(collapsesDown[i] && expandsUp[i + 1]); - const max = !(expandsDown[i] && collapsesUp[i + 1]); - - if (min && max) { - const before = !range(0, i + 1).some(i => !this.viewItems[i].snap || this.viewItems[i].visible); - const after = !range(i + 1, this.viewItems.length).some(i => !this.viewItems[i].snap || this.viewItems[i].visible); - - if (before) { - s.sash.state = SashState.Minimum; - } else if (after) { - s.sash.state = SashState.Maximum; - } else { - s.sash.state = SashState.Disabled; - } - } else if (min && !max) { - s.sash.state = SashState.Minimum; - } else if (!min && max) { - s.sash.state = SashState.Maximum; - } else { - s.sash.state = SashState.Enabled; - } + sash.state = SashState.Enabled; } + // } }); } @@ -848,6 +817,28 @@ export class SplitView extends Disposable { return 0; } + private findFirstSnapIndex(indexes: number[]): number | undefined { + // visible views first + for (const index of indexes) { + if (!this.viewItems[index].visible) { + continue; + } + + if (this.viewItems[index].snap) { + return index; + } + } + + // then, hidden views + for (const index of indexes) { + if (!this.viewItems[index].visible && this.viewItems[index].snap) { + return index; + } + } + + return undefined; + } + dispose(): void { super.dispose(); diff --git a/test/splitview/public/index.html b/test/splitview/public/index.html index 81bec11778f..602682d6aab 100644 --- a/test/splitview/public/index.html +++ b/test/splitview/public/index.html @@ -103,7 +103,7 @@ this.minimumSize = typeof minimumSize === 'number' ? minimumSize : 100; this.maximumSize = typeof maximumSize === 'number' ? maximumSize : Number.POSITIVE_INFINITY; this.onDidChange = Event.None; - this.snap = true; + this.snap = !minimumSize && !maximumSize; this.button = document.createElement('button'); this.button.onclick = () => splitview.setViewVisible(this.id, !splitview.isViewVisible(this.id)); From ca76092b18904e04d75021b91ea94436dfaa286b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 Jul 2019 22:02:38 +0200 Subject: [PATCH 035/190] delete Grid.View --- src/vs/base/browser/ui/grid/grid.ts | 66 +------------------ src/vs/workbench/browser/layout.ts | 55 ++++++++-------- .../browser/parts/panel/panelPart.ts | 1 + .../browser/parts/sidebar/sidebarPart.ts | 1 + 4 files changed, 32 insertions(+), 91 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 602d60e844c..3a22b6b825f 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -8,9 +8,7 @@ import { Orientation } from 'vs/base/browser/ui/sash/sash'; import { Disposable } from 'vs/base/common/lifecycle'; import { tail2 as tail, equals } from 'vs/base/common/arrays'; import { orthogonal, IView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles, IViewSize } from './gridview'; -import { Event, Emitter } from 'vs/base/common/event'; -import { $ } from 'vs/base/browser/dom'; -import { LayoutPriority } from 'vs/base/browser/ui/splitview/splitview'; +import { Event } from 'vs/base/common/event'; export { Orientation, Sizing as GridViewSizing } from './gridview'; @@ -187,7 +185,7 @@ export interface IGridOptions { proportionalLayout?: boolean; } -export class Grid extends Disposable { +export class Grid extends Disposable { protected gridview: GridView; private views = new Map(); @@ -644,63 +642,3 @@ export function createSerializedGrid(gridDescriptor: GridDescriptor): ISerialize height: height || 1 }; } - -export class View implements IView { - - readonly element = $('.grid-view-view'); - - private visible = false; - private width: number | undefined; - private height: number | undefined; - private orientation: Orientation = Orientation.HORIZONTAL; - - get minimumWidth(): number { return this.visible ? this.view.minimumWidth : 0; } - get maximumWidth(): number { return this.visible ? this.view.maximumWidth : (this.orientation === Orientation.HORIZONTAL ? 0 : Number.POSITIVE_INFINITY); } - get minimumHeight(): number { return this.visible ? this.view.minimumHeight : 0; } - get maximumHeight(): number { return this.visible ? this.view.maximumHeight : (this.orientation === Orientation.VERTICAL ? 0 : Number.POSITIVE_INFINITY); } - - private onDidChangeVisibility = new Emitter<{ width: number; height: number; } | undefined>(); - readonly onDidChange: Event<{ width: number; height: number; } | undefined>; - - get priority(): LayoutPriority | undefined { return this.view.priority; } - get snap(): boolean | undefined { return this.view.snap; } - - constructor(private view: IView) { - this.show(); - this.onDidChange = Event.any(this.onDidChangeVisibility.event, Event.filter(view.onDidChange, () => this.visible)); - } - - show(): void { - if (this.visible) { - return; - } - - this.visible = true; - - this.element.appendChild(this.view.element); - this.onDidChangeVisibility.fire(typeof this.width === 'number' ? { width: this.width, height: this.height! } : undefined); - } - - hide(): void { - if (!this.visible) { - return; - } - - this.visible = false; - - this.element.removeChild(this.view.element); - this.onDidChangeVisibility.fire(undefined); - } - - layout(width: number, height: number, orientation: Orientation): void { - this.orientation = orientation; - - if (!this.visible) { - return; - } - - this.view.layout(width, height, orientation); - this.width = width; - this.height = height; - } -} \ No newline at end of file diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index c6c65edb28a..b478adbb976 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -27,13 +27,14 @@ import { IWindowService, MenuBarVisibility, getTitleBarStyle } from 'vs/platform import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { Sizing, Direction, Grid, View } from 'vs/base/browser/ui/grid/grid'; +import { Sizing, Direction, Grid } from 'vs/base/browser/ui/grid/grid'; import { WorkbenchLegacyLayout } from 'vs/workbench/browser/legacyLayout'; import { IDimension } from 'vs/platform/layout/browser/layoutService'; import { Part } from 'vs/workbench/browser/part'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService'; import { IFileService } from 'vs/platform/files/common/files'; +import { IView } from 'vs/base/browser/ui/grid/gridview'; enum Settings { MENUBAR_VISIBLE = 'window.menuBarVisibility', @@ -87,16 +88,16 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi private parts: Map = new Map(); - private workbenchGrid: Grid | WorkbenchLegacyLayout; + private workbenchGrid: Grid | WorkbenchLegacyLayout; private disposed: boolean; - private titleBarPartView: View; - private activityBarPartView: View; - private sideBarPartView: View; - private panelPartView: View; - private editorPartView: View; - private statusBarPartView: View; + private titleBarPartView: IView; + private activityBarPartView: IView; + private sideBarPartView: IView; + private panelPartView: IView; + private editorPartView: IView; + private statusBarPartView: IView; private environmentService: IWorkbenchEnvironmentService; private configurationService: IConfigurationService; @@ -701,12 +702,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi if (this.configurationService.getValue('workbench.useExperimentalGridLayout')) { // Create view wrappers for all parts - this.titleBarPartView = new View(titleBar); - this.sideBarPartView = new View(sideBar); - this.activityBarPartView = new View(activityBar); - this.editorPartView = new View(editorPart); - this.panelPartView = new View(panelPart); - this.statusBarPartView = new View(statusBar); + this.titleBarPartView = titleBar; + this.sideBarPartView = sideBar; + this.activityBarPartView = activityBar; + this.editorPartView = editorPart; + this.panelPartView = panelPart; + this.statusBarPartView = statusBar; this.workbenchGrid = new Grid(this.editorPartView, { proportionalLayout: false }); @@ -789,52 +790,52 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Hide parts if (this.state.panel.hidden) { - this.panelPartView.hide(); + this.workbenchGrid.setViewVisible(this.panelPartView, false); } if (this.state.statusBar.hidden) { - this.statusBarPartView.hide(); + this.workbenchGrid.setViewVisible(this.statusBarPartView, false); } - if (!this.isVisible(Parts.TITLEBAR_PART)) { - this.titleBarPartView.hide(); + if (titlebarInGrid && !this.isVisible(Parts.TITLEBAR_PART)) { + this.workbenchGrid.setViewVisible(this.titleBarPartView, false); } if (this.state.activityBar.hidden) { - this.activityBarPartView.hide(); + this.workbenchGrid.setViewVisible(this.activityBarPartView, false); } if (this.state.sideBar.hidden) { - this.sideBarPartView.hide(); + this.workbenchGrid.setViewVisible(this.sideBarPartView, false); } if (this.state.editor.hidden) { - this.editorPartView.hide(); + this.workbenchGrid.setViewVisible(this.editorPartView, false); } // Show visible parts if (!this.state.editor.hidden) { - this.editorPartView.show(); + this.workbenchGrid.setViewVisible(this.editorPartView, true); } if (!this.state.statusBar.hidden) { - this.statusBarPartView.show(); + this.workbenchGrid.setViewVisible(this.statusBarPartView, true); } if (this.isVisible(Parts.TITLEBAR_PART)) { - this.titleBarPartView.show(); + this.workbenchGrid.setViewVisible(this.titleBarPartView, true); } if (!this.state.activityBar.hidden) { - this.activityBarPartView.show(); + this.workbenchGrid.setViewVisible(this.activityBarPartView, true); } if (!this.state.sideBar.hidden) { - this.sideBarPartView.show(); + this.workbenchGrid.setViewVisible(this.sideBarPartView, true); } if (!this.state.panel.hidden) { - this.panelPartView.show(); + this.workbenchGrid.setViewVisible(this.panelPartView, true); } } diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index d20c01e6620..c073de7d9b3 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -59,6 +59,7 @@ export class PanelPart extends CompositePart implements IPanelService { readonly maximumHeight: number = Number.POSITIVE_INFINITY; readonly priority: LayoutPriority = LayoutPriority.Low; + readonly snap = true; //#endregion diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index ef0d2b4890f..ed6463b04ba 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -47,6 +47,7 @@ export class SidebarPart extends CompositePart implements IViewletServi readonly maximumHeight: number = Number.POSITIVE_INFINITY; readonly priority: LayoutPriority = LayoutPriority.Low; + readonly snap = true; //#endregion From 4ca45c209b5667e3c74f5c9a0d1d2204dc8703d5 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 Jul 2019 22:03:00 +0200 Subject: [PATCH 036/190] cleanup layout priorites --- src/vs/workbench/browser/parts/panel/panelPart.ts | 2 -- src/vs/workbench/browser/parts/sidebar/sidebarPart.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index c073de7d9b3..6d67a653be8 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -32,7 +32,6 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { isUndefinedOrNull, withUndefinedAsNull, withNullAsUndefined } from 'vs/base/common/types'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { LayoutPriority } from 'vs/base/browser/ui/grid/gridview'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; interface ICachedPanel { @@ -58,7 +57,6 @@ export class PanelPart extends CompositePart implements IPanelService { readonly minimumHeight: number = 77; readonly maximumHeight: number = Number.POSITIVE_INFINITY; - readonly priority: LayoutPriority = LayoutPriority.Low; readonly snap = true; //#endregion diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index ed6463b04ba..65f81f7be9b 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -30,7 +30,6 @@ import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { LayoutPriority } from 'vs/base/browser/ui/grid/gridview'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class SidebarPart extends CompositePart implements IViewletService { @@ -46,7 +45,6 @@ export class SidebarPart extends CompositePart implements IViewletServi readonly minimumHeight: number = 0; readonly maximumHeight: number = Number.POSITIVE_INFINITY; - readonly priority: LayoutPriority = LayoutPriority.Low; readonly snap = true; //#endregion From 923e40b1335a7edec876a10e6d5b8909fb0a9bad Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 15 Jul 2019 14:35:22 -0700 Subject: [PATCH 037/190] Update 'vs-minimal' file icon theme --- .../fileicons/images/Document_16x.svg | 1 - .../fileicons/images/Document_16x_inverse.svg | 1 - .../fileicons/images/FolderOpen_16x.svg | 1 - .../images/FolderOpen_16x_inverse.svg | 1 - .../fileicons/images/Folder_16x.svg | 1 - .../fileicons/images/Folder_16x_inverse.svg | 1 - .../fileicons/images/RootFolderOpen_16x.svg | 1 - .../images/RootFolderOpen_16x_inverse.svg | 1 - .../fileicons/images/RootFolder_16x.svg | 1 - .../images/RootFolder_16x_inverse.svg | 1 - .../fileicons/images/document-dark.svg | 3 +++ .../fileicons/images/document-light.svg | 3 +++ .../fileicons/images/folder-dark.svg | 3 +++ .../fileicons/images/folder-light.svg | 3 +++ .../fileicons/images/folder-open-dark.svg | 4 ++++ .../fileicons/images/folder-open-light.svg | 4 ++++ .../fileicons/images/root-folder-dark.svg | 5 +++++ .../fileicons/images/root-folder-light.svg | 5 +++++ .../images/root-folder-open-dark.svg | 5 +++++ .../images/root-folder-open-light.svg | 5 +++++ .../fileicons/vs_minimal-icon-theme.json | 20 +++++++++---------- 21 files changed, 50 insertions(+), 20 deletions(-) delete mode 100644 extensions/theme-defaults/fileicons/images/Document_16x.svg delete mode 100755 extensions/theme-defaults/fileicons/images/Document_16x_inverse.svg delete mode 100644 extensions/theme-defaults/fileicons/images/FolderOpen_16x.svg delete mode 100755 extensions/theme-defaults/fileicons/images/FolderOpen_16x_inverse.svg delete mode 100644 extensions/theme-defaults/fileicons/images/Folder_16x.svg delete mode 100755 extensions/theme-defaults/fileicons/images/Folder_16x_inverse.svg delete mode 100755 extensions/theme-defaults/fileicons/images/RootFolderOpen_16x.svg delete mode 100755 extensions/theme-defaults/fileicons/images/RootFolderOpen_16x_inverse.svg delete mode 100755 extensions/theme-defaults/fileicons/images/RootFolder_16x.svg delete mode 100755 extensions/theme-defaults/fileicons/images/RootFolder_16x_inverse.svg create mode 100644 extensions/theme-defaults/fileicons/images/document-dark.svg create mode 100644 extensions/theme-defaults/fileicons/images/document-light.svg create mode 100644 extensions/theme-defaults/fileicons/images/folder-dark.svg create mode 100644 extensions/theme-defaults/fileicons/images/folder-light.svg create mode 100644 extensions/theme-defaults/fileicons/images/folder-open-dark.svg create mode 100644 extensions/theme-defaults/fileicons/images/folder-open-light.svg create mode 100644 extensions/theme-defaults/fileicons/images/root-folder-dark.svg create mode 100644 extensions/theme-defaults/fileicons/images/root-folder-light.svg create mode 100644 extensions/theme-defaults/fileicons/images/root-folder-open-dark.svg create mode 100644 extensions/theme-defaults/fileicons/images/root-folder-open-light.svg diff --git a/extensions/theme-defaults/fileicons/images/Document_16x.svg b/extensions/theme-defaults/fileicons/images/Document_16x.svg deleted file mode 100644 index 46a9f38cc88..00000000000 --- a/extensions/theme-defaults/fileicons/images/Document_16x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/Document_16x_inverse.svg b/extensions/theme-defaults/fileicons/images/Document_16x_inverse.svg deleted file mode 100755 index 14abfb51077..00000000000 --- a/extensions/theme-defaults/fileicons/images/Document_16x_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/FolderOpen_16x.svg b/extensions/theme-defaults/fileicons/images/FolderOpen_16x.svg deleted file mode 100644 index 1a3933d6351..00000000000 --- a/extensions/theme-defaults/fileicons/images/FolderOpen_16x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/FolderOpen_16x_inverse.svg b/extensions/theme-defaults/fileicons/images/FolderOpen_16x_inverse.svg deleted file mode 100755 index fbf57c927f2..00000000000 --- a/extensions/theme-defaults/fileicons/images/FolderOpen_16x_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/Folder_16x.svg b/extensions/theme-defaults/fileicons/images/Folder_16x.svg deleted file mode 100644 index 3d64ae71db4..00000000000 --- a/extensions/theme-defaults/fileicons/images/Folder_16x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/Folder_16x_inverse.svg b/extensions/theme-defaults/fileicons/images/Folder_16x_inverse.svg deleted file mode 100755 index 13b18d18016..00000000000 --- a/extensions/theme-defaults/fileicons/images/Folder_16x_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x.svg b/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x.svg deleted file mode 100755 index 20460ec997b..00000000000 --- a/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x_inverse.svg b/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x_inverse.svg deleted file mode 100755 index d1a0fb04b70..00000000000 --- a/extensions/theme-defaults/fileicons/images/RootFolderOpen_16x_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/extensions/theme-defaults/fileicons/images/RootFolder_16x.svg b/extensions/theme-defaults/fileicons/images/RootFolder_16x.svg deleted file mode 100755 index 9a049f6237a..00000000000 --- a/extensions/theme-defaults/fileicons/images/RootFolder_16x.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/extensions/theme-defaults/fileicons/images/RootFolder_16x_inverse.svg b/extensions/theme-defaults/fileicons/images/RootFolder_16x_inverse.svg deleted file mode 100755 index 03721272942..00000000000 --- a/extensions/theme-defaults/fileicons/images/RootFolder_16x_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/extensions/theme-defaults/fileicons/images/document-dark.svg b/extensions/theme-defaults/fileicons/images/document-dark.svg new file mode 100644 index 00000000000..5ed5762a1f0 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/document-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/theme-defaults/fileicons/images/document-light.svg b/extensions/theme-defaults/fileicons/images/document-light.svg new file mode 100644 index 00000000000..ad54e13b1b1 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/document-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/theme-defaults/fileicons/images/folder-dark.svg b/extensions/theme-defaults/fileicons/images/folder-dark.svg new file mode 100644 index 00000000000..43d454e7e5a --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/folder-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/theme-defaults/fileicons/images/folder-light.svg b/extensions/theme-defaults/fileicons/images/folder-light.svg new file mode 100644 index 00000000000..8daecdac6a3 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/folder-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/theme-defaults/fileicons/images/folder-open-dark.svg b/extensions/theme-defaults/fileicons/images/folder-open-dark.svg new file mode 100644 index 00000000000..6bc1c584e48 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/folder-open-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/extensions/theme-defaults/fileicons/images/folder-open-light.svg b/extensions/theme-defaults/fileicons/images/folder-open-light.svg new file mode 100644 index 00000000000..0a50339b6c8 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/folder-open-light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/extensions/theme-defaults/fileicons/images/root-folder-dark.svg b/extensions/theme-defaults/fileicons/images/root-folder-dark.svg new file mode 100644 index 00000000000..cdb770c86a8 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/root-folder-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/extensions/theme-defaults/fileicons/images/root-folder-light.svg b/extensions/theme-defaults/fileicons/images/root-folder-light.svg new file mode 100644 index 00000000000..82a0294696f --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/root-folder-light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/extensions/theme-defaults/fileicons/images/root-folder-open-dark.svg b/extensions/theme-defaults/fileicons/images/root-folder-open-dark.svg new file mode 100644 index 00000000000..472def3daa1 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/root-folder-open-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/extensions/theme-defaults/fileicons/images/root-folder-open-light.svg b/extensions/theme-defaults/fileicons/images/root-folder-open-light.svg new file mode 100644 index 00000000000..d2363bfae35 --- /dev/null +++ b/extensions/theme-defaults/fileicons/images/root-folder-open-light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json b/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json index 9c9f60b6efc..7a178065380 100644 --- a/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json +++ b/extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json @@ -1,34 +1,34 @@ { "iconDefinitions": { "_root_folder_dark": { - "iconPath": "./images/RootFolder_16x_inverse.svg" + "iconPath": "./images/root-folder-dark.svg" }, "_root_folder_open_dark": { - "iconPath": "./images/RootFolderOpen_16x_inverse.svg" + "iconPath": "./images/root-folder-open-dark.svg" }, "_folder_dark": { - "iconPath": "./images/Folder_16x_inverse.svg" + "iconPath": "./images/folder-dark.svg" }, "_folder_open_dark": { - "iconPath": "./images/FolderOpen_16x_inverse.svg" + "iconPath": "./images/folder-open-dark.svg" }, "_file_dark": { - "iconPath": "./images/Document_16x_inverse.svg" + "iconPath": "./images/document-dark.svg" }, "_root_folder": { - "iconPath": "./images/RootFolder_16x.svg" + "iconPath": "./images/root-folder-light.svg" }, "_root_folder_open": { - "iconPath": "./images/RootFolderOpen_16x.svg" + "iconPath": "./images/root-folder-open-light.svg" }, "_folder_light": { - "iconPath": "./images/Folder_16x.svg" + "iconPath": "./images/folder-light.svg" }, "_folder_open_light": { - "iconPath": "./images/FolderOpen_16x.svg" + "iconPath": "./images/folder-open-light.svg" }, "_file_light": { - "iconPath": "./images/Document_16x.svg" + "iconPath": "./images/document-light.svg" } }, From c952a8876d6010a85ba66dc46864405d8ae441c3 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 15 Jul 2019 21:57:36 +0000 Subject: [PATCH 038/190] fixes #68663 --- src/vs/workbench/browser/layout.ts | 8 ++++++++ src/vs/workbench/browser/parts/panel/panelPart.ts | 9 ++++++++- src/vs/workbench/browser/parts/sidebar/sidebarPart.ts | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index b478adbb976..88e9676f1e7 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -712,6 +712,14 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.workbenchGrid = new Grid(this.editorPartView, { proportionalLayout: false }); this.container.prepend(this.workbenchGrid.element); + + this._register((this.sideBarPartView as SidebarPart).onDidVisibilityChange((visible) => { + this.setSideBarHidden(!visible, true); + })); + + this._register((this.panelPartView as PanelPart).onDidVisibilityChange((visible) => { + this.setPanelHidden(!visible, true); + })); } else { this.workbenchGrid = instantiationService.createInstance( WorkbenchLegacyLayout, diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 6d67a653be8..88eb05032e8 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/panelpart'; import { IAction } from 'vs/base/common/actions'; -import { Event } from 'vs/base/common/event'; +import { Event, Emitter } from 'vs/base/common/event'; import { Registry } from 'vs/platform/registry/common/platform'; import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { IPanel, ActivePanelContext, PanelFocusContext } from 'vs/workbench/common/panel'; @@ -64,6 +64,9 @@ export class PanelPart extends CompositePart implements IPanelService { get onDidPanelOpen(): Event<{ panel: IPanel, focus: boolean }> { return Event.map(this.onDidCompositeOpen.event, compositeOpen => ({ panel: compositeOpen.composite, focus: compositeOpen.focus })); } get onDidPanelClose(): Event { return this.onDidCompositeClose.event; } + private _onDidVisibilityChange = this._register(new Emitter()); + get onDidVisibilityChange(): Event { return this._onDidVisibilityChange.event; } + private activePanelContextKey: IContextKey; private panelFocusContextKey: IContextKey; @@ -433,6 +436,10 @@ export class PanelPart extends CompositePart implements IPanelService { this.storageService.store(PanelPart.PINNED_PANELS, value, StorageScope.GLOBAL); } + setVisible(visible: boolean): void { + this._onDidVisibilityChange.fire(visible); + } + toJSON(): object { return { type: Parts.PANEL_PART diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index 65f81f7be9b..942257ef3e9 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -51,6 +51,9 @@ export class SidebarPart extends CompositePart implements IViewletServi get onDidViewletRegister(): Event { return >this.viewletRegistry.onDidRegister; } + private _onDidVisibilityChange = this._register(new Emitter()); + get onDidVisibilityChange(): Event { return this._onDidVisibilityChange.event; } + private _onDidViewletDeregister = this._register(new Emitter()); get onDidViewletDeregister(): Event { return this._onDidViewletDeregister.event; } @@ -253,6 +256,10 @@ export class SidebarPart extends CompositePart implements IViewletServi } } + setVisible(visible: boolean): void { + this._onDidVisibilityChange.fire(visible); + } + toJSON(): object { return { type: Parts.SIDEBAR_PART From facc5e44517152ca3f0611ba25c065e671259ad0 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 13:53:56 -0700 Subject: [PATCH 039/190] Documentation --- src/vs/vscode.proposed.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 1c9fb3974c8..46b57f913c2 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1292,11 +1292,25 @@ declare module 'vscode' { export interface Webview { /** * Convert a uri for the local file system to one that can be used inside webviews. + * + * Webviews cannot directly load resoruces from the workspace or local file system using `file:` uris. The + * `toWebviewResource` function takes a local `file:` uri and converts it into a uri that can be used inside of + * a webview to load the same resource: + * + * ```ts + * webview.html = `` + * ``` */ toWebviewResource(localResource: Uri): Uri; /** - * Content security policy rule for webview resources. + * Content security policy source for webview resources. + * + * This is origin used in a content security policy rule: + * + * ``` + * img-src https: ${webview.cspSource} ...; + * ```` */ readonly cspSource: string; } From e93afe173796c78df0532532e2a5091e1dab6bcf Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 14:46:16 -0700 Subject: [PATCH 040/190] Use _register from base class --- .../suggestEnabledInput.ts | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts index b949e001a30..5fac853caaa 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts @@ -9,7 +9,7 @@ import { Widget } from 'vs/base/browser/ui/widget'; import { Color } from 'vs/base/common/color'; import { Emitter, Event } from 'vs/base/common/event'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable } from 'vs/base/common/lifecycle'; import { mixin } from 'vs/base/common/objects'; import { isMacintosh } from 'vs/base/common/platform'; import { URI as uri } from 'vs/base/common/uri'; @@ -103,7 +103,6 @@ export class SuggestEnabledInput extends Widget implements IThemable { private _onInputDidChange = new Emitter(); readonly onInputDidChange: Event = this._onInputDidChange.event; - private disposables: IDisposable[] = []; private readonly inputWidget: CodeEditorWidget; private readonly inputModel: ITextModel; private stylingContainer: HTMLDivElement; @@ -134,31 +133,31 @@ export class SuggestEnabledInput extends Widget implements IThemable { contributions: [SuggestController, SnippetController2, ContextMenuController, MenuPreventer, SelectionClipboard], isSimpleWidget: true, }); - this.disposables.push(this.inputWidget); + this._register(this.inputWidget); let scopeHandle = uri.parse(resourceHandle); this.inputModel = modelService.createModel('', null, scopeHandle, true); this.inputWidget.setModel(this.inputModel); - this.disposables.push(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses + this._register(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses - this.disposables.push((this.inputWidget.onDidFocusEditorText(() => { + this._register((this.inputWidget.onDidFocusEditorText(() => { if (options.focusContextKey) { options.focusContextKey.set(true); } addClass(this.stylingContainer, 'synthetic-focus'); }))); - this.disposables.push((this.inputWidget.onDidBlurEditorText(() => { + this._register((this.inputWidget.onDidBlurEditorText(() => { if (options.focusContextKey) { options.focusContextKey.set(false); } removeClass(this.stylingContainer, 'synthetic-focus'); }))); const onKeyDownMonaco = Event.chain(this.inputWidget.onKeyDown); - onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this, this.disposables); - onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this, this.disposables); + this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this)); + this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this)); let preexistingContent = this.getValue(); const inputWidgetModel = this.inputWidget.getModel(); if (inputWidgetModel) { - this.disposables.push(inputWidgetModel.onDidChangeContent(() => { + this._register(inputWidgetModel.onDidChangeContent(() => { let content = this.getValue(); this.placeholderText.style.visibility = content ? 'hidden' : 'visible'; if (preexistingContent.trim() === content.trim()) { return; } @@ -175,7 +174,7 @@ export class SuggestEnabledInput extends Widget implements IThemable { this.setValue(options.value || ''); - this.disposables.push(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, { + this._register(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, { triggerCharacters: validatedSuggestProvider.triggerCharacters, provideCompletionItems: (model: ITextModel, position: Position, _context: modes.CompletionContext) => { let query = model.getValue(); @@ -249,11 +248,6 @@ export class SuggestEnabledInput extends Widget implements IThemable { private selectAll(): void { this.inputWidget.setSelection(new Range(1, 1, 1, this.getValue().length + 1)); } - - dispose(): void { - this.disposables = dispose(this.disposables); - super.dispose(); - } } // Override styles in selections.ts From 4eb2bf393b7ce9223467063c59c8f867491120c8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 14:55:09 -0700 Subject: [PATCH 041/190] Use DisposableStore --- src/vs/base/browser/ui/sash/sash.ts | 4 ++-- src/vs/workbench/api/node/extHostTask.ts | 12 ++++++------ .../browser/views/explorerDecorationsProvider.ts | 14 +++++++------- .../contrib/scm/browser/dirtydiffDecorator.ts | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 70ddb045301..874bc9482e1 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -260,7 +260,7 @@ export class Sash extends Disposable { style.innerHTML = `* { cursor: ${cursor} !important; }`; }; - const disposables: IDisposable[] = []; + const disposables = new DisposableStore(); updateStyle(); @@ -284,7 +284,7 @@ export class Sash extends Disposable { removeClass(this.el, 'active'); this._onDidEnd.fire(); - dispose(disposables); + disposables.dispose(); for (const iframe of iframes) { iframe.style.pointerEvents = 'auto'; diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index a682a2a4575..4d97792f198 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -31,7 +31,7 @@ import { ExtHostConfiguration } from 'vs/workbench/api/common/extHostConfigurati import { ExtHostTerminalService, ExtHostTerminal } from 'vs/workbench/api/node/extHostTerminalService'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; namespace TaskDefinitionDTO { @@ -377,7 +377,7 @@ class CustomExecutionData implements IDisposable { private static waitForDimensionsTimeoutInMs: number = 5000; private _cancellationSource?: CancellationTokenSource; private readonly _onTaskExecutionComplete: Emitter = new Emitter(); - private readonly _disposables: IDisposable[] = []; + private readonly _disposables = new DisposableStore(); private terminal?: vscode.Terminal; private terminalId?: number; public result: number | undefined; @@ -389,7 +389,7 @@ class CustomExecutionData implements IDisposable { public dispose(): void { this._cancellationSource = undefined; - dispose(this._disposables); + this._disposables.dispose(); } public get onTaskExecutionComplete(): Event { @@ -426,7 +426,7 @@ class CustomExecutionData implements IDisposable { const callbackTerminals: vscode.Terminal[] = this.terminalService.terminals.filter((terminal) => terminal._id === terminalId); if (!callbackTerminals || callbackTerminals.length === 0) { - this._disposables.push(this.terminalService.onDidOpenTerminal(this.onDidOpenTerminal.bind(this))); + this._disposables.add(this.terminalService.onDidOpenTerminal(this.onDidOpenTerminal.bind(this))); return; } @@ -462,9 +462,9 @@ class CustomExecutionData implements IDisposable { } this._cancellationSource = new CancellationTokenSource(); - this._disposables.push(this._cancellationSource); + this._disposables.add(this._cancellationSource); - this._disposables.push(this.terminalService.onDidCloseTerminal(this.onDidCloseTerminal.bind(this))); + this._disposables.add(this.terminalService.onDidCloseTerminal(this.onDidCloseTerminal.bind(this))); // Regardless of how the task completes, we are done with this custom execution task. this.customExecution.callback(terminalRenderer, this._cancellationSource.token).then( diff --git a/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts b/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts index eec3045543e..f1708ff4d49 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts @@ -9,23 +9,23 @@ import { localize } from 'vs/nls'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IDecorationsProvider, IDecorationData } from 'vs/workbench/services/decorations/browser/decorations'; import { listInvalidItemForeground } from 'vs/platform/theme/common/colorRegistry'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { DisposableStore } from 'vs/base/common/lifecycle'; import { IExplorerService } from 'vs/workbench/contrib/files/common/files'; export class ExplorerDecorationsProvider implements IDecorationsProvider { readonly label: string = localize('label', "Explorer"); private _onDidChange = new Emitter(); - private toDispose: IDisposable[]; + private readonly toDispose = new DisposableStore(); constructor( @IExplorerService private explorerService: IExplorerService, @IWorkspaceContextService contextService: IWorkspaceContextService ) { - this.toDispose = []; - this.toDispose.push(contextService.onDidChangeWorkspaceFolders(e => { + this.toDispose.add(this._onDidChange); + this.toDispose.add(contextService.onDidChangeWorkspaceFolders(e => { this._onDidChange.fire(e.changed.concat(e.added).map(wf => wf.uri)); })); - this.toDispose.push(explorerService.onDidChangeItem(change => { + this.toDispose.add(explorerService.onDidChangeItem(change => { if (change.item) { this._onDidChange.fire([change.item.resource]); } @@ -55,7 +55,7 @@ export class ExplorerDecorationsProvider implements IDecorationsProvider { return undefined; } - dispose(): IDisposable[] { - return dispose(this.toDispose); + dispose(): void { + this.toDispose.dispose(); } } diff --git a/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts b/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts index 6f90e69127a..97539eb481f 100644 --- a/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts @@ -1158,7 +1158,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor private enabled = false; private models: ITextModel[] = []; private items: { [modelId: string]: DirtyDiffItem; } = Object.create(null); - private transientDisposables: IDisposable[] = []; + private readonly transientDisposables = this._register(new DisposableStore()); private stylesheet: HTMLStyleElement; constructor( @@ -1204,7 +1204,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor this.disable(); } - this.transientDisposables.push(this.editorService.onDidVisibleEditorsChange(() => this.onEditorsChanged())); + this.transientDisposables.add(this.editorService.onDidVisibleEditorsChange(() => this.onEditorsChanged())); this.onEditorsChanged(); this.enabled = true; } @@ -1214,7 +1214,7 @@ export class DirtyDiffWorkbenchController extends Disposable implements ext.IWor return; } - this.transientDisposables = dispose(this.transientDisposables); + this.transientDisposables.clear(); this.models.forEach(m => this.items[m.id].dispose()); this.models = []; this.items = Object.create(null); From 47e54aef5de9ccbf75ae0a03fee11eaa9ef7989e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 14:57:49 -0700 Subject: [PATCH 042/190] Return undefined instead of null --- src/vs/workbench/browser/editor.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index a7f3c099ea2..5a7209fb226 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -34,14 +34,14 @@ export interface IEditorRegistry { registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; /** - * Returns the editor descriptor for the given input or null if none. + * Returns the editor descriptor for the given input or `undefined` if none. */ - getEditor(input: EditorInput): IEditorDescriptor | null; + getEditor(input: EditorInput): IEditorDescriptor | undefined; /** * Returns the editor descriptor for the given identifier or null if none. */ - getEditorById(editorId: string): IEditorDescriptor | null; + getEditorById(editorId: string): IEditorDescriptor | undefined; /** * Returns an array of registered editors known to the platform. @@ -104,12 +104,12 @@ class EditorRegistry implements IEditorRegistry { this.editors.push(descriptor); } - getEditor(input: EditorInput): EditorDescriptor | null { + getEditor(input: EditorInput): EditorDescriptor | undefined { const findEditorDescriptors = (input: EditorInput, byInstanceOf?: boolean): EditorDescriptor[] => { const matchingDescriptors: EditorDescriptor[] = []; for (const editor of this.editors) { - const inputDescriptors: SyncDescriptor[] | undefined = this.mapEditorToInputs.get(editor); + const inputDescriptors = this.mapEditorToInputs.get(editor); if (inputDescriptors) { for (const inputDescriptor of inputDescriptors) { const inputClass = inputDescriptor.ctor; @@ -154,17 +154,17 @@ class EditorRegistry implements IEditorRegistry { return descriptors[0]; } - return null; + return undefined; } - getEditorById(editorId: string): EditorDescriptor | null { + getEditorById(editorId: string): EditorDescriptor | undefined { for (const editor of this.editors) { if (editor.getId() === editorId) { return editor; } } - return null; + return undefined; } getEditors(): EditorDescriptor[] { From e5e29375f036bc189409d5af1523d20ae1f434a7 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 14:59:43 -0700 Subject: [PATCH 043/190] Remove extra conditional --- src/vs/workbench/browser/editor.ts | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index 5a7209fb226..0fd80573223 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -109,22 +109,20 @@ class EditorRegistry implements IEditorRegistry { const matchingDescriptors: EditorDescriptor[] = []; for (const editor of this.editors) { - const inputDescriptors = this.mapEditorToInputs.get(editor); - if (inputDescriptors) { - for (const inputDescriptor of inputDescriptors) { - const inputClass = inputDescriptor.ctor; + const inputDescriptors = this.mapEditorToInputs.get(editor) || []; + for (const inputDescriptor of inputDescriptors) { + const inputClass = inputDescriptor.ctor; - // Direct check on constructor type (ignores prototype chain) - if (!byInstanceOf && input.constructor === inputClass) { - matchingDescriptors.push(editor); - break; - } + // Direct check on constructor type (ignores prototype chain) + if (!byInstanceOf && input.constructor === inputClass) { + matchingDescriptors.push(editor); + break; + } - // Normal instanceof check - else if (byInstanceOf && input instanceof inputClass) { - matchingDescriptors.push(editor); - break; - } + // Normal instanceof check + else if (byInstanceOf && input instanceof inputClass) { + matchingDescriptors.push(editor); + break; } } } From 711eca07d1379364f0a580a1ceea4baf0716f3e5 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:02:23 -0700 Subject: [PATCH 044/190] Remove extra checks that are not needed --- src/vs/workbench/browser/editor.ts | 2 +- src/vs/workbench/common/editor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index 0fd80573223..f2c559ee20c 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -140,7 +140,7 @@ class EditorRegistry implements IEditorRegistry { }; const descriptors = findEditorDescriptors(input); - if (descriptors && descriptors.length > 0) { + if (descriptors.length > 0) { // Ask the input for its preferred Editor const preferredEditorId = input.getPreferredEditorId(descriptors.map(d => d.getId())); diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 93dacfeacde..48aa2c77ac4 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -381,7 +381,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput { * for the input. This allows subclasses to decide late which editor to use for the input on a case by case basis. */ getPreferredEditorId(candidates: string[]): string | null { - if (candidates && candidates.length > 0) { + if (candidates.length > 0) { return candidates[0]; } From 2b07856867eb8614d5bfa9d87cf45f3d0ff883e4 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:03:33 -0700 Subject: [PATCH 045/190] getPreferredEditorId return undefined instead of null --- src/vs/workbench/common/editor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 48aa2c77ac4..22088d08cb8 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -380,12 +380,12 @@ export abstract class EditorInput extends Disposable implements IEditorInput { * Returns the preferred editor for this input. A list of candidate editors is passed in that whee registered * for the input. This allows subclasses to decide late which editor to use for the input on a case by case basis. */ - getPreferredEditorId(candidates: string[]): string | null { + getPreferredEditorId(candidates: string[]): string | undefined { if (candidates.length > 0) { return candidates[0]; } - return null; + return undefined; } /** From 8b451a25ef9bb95821f91b0ef636a2d1ea564408 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:15:20 -0700 Subject: [PATCH 046/190] getDescription(), return undefined instead of null --- src/vs/workbench/browser/labels.ts | 2 +- .../browser/parts/editor/editor.contribution.ts | 3 ++- src/vs/workbench/browser/parts/editor/editorPicker.ts | 2 +- .../workbench/browser/parts/editor/tabsTitleControl.ts | 4 ++-- .../browser/parts/quickopen/quickOpenController.ts | 2 +- src/vs/workbench/common/editor.ts | 10 +++++----- src/vs/workbench/common/editor/dataUriEditorInput.ts | 4 ++-- src/vs/workbench/common/editor/diffEditorInput.ts | 2 +- src/vs/workbench/common/editor/resourceEditorInput.ts | 4 ++-- src/vs/workbench/common/editor/untitledEditorInput.ts | 4 ++-- .../performance/electron-browser/perfviewEditor.ts | 2 +- .../contrib/webview/browser/webviewEditorInput.ts | 2 +- .../workbench/services/editor/browser/editorService.ts | 4 ++-- 13 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 8742e98d27e..4c0ccf3809e 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -366,7 +366,7 @@ class ResourceLabelWidget extends IconLabel { this.setResource({ resource: toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }), name: withNullAsUndefined(editor.getName()), - description: withNullAsUndefined(editor.getDescription(options ? options.descriptionVerbosity : undefined)) + description: editor.getDescription(options ? options.descriptionVerbosity : undefined) }, options); } diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index c10e7979ba0..53629222ca3 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -51,6 +51,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { toLocalResource } from 'vs/base/common/resources'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { withNullAsUndefined } from 'vs/base/common/types'; // Register String Editor Registry.as(EditorExtensions.Editors).registerEditor( @@ -205,7 +206,7 @@ class SideBySideEditorInputFactory implements IEditorInputFactory { const masterInput = masterInputFactory.deserialize(instantiationService, deserialized.masterSerialized); if (detailsInput && masterInput) { - return new SideBySideEditorInput(deserialized.name, deserialized.description, detailsInput, masterInput); + return new SideBySideEditorInput(deserialized.name, withNullAsUndefined(deserialized.description), detailsInput, masterInput); } } diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index 6b30c32d092..a3d495473f5 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -59,7 +59,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { } getDescription() { - return withNullAsUndefined(this.editor.getDescription()); + return this.editor.getDescription(); } run(mode: Mode, context: IEntryRunContext): boolean { diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 00f4b30dc1e..6a8daa4b094 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -725,7 +725,7 @@ export class TabsTitleControl extends TitleControl { const labels = this.group.editors.map(editor => ({ editor, name: editor.getName()!, - description: withNullAsUndefined(editor.getDescription(verbosity)), + description: editor.getDescription(verbosity), title: withNullAsUndefined(editor.getTitle(Verbosity.LONG)) })); @@ -778,7 +778,7 @@ export class TabsTitleControl extends TitleControl { if (useLongDescriptions) { mapDescriptionToDuplicates.clear(); duplicateTitles.forEach(label => { - label.description = withNullAsUndefined(label.editor.getDescription(Verbosity.LONG)); + label.description = label.editor.getDescription(Verbosity.LONG); getOrSet(mapDescriptionToDuplicates, label.description, []).push(label); }); } diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index 5851bdb62ce..5cfc04c3743 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -745,7 +745,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { if (input instanceof EditorInput) { this.resource = resourceForEditorHistory(input, fileService); this.label = types.withNullAsUndefined(input.getName()); - this.description = types.withNullAsUndefined(input.getDescription()); + this.description = input.getDescription(); this.dirty = input.isDirty(); } else { const resourceInput = input as IResourceInput; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 22088d08cb8..dca1d783821 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -295,7 +295,7 @@ export interface IEditorInput extends IDisposable { /** * Returns the display description of this input. */ - getDescription(verbosity?: Verbosity): string | null; + getDescription(verbosity?: Verbosity): string | undefined; /** * Returns the display title of this input. @@ -364,8 +364,8 @@ export abstract class EditorInput extends Disposable implements IEditorInput { * Returns the description of this input that can be shown to the user. Examples include showing the description of * the input above the editor area to the side of the name of the input. */ - getDescription(verbosity?: Verbosity): string | null { - return null; + getDescription(verbosity?: Verbosity): string | undefined { + return undefined; } /** @@ -552,7 +552,7 @@ export class SideBySideEditorInput extends EditorInput { constructor( private readonly name: string, - private readonly description: string | null, + private readonly description: string | undefined, private readonly _details: EditorInput, private readonly _master: EditorInput ) { @@ -625,7 +625,7 @@ export class SideBySideEditorInput extends EditorInput { return this.name; } - getDescription(): string | null { + getDescription(): string | undefined { return this.description; } diff --git a/src/vs/workbench/common/editor/dataUriEditorInput.ts b/src/vs/workbench/common/editor/dataUriEditorInput.ts index 7c82702e21c..f75c3d04103 100644 --- a/src/vs/workbench/common/editor/dataUriEditorInput.ts +++ b/src/vs/workbench/common/editor/dataUriEditorInput.ts @@ -55,8 +55,8 @@ export class DataUriEditorInput extends EditorInput { return withUndefinedAsNull(this.name); } - getDescription(): string | null { - return withUndefinedAsNull(this.description); + getDescription(): string | undefined { + return this.description; } resolve(): Promise { diff --git a/src/vs/workbench/common/editor/diffEditorInput.ts b/src/vs/workbench/common/editor/diffEditorInput.ts index bd4aea9a15b..477d54e754c 100644 --- a/src/vs/workbench/common/editor/diffEditorInput.ts +++ b/src/vs/workbench/common/editor/diffEditorInput.ts @@ -18,7 +18,7 @@ export class DiffEditorInput extends SideBySideEditorInput { private cachedModel: DiffEditorModel | null; - constructor(name: string, description: string | null, original: EditorInput, modified: EditorInput, private readonly forceOpenAsBinary?: boolean) { + constructor(name: string, description: string | undefined, original: EditorInput, modified: EditorInput, private readonly forceOpenAsBinary?: boolean) { super(name, description, original, modified); } diff --git a/src/vs/workbench/common/editor/resourceEditorInput.ts b/src/vs/workbench/common/editor/resourceEditorInput.ts index 6d652b4e8ca..8ea157dffc2 100644 --- a/src/vs/workbench/common/editor/resourceEditorInput.ts +++ b/src/vs/workbench/common/editor/resourceEditorInput.ts @@ -22,7 +22,7 @@ export class ResourceEditorInput extends EditorInput implements IModeSupport { constructor( private name: string, - private description: string | null, + private description: string | undefined, private readonly resource: URI, private preferredMode: string | undefined, @ITextModelService private readonly textModelResolverService: ITextModelService @@ -53,7 +53,7 @@ export class ResourceEditorInput extends EditorInput implements IModeSupport { } } - getDescription(): string | null { + getDescription(): string | undefined { return this.description; } diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 16f96244129..2d89afb0bb0 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -77,9 +77,9 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport return this.labelService.getUriLabel(dirname(this.resource)); } - getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string | null { + getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string | undefined { if (!this.hasAssociatedFilePath) { - return null; + return undefined; } switch (verbosity) { diff --git a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts index d1c09cbce4f..052e4bd2f5c 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts @@ -49,7 +49,7 @@ export class PerfviewInput extends ResourceEditorInput { ) { super( localize('name', "Startup Performance"), - null, + undefined, PerfviewInput.Uri, undefined, textModelResolverService diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index e882669a573..d6133b09e04 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -130,7 +130,7 @@ export class WebviewEditorInput extends EditorInput { } public getDescription() { - return null; + return undefined; } public setName(value: string): void { diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 3211d6adeb4..791daaa36fa 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -27,7 +27,7 @@ import { isCodeEditor, isDiffEditor, ICodeEditor, IDiffEditor } from 'vs/editor/ import { IEditorGroupView, IEditorOpeningEvent, EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor'; import { ILabelService } from 'vs/platform/label/common/label'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; +import { withNullAsUndefined } from 'vs/base/common/types'; type ICachedEditorInput = ResourceEditorInput | IFileEditorInput | DataUriEditorInput; @@ -524,7 +524,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { const rightInput = this.createInput({ resource: resourceDiffInput.rightResource, forceFile: resourceDiffInput.forceFile }); const label = resourceDiffInput.label || localize('compareLabels', "{0} ↔ {1}", this.toDiffLabel(leftInput), this.toDiffLabel(rightInput)); - return new DiffEditorInput(label, withUndefinedAsNull(resourceDiffInput.description), leftInput, rightInput); + return new DiffEditorInput(label, resourceDiffInput.description, leftInput, rightInput); } // Untitled file support From f66743a804cb40f97ef14833dcb47816c17c91ec Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:19:02 -0700 Subject: [PATCH 047/190] Use asArray --- src/vs/workbench/browser/editor.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index f2c559ee20c..fb795a9d842 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -8,7 +8,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { Registry } from 'vs/platform/registry/common/platform'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IConstructorSignature0, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { isArray } from 'vs/base/common/types'; +import { asArray } from 'vs/base/common/arrays'; export interface IEditorDescriptor { instantiate(instantiationService: IInstantiationService): BaseEditor; @@ -90,13 +90,7 @@ class EditorRegistry implements IEditorRegistry { registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor | SyncDescriptor[]): void { - // Support both non-array and array parameter - let inputDescriptors: SyncDescriptor[] = []; - if (!isArray(editorInputDescriptor)) { - inputDescriptors.push(editorInputDescriptor); - } else { - inputDescriptors = editorInputDescriptor; - } + const inputDescriptors: SyncDescriptor[] = asArray(editorInputDescriptor); // Register (Support multiple Editors per Input) this.mapEditorToInputs.set(descriptor, inputDescriptors); From 23b74291af64f43d30120b0cc1f0c606809649fb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:23:45 -0700 Subject: [PATCH 048/190] Marking fields readonly --- src/vs/workbench/browser/editor.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index fb795a9d842..1f31ed7eafd 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -46,7 +46,7 @@ export interface IEditorRegistry { /** * Returns an array of registered editors known to the platform. */ - getEditors(): IEditorDescriptor[]; + getEditors(): readonly IEditorDescriptor[]; } /** @@ -54,15 +54,12 @@ export interface IEditorRegistry { * can load lazily in the workbench. */ export class EditorDescriptor implements IEditorDescriptor { - private ctor: IConstructorSignature0; - private id: string; - private name: string; - constructor(ctor: IConstructorSignature0, id: string, name: string) { - this.ctor = ctor; - this.id = id; - this.name = name; - } + constructor( + private readonly ctor: IConstructorSignature0, + private readonly id: string, + private readonly name: string + ) { } instantiate(instantiationService: IInstantiationService): BaseEditor { return instantiationService.createInstance(this.ctor); @@ -84,7 +81,7 @@ export class EditorDescriptor implements IEditorDescriptor { class EditorRegistry implements IEditorRegistry { private editors: EditorDescriptor[] = []; - private readonly mapEditorToInputs = new Map[]>(); + private readonly mapEditorToInputs = new Map[]>(); registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor): void; registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; @@ -159,7 +156,7 @@ class EditorRegistry implements IEditorRegistry { return undefined; } - getEditors(): EditorDescriptor[] { + getEditors(): readonly EditorDescriptor[] { return this.editors.slice(0); } @@ -170,7 +167,7 @@ class EditorRegistry implements IEditorRegistry { getEditorInputs(): SyncDescriptor[] { const inputClasses: SyncDescriptor[] = []; for (const editor of this.editors) { - const editorInputDescriptors: SyncDescriptor[] | undefined = this.mapEditorToInputs.get(editor); + const editorInputDescriptors = this.mapEditorToInputs.get(editor); if (editorInputDescriptors) { inputClasses.push(...editorInputDescriptors.map(descriptor => descriptor.ctor)); } From be5a4fa940121461aa023e7605557dc3b64125d9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:42:48 -0700 Subject: [PATCH 049/190] :lipstick: --- src/vs/workbench/api/browser/mainThreadEditors.ts | 4 ++-- .../browser/parts/editor/editorGroupView.ts | 14 +++++++------- .../services/editor/browser/editorService.ts | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index c63aa1bb7a6..fc4d7286c14 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -15,7 +15,7 @@ import { ISelection } from 'vs/editor/common/core/selection'; import { IDecorationOptions, IDecorationRenderOptions, ILineChange } from 'vs/editor/common/editorCommon'; import { ISingleEditOperation } from 'vs/editor/common/model'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor'; +import { IEditorOptions, ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { MainThreadDocumentsAndEditors } from 'vs/workbench/api/browser/mainThreadDocumentsAndEditors'; @@ -121,7 +121,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { selection: options.selection }; - const input = { + const input: IResourceInput = { resource: uri, options: editorOptions }; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 1f25c41cb90..c38cf579a7a 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -44,7 +44,7 @@ import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/m import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { isErrorWithActions, IErrorWithActions } from 'vs/base/common/errorsWithActions'; import { IVisibleEditor } from 'vs/workbench/services/editor/common/editorService'; -import { withNullAsUndefined } from 'vs/base/common/types'; +import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; import { hash } from 'vs/base/common/hash'; import { guessMimeTypes } from 'vs/base/common/mime'; import { extname } from 'vs/base/common/resources'; @@ -789,10 +789,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } // Proceed with opening - return this.doOpenEditor(editor, options); + return this.doOpenEditor(editor, options).then(withUndefinedAsNull); } - private doOpenEditor(editor: EditorInput, options?: EditorOptions): Promise { + private doOpenEditor(editor: EditorInput, options?: EditorOptions): Promise { // Determine options const openEditorOptions: IEditorOpenOptions = { @@ -833,10 +833,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView { return this.doShowEditor(editor, !!openEditorOptions.active, options); } - private async doShowEditor(editor: EditorInput, active: boolean, options?: EditorOptions): Promise { + private async doShowEditor(editor: EditorInput, active: boolean, options?: EditorOptions): Promise { // Show in editor control if the active editor changed - let openEditorPromise: Promise; + let openEditorPromise: Promise; if (active) { openEditorPromise = (async () => { try { @@ -853,11 +853,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Handle errors but do not bubble them up this.doHandleOpenEditorError(error, editor, options); - return null; // error: return NULL as result to signal this + return undefined; // error: return undefined as result to signal this } })(); } else { - openEditorPromise = Promise.resolve(null); // inactive: return NULL as result to signal this + openEditorPromise = Promise.resolve(undefined); // inactive: return undefined as result to signal this } // Show in title control after editor control because some actions depend on it diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 791daaa36fa..039e5b9624c 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -503,7 +503,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { } // Side by Side Support - const resourceSideBySideInput = input; + const resourceSideBySideInput = input as IResourceSideBySideInput; if (resourceSideBySideInput.masterResource && resourceSideBySideInput.detailResource) { const masterInput = this.createInput({ resource: resourceSideBySideInput.masterResource, forceFile: resourceSideBySideInput.forceFile }); const detailInput = this.createInput({ resource: resourceSideBySideInput.detailResource, forceFile: resourceSideBySideInput.forceFile }); @@ -518,7 +518,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { } // Diff Editor Support - const resourceDiffInput = input; + const resourceDiffInput = input as IResourceDiffInput; if (resourceDiffInput.leftResource && resourceDiffInput.rightResource) { const leftInput = this.createInput({ resource: resourceDiffInput.leftResource, forceFile: resourceDiffInput.forceFile }); const rightInput = this.createInput({ resource: resourceDiffInput.rightResource, forceFile: resourceDiffInput.forceFile }); @@ -528,13 +528,13 @@ export class EditorService extends Disposable implements EditorServiceImpl { } // Untitled file support - const untitledInput = input; + const untitledInput = input as IUntitledResourceInput; if (untitledInput.forceUntitled || !untitledInput.resource || (untitledInput.resource && untitledInput.resource.scheme === Schemas.untitled)) { return this.untitledEditorService.createOrGet(untitledInput.resource, untitledInput.mode, untitledInput.contents, untitledInput.encoding); } // Resource Editor Support - const resourceInput = input; + const resourceInput = input as IResourceInput; if (resourceInput.resource instanceof URI) { let label = resourceInput.label; if (!label && resourceInput.resource.scheme !== Schemas.data) { From 20d2018d1832574f173458f1d754fbacb070771f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 15:44:16 -0700 Subject: [PATCH 050/190] Convert to async --- .../api/browser/mainThreadEditors.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index fc4d7286c14..8601055aeeb 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -112,7 +112,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { // --- from extension host process - $tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise { + async $tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise { const uri = URI.revive(resource); const editorOptions: ITextEditorOptions = { @@ -126,37 +126,35 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { options: editorOptions }; - return this._editorService.openEditor(input, viewColumnToEditorGroup(this._editorGroupService, options.position)).then(editor => { - if (!editor) { - return undefined; - } - return this._documentsAndEditors.findTextEditorIdFor(editor); - }); + const editor = await this._editorService.openEditor(input, viewColumnToEditorGroup(this._editorGroupService, options.position)); + if (!editor) { + return undefined; + } + return this._documentsAndEditors.findTextEditorIdFor(editor); } - $tryShowEditor(id: string, position?: EditorViewColumn): Promise { + async $tryShowEditor(id: string, position?: EditorViewColumn): Promise { const mainThreadEditor = this._documentsAndEditors.getEditor(id); if (mainThreadEditor) { const model = mainThreadEditor.getModel(); - return this._editorService.openEditor({ + await this._editorService.openEditor({ resource: model.uri, options: { preserveFocus: false } - }, viewColumnToEditorGroup(this._editorGroupService, position)).then(() => { return; }); + }, viewColumnToEditorGroup(this._editorGroupService, position)); + return; } - return Promise.resolve(); } - $tryHideEditor(id: string): Promise { + async $tryHideEditor(id: string): Promise { const mainThreadEditor = this._documentsAndEditors.getEditor(id); if (mainThreadEditor) { const editors = this._editorService.visibleControls; for (let editor of editors) { if (mainThreadEditor.matches(editor)) { - return editor.group.closeEditor(editor.input).then(() => { return; }); + return editor.group.closeEditor(editor.input); } } } - return Promise.resolve(); } $trySetSelections(id: string, selections: ISelection[]): Promise { From 7411e3f3412b04616c987e110aba2320bd9bd0a0 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 16:12:25 -0700 Subject: [PATCH 051/190] Convert many simple getters for events into readonly properties We seem to use the readonly property way of exposing these values more widely. Standardizing this a bit across the codebase --- src/vs/base/browser/ui/actionbar/actionbar.ts | 8 ++++---- src/vs/base/browser/ui/checkbox/checkbox.ts | 4 ++-- src/vs/base/browser/ui/list/listWidget.ts | 4 ++-- src/vs/base/parts/storage/common/storage.ts | 2 +- src/vs/base/parts/tree/browser/treeView.ts | 6 +++--- src/vs/editor/contrib/find/findState.ts | 5 ++--- src/vs/editor/contrib/folding/foldingModel.ts | 2 +- .../contextview/browser/contextMenuService.ts | 2 +- src/vs/platform/files/common/fileService.ts | 10 +++++----- .../files/node/diskFileSystemProvider.ts | 2 +- .../lifecycle/common/lifecycleService.ts | 6 +++--- .../notification/common/notification.ts | 2 +- .../common/remoteAgentFileSystemChannel.ts | 2 +- .../platform/storage/browser/storageService.ts | 4 ++-- src/vs/platform/storage/common/storage.ts | 2 +- src/vs/platform/storage/node/storageIpc.ts | 4 ++-- .../storage/node/storageMainService.ts | 4 ++-- src/vs/platform/storage/node/storageService.ts | 4 ++-- .../update/electron-browser/updateService.ts | 2 +- .../electron-main/abstractUpdateService.ts | 2 +- .../update/electron-main/updateService.snap.ts | 2 +- .../electron-main/workspacesMainService.ts | 2 +- .../api/browser/mainThreadComments.ts | 2 +- src/vs/workbench/api/browser/mainThreadSCM.ts | 8 ++++---- .../api/node/extHostTerminalService.ts | 6 +++--- src/vs/workbench/browser/composite.ts | 4 ++-- src/vs/workbench/browser/labels.ts | 2 +- src/vs/workbench/browser/layout.ts | 12 ++++++------ .../browser/parts/compositeBarActions.ts | 4 ++-- .../browser/parts/editor/binaryEditor.ts | 4 ++-- .../browser/parts/editor/editorControl.ts | 2 +- .../browser/parts/editor/editorGroupView.ts | 14 +++++++------- .../browser/parts/editor/editorPart.ts | 16 ++++++++-------- .../browser/parts/editor/editorWidgets.ts | 2 +- .../browser/parts/editor/rangeDecorations.ts | 2 +- .../parts/notifications/notificationsCenter.ts | 2 +- .../workbench/browser/parts/panel/panelPart.ts | 4 ++-- .../parts/quickopen/quickOpenController.ts | 4 ++-- .../browser/parts/sidebar/sidebarPart.ts | 4 ++-- .../browser/parts/titlebar/titlebarPart.ts | 2 +- .../browser/parts/views/customView.ts | 2 +- src/vs/workbench/browser/workbench.ts | 4 ++-- src/vs/workbench/common/editor.ts | 8 ++++---- src/vs/workbench/common/editor/editorGroup.ts | 18 +++++++++--------- .../common/editor/untitledEditorInput.ts | 4 ++-- .../common/editor/untitledEditorModel.ts | 6 +++--- src/vs/workbench/common/notifications.ts | 16 ++++++++-------- src/vs/workbench/common/resources.ts | 2 +- .../browser/preferencesRenderers.ts | 2 +- .../preferences/browser/preferencesWidgets.ts | 2 +- .../workbench/contrib/scm/common/scmService.ts | 12 ++++++------ .../contrib/tasks/common/problemMatcher.ts | 2 +- .../contrib/terminal/browser/terminalTab.ts | 4 ++-- .../contrib/webview/browser/webviewEditor.ts | 2 +- .../webview/electron-browser/webviewElement.ts | 2 +- .../electron-browser/contextmenuService.ts | 2 +- .../services/editor/browser/editorService.ts | 8 ++++---- .../textfile/common/textFileEditorModel.ts | 4 ++-- .../common/textFileEditorModelManager.ts | 16 ++++++++-------- .../textfile/common/textFileService.ts | 6 +++--- .../services/themes/common/colorThemeStore.ts | 6 ++---- .../untitled/common/untitledEditorService.ts | 8 ++++---- 62 files changed, 154 insertions(+), 157 deletions(-) diff --git a/src/vs/base/browser/ui/actionbar/actionbar.ts b/src/vs/base/browser/ui/actionbar/actionbar.ts index ffef9180cc6..413a256483f 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.ts +++ b/src/vs/base/browser/ui/actionbar/actionbar.ts @@ -405,16 +405,16 @@ export class ActionBar extends Disposable implements IActionRunner { protected actionsList: HTMLElement; private _onDidBlur = this._register(new Emitter()); - get onDidBlur(): Event { return this._onDidBlur.event; } + readonly onDidBlur: Event = this._onDidBlur.event; private _onDidCancel = this._register(new Emitter()); - get onDidCancel(): Event { return this._onDidCancel.event; } + readonly onDidCancel: Event = this._onDidCancel.event; private _onDidRun = this._register(new Emitter()); - get onDidRun(): Event { return this._onDidRun.event; } + readonly onDidRun: Event = this._onDidRun.event; private _onDidBeforeRun = this._register(new Emitter()); - get onDidBeforeRun(): Event { return this._onDidBeforeRun.event; } + readonly onDidBeforeRun: Event = this._onDidBeforeRun.event; constructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) { super(); diff --git a/src/vs/base/browser/ui/checkbox/checkbox.ts b/src/vs/base/browser/ui/checkbox/checkbox.ts index 21580062e5b..40dcdfbb9ab 100644 --- a/src/vs/base/browser/ui/checkbox/checkbox.ts +++ b/src/vs/base/browser/ui/checkbox/checkbox.ts @@ -72,10 +72,10 @@ export class CheckboxActionViewItem extends BaseActionViewItem { export class Checkbox extends Widget { private readonly _onChange = this._register(new Emitter()); - get onChange(): Event { return this._onChange.event; } + readonly onChange: Event = this._onChange.event; private readonly _onKeyDown = this._register(new Emitter()); - get onKeyDown(): Event { return this._onKeyDown.event; } + readonly onKeyDown: Event = this._onKeyDown.event; private readonly _opts: ICheckboxOpts; readonly domNode: HTMLElement; diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 7e4aa5fb5b4..08728828e58 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -111,7 +111,7 @@ class Trait implements ISpliceable, IDisposable { private sortedIndexes: number[] = []; private _onChange = new Emitter(); - get onChange(): Event { return this._onChange.event; } + readonly onChange: Event = this._onChange.event; get trait(): string { return this._trait; } @@ -1165,7 +1165,7 @@ export class List implements ISpliceable, IDisposable { readonly onDidBlur: Event; private _onDidDispose = new Emitter(); - get onDidDispose(): Event { return this._onDidDispose.event; } + readonly onDidDispose: Event = this._onDidDispose.event; constructor( container: HTMLElement, diff --git a/src/vs/base/parts/storage/common/storage.ts b/src/vs/base/parts/storage/common/storage.ts index 3f3892a8e19..03dedeca57f 100644 --- a/src/vs/base/parts/storage/common/storage.ts +++ b/src/vs/base/parts/storage/common/storage.ts @@ -74,7 +74,7 @@ export class Storage extends Disposable implements IStorage { private static readonly DEFAULT_FLUSH_DELAY = 100; private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); - get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } + readonly onDidChangeStorage: Event = this._onDidChangeStorage.event; private state = StorageState.None; diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index 6852c0c727e..2042f576d55 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -447,13 +447,13 @@ export class TreeView extends HeightMap { private onHiddenScrollTop: number | null = null; private readonly _onDOMFocus = new Emitter(); - get onDOMFocus(): Event { return this._onDOMFocus.event; } + readonly onDOMFocus: Event = this._onDOMFocus.event; private readonly _onDOMBlur = new Emitter(); - get onDOMBlur(): Event { return this._onDOMBlur.event; } + readonly onDOMBlur: Event = this._onDOMBlur.event; private readonly _onDidScroll = new Emitter(); - get onDidScroll(): Event { return this._onDidScroll.event; } + readonly onDidScroll: Event = this._onDidScroll.event; constructor(context: _.ITreeContext, container: HTMLElement) { super(); diff --git a/src/vs/editor/contrib/find/findState.ts b/src/vs/editor/contrib/find/findState.ts index 0af1b84cd30..96f1078f130 100644 --- a/src/vs/editor/contrib/find/findState.ts +++ b/src/vs/editor/contrib/find/findState.ts @@ -69,7 +69,7 @@ export class FindReplaceState implements IDisposable { private _matchesPosition: number; private _matchesCount: number; private _currentMatch: Range | null; - private readonly _onFindReplaceStateChange: Emitter; + private readonly _onFindReplaceStateChange = new Emitter(); public get searchString(): string { return this._searchString; } public get replaceString(): string { return this._replaceString; } @@ -87,7 +87,7 @@ export class FindReplaceState implements IDisposable { public get matchesPosition(): number { return this._matchesPosition; } public get matchesCount(): number { return this._matchesCount; } public get currentMatch(): Range | null { return this._currentMatch; } - public get onFindReplaceStateChange(): Event { return this._onFindReplaceStateChange.event; } + public readonly onFindReplaceStateChange: Event = this._onFindReplaceStateChange.event; constructor() { this._searchString = ''; @@ -104,7 +104,6 @@ export class FindReplaceState implements IDisposable { this._matchesPosition = 0; this._matchesCount = 0; this._currentMatch = null; - this._onFindReplaceStateChange = new Emitter(); } public dispose(): void { diff --git a/src/vs/editor/contrib/folding/foldingModel.ts b/src/vs/editor/contrib/folding/foldingModel.ts index 70906b653eb..e81b529d061 100644 --- a/src/vs/editor/contrib/folding/foldingModel.ts +++ b/src/vs/editor/contrib/folding/foldingModel.ts @@ -29,9 +29,9 @@ export class FoldingModel { private _isInitialized: boolean; private _updateEventEmitter = new Emitter(); + public readonly onDidChange: Event = this._updateEventEmitter.event; public get regions(): FoldingRegions { return this._regions; } - public get onDidChange(): Event { return this._updateEventEmitter.event; } public get textModel() { return this._textModel; } public get isInitialized() { return this._isInitialized; } diff --git a/src/vs/platform/contextview/browser/contextMenuService.ts b/src/vs/platform/contextview/browser/contextMenuService.ts index e2fc80ef4ec..bb76d44886a 100644 --- a/src/vs/platform/contextview/browser/contextMenuService.ts +++ b/src/vs/platform/contextview/browser/contextMenuService.ts @@ -17,7 +17,7 @@ export class ContextMenuService extends Disposable implements IContextMenuServic _serviceBrand: any; private _onDidContextMenu = this._register(new Emitter()); - get onDidContextMenu(): Event { return this._onDidContextMenu.event; } + readonly onDidContextMenu: Event = this._onDidContextMenu.event; private contextMenuHandler: ContextMenuHandler; diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts index 67dd28f9bbb..5beb3a1c8b8 100644 --- a/src/vs/platform/files/common/fileService.ts +++ b/src/vs/platform/files/common/fileService.ts @@ -32,10 +32,10 @@ export class FileService extends Disposable implements IFileService { //#region File System Provider private _onDidChangeFileSystemProviderRegistrations: Emitter = this._register(new Emitter()); - get onDidChangeFileSystemProviderRegistrations(): Event { return this._onDidChangeFileSystemProviderRegistrations.event; } + readonly onDidChangeFileSystemProviderRegistrations: Event = this._onDidChangeFileSystemProviderRegistrations.event; private _onWillActivateFileSystemProvider: Emitter = this._register(new Emitter()); - get onWillActivateFileSystemProvider(): Event { return this._onWillActivateFileSystemProvider.event; } + readonly onWillActivateFileSystemProvider: Event = this._onWillActivateFileSystemProvider.event; private readonly provider = new Map(); @@ -132,10 +132,10 @@ export class FileService extends Disposable implements IFileService { //#endregion private _onAfterOperation: Emitter = this._register(new Emitter()); - get onAfterOperation(): Event { return this._onAfterOperation.event; } + readonly onAfterOperation: Event = this._onAfterOperation.event; private _onError: Emitter = this._register(new Emitter()); - get onError(): Event { return this._onError.event; } + readonly onError: Event = this._onError.event; //#region File Metadata Resolving @@ -763,7 +763,7 @@ export class FileService extends Disposable implements IFileService { //#region File Watching private _onFileChanges: Emitter = this._register(new Emitter()); - get onFileChanges(): Event { return this._onFileChanges.event; } + readonly onFileChanges: Event = this._onFileChanges.event; private activeWatchers = new Map(); diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index 1a7534ffe08..8ef39ec23f0 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -367,7 +367,7 @@ export class DiskFileSystemProvider extends Disposable implements IFileSystemPro //#region File Watching private _onDidWatchErrorOccur: Emitter = this._register(new Emitter()); - get onDidErrorOccur(): Event { return this._onDidWatchErrorOccur.event; } + readonly onDidErrorOccur: Event = this._onDidWatchErrorOccur.event; private _onDidChangeFile: Emitter = this._register(new Emitter()); get onDidChangeFile(): Event { return this._onDidChangeFile.event; } diff --git a/src/vs/platform/lifecycle/common/lifecycleService.ts b/src/vs/platform/lifecycle/common/lifecycleService.ts index b325cde418a..2225c04ca99 100644 --- a/src/vs/platform/lifecycle/common/lifecycleService.ts +++ b/src/vs/platform/lifecycle/common/lifecycleService.ts @@ -16,13 +16,13 @@ export abstract class AbstractLifecycleService extends Disposable implements ILi _serviceBrand: ServiceIdentifier; protected readonly _onBeforeShutdown = this._register(new Emitter()); - get onBeforeShutdown(): Event { return this._onBeforeShutdown.event; } + readonly onBeforeShutdown: Event = this._onBeforeShutdown.event; protected readonly _onWillShutdown = this._register(new Emitter()); - get onWillShutdown(): Event { return this._onWillShutdown.event; } + readonly onWillShutdown: Event = this._onWillShutdown.event; protected readonly _onShutdown = this._register(new Emitter()); - get onShutdown(): Event { return this._onShutdown.event; } + readonly onShutdown: Event = this._onShutdown.event; protected _startupKind: StartupKind; get startupKind(): StartupKind { return this._startupKind; } diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts index 75549c25f55..173b575822e 100644 --- a/src/vs/platform/notification/common/notification.ts +++ b/src/vs/platform/notification/common/notification.ts @@ -254,7 +254,7 @@ export class NoOpNotification implements INotificationHandle { readonly progress = new NoOpProgress(); private readonly _onDidClose: Emitter = new Emitter(); - get onDidClose(): Event { return this._onDidClose.event; } + readonly onDidClose: Event = this._onDidClose.event; updateSeverity(severity: Severity): void { } updateMessage(message: NotificationMessage): void { } diff --git a/src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts b/src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts index edc89fb407e..cefb3518ba0 100644 --- a/src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts +++ b/src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts @@ -28,7 +28,7 @@ export class RemoteExtensionsFileSystemProvider extends Disposable implements IF readonly onDidChangeFile: Event = this._onDidChange.event; private _onDidWatchErrorOccur: Emitter = this._register(new Emitter()); - get onDidErrorOccur(): Event { return this._onDidWatchErrorOccur.event; } + readonly onDidErrorOccur: Event = this._onDidWatchErrorOccur.event; private readonly _onDidChangeCapabilities = this._register(new Emitter()); readonly onDidChangeCapabilities: Event = this._onDidChangeCapabilities.event; diff --git a/src/vs/platform/storage/browser/storageService.ts b/src/vs/platform/storage/browser/storageService.ts index 734397a9f16..7e18f2ba09d 100644 --- a/src/vs/platform/storage/browser/storageService.ts +++ b/src/vs/platform/storage/browser/storageService.ts @@ -20,10 +20,10 @@ export class BrowserStorageService extends Disposable implements IStorageService _serviceBrand: ServiceIdentifier; private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); - get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } + readonly onDidChangeStorage: Event = this._onDidChangeStorage.event; private readonly _onWillSaveState: Emitter = this._register(new Emitter()); - get onWillSaveState(): Event { return this._onWillSaveState.event; } + readonly onWillSaveState: Event = this._onWillSaveState.event; private globalStorage: IStorage; private workspaceStorage: IStorage; diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index 443cf4a0131..5f6e2b6673f 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -126,7 +126,7 @@ export class InMemoryStorageService extends Disposable implements IStorageServic _serviceBrand = null as any; private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); - get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } + readonly onDidChangeStorage: Event = this._onDidChangeStorage.event; readonly onWillSaveState = Event.None; diff --git a/src/vs/platform/storage/node/storageIpc.ts b/src/vs/platform/storage/node/storageIpc.ts index d317e31a55b..aaba475a269 100644 --- a/src/vs/platform/storage/node/storageIpc.ts +++ b/src/vs/platform/storage/node/storageIpc.ts @@ -32,7 +32,7 @@ export class GlobalStorageDatabaseChannel extends Disposable implements IServerC private static STORAGE_CHANGE_DEBOUNCE_TIME = 100; private readonly _onDidChangeItems: Emitter = this._register(new Emitter()); - get onDidChangeItems(): Event { return this._onDidChangeItems.event; } + readonly onDidChangeItems: Event = this._onDidChangeItems.event; private whenReady: Promise; @@ -150,7 +150,7 @@ export class GlobalStorageDatabaseChannelClient extends Disposable implements IS _serviceBrand: any; private readonly _onDidChangeItemsExternal: Emitter = this._register(new Emitter()); - get onDidChangeItemsExternal(): Event { return this._onDidChangeItemsExternal.event; } + readonly onDidChangeItemsExternal: Event = this._onDidChangeItemsExternal.event; private onDidChangeItemsOnMainListener: IDisposable; diff --git a/src/vs/platform/storage/node/storageMainService.ts b/src/vs/platform/storage/node/storageMainService.ts index ccb16988860..8c76782626a 100644 --- a/src/vs/platform/storage/node/storageMainService.ts +++ b/src/vs/platform/storage/node/storageMainService.ts @@ -80,10 +80,10 @@ export class StorageMainService extends Disposable implements IStorageMainServic private static STORAGE_NAME = 'state.vscdb'; private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); - get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } + readonly onDidChangeStorage: Event = this._onDidChangeStorage.event; private readonly _onWillSaveState: Emitter = this._register(new Emitter()); - get onWillSaveState(): Event { return this._onWillSaveState.event; } + readonly onWillSaveState: Event = this._onWillSaveState.event; get items(): Map { return this.storage.items; } diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index 27d30af0527..caff11a3483 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -25,10 +25,10 @@ export class StorageService extends Disposable implements IStorageService { private static WORKSPACE_META_NAME = 'workspace.json'; private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); - get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } + readonly onDidChangeStorage: Event = this._onDidChangeStorage.event; private readonly _onWillSaveState: Emitter = this._register(new Emitter()); - get onWillSaveState(): Event { return this._onWillSaveState.event; } + readonly onWillSaveState: Event = this._onWillSaveState.event; private globalStorage: IStorage; diff --git a/src/vs/platform/update/electron-browser/updateService.ts b/src/vs/platform/update/electron-browser/updateService.ts index 023ea3ea7da..952c39cdbed 100644 --- a/src/vs/platform/update/electron-browser/updateService.ts +++ b/src/vs/platform/update/electron-browser/updateService.ts @@ -14,7 +14,7 @@ export class UpdateService implements IUpdateService { _serviceBrand: ServiceIdentifier; private _onStateChange = new Emitter(); - get onStateChange(): Event { return this._onStateChange.event; } + readonly onStateChange: Event = this._onStateChange.event; private _state: State = State.Uninitialized; get state(): State { return this._state; } diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index 76544db2221..f8059fb04b6 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -27,7 +27,7 @@ export abstract class AbstractUpdateService implements IUpdateService { private _state: State = State.Uninitialized; private _onStateChange = new Emitter(); - get onStateChange(): Event { return this._onStateChange.event; } + readonly onStateChange: Event = this._onStateChange.event; get state(): State { return this._state; diff --git a/src/vs/platform/update/electron-main/updateService.snap.ts b/src/vs/platform/update/electron-main/updateService.snap.ts index 33dac322927..ad64d8adfe0 100644 --- a/src/vs/platform/update/electron-main/updateService.snap.ts +++ b/src/vs/platform/update/electron-main/updateService.snap.ts @@ -21,7 +21,7 @@ abstract class AbstractUpdateService2 implements IUpdateService { private _state: State = State.Uninitialized; private _onStateChange = new Emitter(); - get onStateChange(): Event { return this._onStateChange.event; } + readonly onStateChange: Event = this._onStateChange.event; get state(): State { return this._state; diff --git a/src/vs/platform/workspaces/electron-main/workspacesMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesMainService.ts index 58107e613f2..54d6757842a 100644 --- a/src/vs/platform/workspaces/electron-main/workspacesMainService.ts +++ b/src/vs/platform/workspaces/electron-main/workspacesMainService.ts @@ -31,7 +31,7 @@ export class WorkspacesMainService extends Disposable implements IWorkspacesMain private readonly untitledWorkspacesHome: URI; // local URI that contains all untitled workspaces private readonly _onUntitledWorkspaceDeleted = this._register(new Emitter()); - get onUntitledWorkspaceDeleted(): Event { return this._onUntitledWorkspaceDeleted.event; } + readonly onUntitledWorkspaceDeleted: Event = this._onUntitledWorkspaceDeleted.event; constructor( @IEnvironmentService private readonly environmentService: IEnvironmentService, diff --git a/src/vs/workbench/api/browser/mainThreadComments.ts b/src/vs/workbench/api/browser/mainThreadComments.ts index 7bce8f98dee..77c2e1052a7 100644 --- a/src/vs/workbench/api/browser/mainThreadComments.ts +++ b/src/vs/workbench/api/browser/mainThreadComments.ts @@ -57,7 +57,7 @@ export class MainThreadCommentThread implements modes.CommentThread { } private _onDidChangeLabel = new Emitter(); - get onDidChangeLabel(): Event { return this._onDidChangeLabel.event; } + readonly onDidChangeLabel: Event = this._onDidChangeLabel.event; private _comments: modes.Comment[] | undefined; diff --git a/src/vs/workbench/api/browser/mainThreadSCM.ts b/src/vs/workbench/api/browser/mainThreadSCM.ts index b0a25696935..089cb517b45 100644 --- a/src/vs/workbench/api/browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/browser/mainThreadSCM.ts @@ -24,7 +24,7 @@ class MainThreadSCMResourceGroup implements ISCMResourceGroup { get hideWhenEmpty(): boolean { return !!this.features.hideWhenEmpty; } private _onDidChange = new Emitter(); - get onDidChange(): Event { return this._onDidChange.event; } + readonly onDidChange: Event = this._onDidChange.event; constructor( private readonly sourceControlHandle: number, @@ -105,7 +105,7 @@ class MainThreadSCMProvider implements ISCMProvider { // } private _onDidChangeResources = new Emitter(); - get onDidChangeResources(): Event { return this._onDidChangeResources.event; } + readonly onDidChangeResources: Event = this._onDidChangeResources.event; private features: SCMProviderFeatures = {}; @@ -120,13 +120,13 @@ class MainThreadSCMProvider implements ISCMProvider { get count(): number | undefined { return this.features.count; } private _onDidChangeCommitTemplate = new Emitter(); - get onDidChangeCommitTemplate(): Event { return this._onDidChangeCommitTemplate.event; } + readonly onDidChangeCommitTemplate: Event = this._onDidChangeCommitTemplate.event; private _onDidChangeStatusBarCommands = new Emitter(); get onDidChangeStatusBarCommands(): Event { return this._onDidChangeStatusBarCommands.event; } private _onDidChange = new Emitter(); - get onDidChange(): Event { return this._onDidChange.event; } + readonly onDidChange: Event = this._onDidChange.event; constructor( private readonly proxy: ExtHostSCMShape, diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 87657c7e6f1..56d11496bb0 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -726,13 +726,13 @@ class ExtHostVirtualProcess implements ITerminalChildProcess { private _queueDisposables: IDisposable[] | undefined; private readonly _onProcessData = new Emitter(); - public get onProcessData(): Event { return this._onProcessData.event; } + public readonly onProcessData: Event = this._onProcessData.event; private readonly _onProcessExit = new Emitter(); - public get onProcessExit(): Event { return this._onProcessExit.event; } + public readonly onProcessExit: Event = this._onProcessExit.event; private readonly _onProcessReady = new Emitter<{ pid: number, cwd: string }>(); public get onProcessReady(): Event<{ pid: number, cwd: string }> { return this._onProcessReady.event; } private readonly _onProcessTitleChanged = new Emitter(); - public get onProcessTitleChanged(): Event { return this._onProcessTitleChanged.event; } + public readonly onProcessTitleChanged: Event = this._onProcessTitleChanged.event; private readonly _onProcessOverrideDimensions = new Emitter(); public get onProcessOverrideDimensions(): Event { return this._onProcessOverrideDimensions.event; } diff --git a/src/vs/workbench/browser/composite.ts b/src/vs/workbench/browser/composite.ts index 84bf4619b0e..123e9a9b692 100644 --- a/src/vs/workbench/browser/composite.ts +++ b/src/vs/workbench/browser/composite.ts @@ -30,10 +30,10 @@ import { Disposable } from 'vs/base/common/lifecycle'; export abstract class Composite extends Component implements IComposite { private readonly _onTitleAreaUpdate: Emitter = this._register(new Emitter()); - get onTitleAreaUpdate(): Event { return this._onTitleAreaUpdate.event; } + readonly onTitleAreaUpdate: Event = this._onTitleAreaUpdate.event; private readonly _onDidChangeVisibility: Emitter = this._register(new Emitter()); - get onDidChangeVisibility(): Event { return this._onDidChangeVisibility.event; } + readonly onDidChangeVisibility: Event = this._onDidChangeVisibility.event; private _onDidFocus: Emitter; get onDidFocus(): Event { diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 4c0ccf3809e..9db4979a3aa 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -239,7 +239,7 @@ enum Redraw { class ResourceLabelWidget extends IconLabel { private _onDidRender = this._register(new Emitter()); - get onDidRender(): Event { return this._onDidRender.event; } + readonly onDidRender: Event = this._onDidRender.event; private label?: IResourceLabelProps; private options?: IResourceLabelOptions; diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 88e9676f1e7..a70593c4390 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -63,22 +63,22 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi _serviceBrand: ServiceIdentifier; private readonly _onTitleBarVisibilityChange: Emitter = this._register(new Emitter()); - get onTitleBarVisibilityChange(): Event { return this._onTitleBarVisibilityChange.event; } + readonly onTitleBarVisibilityChange: Event = this._onTitleBarVisibilityChange.event; private readonly _onZenModeChange: Emitter = this._register(new Emitter()); - get onZenModeChange(): Event { return this._onZenModeChange.event; } + readonly onZenModeChange: Event = this._onZenModeChange.event; private readonly _onFullscreenChange: Emitter = this._register(new Emitter()); - get onFullscreenChange(): Event { return this._onFullscreenChange.event; } + readonly onFullscreenChange: Event = this._onFullscreenChange.event; private readonly _onCenteredLayoutChange: Emitter = this._register(new Emitter()); - get onCenteredLayoutChange(): Event { return this._onCenteredLayoutChange.event; } + readonly onCenteredLayoutChange: Event = this._onCenteredLayoutChange.event; private readonly _onPanelPositionChange: Emitter = this._register(new Emitter()); - get onPanelPositionChange(): Event { return this._onPanelPositionChange.event; } + readonly onPanelPositionChange: Event = this._onPanelPositionChange.event; private readonly _onLayout = this._register(new Emitter()); - get onLayout(): Event { return this._onLayout.event; } + readonly onLayout: Event = this._onLayout.event; private _dimension: IDimension; get dimension(): IDimension { return this._dimension; } diff --git a/src/vs/workbench/browser/parts/compositeBarActions.ts b/src/vs/workbench/browser/parts/compositeBarActions.ts index fe21d315410..d3445a9bbb6 100644 --- a/src/vs/workbench/browser/parts/compositeBarActions.ts +++ b/src/vs/workbench/browser/parts/compositeBarActions.ts @@ -52,10 +52,10 @@ export interface ICompositeBar { export class ActivityAction extends Action { private _onDidChangeActivity = new Emitter(); - get onDidChangeActivity(): Event { return this._onDidChangeActivity.event; } + readonly onDidChangeActivity: Event = this._onDidChangeActivity.event; private _onDidChangeBadge = new Emitter(); - get onDidChangeBadge(): Event { return this._onDidChangeBadge.event; } + readonly onDidChangeBadge: Event = this._onDidChangeBadge.event; private badge?: IBadge; private clazz: string | undefined; diff --git a/src/vs/workbench/browser/parts/editor/binaryEditor.ts b/src/vs/workbench/browser/parts/editor/binaryEditor.ts index b2d51bde13c..81a6096128b 100644 --- a/src/vs/workbench/browser/parts/editor/binaryEditor.ts +++ b/src/vs/workbench/browser/parts/editor/binaryEditor.ts @@ -33,10 +33,10 @@ export interface IOpenCallbacks { export abstract class BaseBinaryResourceEditor extends BaseEditor { private readonly _onMetadataChanged: Emitter = this._register(new Emitter()); - get onMetadataChanged(): Event { return this._onMetadataChanged.event; } + readonly onMetadataChanged: Event = this._onMetadataChanged.event; private readonly _onDidOpenInPlace: Emitter = this._register(new Emitter()); - get onDidOpenInPlace(): Event { return this._onDidOpenInPlace.event; } + readonly onDidOpenInPlace: Event = this._onDidOpenInPlace.event; private callbacks: IOpenCallbacks; private metadata: string | undefined; diff --git a/src/vs/workbench/browser/parts/editor/editorControl.ts b/src/vs/workbench/browser/parts/editor/editorControl.ts index 3db5b69060b..726b84c97db 100644 --- a/src/vs/workbench/browser/parts/editor/editorControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorControl.ts @@ -30,7 +30,7 @@ export class EditorControl extends Disposable { get maximumHeight() { return this._activeControl ? this._activeControl.maximumHeight : DEFAULT_EDITOR_MAX_DIMENSIONS.height; } private readonly _onDidFocus: Emitter = this._register(new Emitter()); - get onDidFocus(): Event { return this._onDidFocus.event; } + readonly onDidFocus: Event = this._onDidFocus.event; private _onDidSizeConstraintsChange = this._register(new Emitter<{ width: number; height: number; } | undefined>()); get onDidSizeConstraintsChange(): Event<{ width: number; height: number; } | undefined> { return this._onDidSizeConstraintsChange.event; } diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index c38cf579a7a..e5cc3843429 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -71,25 +71,25 @@ export class EditorGroupView extends Themable implements IEditorGroupView { //#region events private readonly _onDidFocus: Emitter = this._register(new Emitter()); - get onDidFocus(): Event { return this._onDidFocus.event; } + readonly onDidFocus: Event = this._onDidFocus.event; private readonly _onWillDispose: Emitter = this._register(new Emitter()); - get onWillDispose(): Event { return this._onWillDispose.event; } + readonly onWillDispose: Event = this._onWillDispose.event; private readonly _onDidGroupChange: Emitter = this._register(new Emitter()); - get onDidGroupChange(): Event { return this._onDidGroupChange.event; } + readonly onDidGroupChange: Event = this._onDidGroupChange.event; private readonly _onWillOpenEditor: Emitter = this._register(new Emitter()); - get onWillOpenEditor(): Event { return this._onWillOpenEditor.event; } + readonly onWillOpenEditor: Event = this._onWillOpenEditor.event; private readonly _onDidOpenEditorFail: Emitter = this._register(new Emitter()); - get onDidOpenEditorFail(): Event { return this._onDidOpenEditorFail.event; } + readonly onDidOpenEditorFail: Event = this._onDidOpenEditorFail.event; private readonly _onWillCloseEditor: Emitter = this._register(new Emitter()); - get onWillCloseEditor(): Event { return this._onWillCloseEditor.event; } + readonly onWillCloseEditor: Event = this._onWillCloseEditor.event; private readonly _onDidCloseEditor: Emitter = this._register(new Emitter()); - get onDidCloseEditor(): Event { return this._onDidCloseEditor.event; } + readonly onDidCloseEditor: Event = this._onDidCloseEditor.event; //#endregion diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 5bb777ae85f..dc894921aaa 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -91,29 +91,29 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro //#region Events private readonly _onDidLayout: Emitter = this._register(new Emitter()); - get onDidLayout(): Event { return this._onDidLayout.event; } + readonly onDidLayout: Event = this._onDidLayout.event; private readonly _onDidActiveGroupChange: Emitter = this._register(new Emitter()); - get onDidActiveGroupChange(): Event { return this._onDidActiveGroupChange.event; } + readonly onDidActiveGroupChange: Event = this._onDidActiveGroupChange.event; private readonly _onDidActivateGroup: Emitter = this._register(new Emitter()); - get onDidActivateGroup(): Event { return this._onDidActivateGroup.event; } + readonly onDidActivateGroup: Event = this._onDidActivateGroup.event; private readonly _onDidAddGroup: Emitter = this._register(new Emitter()); - get onDidAddGroup(): Event { return this._onDidAddGroup.event; } + readonly onDidAddGroup: Event = this._onDidAddGroup.event; private readonly _onDidRemoveGroup: Emitter = this._register(new Emitter()); - get onDidRemoveGroup(): Event { return this._onDidRemoveGroup.event; } + readonly onDidRemoveGroup: Event = this._onDidRemoveGroup.event; private readonly _onDidMoveGroup: Emitter = this._register(new Emitter()); - get onDidMoveGroup(): Event { return this._onDidMoveGroup.event; } + readonly onDidMoveGroup: Event = this._onDidMoveGroup.event; private onDidSetGridWidget = this._register(new Emitter<{ width: number; height: number; } | undefined>()); private _onDidSizeConstraintsChange = this._register(new Relay<{ width: number; height: number; } | undefined>()); get onDidSizeConstraintsChange(): Event<{ width: number; height: number; } | undefined> { return Event.any(this.onDidSetGridWidget.event, this._onDidSizeConstraintsChange.event); } private readonly _onDidPreferredSizeChange: Emitter = this._register(new Emitter()); - get onDidPreferredSizeChange(): Event { return this._onDidPreferredSizeChange.event; } + readonly onDidPreferredSizeChange: Event = this._onDidPreferredSizeChange.event; //#endregion @@ -162,7 +162,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro private enforcedPartOptions: IEditorPartOptions[] = []; private readonly _onDidEditorPartOptionsChange: Emitter = this._register(new Emitter()); - get onDidEditorPartOptionsChange(): Event { return this._onDidEditorPartOptionsChange.event; } + readonly onDidEditorPartOptionsChange: Event = this._onDidEditorPartOptionsChange.event; private registerListeners(): void { this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e))); diff --git a/src/vs/workbench/browser/parts/editor/editorWidgets.ts b/src/vs/workbench/browser/parts/editor/editorWidgets.ts index de5aacf5354..d0595046aaa 100644 --- a/src/vs/workbench/browser/parts/editor/editorWidgets.ts +++ b/src/vs/workbench/browser/parts/editor/editorWidgets.ts @@ -24,7 +24,7 @@ import { IFileService } from 'vs/platform/files/common/files'; export class FloatingClickWidget extends Widget implements IOverlayWidget { private readonly _onClick: Emitter = this._register(new Emitter()); - get onClick(): Event { return this._onClick.event; } + readonly onClick: Event = this._onClick.event; private _domNode: HTMLElement; diff --git a/src/vs/workbench/browser/parts/editor/rangeDecorations.ts b/src/vs/workbench/browser/parts/editor/rangeDecorations.ts index 0e994f72c34..4c52be6ca69 100644 --- a/src/vs/workbench/browser/parts/editor/rangeDecorations.ts +++ b/src/vs/workbench/browser/parts/editor/rangeDecorations.ts @@ -26,7 +26,7 @@ export class RangeHighlightDecorations extends Disposable { private readonly editorDisposables = this._register(new DisposableStore()); private readonly _onHighlightRemoved: Emitter = this._register(new Emitter()); - get onHighlightRemoved(): Event { return this._onHighlightRemoved.event; } + readonly onHighlightRemoved: Event = this._onHighlightRemoved.event; constructor(@IEditorService private readonly editorService: IEditorService) { super(); diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts index e06e38cde64..adef1d21348 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts @@ -28,7 +28,7 @@ export class NotificationsCenter extends Themable { private static MAX_DIMENSIONS = new Dimension(450, 400); private readonly _onDidChangeVisibility: Emitter = this._register(new Emitter()); - get onDidChangeVisibility(): Event { return this._onDidChangeVisibility.event; } + readonly onDidChangeVisibility: Event = this._onDidChangeVisibility.event; private notificationsCenterContainer: HTMLElement; private notificationsCenterHeader: HTMLElement; diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 88eb05032e8..874d81baddb 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -62,10 +62,10 @@ export class PanelPart extends CompositePart implements IPanelService { //#endregion get onDidPanelOpen(): Event<{ panel: IPanel, focus: boolean }> { return Event.map(this.onDidCompositeOpen.event, compositeOpen => ({ panel: compositeOpen.composite, focus: compositeOpen.focus })); } - get onDidPanelClose(): Event { return this.onDidCompositeClose.event; } + readonly onDidPanelClose: Event = this.onDidCompositeClose.event; private _onDidVisibilityChange = this._register(new Emitter()); - get onDidVisibilityChange(): Event { return this._onDidVisibilityChange.event; } + readonly onDidVisibilityChange: Event = this._onDidVisibilityChange.event; private activePanelContextKey: IContextKey; private panelFocusContextKey: IContextKey; diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index 5cfc04c3743..f31bd9d480e 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -64,10 +64,10 @@ export class QuickOpenController extends Component implements IQuickOpenService _serviceBrand: ServiceIdentifier; private readonly _onShow: Emitter = this._register(new Emitter()); - get onShow(): Event { return this._onShow.event; } + readonly onShow: Event = this._onShow.event; private readonly _onHide: Emitter = this._register(new Emitter()); - get onHide(): Event { return this._onHide.event; } + readonly onHide: Event = this._onHide.event; private preserveInput: boolean; private isQuickOpen: boolean; diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index 942257ef3e9..88c40e827ae 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -52,10 +52,10 @@ export class SidebarPart extends CompositePart implements IViewletServi get onDidViewletRegister(): Event { return >this.viewletRegistry.onDidRegister; } private _onDidVisibilityChange = this._register(new Emitter()); - get onDidVisibilityChange(): Event { return this._onDidVisibilityChange.event; } + readonly onDidVisibilityChange: Event = this._onDidVisibilityChange.event; private _onDidViewletDeregister = this._register(new Emitter()); - get onDidViewletDeregister(): Event { return this._onDidViewletDeregister.event; } + readonly onDidViewletDeregister: Event = this._onDidViewletDeregister.event; get onDidViewletOpen(): Event { return Event.map(this.onDidCompositeOpen.event, compositeEvent => compositeEvent.composite); } get onDidViewletClose(): Event { return this.onDidCompositeClose.event as Event; } diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 83457d8a39f..f6b0a6849f9 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -56,7 +56,7 @@ export class TitlebarPart extends Part implements ITitleService { //#endregion private _onMenubarVisibilityChange = this._register(new Emitter()); - get onMenubarVisibilityChange(): Event { return this._onMenubarVisibilityChange.event; } + readonly onMenubarVisibilityChange: Event = this._onMenubarVisibilityChange.event; _serviceBrand: ServiceIdentifier; diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index ee1ae6612f9..99a141b9b3a 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -108,7 +108,7 @@ class TitleMenus extends Disposable { private titleSecondaryActions: IAction[] = []; private _onDidChangeTitle = this._register(new Emitter()); - get onDidChangeTitle(): Event { return this._onDidChangeTitle.event; } + readonly onDidChangeTitle: Event = this._onDidChangeTitle.event; constructor( id: string, diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index 3fae12549dd..634655ffa84 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -48,10 +48,10 @@ import { Layout } from 'vs/workbench/browser/layout'; export class Workbench extends Layout { private readonly _onShutdown = this._register(new Emitter()); - get onShutdown(): Event { return this._onShutdown.event; } + readonly onShutdown: Event = this._onShutdown.event; private readonly _onWillShutdown = this._register(new Emitter()); - get onWillShutdown(): Event { return this._onWillShutdown.event; } + readonly onWillShutdown: Event = this._onWillShutdown.event; constructor( parent: HTMLElement, diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index dca1d783821..4cd3bb02e5d 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -330,13 +330,13 @@ export interface IEditorInput extends IDisposable { export abstract class EditorInput extends Disposable implements IEditorInput { protected readonly _onDidChangeDirty: Emitter = this._register(new Emitter()); - get onDidChangeDirty(): Event { return this._onDidChangeDirty.event; } + readonly onDidChangeDirty: Event = this._onDidChangeDirty.event; protected readonly _onDidChangeLabel: Emitter = this._register(new Emitter()); - get onDidChangeLabel(): Event { return this._onDidChangeLabel.event; } + readonly onDidChangeLabel: Event = this._onDidChangeLabel.event; private readonly _onDispose: Emitter = this._register(new Emitter()); - get onDispose(): Event { return this._onDispose.event; } + readonly onDispose: Event = this._onDispose.event; private disposed: boolean = false; @@ -658,7 +658,7 @@ export interface ITextEditorModel extends IEditorModel { export class EditorModel extends Disposable implements IEditorModel { private readonly _onDispose: Emitter = this._register(new Emitter()); - get onDispose(): Event { return this._onDispose.event; } + readonly onDispose: Event = this._onDispose.event; /** * Causes this model to load returning a promise when loading is completed. diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index e5b47924916..5b207d4a79d 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -60,31 +60,31 @@ export class EditorGroup extends Disposable { //#region events private readonly _onDidEditorActivate = this._register(new Emitter()); - get onDidEditorActivate(): Event { return this._onDidEditorActivate.event; } + readonly onDidEditorActivate: Event = this._onDidEditorActivate.event; private readonly _onDidEditorOpen = this._register(new Emitter()); - get onDidEditorOpen(): Event { return this._onDidEditorOpen.event; } + readonly onDidEditorOpen: Event = this._onDidEditorOpen.event; private readonly _onDidEditorClose = this._register(new Emitter()); - get onDidEditorClose(): Event { return this._onDidEditorClose.event; } + readonly onDidEditorClose: Event = this._onDidEditorClose.event; private readonly _onDidEditorDispose = this._register(new Emitter()); - get onDidEditorDispose(): Event { return this._onDidEditorDispose.event; } + readonly onDidEditorDispose: Event = this._onDidEditorDispose.event; private readonly _onDidEditorBecomeDirty = this._register(new Emitter()); - get onDidEditorBecomeDirty(): Event { return this._onDidEditorBecomeDirty.event; } + readonly onDidEditorBecomeDirty: Event = this._onDidEditorBecomeDirty.event; private readonly _onDidEditorLabelChange = this._register(new Emitter()); - get onDidEditorLabelChange(): Event { return this._onDidEditorLabelChange.event; } + readonly onDidEditorLabelChange: Event = this._onDidEditorLabelChange.event; private readonly _onDidEditorMove = this._register(new Emitter()); - get onDidEditorMove(): Event { return this._onDidEditorMove.event; } + readonly onDidEditorMove: Event = this._onDidEditorMove.event; private readonly _onDidEditorPin = this._register(new Emitter()); - get onDidEditorPin(): Event { return this._onDidEditorPin.event; } + readonly onDidEditorPin: Event = this._onDidEditorPin.event; private readonly _onDidEditorUnpin = this._register(new Emitter()); - get onDidEditorUnpin(): Event { return this._onDidEditorUnpin.event; } + readonly onDidEditorUnpin: Event = this._onDidEditorUnpin.event; //#endregion diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 2d89afb0bb0..561b5cb6f87 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -28,10 +28,10 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport private modelResolve: Promise | null; private readonly _onDidModelChangeContent: Emitter = this._register(new Emitter()); - get onDidModelChangeContent(): Event { return this._onDidModelChangeContent.event; } + readonly onDidModelChangeContent: Event = this._onDidModelChangeContent.event; private readonly _onDidModelChangeEncoding: Emitter = this._register(new Emitter()); - get onDidModelChangeEncoding(): Event { return this._onDidModelChangeEncoding.event; } + readonly onDidModelChangeEncoding: Event = this._onDidModelChangeEncoding.event; constructor( private readonly resource: URI, diff --git a/src/vs/workbench/common/editor/untitledEditorModel.ts b/src/vs/workbench/common/editor/untitledEditorModel.ts index 8b2c38d28f6..57a77b7267b 100644 --- a/src/vs/workbench/common/editor/untitledEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledEditorModel.ts @@ -22,13 +22,13 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin static DEFAULT_CONTENT_CHANGE_BUFFER_DELAY = CONTENT_CHANGE_EVENT_BUFFER_DELAY; private readonly _onDidChangeContent: Emitter = this._register(new Emitter()); - get onDidChangeContent(): Event { return this._onDidChangeContent.event; } + readonly onDidChangeContent: Event = this._onDidChangeContent.event; private readonly _onDidChangeDirty: Emitter = this._register(new Emitter()); - get onDidChangeDirty(): Event { return this._onDidChangeDirty.event; } + readonly onDidChangeDirty: Event = this._onDidChangeDirty.event; private readonly _onDidChangeEncoding: Emitter = this._register(new Emitter()); - get onDidChangeEncoding(): Event { return this._onDidChangeEncoding.event; } + readonly onDidChangeEncoding: Event = this._onDidChangeEncoding.event; private dirty: boolean = false; private versionId: number = 0; diff --git a/src/vs/workbench/common/notifications.ts b/src/vs/workbench/common/notifications.ts index e4718e06f67..b83f9599436 100644 --- a/src/vs/workbench/common/notifications.ts +++ b/src/vs/workbench/common/notifications.ts @@ -86,7 +86,7 @@ export interface IStatusMessageChangeEvent { export class NotificationHandle implements INotificationHandle { private readonly _onDidClose: Emitter = new Emitter(); - get onDidClose(): Event { return this._onDidClose.event; } + readonly onDidClose: Event = this._onDidClose.event; constructor(private readonly item: INotificationViewItem, private readonly closeItem: (item: INotificationViewItem) => void) { this.registerListeners(); @@ -126,10 +126,10 @@ export class NotificationsModel extends Disposable implements INotificationsMode private static NO_OP_NOTIFICATION = new NoOpNotification(); private readonly _onDidNotificationChange: Emitter = this._register(new Emitter()); - get onDidNotificationChange(): Event { return this._onDidNotificationChange.event; } + readonly onDidNotificationChange: Event = this._onDidNotificationChange.event; private readonly _onDidStatusMessageChange: Emitter = this._register(new Emitter()); - get onDidStatusMessageChange(): Event { return this._onDidStatusMessageChange.event; } + readonly onDidStatusMessageChange: Event = this._onDidStatusMessageChange.event; private readonly _notifications: INotificationViewItem[] = []; get notifications(): INotificationViewItem[] { return this._notifications; } @@ -301,7 +301,7 @@ export class NotificationViewItemProgress extends Disposable implements INotific private readonly _state: INotificationViewItemProgressState; private readonly _onDidChange: Emitter = this._register(new Emitter()); - get onDidChange(): Event { return this._onDidChange.event; } + readonly onDidChange: Event = this._onDidChange.event; constructor() { super(); @@ -397,13 +397,13 @@ export class NotificationViewItem extends Disposable implements INotificationVie private _progress: NotificationViewItemProgress; private readonly _onDidExpansionChange: Emitter = this._register(new Emitter()); - get onDidExpansionChange(): Event { return this._onDidExpansionChange.event; } + readonly onDidExpansionChange: Event = this._onDidExpansionChange.event; private readonly _onDidClose: Emitter = this._register(new Emitter()); - get onDidClose(): Event { return this._onDidClose.event; } + readonly onDidClose: Event = this._onDidClose.event; private readonly _onDidLabelChange: Emitter = this._register(new Emitter()); - get onDidLabelChange(): Event { return this._onDidLabelChange.event; } + readonly onDidLabelChange: Event = this._onDidLabelChange.event; static create(notification: INotification): INotificationViewItem | null { if (!notification || !notification.message || isPromiseCanceledError(notification.message)) { @@ -654,7 +654,7 @@ export class NotificationViewItem extends Disposable implements INotificationVie export class ChoiceAction extends Action { private readonly _onDidRun = new Emitter(); - get onDidRun(): Event { return this._onDidRun.event; } + readonly onDidRun: Event = this._onDidRun.event; private readonly _keepOpen: boolean; diff --git a/src/vs/workbench/common/resources.ts b/src/vs/workbench/common/resources.ts index 1b1e64b5992..53de865d8f1 100644 --- a/src/vs/workbench/common/resources.ts +++ b/src/vs/workbench/common/resources.ts @@ -107,7 +107,7 @@ export class ResourceGlobMatcher extends Disposable { private static readonly NO_ROOT: string | null = null; private readonly _onExpressionChange: Emitter = this._register(new Emitter()); - get onExpressionChange(): Event { return this._onExpressionChange.event; } + readonly onExpressionChange: Event = this._onExpressionChange.event; private readonly mapRootToParsedExpression: Map = new Map(); private readonly mapRootToExpressionConfig: Map = new Map(); diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts index e353af16e13..360bc205add 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts @@ -437,7 +437,7 @@ class DefaultSettingsHeaderRenderer extends Disposable { export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider { private readonly _onHiddenAreasChanged = this._register(new Emitter()); - get onHiddenAreasChanged(): Event { return this._onHiddenAreasChanged.event; } + readonly onHiddenAreasChanged: Event = this._onHiddenAreasChanged.event; private settingsGroups: ISettingsGroup[]; private hiddenGroups: ISettingsGroup[] = []; diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts index f45d098fb72..7eeb9c15120 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts @@ -745,7 +745,7 @@ export class EditPreferenceWidget extends Disposable { private _editPreferenceDecoration: string[]; private readonly _onClick = this._register(new Emitter()); - get onClick(): Event { return this._onClick.event; } + readonly onClick: Event = this._onClick.event; constructor(private editor: ICodeEditor ) { diff --git a/src/vs/workbench/contrib/scm/common/scmService.ts b/src/vs/workbench/contrib/scm/common/scmService.ts index 4b5e9e6d10b..e75d7df468e 100644 --- a/src/vs/workbench/contrib/scm/common/scmService.ts +++ b/src/vs/workbench/contrib/scm/common/scmService.ts @@ -23,7 +23,7 @@ class SCMInput implements ISCMInput { } private _onDidChange = new Emitter(); - get onDidChange(): Event { return this._onDidChange.event; } + readonly onDidChange: Event = this._onDidChange.event; private _placeholder = ''; @@ -37,7 +37,7 @@ class SCMInput implements ISCMInput { } private _onDidChangePlaceholder = new Emitter(); - get onDidChangePlaceholder(): Event { return this._onDidChangePlaceholder.event; } + readonly onDidChangePlaceholder: Event = this._onDidChangePlaceholder.event; private _visible = true; @@ -51,7 +51,7 @@ class SCMInput implements ISCMInput { } private _onDidChangeVisibility = new Emitter(); - get onDidChangeVisibility(): Event { return this._onDidChangeVisibility.event; } + readonly onDidChangeVisibility: Event = this._onDidChangeVisibility.event; private _validateInput: IInputValidator = () => Promise.resolve(undefined); @@ -65,7 +65,7 @@ class SCMInput implements ISCMInput { } private _onDidChangeValidateInput = new Emitter(); - get onDidChangeValidateInput(): Event { return this._onDidChangeValidateInput.event; } + readonly onDidChangeValidateInput: Event = this._onDidChangeValidateInput.event; } class SCMRepository implements ISCMRepository { @@ -118,10 +118,10 @@ export class SCMService implements ISCMService { readonly onDidChangeSelectedRepositories: Event = this._onDidChangeSelectedRepositories.event; private _onDidAddProvider = new Emitter(); - get onDidAddRepository(): Event { return this._onDidAddProvider.event; } + readonly onDidAddRepository: Event = this._onDidAddProvider.event; private _onDidRemoveProvider = new Emitter(); - get onDidRemoveRepository(): Event { return this._onDidRemoveProvider.event; } + readonly onDidRemoveRepository: Event = this._onDidRemoveProvider.event; constructor(@ILogService private readonly logService: ILogService) { } diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts index 30c10b277a6..1c4f457c5b9 100644 --- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts @@ -1718,7 +1718,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { private matchers: IStringDictionary; private readyPromise: Promise; private readonly _onMatchersChanged: Emitter = new Emitter(); - public get onMatcherChanged(): Event { return this._onMatchersChanged.event; } + public readonly onMatcherChanged: Event = this._onMatchersChanged.event; constructor() { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts index 23d85afde8e..a984ba56232 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts @@ -223,9 +223,9 @@ export class TerminalTab extends Disposable implements ITerminalTab { public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; } private readonly _onDisposed: Emitter; - public get onDisposed(): Event { return this._onDisposed.event; } + public readonly onDisposed: Event = this._onDisposed.event; private readonly _onInstancesChanged: Emitter; - public get onInstancesChanged(): Event { return this._onInstancesChanged.event; } + public readonly onInstancesChanged: Event = this._onInstancesChanged.event; constructor( terminalFocusContextKey: IContextKey, diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index 9dfa9721021..889766333d3 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -37,7 +37,7 @@ export class WebviewEditor extends BaseEditor { private readonly _onFocusWindowHandler = this._register(new MutableDisposable()); private readonly _onDidFocusWebview = this._register(new Emitter()); - public get onDidFocus(): Event { return this._onDidFocusWebview.event; } + public readonly onDidFocus: Event = this._onDidFocusWebview.event; private pendingMessages: any[] = []; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 32d4b8d25f0..e0c1d79deb1 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -296,7 +296,7 @@ export class WebviewElement extends Disposable implements Webview { private _focused = false; private readonly _onDidFocus = this._register(new Emitter()); - public get onDidFocus(): Event { return this._onDidFocus.event; } + public readonly onDidFocus: Event = this._onDidFocus.event; constructor( private readonly _options: WebviewOptions, diff --git a/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts index f0a715d5868..37d10c4d8fd 100644 --- a/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts +++ b/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts @@ -66,7 +66,7 @@ class NativeContextMenuService extends Disposable implements IContextMenuService _serviceBrand: any; private _onDidContextMenu = this._register(new Emitter()); - get onDidContextMenu(): Event { return this._onDidContextMenu.event; } + readonly onDidContextMenu: Event = this._onDidContextMenu.event; constructor( @INotificationService private readonly notificationService: INotificationService, diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 039e5b9624c..444045e8825 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -40,16 +40,16 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region events private readonly _onDidActiveEditorChange: Emitter = this._register(new Emitter()); - get onDidActiveEditorChange(): Event { return this._onDidActiveEditorChange.event; } + readonly onDidActiveEditorChange: Event = this._onDidActiveEditorChange.event; private readonly _onDidVisibleEditorsChange: Emitter = this._register(new Emitter()); - get onDidVisibleEditorsChange(): Event { return this._onDidVisibleEditorsChange.event; } + readonly onDidVisibleEditorsChange: Event = this._onDidVisibleEditorsChange.event; private readonly _onDidCloseEditor: Emitter = this._register(new Emitter()); - get onDidCloseEditor(): Event { return this._onDidCloseEditor.event; } + readonly onDidCloseEditor: Event = this._onDidCloseEditor.event; private readonly _onDidOpenEditorFail: Emitter = this._register(new Emitter()); - get onDidOpenEditorFail(): Event { return this._onDidOpenEditorFail.event; } + readonly onDidOpenEditorFail: Event = this._onDidOpenEditorFail.event; //#endregion diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index e860bcd6048..819e2a1fc08 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -70,10 +70,10 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil static setSaveParticipant(handler: ISaveParticipant | null): void { TextFileEditorModel.saveParticipant = handler; } private readonly _onDidContentChange: Emitter = this._register(new Emitter()); - get onDidContentChange(): Event { return this._onDidContentChange.event; } + readonly onDidContentChange: Event = this._onDidContentChange.event; private readonly _onDidStateChange: Emitter = this._register(new Emitter()); - get onDidStateChange(): Event { return this._onDidStateChange.event; } + readonly onDidStateChange: Event = this._onDidStateChange.event; private resource: URI; diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts b/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts index af67898ef69..8afe2d46768 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts @@ -15,28 +15,28 @@ import { ResourceMap } from 'vs/base/common/map'; export class TextFileEditorModelManager extends Disposable implements ITextFileEditorModelManager { private readonly _onModelDisposed: Emitter = this._register(new Emitter()); - get onModelDisposed(): Event { return this._onModelDisposed.event; } + readonly onModelDisposed: Event = this._onModelDisposed.event; private readonly _onModelContentChanged: Emitter = this._register(new Emitter()); - get onModelContentChanged(): Event { return this._onModelContentChanged.event; } + readonly onModelContentChanged: Event = this._onModelContentChanged.event; private readonly _onModelDirty: Emitter = this._register(new Emitter()); - get onModelDirty(): Event { return this._onModelDirty.event; } + readonly onModelDirty: Event = this._onModelDirty.event; private readonly _onModelSaveError: Emitter = this._register(new Emitter()); - get onModelSaveError(): Event { return this._onModelSaveError.event; } + readonly onModelSaveError: Event = this._onModelSaveError.event; private readonly _onModelSaved: Emitter = this._register(new Emitter()); - get onModelSaved(): Event { return this._onModelSaved.event; } + readonly onModelSaved: Event = this._onModelSaved.event; private readonly _onModelReverted: Emitter = this._register(new Emitter()); - get onModelReverted(): Event { return this._onModelReverted.event; } + readonly onModelReverted: Event = this._onModelReverted.event; private readonly _onModelEncodingChanged: Emitter = this._register(new Emitter()); - get onModelEncodingChanged(): Event { return this._onModelEncodingChanged.event; } + readonly onModelEncodingChanged: Event = this._onModelEncodingChanged.event; private readonly _onModelOrphanedChanged: Emitter = this._register(new Emitter()); - get onModelOrphanedChanged(): Event { return this._onModelOrphanedChanged.event; } + readonly onModelOrphanedChanged: Event = this._onModelOrphanedChanged.event; private _onModelsDirtyEvent: Event; private _onModelsSaveError: Event; diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 34ac606235f..33870009b83 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -49,13 +49,13 @@ export abstract class TextFileService extends Disposable implements ITextFileSer _serviceBrand: ServiceIdentifier; private readonly _onAutoSaveConfigurationChange: Emitter = this._register(new Emitter()); - get onAutoSaveConfigurationChange(): Event { return this._onAutoSaveConfigurationChange.event; } + readonly onAutoSaveConfigurationChange: Event = this._onAutoSaveConfigurationChange.event; private readonly _onFilesAssociationChange: Emitter = this._register(new Emitter()); - get onFilesAssociationChange(): Event { return this._onFilesAssociationChange.event; } + readonly onFilesAssociationChange: Event = this._onFilesAssociationChange.event; private readonly _onWillMove = this._register(new Emitter()); - get onWillMove(): Event { return this._onWillMove.event; } + readonly onWillMove: Event = this._onWillMove.event; private _models: TextFileEditorModelManager; get models(): ITextFileEditorModelManager { return this._models; } diff --git a/src/vs/workbench/services/themes/common/colorThemeStore.ts b/src/vs/workbench/services/themes/common/colorThemeStore.ts index a803474e606..272338755fc 100644 --- a/src/vs/workbench/services/themes/common/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/common/colorThemeStore.ts @@ -53,17 +53,15 @@ export interface ColorThemeChangeEvent { export class ColorThemeStore { private extensionsColorThemes: ColorThemeData[]; - private readonly onDidChangeEmitter: Emitter; - public get onDidChange(): Event { return this.onDidChangeEmitter.event; } + private readonly onDidChangeEmitter = new Emitter(); + public readonly onDidChange: Event = this.onDidChangeEmitter.event; constructor(@IExtensionService private readonly extensionService: IExtensionService, defaultTheme: ColorThemeData) { this.extensionsColorThemes = [defaultTheme]; - this.onDidChangeEmitter = new Emitter(); this.initialize(); } - private initialize() { themesExtPoint.setHandler((extensions, delta) => { const previousIds: { [key: string]: boolean } = {}; diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index 5996ee18648..ad0498407ff 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -118,16 +118,16 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor private mapResourceToAssociatedFilePath = new ResourceMap(); private readonly _onDidChangeContent: Emitter = this._register(new Emitter()); - get onDidChangeContent(): Event { return this._onDidChangeContent.event; } + readonly onDidChangeContent: Event = this._onDidChangeContent.event; private readonly _onDidChangeDirty: Emitter = this._register(new Emitter()); - get onDidChangeDirty(): Event { return this._onDidChangeDirty.event; } + readonly onDidChangeDirty: Event = this._onDidChangeDirty.event; private readonly _onDidChangeEncoding: Emitter = this._register(new Emitter()); - get onDidChangeEncoding(): Event { return this._onDidChangeEncoding.event; } + readonly onDidChangeEncoding: Event = this._onDidChangeEncoding.event; private readonly _onDidDisposeModel: Emitter = this._register(new Emitter()); - get onDidDisposeModel(): Event { return this._onDidDisposeModel.event; } + readonly onDidDisposeModel: Event = this._onDidDisposeModel.event; constructor( @IInstantiationService private readonly instantiationService: IInstantiationService, From 57f3bc13cbfce31c28c5db8d9aea485c6e7537e9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 16:19:58 -0700 Subject: [PATCH 052/190] Use enum to track force open mode --- .../files/common/editors/fileEditorInput.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index c9d15e680c1..2d25923a2c2 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -19,6 +19,12 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/contrib/files/common/files'; import { ILabelService } from 'vs/platform/label/common/label'; +const enum ForceOpenAs { + None, + Text, + Binary +} + /** * A file editor input is the input type for the file editor of file system resources. */ @@ -26,8 +32,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { private preferredEncoding: string; private preferredMode: string; - private forceOpenAsBinary: boolean; - private forceOpenAsText: boolean; + private forceOpenAs: ForceOpenAs = ForceOpenAs.None; private textModelReference: Promise> | null; private name: string; @@ -107,7 +112,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { setPreferredEncoding(encoding: string): void { this.preferredEncoding = encoding; - this.forceOpenAsText = true; // encoding is a good hint to open the file as text + this.forceOpenAs = ForceOpenAs.Text; // encoding is a good hint to open the file as text } getPreferredMode(): string | undefined { @@ -125,17 +130,15 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { setPreferredMode(mode: string): void { this.preferredMode = mode; - this.forceOpenAsText = true; // mode is a good hint to open the file as text + this.forceOpenAs = ForceOpenAs.Text; // mode is a good hint to open the file as text } setForceOpenAsText(): void { - this.forceOpenAsText = true; - this.forceOpenAsBinary = false; + this.forceOpenAs = ForceOpenAs.Text; } setForceOpenAsBinary(): void { - this.forceOpenAsBinary = true; - this.forceOpenAsText = false; + this.forceOpenAs = ForceOpenAs.Binary; } getTypeId(): string { @@ -256,13 +259,13 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { } getPreferredEditorId(candidates: string[]): string { - return this.forceOpenAsBinary ? BINARY_FILE_EDITOR_ID : TEXT_FILE_EDITOR_ID; + return this.forceOpenAs === ForceOpenAs.Binary ? BINARY_FILE_EDITOR_ID : TEXT_FILE_EDITOR_ID; } resolve(): Promise { // Resolve as binary - if (this.forceOpenAsBinary) { + if (this.forceOpenAs === ForceOpenAs.Binary) { return this.doResolveAsBinary(); } @@ -278,7 +281,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { mode: this.preferredMode, encoding: this.preferredEncoding, reload: { async: true }, // trigger a reload of the model if it exists already but do not wait to show the model - allowBinary: this.forceOpenAsText, + allowBinary: this.forceOpenAs === ForceOpenAs.Text, reason: LoadReason.EDITOR }); From c975752a85031eef6c40b03221c8625cfb50be00 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 15 Jul 2019 17:30:29 -0700 Subject: [PATCH 053/190] fixes #77430 --- src/vs/base/browser/ui/dialog/dialog.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vs/base/browser/ui/dialog/dialog.ts b/src/vs/base/browser/ui/dialog/dialog.ts index a33545b641e..2e95c5955ac 100644 --- a/src/vs/base/browser/ui/dialog/dialog.ts +++ b/src/vs/base/browser/ui/dialog/dialog.ts @@ -99,6 +99,14 @@ export class Dialog extends Disposable { let focusedButton = 0; const buttonGroup = this.buttonGroup = new ButtonGroup(this.buttonsContainer, this.buttons.length, { title: true }); const buttonMap = this.rearrangeButtons(this.buttons, this.options.cancelId); + + // Set focused button to UI index + buttonMap.forEach((value, index) => { + if (value.index === 0) { + focusedButton = index; + } + }); + buttonGroup.buttons.forEach((button, index) => { button.label = mnemonicButtonLabel(buttonMap[index].label, true); @@ -190,11 +198,7 @@ export class Dialog extends Disposable { show(this.element); // Focus first element - buttonMap.forEach((value, index) => { - if (value.index === focusedButton) { - buttonGroup.buttons[index].focus(); - } - }); + buttonGroup.buttons[focusedButton].focus(); }); } From 7bce874d1bc823a2c871eb8e819669802afb129e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 17:25:17 -0700 Subject: [PATCH 054/190] Mark fields private --- .../contrib/webview/browser/webviewEditor.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index 889766333d3..ba0782158e4 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -24,8 +24,8 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic export class WebviewEditor extends BaseEditor { - protected _webview: Webview | undefined; - protected findWidgetVisible: IContextKey; + private _webview: Webview | undefined; + private _findWidgetVisible: IContextKey; public static readonly ID = 'WebviewEditor'; @@ -39,7 +39,7 @@ export class WebviewEditor extends BaseEditor { private readonly _onDidFocusWebview = this._register(new Emitter()); public readonly onDidFocus: Event = this._onDidFocusWebview.event; - private pendingMessages: any[] = []; + private _pendingMessages: any[] = []; constructor( @ITelemetryService telemetryService: ITelemetryService, @@ -53,7 +53,7 @@ export class WebviewEditor extends BaseEditor { ) { super(WebviewEditor.ID, telemetryService, themeService, storageService); if (_contextKeyService) { - this.findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(_contextKeyService); + this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(_contextKeyService); } } @@ -78,7 +78,7 @@ export class WebviewEditor extends BaseEditor { } public dispose(): void { - this.pendingMessages = []; + this._pendingMessages = []; // Let the editor input dispose of the webview. this._webview = undefined; @@ -96,18 +96,18 @@ export class WebviewEditor extends BaseEditor { if (this._webview) { this._webview.sendMessage(data); } else { - this.pendingMessages.push(data); + this._pendingMessages.push(data); } } public showFind() { if (this._webview) { this._webview.showFind(); - this.findWidgetVisible.set(true); + this._findWidgetVisible.set(true); } } public hideFind() { - this.findWidgetVisible.reset(); + this._findWidgetVisible.reset(); if (this._webview) { this._webview.hideFind(); } @@ -178,7 +178,7 @@ export class WebviewEditor extends BaseEditor { this._webview = undefined; this._webviewContent = undefined; - this.pendingMessages = []; + this._pendingMessages = []; super.clearInput(); } @@ -189,7 +189,7 @@ export class WebviewEditor extends BaseEditor { this._webview = undefined; this._webviewContent = undefined; } - this.pendingMessages = []; + this._pendingMessages = []; return super.setInput(input, options, token) .then(() => input.resolve()) .then(() => { @@ -240,7 +240,7 @@ export class WebviewEditor extends BaseEditor { } else { if (input.options.enableFindWidget) { this._contextKeyService = this._register(this._contextKeyService.createScoped(this._webviewContent)); - this.findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); + this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); } this._webview = this._webviewService.createWebview(input.id, @@ -263,10 +263,10 @@ export class WebviewEditor extends BaseEditor { this.doUpdateContainer(); } - for (const message of this.pendingMessages) { + for (const message of this._pendingMessages) { this._webview.sendMessage(message); } - this.pendingMessages = []; + this._pendingMessages = []; this.trackFocus(); From 6eab67ec20375b4b68293d91c64048205c535367 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 17:40:22 -0700 Subject: [PATCH 055/190] Fix webview focus event --- src/vs/workbench/contrib/webview/browser/webviewEditor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index ba0782158e4..b128f150afb 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -24,11 +24,11 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic export class WebviewEditor extends BaseEditor { + public static readonly ID = 'WebviewEditor'; + private _webview: Webview | undefined; private _findWidgetVisible: IContextKey; - public static readonly ID = 'WebviewEditor'; - private _editorFrame: HTMLElement; private _content?: HTMLElement; private _webviewContent: HTMLElement | undefined; @@ -37,7 +37,7 @@ export class WebviewEditor extends BaseEditor { private readonly _onFocusWindowHandler = this._register(new MutableDisposable()); private readonly _onDidFocusWebview = this._register(new Emitter()); - public readonly onDidFocus: Event = this._onDidFocusWebview.event; + public get onDidFocus(): Event { return this._onDidFocusWebview.event; } private _pendingMessages: any[] = []; From a7bc93f0be95fa7b3c21505ecd957bdb6ba7bd5c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 18:01:54 -0700 Subject: [PATCH 056/190] Remove overload for registerEditor The non-array version of `registerEditor` was only being used in tests --- src/vs/workbench/browser/editor.ts | 13 +++---------- .../editor/test/browser/editorGroupsService.test.ts | 2 +- .../editor/test/browser/editorService.test.ts | 2 +- .../test/browser/parts/editor/baseEditor.test.ts | 8 ++++---- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index 1f31ed7eafd..41d46524d9a 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -8,7 +8,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { Registry } from 'vs/platform/registry/common/platform'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IConstructorSignature0, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { asArray } from 'vs/base/common/arrays'; export interface IEditorDescriptor { instantiate(instantiationService: IInstantiationService): BaseEditor; @@ -27,11 +26,10 @@ export interface IEditorRegistry { * input, the input itself will be asked which editor it prefers if this method is provided. Otherwise * the first editor in the list will be returned. * - * @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the + * @param inputDescriptors A set of constructor functions that returns an instance of EditorInput for which the * registered editor should be used for. */ - registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor): void; - registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; + registerEditor(descriptor: IEditorDescriptor, inputDescriptors: readonly SyncDescriptor[]): void; /** * Returns the editor descriptor for the given input or `undefined` if none. @@ -83,12 +81,7 @@ class EditorRegistry implements IEditorRegistry { private editors: EditorDescriptor[] = []; private readonly mapEditorToInputs = new Map[]>(); - registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor): void; - registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; - registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor | SyncDescriptor[]): void { - - const inputDescriptors: SyncDescriptor[] = asArray(editorInputDescriptor); - + registerEditor(descriptor: EditorDescriptor, inputDescriptors: readonly SyncDescriptor[]): void { // Register (Support multiple Editors per Input) this.mapEditorToInputs.set(descriptor, inputDescriptors); diff --git a/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts b/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts index 28720257840..b577d40f181 100644 --- a/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts @@ -80,7 +80,7 @@ suite('EditorGroupsService', () => { } (Registry.as(EditorExtensions.EditorInputFactories)).registerEditorInputFactory('testEditorInputForGroupsService', TestEditorInputFactory); - (Registry.as(Extensions.Editors)).registerEditor(new EditorDescriptor(TestEditorControl, 'MyTestEditorForGroupsService', 'My Test File Editor'), new SyncDescriptor(TestEditorInput)); + (Registry.as(Extensions.Editors)).registerEditor(new EditorDescriptor(TestEditorControl, 'MyTestEditorForGroupsService', 'My Test File Editor'), [new SyncDescriptor(TestEditorInput)]); } registerTestEditorInput(); diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 81cbc839a9b..913a95d4aa1 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -83,7 +83,7 @@ class FileServiceProvider extends Disposable { suite('EditorService', () => { function registerTestEditorInput(): void { - Registry.as(Extensions.Editors).registerEditor(new EditorDescriptor(TestEditorControl, 'MyTestEditorForEditorService', 'My Test Editor For Next Editor Service'), new SyncDescriptor(TestEditorInput)); + Registry.as(Extensions.Editors).registerEditor(new EditorDescriptor(TestEditorControl, 'MyTestEditorForEditorService', 'My Test Editor For Next Editor Service'), [new SyncDescriptor(TestEditorInput)]); } registerTestEditorInput(); diff --git a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts index c1ab20f2573..5b5fa096f9d 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -127,7 +127,7 @@ suite('Workbench base editor', () => { let oldEditorsCnt = EditorRegistry.getEditors().length; let oldInputCnt = (EditorRegistry).getEditorInputs().length; - EditorRegistry.registerEditor(d1, new SyncDescriptor(MyInput)); + EditorRegistry.registerEditor(d1, [new SyncDescriptor(MyInput)]); EditorRegistry.registerEditor(d2, [new SyncDescriptor(MyInput), new SyncDescriptor(MyOtherInput)]); assert.equal(EditorRegistry.getEditors().length, oldEditorsCnt + 2); @@ -148,8 +148,8 @@ suite('Workbench base editor', () => { let oldEditors = EditorRegistry.getEditors(); (EditorRegistry).setEditors([]); - EditorRegistry.registerEditor(d2, new SyncDescriptor(ResourceEditorInput)); - EditorRegistry.registerEditor(d1, new SyncDescriptor(MyResourceInput)); + EditorRegistry.registerEditor(d2, [new SyncDescriptor(ResourceEditorInput)]); + EditorRegistry.registerEditor(d1, [new SyncDescriptor(MyResourceInput)]); let inst = new TestInstantiationService(); @@ -168,7 +168,7 @@ suite('Workbench base editor', () => { let oldEditors = EditorRegistry.getEditors(); (EditorRegistry).setEditors([]); - EditorRegistry.registerEditor(d1, new SyncDescriptor(ResourceEditorInput)); + EditorRegistry.registerEditor(d1, [new SyncDescriptor(ResourceEditorInput)]); let inst = new TestInstantiationService(); From 606f487fa4c0c6ef3ba9cf106672ca6c679ec8b3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 18:04:11 -0700 Subject: [PATCH 057/190] Fix comments --- src/vs/workbench/browser/editor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index 41d46524d9a..e4add229a83 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -26,7 +26,7 @@ export interface IEditorRegistry { * input, the input itself will be asked which editor it prefers if this method is provided. Otherwise * the first editor in the list will be returned. * - * @param inputDescriptors A set of constructor functions that returns an instance of EditorInput for which the + * @param inputDescriptors A set of constructor functions that return an instance of EditorInput for which the * registered editor should be used for. */ registerEditor(descriptor: IEditorDescriptor, inputDescriptors: readonly SyncDescriptor[]): void; @@ -37,7 +37,7 @@ export interface IEditorRegistry { getEditor(input: EditorInput): IEditorDescriptor | undefined; /** - * Returns the editor descriptor for the given identifier or null if none. + * Returns the editor descriptor for the given identifier or `undefined` if none. */ getEditorById(editorId: string): IEditorDescriptor | undefined; From 02fdb59938f1b52a193e27f5518e40f8d3bdd4fa Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 15 Jul 2019 18:12:55 -0700 Subject: [PATCH 058/190] Make sure we set emitter before getting event --- src/vs/workbench/contrib/terminal/browser/terminalTab.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts index a984ba56232..20259f39e08 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts @@ -222,9 +222,9 @@ export class TerminalTab extends Disposable implements ITerminalTab { public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; } - private readonly _onDisposed: Emitter; + private readonly _onDisposed: Emitter = new Emitter(); public readonly onDisposed: Event = this._onDisposed.event; - private readonly _onInstancesChanged: Emitter; + private readonly _onInstancesChanged: Emitter = new Emitter(); public readonly onInstancesChanged: Event = this._onInstancesChanged.event; constructor( @@ -237,8 +237,6 @@ export class TerminalTab extends Disposable implements ITerminalTab { @IInstantiationService private readonly _instantiationService: IInstantiationService ) { super(); - this._onDisposed = new Emitter(); - this._onInstancesChanged = new Emitter(); let instance: ITerminalInstance; if ('id' in shellLaunchConfigOrInstance) { From 8e0f348413f4f616c23a88ae30030efa85811973 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 16 Jul 2019 01:35:01 +0000 Subject: [PATCH 059/190] fixes #67212 --- src/vs/workbench/browser/layout.ts | 35 ++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index a70593c4390..20b51a70e76 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -53,6 +53,7 @@ enum Storage { PANEL_HIDDEN = 'workbench.panel.hidden', PANEL_POSITION = 'workbench.panel.location', + PANEL_SIZE_BEFORE_MAXIMIZED = 'workbench.panel.sizeBeforeMaximized', ZEN_MODE_ENABLED = 'workbench.zenmode.active', CENTERED_LAYOUT_ENABLED = 'workbench.centerededitorlayout.active', @@ -141,6 +142,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi panel: { hidden: false, + sizeBeforeMaximize: 0, position: Position.BOTTOM, height: 350, width: 350, @@ -397,6 +399,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } } + // Panel size before maximized + this.state.panel.sizeBeforeMaximize = this.storageService.getNumber(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, StorageScope.GLOBAL, 0); + // Statusbar visibility this.state.statusBar.hidden = !this.configurationService.getValue(Settings.STATUSBAR_VISIBLE); @@ -1069,7 +1074,28 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi toggleMaximizedPanel(): void { if (this.workbenchGrid instanceof Grid) { - this.workbenchGrid.maximizeViewSize(this.panelPartView); + const curSize = this.workbenchGrid.getViewSize2(this.panelPartView); + const size = { ...curSize }; + + if (!this.isPanelMaximized()) { + if (this.state.panel.position === Position.BOTTOM) { + size.height = this.panelPartView.maximumHeight; + this.state.panel.sizeBeforeMaximize = curSize.height; + } else { + size.width = this.panelPartView.maximumWidth; + this.state.panel.sizeBeforeMaximize = curSize.width; + } + + this.storageService.store(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, this.state.panel.sizeBeforeMaximize, StorageScope.GLOBAL); + } else { + if (this.state.panel.position === Position.BOTTOM) { + size.height = this.state.panel.sizeBeforeMaximize; + } else { + size.width = this.state.panel.sizeBeforeMaximize; + } + } + + this.workbenchGrid.resizeView(this.panelPartView, size); } else { this.workbenchGrid.layout({ toggleMaximizedPanel: true, source: Parts.PANEL_PART }); } @@ -1078,7 +1104,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi isPanelMaximized(): boolean { if (this.workbenchGrid instanceof Grid) { try { - return this.workbenchGrid.getViewSize2(this.panelPartView).height === this.getPart(Parts.PANEL_PART).maximumHeight; + // The panel is maximum when the editor is minimum + if (this.state.panel.position === Position.BOTTOM) { + return this.workbenchGrid.getViewSize2(this.editorPartView).height <= this.editorPartView.minimumHeight; + } else { + return this.workbenchGrid.getViewSize2(this.editorPartView).width <= this.editorPartView.minimumWidth; + } } catch (e) { return false; } From c64f42b841427e72e8c1bc82cd6cb266064669eb Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 16 Jul 2019 08:14:12 +0200 Subject: [PATCH 060/190] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 46ab96c10c0..46667dd4119 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "d679b3a96ff63c9a5bdf13c8da3659810fbc2a2d", + "distro": "18f781db7cf104b1156ee97a29d4938296ea4616", "author": { "name": "Microsoft Corporation" }, From 08b3fd579751373b7438ddd5e870f6d97b88470f Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Tue, 16 Jul 2019 11:51:09 +0530 Subject: [PATCH 061/190] Changed Filer to File Match only --- .../workbench/contrib/search/browser/search.contribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index cc180c7f64c..49878f159b1 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -50,7 +50,7 @@ import { registerContributions as searchWidgetContributions } from 'vs/workbench import * as Constants from 'vs/workbench/contrib/search/common/constants'; import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search'; import { ISearchHistoryService, SearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService'; -import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService, FileMatch, FolderMatch } from 'vs/workbench/contrib/search/common/searchModel'; +import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService, FileMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_CONTAINER, VIEW_ID } from 'vs/workbench/services/search/common/search'; @@ -215,7 +215,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ CommandsRegistry.registerCommand({ id: Constants.RevealInSideBarForSearchResults, - handler: (accessor, fileMatch: FileMatch | FolderMatch) => { + handler: (accessor, fileMatch: FileMatch) => { const viewletService = accessor.get(IViewletService); const explorerService = accessor.get(IExplorerService); const contextService = accessor.get(IWorkspaceContextService); @@ -240,7 +240,7 @@ const RevealInSideBarForSearchResultsCommand: ICommandAction = { MenuRegistry.appendMenuItem(MenuId.SearchContext, { command: RevealInSideBarForSearchResultsCommand, - when: ContextKeyExpr.and(Constants.FileMatchOrFolderMatchFocusKey, Constants.HasSearchResults), + when: ContextKeyExpr.and(Constants.FileFocusKey, Constants.HasSearchResults), group: '2_files', }); From 57aca202fae8449161cf739cd9bf5e15199ebb7e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 16 Jul 2019 08:39:12 +0200 Subject: [PATCH 062/190] splitview: fix resize priority in distributeEmptySpace --- src/vs/base/browser/ui/splitview/splitview.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 9584ce7d4ae..78f46feb865 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -736,6 +736,16 @@ export class SplitView extends Disposable { let emptyDelta = this.size - contentSize; const indexes = range(this.viewItems.length - 1, -1); + const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low); + const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High); + + for (const index of highPriorityIndexes) { + pushToStart(indexes, index); + } + + for (const index of lowPriorityIndexes) { + pushToEnd(indexes, index); + } if (typeof lowPriorityIndex === 'number') { pushToEnd(indexes, lowPriorityIndex); From d90c3e2c60a64df83869b8ee996d35dfa0c46b38 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 16 Jul 2019 08:48:08 +0200 Subject: [PATCH 063/190] missing event wiring fixes #67210 --- src/vs/base/browser/ui/centered/centeredViewLayout.ts | 3 ++- src/vs/workbench/browser/part.ts | 5 +++-- src/vs/workbench/browser/parts/editor/editorPart.ts | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/centered/centeredViewLayout.ts b/src/vs/base/browser/ui/centered/centeredViewLayout.ts index ff349b87bd4..b40384018f1 100644 --- a/src/vs/base/browser/ui/centered/centeredViewLayout.ts +++ b/src/vs/base/browser/ui/centered/centeredViewLayout.ts @@ -6,7 +6,7 @@ import { SplitView, Orientation, ISplitViewStyles, IView as ISplitViewView } from 'vs/base/browser/ui/splitview/splitview'; import { $ } from 'vs/base/browser/dom'; import { Event } from 'vs/base/common/event'; -import { IView } from 'vs/base/browser/ui/grid/gridview'; +import { IView, IViewSize } from 'vs/base/browser/ui/grid/gridview'; import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; @@ -68,6 +68,7 @@ export class CenteredViewLayout implements IDisposable { get maximumWidth(): number { return this.splitView ? this.splitView.maximumSize : this.view.maximumWidth; } get minimumHeight(): number { return this.view.minimumHeight; } get maximumHeight(): number { return this.view.maximumHeight; } + get onDidChange(): Event { return this.view.onDidChange; } layout(width: number, height: number): void { this.width = width; diff --git a/src/vs/workbench/browser/part.ts b/src/vs/workbench/browser/part.ts index 3822e23e4ea..f80e4545957 100644 --- a/src/vs/workbench/browser/part.ts +++ b/src/vs/workbench/browser/part.ts @@ -12,6 +12,7 @@ import { IDimension } from 'vs/platform/layout/browser/layoutService'; import { ISerializableView, Orientation } from 'vs/base/browser/ui/grid/grid'; import { Event, Emitter } from 'vs/base/common/event'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; +import { IViewSize } from 'vs/base/browser/ui/grid/gridview'; export interface IPartOptions { hasTitle?: boolean; @@ -117,8 +118,8 @@ export abstract class Part extends Component implements ISerializableView { //#region ISerializableView - private _onDidChange = this._register(new Emitter<{ width: number; height: number; }>()); - get onDidChange(): Event<{ width: number, height: number }> { return this._onDidChange.event; } + private _onDidChange = this._register(new Emitter()); + get onDidChange(): Event { return this._onDidChange.event; } element: HTMLElement; diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index dc894921aaa..b7872b6731e 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -27,7 +27,7 @@ import { EditorDropTarget } from 'vs/workbench/browser/parts/editor/editorDropTa import { localize } from 'vs/nls'; import { Color } from 'vs/base/common/color'; import { CenteredViewLayout } from 'vs/base/browser/ui/centered/centeredViewLayout'; -import { IView, orthogonal, LayoutPriority } from 'vs/base/browser/ui/grid/gridview'; +import { IView, orthogonal, LayoutPriority, IViewSize } from 'vs/base/browser/ui/grid/gridview'; import { onUnexpectedError } from 'vs/base/common/errors'; import { Parts, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; @@ -756,13 +756,14 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro //#region Part - readonly priority: LayoutPriority = LayoutPriority.High; - get minimumWidth(): number { return this.centeredLayoutWidget.minimumWidth; } get maximumWidth(): number { return this.centeredLayoutWidget.maximumWidth; } get minimumHeight(): number { return this.centeredLayoutWidget.minimumHeight; } get maximumHeight(): number { return this.centeredLayoutWidget.maximumHeight; } + get onDidChange(): Event { return this.centeredLayoutWidget.onDidChange; } + readonly priority: LayoutPriority = LayoutPriority.High; + get preferredSize(): Dimension { if (!this._preferredSize) { this._preferredSize = new Dimension(this.gridWidget.minimumWidth, this.gridWidget.minimumHeight); From 8580cf0edbfcf70cdb4e6ae4b0c7e9fd26451269 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 16 Jul 2019 09:16:17 +0200 Subject: [PATCH 064/190] cleanup TODO --- src/vs/base/browser/ui/grid/grid.ts | 6 ------ src/vs/workbench/browser/layout.ts | 6 +++--- src/vs/workbench/browser/parts/editor/editorPart.ts | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 3a22b6b825f..0fc6d389e81 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -300,12 +300,6 @@ export class Grid extends Disposable { return this.gridview.getViewSize(location); } - // TODO@joao cleanup - getViewSize2(view: T): { width: number; height: number; } { - const location = this.getViewLocation(view); - return this.gridview.getViewSize(location); - } - maximizeViewSize(view: T): void { const location = this.getViewLocation(view); this.gridview.maximizeViewSize(location); diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 20b51a70e76..1b23d3a42e3 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -1074,7 +1074,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi toggleMaximizedPanel(): void { if (this.workbenchGrid instanceof Grid) { - const curSize = this.workbenchGrid.getViewSize2(this.panelPartView); + const curSize = this.workbenchGrid.getViewSize(this.panelPartView); const size = { ...curSize }; if (!this.isPanelMaximized()) { @@ -1106,9 +1106,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi try { // The panel is maximum when the editor is minimum if (this.state.panel.position === Position.BOTTOM) { - return this.workbenchGrid.getViewSize2(this.editorPartView).height <= this.editorPartView.minimumHeight; + return this.workbenchGrid.getViewSize(this.editorPartView).height <= this.editorPartView.minimumHeight; } else { - return this.workbenchGrid.getViewSize2(this.editorPartView).width <= this.editorPartView.minimumWidth; + return this.workbenchGrid.getViewSize(this.editorPartView).width <= this.editorPartView.minimumWidth; } } catch (e) { return false; diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index b7872b6731e..a42cf0aed2f 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -564,7 +564,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro // Maximize the group if it is currently minimized if (this.gridWidget) { - const viewSize = this.gridWidget.getViewSize2(group); + const viewSize = this.gridWidget.getViewSize(group); if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) { this.arrangeGroups(GroupsArrangement.MINIMIZE_OTHERS); } From eb265bbd466206515b0dfe8930bd92b9acec5a14 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 16 Jul 2019 11:52:51 +0200 Subject: [PATCH 065/190] Adopt latest istanbul for coverage information --- package.json | 9 +- test/all.js | 111 +-------- test/coverage.js | 86 +++++++ test/electron/renderer.js | 74 +----- yarn.lock | 499 +++++++++++++++++--------------------- 5 files changed, 325 insertions(+), 454 deletions(-) create mode 100644 test/coverage.js diff --git a/package.json b/package.json index 46667dd4119..c27f0802eeb 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,11 @@ "husky": "^0.13.1", "innosetup": "5.6.1", "is": "^3.1.0", - "istanbul": "^0.3.17", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.6", "jsdom-no-contextify": "^3.1.0", "lazy.js": "^0.4.2", "merge-options": "^1.0.1", @@ -122,7 +126,6 @@ "pump": "^1.0.1", "queue": "3.0.6", "rcedit": "^1.1.0", - "remap-istanbul": "^0.13.0", "rimraf": "^2.2.8", "sinon": "^1.17.2", "source-map": "^0.4.4", @@ -155,4 +158,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.4" } -} \ No newline at end of file +} diff --git a/test/all.js b/test/all.js index 350e8606800..834d63250bb 100644 --- a/test/all.js +++ b/test/all.js @@ -6,16 +6,12 @@ /*eslint-env mocha*/ /*global define,run*/ -var assert = require('assert'); -var path = require('path'); -var glob = require('glob'); -var istanbul = require('istanbul'); -var i_remap = require('remap-istanbul/lib/remap'); -var jsdom = require('jsdom-no-contextify'); -var minimatch = require('minimatch'); -var fs = require('fs'); -var vm = require('vm'); -var TEST_GLOB = '**/test/**/*.test.js'; +const assert = require('assert'); +const path = require('path'); +const glob = require('glob'); +const jsdom = require('jsdom-no-contextify'); +const TEST_GLOB = '**/test/**/*.test.js'; +const coverage = require('./coverage'); var optimist = require('optimist') .usage('Run the Code tests. All mocha options apply.') @@ -23,7 +19,6 @@ var optimist = require('optimist') .describe('run', 'Run a single file').string('run') .describe('coverage', 'Generate a coverage report').boolean('coverage') .describe('only-monaco-editor', 'Run only monaco editor tests').boolean('only-monaco-editor') - .describe('forceLoad', 'Force loading').boolean('forceLoad') .describe('browser', 'Run tests in a browser').boolean('browser') .alias('h', 'help').boolean('h') .describe('h', 'Show help'); @@ -58,103 +53,13 @@ function main() { }; if (argv.coverage) { - var instrumenter = new istanbul.Instrumenter(); - - var seenSources = {}; - - loaderConfig.nodeInstrumenter = function (contents, source) { - seenSources[source] = true; - - if (minimatch(source, TEST_GLOB)) { - return contents; - } - - return instrumenter.instrumentSync(contents, source); - }; + coverage.initialize(loaderConfig); process.on('exit', function (code) { if (code !== 0) { return; } - - if (argv.forceLoad) { - var allFiles = glob.sync(out + '/vs/**/*.js'); - allFiles = allFiles.map(function (source) { - return path.join(__dirname, '..', source); - }); - allFiles = allFiles.filter(function (source) { - if (seenSources[source]) { - return false; - } - if (minimatch(source, TEST_GLOB)) { - return false; - } - if (/fixtures/.test(source)) { - return false; - } - return true; - }); - allFiles.forEach(function (source, index) { - var contents = fs.readFileSync(source).toString(); - contents = instrumenter.instrumentSync(contents, source); - var stopAt = contents.indexOf('}\n__cov'); - stopAt = contents.indexOf('}\n__cov', stopAt + 1); - - var str = '(function() {' + contents.substr(0, stopAt + 1) + '});'; - var r = vm.runInThisContext(str, source); - r.call(global); - }); - } - - let remapIgnores = /\b((marked)|(raw\.marked)|(nls)|(css))\.js$/; - - var remappedCoverage = i_remap(global.__coverage__, { exclude: remapIgnores }).getFinalCoverage(); - - // The remapped coverage comes out with broken paths - var toUpperDriveLetter = function (str) { - if (/^[a-z]:/.test(str)) { - return str.charAt(0).toUpperCase() + str.substr(1); - } - return str; - }; - var toLowerDriveLetter = function (str) { - if (/^[A-Z]:/.test(str)) { - return str.charAt(0).toLowerCase() + str.substr(1); - } - return str; - }; - - var REPO_PATH = toUpperDriveLetter(path.join(__dirname, '..')); - var fixPath = function (brokenPath) { - var startIndex = brokenPath.indexOf(REPO_PATH); - if (startIndex === -1) { - return toLowerDriveLetter(brokenPath); - } - return toLowerDriveLetter(brokenPath.substr(startIndex)); - }; - - var finalCoverage = {}; - for (var entryKey in remappedCoverage) { - var entry = remappedCoverage[entryKey]; - entry.path = fixPath(entry.path); - finalCoverage[fixPath(entryKey)] = entry; - } - - var collector = new istanbul.Collector(); - collector.add(finalCoverage); - - var coveragePath = path.join(path.dirname(__dirname), '.build', 'coverage'); - var reportTypes = []; - if (argv.run || argv.runGlob) { - // single file running - coveragePath += '-single'; - reportTypes = ['lcovonly']; - } else { - reportTypes = ['json', 'lcov', 'html']; - } - var reporter = new istanbul.Reporter(null, coveragePath); - reporter.addAll(reportTypes); - reporter.write(collector, true, function () { }); + coverage.createReport(argv.run || argv.runGlob); }); } diff --git a/test/coverage.js b/test/coverage.js new file mode 100644 index 00000000000..bf7e7aa3f95 --- /dev/null +++ b/test/coverage.js @@ -0,0 +1,86 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const minimatch = require('minimatch'); +const fs = require('fs'); +const path = require('path'); +const iLibInstrument = require('istanbul-lib-instrument'); +const iLibCoverage = require('istanbul-lib-coverage'); +const iLibSourceMaps = require('istanbul-lib-source-maps'); +const iLibReport = require('istanbul-lib-report'); +const iReports = require('istanbul-reports'); + +const REPO_PATH = toUpperDriveLetter(path.join(__dirname, '..')); + +exports.initialize = function (loaderConfig) { + const instrumenter = iLibInstrument.createInstrumenter(); + loaderConfig.nodeInstrumenter = function (contents, source) { + if (minimatch(source, '**/test/**/*.test.js')) { + // tests don't get instrumented + return contents; + } + // Try to find a .map file + let map = null; + try { + map = JSON.parse(fs.readFileSync(`${source}.map`).toString()); + } catch (err) { + // missing source map... + } + return instrumenter.instrumentSync(contents, source, map); + }; +}; + +exports.createReport = function (isSingle) { + const mapStore = iLibSourceMaps.createSourceMapStore(); + const coverageMap = iLibCoverage.createCoverageMap(global.__coverage__); + const transformed = mapStore.transformCoverage(coverageMap); + + // Paths come out all broken + let newData = Object.create(null); + Object.keys(transformed.map.data).forEach((file) => { + const entry = transformed.map.data[file]; + const fixedPath = fixPath(entry.path); + entry.data.path = fixedPath; + newData[fixedPath] = entry; + }); + transformed.map.data = newData; + + const tree = iLibReport.summarizers.flat(transformed.map); + const context = iLibReport.createContext({ + dir: path.join(__dirname, `../.build/coverage${isSingle ? '-single' : ''}`) + }); + + let reports = []; + if (isSingle) { + reports.push(iReports.create('lcovonly')); + } else { + reports.push(iReports.create('json')); + reports.push(iReports.create('lcov')); + reports.push(iReports.create('html')); + } + reports.forEach(report => tree.visit(report, context)); +}; + +function toUpperDriveLetter(str) { + if (/^[a-z]:/.test(str)) { + return str.charAt(0).toUpperCase() + str.substr(1); + } + return str; +} + +function toLowerDriveLetter(str) { + if (/^[A-Z]:/.test(str)) { + return str.charAt(0).toLowerCase() + str.substr(1); + } + return str; +} + +function fixPath(brokenPath) { + const startIndex = brokenPath.lastIndexOf(REPO_PATH); + if (startIndex === -1) { + return toLowerDriveLetter(brokenPath); + } + return toLowerDriveLetter(brokenPath.substr(startIndex)); +} diff --git a/test/electron/renderer.js b/test/electron/renderer.js index 4d5a7f0f1ee..36668cd53b3 100644 --- a/test/electron/renderer.js +++ b/test/electron/renderer.js @@ -9,11 +9,9 @@ const { ipcRenderer } = require('electron'); const assert = require('assert'); const path = require('path'); const glob = require('glob'); -const minimatch = require('minimatch'); -const istanbul = require('istanbul'); -const i_remap = require('remap-istanbul/lib/remap'); const util = require('util'); const bootstrap = require('../../src/bootstrap'); +const coverage = require('../coverage'); // Disabled custom inspect. See #38847 if (util.inspect && util.inspect['defaultOptions']) { @@ -42,77 +40,19 @@ function initLoader(opts) { } }; - // nodeInstrumenter when coverage is requested if (opts.coverage) { - const instrumenter = new istanbul.Instrumenter(); - - loaderConfig.nodeInstrumenter = function (contents, source) { - return minimatch(source, _tests_glob) - ? contents // don't instrument tests itself - : instrumenter.instrumentSync(contents, source); - }; + // initialize coverage if requested + coverage.initialize(loaderConfig); } loader.require.config(loaderConfig); } function createCoverageReport(opts) { - return new Promise(resolve => { - - if (!opts.coverage) { - return resolve(undefined); - } - - const exclude = /\b((marked)|(raw\.marked)|(nls)|(css))\.js$/; - const remappedCoverage = i_remap(global.__coverage__, { exclude: exclude }).getFinalCoverage(); - - // The remapped coverage comes out with broken paths - function toUpperDriveLetter(str) { - if (/^[a-z]:/.test(str)) { - return str.charAt(0).toUpperCase() + str.substr(1); - } - return str; - } - function toLowerDriveLetter(str) { - if (/^[A-Z]:/.test(str)) { - return str.charAt(0).toLowerCase() + str.substr(1); - } - return str; - } - - const REPO_PATH = toUpperDriveLetter(path.join(__dirname, '../..')); - const fixPath = function (brokenPath) { - const startIndex = brokenPath.indexOf(REPO_PATH); - if (startIndex === -1) { - return toLowerDriveLetter(brokenPath); - } - return toLowerDriveLetter(brokenPath.substr(startIndex)); - }; - - const finalCoverage = Object.create(null); - for (const entryKey in remappedCoverage) { - const entry = remappedCoverage[entryKey]; - entry.path = fixPath(entry.path); - finalCoverage[fixPath(entryKey)] = entry; - } - - const collector = new istanbul.Collector(); - collector.add(finalCoverage); - - let coveragePath = path.join(path.dirname(__dirname), '../.build/coverage'); - let reportTypes = []; - if (opts.run || opts.runGlob) { - // single file running - coveragePath += '-single'; - reportTypes = ['lcovonly']; - } else { - reportTypes = ['json', 'lcov', 'html']; - } - - const reporter = new istanbul.Reporter(null, coveragePath); - reporter.addAll(reportTypes); - reporter.write(collector, true, resolve); - }); + if (opts.coverage) { + coverage.createReport(opts.run || opts.runGlob); + } + return Promise.resolve(undefined); } function loadTestModules(opts) { diff --git a/yarn.lock b/yarn.lock index c8559584760..574bd317d96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,40 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/generator@^7.4.0", "@babel/generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" + integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== + dependencies: + "@babel/types" "^7.5.0" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -23,6 +57,44 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" + integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== + +"@babel/template@^7.1.0", "@babel/template@^7.4.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.4.3": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" + integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.5.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.5.0" + "@babel/types" "^7.5.0" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" + integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + "@types/commander@^2.11.0": version "2.12.2" resolved "https://registry.yarnpkg.com/@types/commander/-/commander-2.12.2.tgz#183041a23842d4281478fa5d23c5ca78e6fd08ae" @@ -261,11 +333,6 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= - accepts@~1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f" @@ -377,15 +444,6 @@ ajv@^6.5.3, ajv@^6.6.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" @@ -749,7 +807,7 @@ async-settle@^1.0.0: dependencies: async-done "^1.2.2" -async@1.x, async@^1.4.0, async@^1.5.2: +async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= @@ -991,7 +1049,7 @@ boom@5.x.x: dependencies: hoek "4.x.x" -brace-expansion@^1.0.0, brace-expansion@^1.1.7: +brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" integrity sha1-wHshHHyVLsH479Uad+8NHTmQopI= @@ -1232,11 +1290,6 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= - camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1282,14 +1335,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - chainsaw@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" @@ -1487,15 +1532,6 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -1704,6 +1740,11 @@ commander@^2.19.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + commandpost@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/commandpost/-/commandpost-1.2.1.tgz#2e9c4c7508b9dc704afefaa91cab92ee6054cc68" @@ -2108,14 +2149,14 @@ debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" -decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -2162,7 +2203,7 @@ deep-extend@~0.4.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" integrity sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8= -deep-is@~0.1.2, deep-is@~0.1.3: +deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= @@ -2625,30 +2666,6 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@1.7.x: - version "1.7.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.7.1.tgz#30ecfcf66ca98dc67cd2fd162abeb6eafa8ce6fc" - integrity sha1-MOz89mypjcZ80v0WKr626vqM5vw= - dependencies: - esprima "^1.2.2" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.5.0" - optionalDependencies: - source-map "~0.2.0" - -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - eslint-scope@^3.7.1: version "3.7.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" @@ -2778,21 +2795,11 @@ espree@^5.0.0: acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" -esprima@2.5.x: - version "2.5.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.5.0.tgz#f387a46fd344c1b1a39baf8c20bfb43b6d0058cc" - integrity sha1-84ekb9NEwbGjm6+MIL+0O20AWMw= - -esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: +esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= -esprima@^1.2.2: - version "1.2.5" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.5.tgz#0993502feaf668138325756f30f9a51feeec11e9" - integrity sha1-CZNQL+r2aBODJXVvMPmlH+7sEek= - esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -2820,11 +2827,6 @@ esrecurse@^4.1.0: estraverse "^4.1.0" object-assign "^4.0.1" -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -3114,11 +3116,6 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= -fast-levenshtein@~1.0.0: - version "1.0.7" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz#0178dcdee023b92905193af0959e8a7639cfdcb9" - integrity sha1-AXjc3uAjuSkFGTrwlZ6KdjnP3Lk= - fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -3168,14 +3165,6 @@ filename-regex@^2.0.0: resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" integrity sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U= -fileset@0.2.x: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fileset/-/fileset-0.2.1.tgz#588ef8973c6623b2a76df465105696b96aac8067" - integrity sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc= - dependencies: - glob "5.x" - minimatch "2.x" - fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -3652,7 +3641,7 @@ glob@3.2.11: inherits "2" minimatch "0.3" -glob@5.x, glob@^5.0.13, glob@^5.0.15, glob@^5.0.3: +glob@^5.0.13, glob@^5.0.3: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= @@ -3723,7 +3712,7 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" -globals@^11.0.1: +globals@^11.0.1, globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== @@ -4053,16 +4042,16 @@ gulplog@^1.0.0: dependencies: glogg "^1.0.0" -handlebars@^4.0.1: - version "4.0.11" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" - integrity sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw= +handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== dependencies: - async "^1.4.0" + neo-async "^2.6.0" optimist "^0.6.1" - source-map "^0.4.4" + source-map "^0.6.1" optionalDependencies: - uglify-js "^2.6" + uglify-js "^3.1.4" har-schema@^2.0.0: version "2.0.0" @@ -4931,45 +4920,50 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul@0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" +istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== -istanbul@^0.3.17: - version "0.3.22" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.3.22.tgz#3e164d85021fe19c985d1f0e7ef0c3e22d012eb6" - integrity sha1-PhZNhQIf4ZyYXR8OfvDD4i0BLrY= +istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.7.x" - esprima "2.5.x" - fileset "0.2.x" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.2.6: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== + dependencies: + handlebars "^4.1.2" istextorbinary@1.0.2: version "1.0.2" @@ -5021,14 +5015,6 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@3.x: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" - integrity sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - js-yaml@^3.12.0: version "3.12.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" @@ -5078,6 +5064,11 @@ jsdom-no-contextify@^3.1.0: xml-name-validator "^1.0.0" xmlhttprequest ">= 1.6.0 < 2.0.0" +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-edm-parser@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/json-edm-parser/-/json-edm-parser-0.1.2.tgz#1e60b0fef1bc0af67bc0d146dfdde5486cd615b4" @@ -5230,11 +5221,6 @@ last-run@^1.1.0: default-resolution "^2.0.0" es6-weak-map "^2.0.1" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= - lazy.js@^0.4.2: version "0.4.3" resolved "https://registry.yarnpkg.com/lazy.js/-/lazy.js-0.4.3.tgz#87f67a07ad36555121e4fff1520df31be66786d8" @@ -5281,14 +5267,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -levn@~0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.2.5.tgz#ba8d339d0ca4a610e3a3f145b9caf48807155054" - integrity sha1-uo0znQykphDjo/FFucr0iAcVUFQ= - dependencies: - prelude-ls "~1.1.0" - type-check "~0.3.1" - liftoff@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.5.0.tgz#2009291bb31cea861bbf10a7c15a28caf75c31ec" @@ -5446,11 +5424,6 @@ long@^3.2.0: resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= - loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" @@ -5500,6 +5473,14 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + make-error-cause@^1.1.1: version "1.2.2" resolved "https://registry.yarnpkg.com/make-error-cause/-/make-error-cause-1.2.2.tgz#df0388fcd0b37816dff0a5fb8108939777dcbc9d" @@ -5795,13 +5776,6 @@ minimatch@0.3: dependencies: brace-expansion "^1.1.7" -minimatch@2.x: - version "2.0.10" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" - integrity sha1-jQh8OcazjAAbl/ynzm0OHoCvusc= - dependencies: - brace-expansion "^1.0.0" - minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -6044,6 +6018,11 @@ neo-async@^2.5.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.1.tgz#acb909e327b1e87ec9ef15f41b8a269512ad41ee" integrity sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA== +neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + nice-try@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" @@ -6125,7 +6104,7 @@ noop-logger@^0.1.1: resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= -nopt@3.x, nopt@^3.0.1: +nopt@^3.0.1: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= @@ -6375,7 +6354,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -6428,19 +6407,7 @@ optimist@0.6.x, optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.5.0.tgz#b75a8995a2d417df25b6e4e3862f50aa88651368" - integrity sha1-t1qJlaLUF98ltuTjhi9QqohlE2g= - dependencies: - deep-is "~0.1.2" - fast-levenshtein "~1.0.0" - levn "~0.2.5" - prelude-ls "~1.1.1" - type-check "~0.3.1" - wordwrap "~0.0.2" - -optionator@^0.8.1, optionator@^0.8.2: +optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= @@ -6815,6 +6782,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -7145,7 +7117,7 @@ prebuild-install@5.3.0: tunnel-agent "^0.6.0" which-pm-runs "^1.0.0" -prelude-ls@~1.1.0, prelude-ls@~1.1.1, prelude-ls@~1.1.2: +prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= @@ -7618,17 +7590,6 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -remap-istanbul@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.13.0.tgz#a529dfd080bb760f5274e3671c9c065f29923ed1" - integrity sha512-rS5ZpVAx3fGtKZkiBe1esXg5mKYbgW9iz8kkADFt3p6lo3NsBBUX1q6SwdhwUtYCGnr7nK6gRlbYK3i8R0jbRA== - dependencies: - istanbul "0.4.5" - minimatch "^3.0.4" - plugin-error "^1.0.1" - source-map "0.6.1" - through2 "3.0.0" - remove-bom-buffer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" @@ -7851,11 +7812,6 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.x: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" @@ -7883,14 +7839,7 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= - dependencies: - align-text "^0.1.1" - -rimraf@2: +rimraf@2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -8046,6 +7995,11 @@ semver@^5.5.1, semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +semver@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== + send@0.16.1: version "0.16.1" resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" @@ -8300,11 +8254,6 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" @@ -8312,17 +8261,15 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= - dependencies: - amdefine ">=0.0.4" +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== sparkles@^1.0.0: version "1.0.0" @@ -8639,7 +8586,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^3.1.0, supports-color@^3.2.3: +supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= @@ -8667,6 +8614,13 @@ supports-color@^5.3.0, supports-color@^5.4.0: dependencies: has-flag "^3.0.0" +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + sver-compat@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" @@ -8799,14 +8753,6 @@ through2@2.0.3, through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0 readable-stream "^2.1.5" xtend "~4.0.1" -through2@3.0.0, through2@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.0.tgz#468b461df9cd9fcc170f22ebf6852e467e578ff2" - integrity sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ== - dependencies: - readable-stream "2 || 3" - xtend "~4.0.1" - through2@^0.6.0: version "0.6.5" resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" @@ -8815,6 +8761,14 @@ through2@^0.6.0: readable-stream ">=1.0.33-1 <1.1.0-0" xtend ">=4.0.0 <4.1.0-0" +through2@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.0.tgz#468b461df9cd9fcc170f22ebf6852e467e578ff2" + integrity sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ== + dependencies: + readable-stream "2 || 3" + xtend "~4.0.1" + through2@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/through2/-/through2-0.2.3.tgz#eb3284da4ea311b6cc8ace3653748a52abf25a3f" @@ -8894,6 +8848,11 @@ to-buffer@^1.1.0: resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + to-iso-string@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1" @@ -8963,6 +8922,11 @@ trim-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" @@ -9042,7 +9006,7 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -type-check@~0.3.1, type-check@~0.3.2: +type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= @@ -9109,16 +9073,6 @@ uglify-es@^3.3.4: commander "~2.13.0" source-map "~0.6.1" -uglify-js@^2.6: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - uglify-js@^3.0.5: version "3.1.9" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.9.tgz#dffca799308cf327ec3ac77eeacb8e196ce3b452" @@ -9127,10 +9081,13 @@ uglify-js@^3.0.5: commander "~2.11.0" source-map "~0.6.1" -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= +uglify-js@^3.1.4: + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" uglifyjs-webpack-plugin@^1.2.4: version "1.2.7" @@ -9747,13 +9704,6 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= -which@^1.1.1, which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - integrity sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg== - dependencies: - isexe "^2.0.0" - which@^1.2.14: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -9761,6 +9711,13 @@ which@^1.2.14: dependencies: isexe "^2.0.0" +which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + integrity sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg== + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -9768,11 +9725,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= - windows-foreground-love@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/windows-foreground-love/-/windows-foreground-love-0.1.0.tgz#948e4beac0733cd58624710cc09432b7e8bf3521" @@ -9793,21 +9745,16 @@ windows-process-tree@0.2.4: dependencies: nan "^2.13.2" -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= - -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + worker-farm@^1.5.2: version "1.6.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" @@ -10026,16 +9973,6 @@ yargs@^7.1.0: y18n "^3.2.1" yargs-parser "^5.0.0" -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - yauzl@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" From 501bd363767eabefd6e263bbf4f80e8fc5df1524 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 11:58:12 +0200 Subject: [PATCH 066/190] Move extensions workbench service to browser --- .../{node => browser}/extensionsWorkbenchService.ts | 6 +++--- .../extensions/electron-browser/extensions.contribution.ts | 4 ++-- .../test/electron-browser/extensionsActions.test.ts | 2 +- .../test/electron-browser/extensionsViews.test.ts | 2 +- .../electron-browser/extensionsWorkbenchService.test.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/vs/workbench/contrib/extensions/{node => browser}/extensionsWorkbenchService.ts (99%) diff --git a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts similarity index 99% rename from src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts rename to src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index fe9b03f0756..6b5f5bfafed 100644 --- a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -146,14 +146,14 @@ class Extension implements IExtension { if (this.type === ExtensionType.System && this.local) { if (this.local.manifest && this.local.manifest.contributes) { if (Array.isArray(this.local.manifest.contributes.themes) && this.local.manifest.contributes.themes.length) { - return require.toUrl('../browser/media/theme-icon.png'); + return require.toUrl('./media/theme-icon.png'); } if (Array.isArray(this.local.manifest.contributes.grammars) && this.local.manifest.contributes.grammars.length) { - return require.toUrl('../browser/media/language-icon.svg'); + return require.toUrl('./media/language-icon.svg'); } } } - return require.toUrl('../browser/media/defaultIcon.png'); + return require.toUrl('./media/defaultIcon.png'); } get repository(): string | undefined { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts index 8723e3a6930..3e85c598dde 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts @@ -16,8 +16,8 @@ import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-b import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { VIEWLET_ID, IExtensionsWorkbenchService } from '../common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; +import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, ShowBuiltInExtensionsAction, UpdateAllAction, diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 49503a85eca..71e40ea102c 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -8,7 +8,7 @@ import { assign } from 'vs/base/common/objects'; import { generateUuid } from 'vs/base/common/uuid'; import { IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/contrib/extensions/common/extensions'; import * as ExtensionsActions from 'vs/workbench/contrib/extensions/browser/extensionsActions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService, IExtensionManagementServer diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 55e61060143..15222e2ae26 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -9,7 +9,7 @@ import { generateUuid } from 'vs/base/common/uuid'; import { ExtensionsListView } from 'vs/workbench/contrib/extensions/browser/extensionsViews'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, IExtensionManagementServerService, EnablementState, ExtensionRecommendationReason, SortBy, IExtensionManagementServer diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 1b142655ae5..a6b3f07d04c 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -9,7 +9,7 @@ import * as fs from 'fs'; import { assign } from 'vs/base/common/objects'; import { generateUuid } from 'vs/base/common/uuid'; import { IExtensionsWorkbenchService, ExtensionState, AutoCheckUpdatesConfigurationKey, AutoUpdateConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IGalleryExtensionAssets, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService From 0288def8919e33754fd9f2138f8a585913c95ed7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 16 Jul 2019 12:16:46 +0200 Subject: [PATCH 067/190] Failure to launch VSCode from WSL2. Fixes microsoft/vscode-remote-release#914 --- resources/win32/bin/code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/win32/bin/code.sh b/resources/win32/bin/code.sh index 5d92383c496..4a312474df1 100644 --- a/resources/win32/bin/code.sh +++ b/resources/win32/bin/code.sh @@ -36,7 +36,7 @@ if grep -qi Microsoft /proc/version; then if ! [ -z "$WSL_EXT_WLOC" ]; then # replace \r\n with \n in WSL_EXT_WLOC WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh - WIN_CODE_CMD=$(wslpath -w "$VSCODE_PATH/bin/$APP_NAME.cmd") + WIN_CODE_CMD=$ELECTRON "$WSL_CODE" "$COMMIT" "$QUALITY" "$WIN_CODE_CMD" "$APP_NAME" "$DATAFOLDER" "$@" exit $? else From bb8d54703b760c9b8a616b234cd0a4f252b42e23 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 12:51:53 +0200 Subject: [PATCH 068/190] split extensions contributions between electron and browser --- .../browser/extensions.contribution.ts | 352 ++++++++++++++++++ .../extensions.contribution.ts | 327 +--------------- src/vs/workbench/workbench.main.ts | 1 + 3 files changed, 355 insertions(+), 325 deletions(-) create mode 100644 src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts new file mode 100644 index 00000000000..56cb0142584 --- /dev/null +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -0,0 +1,352 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import 'vs/css!./media/extensions'; +import { localize } from 'vs/nls'; +import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; +import { + OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, + ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, ShowBuiltInExtensionsAction, UpdateAllAction, + EnableAllAction, EnableAllWorkpsaceAction, DisableAllAction, DisableAllWorkpsaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, OpenExtensionsFolderAction, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction +} from 'vs/workbench/contrib/extensions/browser/extensionsActions'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; +import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; +import { ExtensionEditor } from 'vs/workbench/contrib/extensions/browser/extensionEditor'; +import { StatusUpdater, ExtensionsViewlet, MaliciousExtensionChecker, ExtensionsViewletViewsContribution } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; +import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; +import * as jsonContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; +import { ExtensionsConfigurationSchema, ExtensionsConfigurationSchemaId } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { KeymapExtensions } from 'vs/workbench/contrib/extensions/common/extensionsUtils'; +import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { GalleryExtensionsHandler, ExtensionsHandler } from 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; +import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; +import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { URI, UriComponents } from 'vs/base/common/uri'; +import { ExtensionActivationProgress } from 'vs/workbench/contrib/extensions/browser/extensionsActivationProgress'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { ExtensionDependencyChecker } from 'vs/workbench/contrib/extensions/browser/extensionsDependencyChecker'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { ExtensionType } from 'vs/platform/extensions/common/extensions'; + +// Singletons +registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService); + +const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); +workbenchRegistry.registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ConfigureRecommendedExtensionsCommandsContributor, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, LifecyclePhase.Eventually); + +Registry.as(OutputExtensions.OutputChannels) + .registerChannel({ id: ExtensionsChannelId, label: ExtensionsLabel, log: false }); + +// Quickopen +Registry.as(Extensions.Quickopen).registerQuickOpenHandler( + new QuickOpenHandlerDescriptor( + ExtensionsHandler, + ExtensionsHandler.ID, + 'ext ', + undefined, + localize('extensionsCommands', "Manage Extensions"), + true + ) +); + +Registry.as(Extensions.Quickopen).registerQuickOpenHandler( + new QuickOpenHandlerDescriptor( + GalleryExtensionsHandler, + GalleryExtensionsHandler.ID, + 'ext install ', + undefined, + localize('galleryExtensionsCommands', "Install Gallery Extensions"), + true + ) +); + +// Editor +const editorDescriptor = new EditorDescriptor( + ExtensionEditor, + ExtensionEditor.ID, + localize('extension', "Extension") +); + +Registry.as(EditorExtensions.Editors) + .registerEditor(editorDescriptor, [new SyncDescriptor(ExtensionsInput)]); + +// Viewlet +const viewletDescriptor = new ViewletDescriptor( + ExtensionsViewlet, + VIEWLET_ID, + localize('extensions', "Extensions"), + 'extensions', + 4 +); + +Registry.as(ViewletExtensions.Viewlets) + .registerViewlet(viewletDescriptor); + +// Global actions +const actionRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); + +const openViewletActionDescriptor = new SyncActionDescriptor(OpenExtensionsViewletAction, OpenExtensionsViewletAction.ID, OpenExtensionsViewletAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X }); +actionRegistry.registerWorkbenchAction(openViewletActionDescriptor, 'View: Show Extensions', localize('view', "View")); + +const installActionDescriptor = new SyncActionDescriptor(InstallExtensionsAction, InstallExtensionsAction.ID, InstallExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(installActionDescriptor, 'Extensions: Install Extensions', ExtensionsLabel); + +const listOutdatedActionDescriptor = new SyncActionDescriptor(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(listOutdatedActionDescriptor, 'Extensions: Show Outdated Extensions', ExtensionsLabel); + +const recommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, ShowRecommendedExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(recommendationsActionDescriptor, 'Extensions: Show Recommended Extensions', ExtensionsLabel); + +const keymapRecommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedKeymapExtensionsAction, ShowRecommendedKeymapExtensionsAction.ID, ShowRecommendedKeymapExtensionsAction.SHORT_LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_M) }); +actionRegistry.registerWorkbenchAction(keymapRecommendationsActionDescriptor, 'Preferences: Keymaps', PreferencesLabel); + +const languageExtensionsActionDescriptor = new SyncActionDescriptor(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL); +actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Preferences: Language Extensions', PreferencesLabel); + +const azureExtensionsActionDescriptor = new SyncActionDescriptor(ShowAzureExtensionsAction, ShowAzureExtensionsAction.ID, ShowAzureExtensionsAction.SHORT_LABEL); +actionRegistry.registerWorkbenchAction(azureExtensionsActionDescriptor, 'Preferences: Azure Extensions', PreferencesLabel); + +const popularActionDescriptor = new SyncActionDescriptor(ShowPopularExtensionsAction, ShowPopularExtensionsAction.ID, ShowPopularExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(popularActionDescriptor, 'Extensions: Show Popular Extensions', ExtensionsLabel); + +const enabledActionDescriptor = new SyncActionDescriptor(ShowEnabledExtensionsAction, ShowEnabledExtensionsAction.ID, ShowEnabledExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(enabledActionDescriptor, 'Extensions: Show Enabled Extensions', ExtensionsLabel); + +const installedActionDescriptor = new SyncActionDescriptor(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(installedActionDescriptor, 'Extensions: Show Installed Extensions', ExtensionsLabel); + +const disabledActionDescriptor = new SyncActionDescriptor(ShowDisabledExtensionsAction, ShowDisabledExtensionsAction.ID, ShowDisabledExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(disabledActionDescriptor, 'Extensions: Show Disabled Extensions', ExtensionsLabel); + +const builtinActionDescriptor = new SyncActionDescriptor(ShowBuiltInExtensionsAction, ShowBuiltInExtensionsAction.ID, ShowBuiltInExtensionsAction.LABEL); +actionRegistry.registerWorkbenchAction(builtinActionDescriptor, 'Extensions: Show Built-in Extensions', ExtensionsLabel); + +const updateAllActionDescriptor = new SyncActionDescriptor(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL); +actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, 'Extensions: Update All Extensions', ExtensionsLabel); + +const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL); +actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel); + +const installVSIXActionDescriptor = new SyncActionDescriptor(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL); +actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel); + +const disableAllAction = new SyncActionDescriptor(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL); +actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All Installed Extensions', ExtensionsLabel); + +const disableAllWorkspaceAction = new SyncActionDescriptor(DisableAllWorkpsaceAction, DisableAllWorkpsaceAction.ID, DisableAllWorkpsaceAction.LABEL); +actionRegistry.registerWorkbenchAction(disableAllWorkspaceAction, 'Extensions: Disable All Installed Extensions for this Workspace', ExtensionsLabel); + +const enableAllAction = new SyncActionDescriptor(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL); +actionRegistry.registerWorkbenchAction(enableAllAction, 'Extensions: Enable All Extensions', ExtensionsLabel); + +const enableAllWorkspaceAction = new SyncActionDescriptor(EnableAllWorkpsaceAction, EnableAllWorkpsaceAction.ID, EnableAllWorkpsaceAction.LABEL); +actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: Enable All Extensions for this Workspace', ExtensionsLabel); + +const checkForUpdatesAction = new SyncActionDescriptor(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL); +actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Extension Updates`, ExtensionsLabel); + +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InstallSpecificVersionOfExtensionAction, InstallSpecificVersionOfExtensionAction.ID, InstallSpecificVersionOfExtensionAction.LABEL), 'Install Specific Version of Extension...', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReinstallAction, ReinstallAction.ID, ReinstallAction.LABEL), 'Reinstall Extension...', localize('developer', "Developer")); + +Registry.as(ConfigurationExtensions.Configuration) + .registerConfiguration({ + id: 'extensions', + order: 30, + title: localize('extensionsConfigurationTitle', "Extensions"), + type: 'object', + properties: { + 'extensions.autoUpdate': { + type: 'boolean', + description: localize('extensionsAutoUpdate', "When enabled, automatically installs updates for extensions. The updates are fetched from a Microsoft online service."), + default: true, + scope: ConfigurationScope.APPLICATION, + tags: ['usesOnlineServices'] + }, + 'extensions.autoCheckUpdates': { + type: 'boolean', + description: localize('extensionsCheckUpdates', "When enabled, automatically checks extensions for updates. If an extension has an update, it is marked as outdated in the Extensions view. The updates are fetched from a Microsoft online service."), + default: true, + scope: ConfigurationScope.APPLICATION, + tags: ['usesOnlineServices'] + }, + 'extensions.ignoreRecommendations': { + type: 'boolean', + description: localize('extensionsIgnoreRecommendations', "When enabled, the notifications for extension recommendations will not be shown."), + default: false + }, + 'extensions.showRecommendationsOnlyOnDemand': { + type: 'boolean', + description: localize('extensionsShowRecommendationsOnlyOnDemand', "When enabled, recommendations will not be fetched or shown unless specifically requested by the user. Some recommendations are fetched from a Microsoft online service."), + default: false, + tags: ['usesOnlineServices'] + }, + 'extensions.closeExtensionDetailsOnViewChange': { + type: 'boolean', + description: localize('extensionsCloseExtensionDetailsOnViewChange', "When enabled, editors with extension details will be automatically closed upon navigating away from the Extensions View."), + default: false + } + } + }); + +const jsonRegistry = Registry.as(jsonContributionRegistry.Extensions.JSONContribution); +jsonRegistry.registerSchema(ExtensionsConfigurationSchemaId, ExtensionsConfigurationSchema); + +// Register Commands +CommandsRegistry.registerCommand('_extensions.manage', (accessor: ServicesAccessor, extensionId: string) => { + const extensionService = accessor.get(IExtensionsWorkbenchService); + const extension = extensionService.local.filter(e => areSameExtensions(e.identifier, { id: extensionId })); + if (extension.length === 1) { + extensionService.open(extension[0]); + } +}); + +CommandsRegistry.registerCommand('extension.open', (accessor: ServicesAccessor, extensionId: string) => { + const extensionService = accessor.get(IExtensionsWorkbenchService); + + return extensionService.queryGallery({ names: [extensionId], pageSize: 1 }, CancellationToken.None).then(pager => { + if (pager.total !== 1) { + return; + } + + extensionService.open(pager.firstPage[0]); + }); +}); + +CommandsRegistry.registerCommand({ + id: 'workbench.extensions.installExtension', + description: { + description: localize('workbench.extensions.installExtension.description', "Install the given extension"), + args: [ + { + name: localize('workbench.extensions.installExtension.arg.name', "Extension id or VSIX resource uri"), + schema: { + 'type': ['object', 'string'] + } + } + ] + }, + handler: async (accessor, arg: string | UriComponents) => { + const extensionManagementService = accessor.get(IExtensionManagementService); + const extensionGalleryService = accessor.get(IExtensionGalleryService); + try { + if (typeof arg === 'string') { + const extension = await extensionGalleryService.getCompatibleExtension({ id: arg }); + if (extension) { + await extensionManagementService.installFromGallery(extension); + } else { + throw new Error(localize('notFound', "Extension '{0}' not found.", arg)); + } + } else { + const vsix = URI.revive(arg); + await extensionManagementService.install(vsix); + } + } catch (e) { + onUnexpectedError(e); + } + } +}); + +CommandsRegistry.registerCommand({ + id: 'workbench.extensions.uninstallExtension', + description: { + description: localize('workbench.extensions.uninstallExtension.description', "Uninstall the given extension"), + args: [ + { + name: localize('workbench.extensions.uninstallExtension.arg.name', "Id of the extension to uninstall"), + schema: { + 'type': 'string' + } + } + ] + }, + handler: async (accessor, id: string) => { + if (!id) { + throw new Error(localize('id required', "Extension id required.")); + } + const extensionManagementService = accessor.get(IExtensionManagementService); + try { + const installed = await extensionManagementService.getInstalled(ExtensionType.User); + const [extensionToUninstall] = installed.filter(e => areSameExtensions(e.identifier, { id })); + if (!extensionToUninstall) { + return Promise.reject(new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, e.g.: ms-vscode.csharp.", id))); + } + await extensionManagementService.uninstall(extensionToUninstall, true); + } catch (e) { + onUnexpectedError(e); + } + } +}); + +// File menu registration + +MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { + group: '2_keybindings', + command: { + id: ShowRecommendedKeymapExtensionsAction.ID, + title: localize({ key: 'miOpenKeymapExtensions', comment: ['&& denotes a mnemonic'] }, "&&Keymaps") + }, + order: 2 +}); + +MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { + group: '2_keybindings', + command: { + id: ShowRecommendedKeymapExtensionsAction.ID, + title: localize('miOpenKeymapExtensions2', "Keymaps") + }, + order: 2 +}); + +MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { + group: '1_settings', + command: { + id: VIEWLET_ID, + title: localize({ key: 'miPreferencesExtensions', comment: ['&& denotes a mnemonic'] }, "&&Extensions") + }, + order: 3 +}); + +// View menu + +MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { + group: '3_views', + command: { + id: VIEWLET_ID, + title: localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions") + }, + order: 5 +}); + +// Global Activity Menu + +MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { + group: '2_configuration', + command: { + id: VIEWLET_ID, + title: localize('showExtensions', "Extensions") + }, + order: 3 +}); \ No newline at end of file diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts index 3e85c598dde..b2982429480 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts @@ -3,104 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!../browser/media/extensions'; import { localize } from 'vs/nls'; -import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IExtensionTipsService, ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; - +import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; -import { - OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, - ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, ShowBuiltInExtensionsAction, UpdateAllAction, - EnableAllAction, EnableAllWorkpsaceAction, DisableAllAction, DisableAllWorkpsaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, OpenExtensionsFolderAction, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction -} from 'vs/workbench/contrib/extensions/browser/extensionsActions'; -import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; -import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; -import { ExtensionEditor } from 'vs/workbench/contrib/extensions/browser/extensionEditor'; -import { StatusUpdater, ExtensionsViewlet, MaliciousExtensionChecker, ExtensionsViewletViewsContribution } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; -import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import * as jsonContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { ExtensionsConfigurationSchema, ExtensionsConfigurationSchemaId } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeymapExtensions } from 'vs/workbench/contrib/extensions/common/extensionsUtils'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { GalleryExtensionsHandler, ExtensionsHandler } from 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { RuntimeExtensionsEditor, ShowRuntimeExtensionsAction, IExtensionHostProfileService, DebugExtensionHostAction, StartExtensionHostProfileAction, StopExtensionHostProfileAction, CONTEXT_PROFILE_SESSION_STATE, SaveExtensionHostProfileAction, CONTEXT_EXTENSION_HOST_PROFILE_RECORDED } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor'; import { EditorInput, IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, ActiveEditorContext } from 'vs/workbench/common/editor'; import { ExtensionHostProfileService } from 'vs/workbench/contrib/extensions/electron-browser/extensionProfileService'; import { RuntimeExtensionsInput } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsInput'; -import { URI, UriComponents } from 'vs/base/common/uri'; +import { URI } from 'vs/base/common/uri'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ExtensionActivationProgress } from 'vs/workbench/contrib/extensions/browser/extensionsActivationProgress'; import { ExtensionsAutoProfiler } from 'vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { ExtensionDependencyChecker } from 'vs/workbench/contrib/extensions/browser/extensionsDependencyChecker'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ExtensionType } from 'vs/platform/extensions/common/extensions'; // Singletons -registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService); registerSingleton(IExtensionTipsService, ExtensionTipsService); registerSingleton(IExtensionHostProfileService, ExtensionHostProfileService, true); const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ConfigureRecommendedExtensionsCommandsContributor, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, LifecyclePhase.Starting); -workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, LifecyclePhase.Eventually); workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, LifecyclePhase.Eventually); - -Registry.as(OutputExtensions.OutputChannels) - .registerChannel({ id: ExtensionsChannelId, label: ExtensionsLabel, log: false }); - -// Quickopen -Registry.as(Extensions.Quickopen).registerQuickOpenHandler( - new QuickOpenHandlerDescriptor( - ExtensionsHandler, - ExtensionsHandler.ID, - 'ext ', - undefined, - localize('extensionsCommands', "Manage Extensions"), - true - ) -); - -Registry.as(Extensions.Quickopen).registerQuickOpenHandler( - new QuickOpenHandlerDescriptor( - GalleryExtensionsHandler, - GalleryExtensionsHandler.ID, - 'ext install ', - undefined, - localize('galleryExtensionsCommands', "Install Gallery Extensions"), - true - ) -); - -// Editor -const editorDescriptor = new EditorDescriptor( - ExtensionEditor, - ExtensionEditor.ID, - localize('extension', "Extension") -); - -Registry.as(EditorExtensions.Editors) - .registerEditor(editorDescriptor, [new SyncDescriptor(ExtensionsInput)]); // Running Extensions Editor @@ -125,150 +54,12 @@ class RuntimeExtensionsInputFactory implements IEditorInputFactory { Registry.as(EditorInputExtensions.EditorInputFactories).registerEditorInputFactory(RuntimeExtensionsInput.ID, RuntimeExtensionsInputFactory); -// Viewlet -const viewletDescriptor = new ViewletDescriptor( - ExtensionsViewlet, - VIEWLET_ID, - localize('extensions', "Extensions"), - 'extensions', - 4 -); - -Registry.as(ViewletExtensions.Viewlets) - .registerViewlet(viewletDescriptor); - // Global actions const actionRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); -const openViewletActionDescriptor = new SyncActionDescriptor(OpenExtensionsViewletAction, OpenExtensionsViewletAction.ID, OpenExtensionsViewletAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X }); -actionRegistry.registerWorkbenchAction(openViewletActionDescriptor, 'View: Show Extensions', localize('view', "View")); - -const installActionDescriptor = new SyncActionDescriptor(InstallExtensionsAction, InstallExtensionsAction.ID, InstallExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(installActionDescriptor, 'Extensions: Install Extensions', ExtensionsLabel); - -const listOutdatedActionDescriptor = new SyncActionDescriptor(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(listOutdatedActionDescriptor, 'Extensions: Show Outdated Extensions', ExtensionsLabel); - -const recommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, ShowRecommendedExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(recommendationsActionDescriptor, 'Extensions: Show Recommended Extensions', ExtensionsLabel); - -const keymapRecommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedKeymapExtensionsAction, ShowRecommendedKeymapExtensionsAction.ID, ShowRecommendedKeymapExtensionsAction.SHORT_LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_M) }); -actionRegistry.registerWorkbenchAction(keymapRecommendationsActionDescriptor, 'Preferences: Keymaps', PreferencesLabel); - -const languageExtensionsActionDescriptor = new SyncActionDescriptor(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL); -actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Preferences: Language Extensions', PreferencesLabel); - -const azureExtensionsActionDescriptor = new SyncActionDescriptor(ShowAzureExtensionsAction, ShowAzureExtensionsAction.ID, ShowAzureExtensionsAction.SHORT_LABEL); -actionRegistry.registerWorkbenchAction(azureExtensionsActionDescriptor, 'Preferences: Azure Extensions', PreferencesLabel); - -const popularActionDescriptor = new SyncActionDescriptor(ShowPopularExtensionsAction, ShowPopularExtensionsAction.ID, ShowPopularExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(popularActionDescriptor, 'Extensions: Show Popular Extensions', ExtensionsLabel); - -const enabledActionDescriptor = new SyncActionDescriptor(ShowEnabledExtensionsAction, ShowEnabledExtensionsAction.ID, ShowEnabledExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(enabledActionDescriptor, 'Extensions: Show Enabled Extensions', ExtensionsLabel); - -const installedActionDescriptor = new SyncActionDescriptor(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(installedActionDescriptor, 'Extensions: Show Installed Extensions', ExtensionsLabel); - -const disabledActionDescriptor = new SyncActionDescriptor(ShowDisabledExtensionsAction, ShowDisabledExtensionsAction.ID, ShowDisabledExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(disabledActionDescriptor, 'Extensions: Show Disabled Extensions', ExtensionsLabel); - -const builtinActionDescriptor = new SyncActionDescriptor(ShowBuiltInExtensionsAction, ShowBuiltInExtensionsAction.ID, ShowBuiltInExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(builtinActionDescriptor, 'Extensions: Show Built-in Extensions', ExtensionsLabel); - -const updateAllActionDescriptor = new SyncActionDescriptor(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL); -actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, 'Extensions: Update All Extensions', ExtensionsLabel); - -const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL); -actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel); - -const installVSIXActionDescriptor = new SyncActionDescriptor(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL); -actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel); - -const disableAllAction = new SyncActionDescriptor(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL); -actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All Installed Extensions', ExtensionsLabel); - -const disableAllWorkspaceAction = new SyncActionDescriptor(DisableAllWorkpsaceAction, DisableAllWorkpsaceAction.ID, DisableAllWorkpsaceAction.LABEL); -actionRegistry.registerWorkbenchAction(disableAllWorkspaceAction, 'Extensions: Disable All Installed Extensions for this Workspace', ExtensionsLabel); - -const enableAllAction = new SyncActionDescriptor(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL); -actionRegistry.registerWorkbenchAction(enableAllAction, 'Extensions: Enable All Extensions', ExtensionsLabel); - -const enableAllWorkspaceAction = new SyncActionDescriptor(EnableAllWorkpsaceAction, EnableAllWorkpsaceAction.ID, EnableAllWorkpsaceAction.LABEL); -actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: Enable All Extensions for this Workspace', ExtensionsLabel); - -const checkForUpdatesAction = new SyncActionDescriptor(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL); -actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Extension Updates`, ExtensionsLabel); - -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel); -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel); -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InstallSpecificVersionOfExtensionAction, InstallSpecificVersionOfExtensionAction.ID, InstallSpecificVersionOfExtensionAction.LABEL), 'Install Specific Version of Extension...', ExtensionsLabel); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowRuntimeExtensionsAction, ShowRuntimeExtensionsAction.ID, ShowRuntimeExtensionsAction.LABEL), 'Show Running Extensions', localize('developer', "Developer")); -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReinstallAction, ReinstallAction.ID, ReinstallAction.LABEL), 'Reinstall Extension...', localize('developer', "Developer")); - -Registry.as(ConfigurationExtensions.Configuration) - .registerConfiguration({ - id: 'extensions', - order: 30, - title: localize('extensionsConfigurationTitle', "Extensions"), - type: 'object', - properties: { - 'extensions.autoUpdate': { - type: 'boolean', - description: localize('extensionsAutoUpdate', "When enabled, automatically installs updates for extensions. The updates are fetched from a Microsoft online service."), - default: true, - scope: ConfigurationScope.APPLICATION, - tags: ['usesOnlineServices'] - }, - 'extensions.autoCheckUpdates': { - type: 'boolean', - description: localize('extensionsCheckUpdates', "When enabled, automatically checks extensions for updates. If an extension has an update, it is marked as outdated in the Extensions view. The updates are fetched from a Microsoft online service."), - default: true, - scope: ConfigurationScope.APPLICATION, - tags: ['usesOnlineServices'] - }, - 'extensions.ignoreRecommendations': { - type: 'boolean', - description: localize('extensionsIgnoreRecommendations', "When enabled, the notifications for extension recommendations will not be shown."), - default: false - }, - 'extensions.showRecommendationsOnlyOnDemand': { - type: 'boolean', - description: localize('extensionsShowRecommendationsOnlyOnDemand', "When enabled, recommendations will not be fetched or shown unless specifically requested by the user. Some recommendations are fetched from a Microsoft online service."), - default: false, - tags: ['usesOnlineServices'] - }, - 'extensions.closeExtensionDetailsOnViewChange': { - type: 'boolean', - description: localize('extensionsCloseExtensionDetailsOnViewChange', "When enabled, editors with extension details will be automatically closed upon navigating away from the Extensions View."), - default: false - } - } - }); - -const jsonRegistry = Registry.as(jsonContributionRegistry.Extensions.JSONContribution); -jsonRegistry.registerSchema(ExtensionsConfigurationSchemaId, ExtensionsConfigurationSchema); // Register Commands -CommandsRegistry.registerCommand('_extensions.manage', (accessor: ServicesAccessor, extensionId: string) => { - const extensionService = accessor.get(IExtensionsWorkbenchService); - const extension = extensionService.local.filter(e => areSameExtensions(e.identifier, { id: extensionId })); - if (extension.length === 1) { - extensionService.open(extension[0]); - } -}); - -CommandsRegistry.registerCommand('extension.open', (accessor: ServicesAccessor, extensionId: string) => { - const extensionService = accessor.get(IExtensionsWorkbenchService); - - return extensionService.queryGallery({ names: [extensionId], pageSize: 1 }, CancellationToken.None).then(pager => { - if (pager.total !== 1) { - return; - } - - extensionService.open(pager.firstPage[0]); - }); -}); CommandsRegistry.registerCommand(DebugExtensionHostAction.ID, (accessor: ServicesAccessor) => { const instantiationService = accessor.get(IInstantiationService); @@ -290,46 +81,6 @@ CommandsRegistry.registerCommand(SaveExtensionHostProfileAction.ID, (accessor: S instantiationService.createInstance(SaveExtensionHostProfileAction, SaveExtensionHostProfileAction.ID, SaveExtensionHostProfileAction.LABEL).run(); }); -// File menu registration - -MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { - group: '2_keybindings', - command: { - id: ShowRecommendedKeymapExtensionsAction.ID, - title: localize({ key: 'miOpenKeymapExtensions', comment: ['&& denotes a mnemonic'] }, "&&Keymaps") - }, - order: 2 -}); - -MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { - group: '2_keybindings', - command: { - id: ShowRecommendedKeymapExtensionsAction.ID, - title: localize('miOpenKeymapExtensions2', "Keymaps") - }, - order: 2 -}); - -MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { - group: '1_settings', - command: { - id: VIEWLET_ID, - title: localize({ key: 'miPreferencesExtensions', comment: ['&& denotes a mnemonic'] }, "&&Extensions") - }, - order: 3 -}); - -// View menu - -MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { - group: '3_views', - command: { - id: VIEWLET_ID, - title: localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions") - }, - order: 5 -}); - // Running extensions MenuRegistry.appendMenuItem(MenuId.EditorTitle, { @@ -383,78 +134,4 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { }, group: 'navigation', when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(RuntimeExtensionsEditor.ID)) -}); - -CommandsRegistry.registerCommand({ - id: 'workbench.extensions.installExtension', - description: { - description: localize('workbench.extensions.installExtension.description', "Install the given extension"), - args: [ - { - name: localize('workbench.extensions.installExtension.arg.name', "Extension id or VSIX resource uri"), - schema: { - 'type': ['object', 'string'] - } - } - ] - }, - handler: async (accessor, arg: string | UriComponents) => { - const extensionManagementService = accessor.get(IExtensionManagementService); - const extensionGalleryService = accessor.get(IExtensionGalleryService); - try { - if (typeof arg === 'string') { - const extension = await extensionGalleryService.getCompatibleExtension({ id: arg }); - if (extension) { - await extensionManagementService.installFromGallery(extension); - } else { - throw new Error(localize('notFound', "Extension '{0}' not found.", arg)); - } - } else { - const vsix = URI.revive(arg); - await extensionManagementService.install(vsix); - } - } catch (e) { - onUnexpectedError(e); - } - } -}); - -CommandsRegistry.registerCommand({ - id: 'workbench.extensions.uninstallExtension', - description: { - description: localize('workbench.extensions.uninstallExtension.description', "Uninstall the given extension"), - args: [ - { - name: localize('workbench.extensions.uninstallExtension.arg.name', "Id of the extension to uninstall"), - schema: { - 'type': 'string' - } - } - ] - }, - handler: async (accessor, id: string) => { - if (!id) { - throw new Error(localize('id required', "Extension id required.")); - } - const extensionManagementService = accessor.get(IExtensionManagementService); - try { - const installed = await extensionManagementService.getInstalled(ExtensionType.User); - const [extensionToUninstall] = installed.filter(e => areSameExtensions(e.identifier, { id })); - if (!extensionToUninstall) { - return Promise.reject(new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, e.g.: ms-vscode.csharp.", id))); - } - await extensionManagementService.uninstall(extensionToUninstall, true); - } catch (e) { - onUnexpectedError(e); - } - } -}); - -MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { - group: '2_configuration', - command: { - id: VIEWLET_ID, - title: localize('showExtensions', "Extensions") - }, - order: 3 }); \ No newline at end of file diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 753464f354a..3ec44b2b0d3 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -255,6 +255,7 @@ import 'vs/workbench/contrib/webview/browser/webview.contribution'; import 'vs/workbench/contrib/webview/electron-browser/webview.contribution'; // Extensions Management +import 'vs/workbench/contrib/extensions/browser/extensions.contribution'; import 'vs/workbench/contrib/extensions/electron-browser/extensions.contribution'; import 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; import 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; From 957c83c4efc8a832c91bde51c316d86e4e6c9a88 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 15:43:51 +0200 Subject: [PATCH 069/190] move extension management ipc to common --- src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts | 2 +- .../{node => common}/extensionManagementIpc.ts | 0 .../electron-browser/extensionManagementServerService.ts | 2 +- .../extensions/electron-browser/remoteExtensionManagementIpc.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/vs/platform/extensionManagement/{node => common}/extensionManagementIpc.ts (100%) diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 854373e8920..31e2fa0a8fa 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -13,7 +13,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { ExtensionManagementChannel } from 'vs/platform/extensionManagement/node/extensionManagementIpc'; +import { ExtensionManagementChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; import { IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementIpc.ts b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts similarity index 100% rename from src/vs/platform/extensionManagement/node/extensionManagementIpc.ts rename to src/vs/platform/extensionManagement/common/extensionManagementIpc.ts diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts index 611ab9aec95..9af2b50701d 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { Schemas } from 'vs/base/common/network'; import { URI } from 'vs/base/common/uri'; import { IExtensionManagementServer, IExtensionManagementServerService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/node/extensionManagementIpc'; +import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; diff --git a/src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts b/src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts index 518978b8983..84ec145c4c8 100644 --- a/src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts +++ b/src/vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc.ts @@ -18,7 +18,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { localize } from 'vs/nls'; import { IProductService } from 'vs/platform/product/common/product'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/node/extensionManagementIpc'; +import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; export class RemoteExtensionManagementChannelClient extends ExtensionManagementChannelClient { From 58aa4c19db774c983a50b0418995fa46af132ac8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 15:53:39 +0200 Subject: [PATCH 070/190] move extension management server service to extension management --- .../extensions/test/electron-browser/extensionsActions.test.ts | 2 +- .../extensions/test/electron-browser/extensionsViews.test.ts | 2 +- .../electron-browser/extensionManagementServerService.ts | 0 src/vs/workbench/workbench.main.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/vs/workbench/services/{extensions => extensionManagement}/electron-browser/extensionManagementServerService.ts (100%) diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 71e40ea102c..e8ac33ea50b 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -39,7 +39,7 @@ import { ExtensionIdentifier, IExtensionContributions, ExtensionType, IExtension import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ILabelService } from 'vs/platform/label/common/label'; -import { ExtensionManagementServerService } from 'vs/workbench/services/extensions/electron-browser/extensionManagementServerService'; +import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import { IProductService } from 'vs/platform/product/common/product'; suite('ExtensionsActions Test', () => { diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 15222e2ae26..883b6829f6e 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -40,7 +40,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import { ExtensionIdentifier, ExtensionType, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; -import { ExtensionManagementServerService } from 'vs/workbench/services/extensions/electron-browser/extensionManagementServerService'; +import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import { IProductService } from 'vs/platform/product/common/product'; diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts similarity index 100% rename from src/vs/workbench/services/extensions/electron-browser/extensionManagementServerService.ts rename to src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 3ec44b2b0d3..9e7838d27a4 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -129,7 +129,7 @@ import 'vs/workbench/services/extensions/electron-browser/extensionService'; import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; import 'vs/workbench/services/extensions/node/multiExtensionManagement'; import 'vs/workbench/services/label/common/labelService'; -import 'vs/workbench/services/extensions/electron-browser/extensionManagementServerService'; +import 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; import 'vs/workbench/services/window/electron-browser/windowService'; From 28330549dd07fd5e35dbb34b699724afede0de9c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 16:03:47 +0200 Subject: [PATCH 071/190] introduce ext management server service on web --- .../extensionManagementServerService.ts | 40 +++++++++++++++++++ src/vs/workbench/workbench.web.main.ts | 6 ++- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts new file mode 100644 index 00000000000..f4c386d50f9 --- /dev/null +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { localize } from 'vs/nls'; +import { URI } from 'vs/base/common/uri'; +import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; +import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; +import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; +import { IChannel } from 'vs/base/parts/ipc/common/ipc'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; + +const localExtensionManagementServerAuthority: string = 'vscode-local'; + +export class ExtensionManagementServerService implements IExtensionManagementServerService { + + _serviceBrand: any; + + readonly localExtensionManagementServer: IExtensionManagementServer; + readonly remoteExtensionManagementServer: IExtensionManagementServer | null = null; + + constructor( + @IRemoteAgentService remoteAgentService: IRemoteAgentService, + ) { + const remoteAgentConnection = remoteAgentService.getConnection(); + const localExtensionManagementService = new ExtensionManagementChannelClient(remoteAgentConnection!.getChannel('extensions')); + this.localExtensionManagementServer = { extensionManagementService: localExtensionManagementService, authority: localExtensionManagementServerAuthority, label: localize('local', "Local") }; + } + + getExtensionManagementServer(location: URI): IExtensionManagementServer | null { + if (location.scheme === REMOTE_HOST_SCHEME) { + return this.localExtensionManagementServer; + } + return null; + } +} + +registerSingleton(IExtensionManagementServerService, ExtensionManagementServerService); \ No newline at end of file diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 720b5e70ed1..9c63cffd384 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -123,9 +123,7 @@ import 'vs/workbench/services/themes/browser/workbenchThemeService'; // import 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import 'vs/workbench/services/extensions/browser/extensionService'; // import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; -// import 'vs/workbench/services/extensions/node/multiExtensionManagement'; import 'vs/workbench/services/label/common/labelService'; -// import 'vs/workbench/services/extensions/electron-browser/extensionManagementServerService'; // import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; // import 'vs/workbench/services/window/electron-browser/windowService'; @@ -169,6 +167,10 @@ registerSingleton(IContextMenuService, ContextMenuService); //#endregion +//#region --- Extensions Management +import 'vs/workbench/services/extensionManagement/common/extensionManagementServerService'; +//#endregion + //#region --- workbench parts From 51a01d72682a55311b900f1c7c348fcd9d01c78e Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 16 Jul 2019 16:06:44 +0200 Subject: [PATCH 072/190] ExtTipsService: add WINDIR as variable --- .../extensions/electron-browser/extensionTipsService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts index eb853688336..816a5521610 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts @@ -913,7 +913,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe windowsPath = windowsPath.replace('%USERPROFILE%', process.env['USERPROFILE']!) .replace('%ProgramFiles(x86)%', process.env['ProgramFiles(x86)']!) .replace('%ProgramFiles%', process.env['ProgramFiles']!) - .replace('%APPDATA%', process.env['APPDATA']!); + .replace('%APPDATA%', process.env['APPDATA']!) + .replace('%WINDIR%', process.env['WINDIR']!); promises.push(findExecutable(exeName, windowsPath)); } else { promises.push(findExecutable(exeName, join('/usr/local/bin', exeName))); From ff1da264d5e1c8d473f58f15e8629ef3a72050f9 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 16:26:59 +0200 Subject: [PATCH 073/190] move multi extension management to extension management --- .../node/multiExtensionManagement.ts | 0 src/vs/workbench/workbench.main.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/vs/workbench/services/{extensions => extensionManagement}/node/multiExtensionManagement.ts (100%) diff --git a/src/vs/workbench/services/extensions/node/multiExtensionManagement.ts b/src/vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts similarity index 100% rename from src/vs/workbench/services/extensions/node/multiExtensionManagement.ts rename to src/vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 9e7838d27a4..ee9cf6d2318 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -127,7 +127,7 @@ import 'vs/workbench/services/themes/browser/workbenchThemeService'; import 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import 'vs/workbench/services/extensions/electron-browser/extensionService'; import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; -import 'vs/workbench/services/extensions/node/multiExtensionManagement'; +import 'vs/workbench/services/extensionManagement/node/multiExtensionManagement'; import 'vs/workbench/services/label/common/labelService'; import 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; From 73a34e684b54d2d6e58460194026855ab142e10d Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 16:39:08 +0200 Subject: [PATCH 074/190] split extension management service --- .../extensionManagement.ts} | 30 ++++------------- .../node/extensionManagement.ts | 33 +++++++++++++++++++ src/vs/workbench/workbench.main.ts | 5 +-- 3 files changed, 42 insertions(+), 26 deletions(-) rename src/vs/workbench/services/extensionManagement/{node/multiExtensionManagement.ts => common/extensionManagement.ts} (87%) create mode 100644 src/vs/workbench/services/extensionManagement/node/extensionManagement.ts diff --git a/src/vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts similarity index 87% rename from src/vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts rename to src/vs/workbench/services/extensionManagement/common/extensionManagement.ts index 1760b4d5fc3..bbb99a6504f 100644 --- a/src/vs/workbench/services/extensionManagement/node/multiExtensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts @@ -13,14 +13,12 @@ import { URI } from 'vs/base/common/uri'; import { Disposable } from 'vs/base/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { localize } from 'vs/nls'; import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IProductService } from 'vs/platform/product/common/product'; -export class MultiExtensionManagementService extends Disposable implements IExtensionManagementService { +export class ExtensionManagementService extends Disposable implements IExtensionManagementService { _serviceBrand: any; @@ -29,13 +27,13 @@ export class MultiExtensionManagementService extends Disposable implements IExte readonly onUninstallExtension: Event; readonly onDidUninstallExtension: Event; - private readonly servers: IExtensionManagementServer[]; + protected readonly servers: IExtensionManagementServer[]; constructor( - @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, + @IExtensionManagementServerService protected readonly extensionManagementServerService: IExtensionManagementServerService, @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @IProductService private readonly productService: IProductService, + @IConfigurationService protected readonly configurationService: IConfigurationService, + @IProductService protected readonly productService: IProductService, ) { super(); this.servers = this.extensionManagementServerService.remoteExtensionManagementServer ? [this.extensionManagementServerService.localExtensionManagementServer, this.extensionManagementServerService.remoteExtensionManagementServer] : [this.extensionManagementServerService.localExtensionManagementServer]; @@ -133,20 +131,6 @@ export class MultiExtensionManagementService extends Disposable implements IExte } async install(vsix: URI): Promise { - if (this.extensionManagementServerService.remoteExtensionManagementServer) { - const manifest = await getManifest(vsix.fsPath); - if (isLanguagePackExtension(manifest)) { - // Install on both servers - const [local] = await Promise.all(this.servers.map(server => server.extensionManagementService.install(vsix))); - return local; - } - if (isUIExtension(manifest, this.productService, this.configurationService)) { - // Install only on local server - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); - } - // Install only on remote server - return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(vsix); - } return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); } @@ -178,6 +162,4 @@ export class MultiExtensionManagementService extends Disposable implements IExte private getServer(extension: ILocalExtension): IExtensionManagementServer | null { return this.extensionManagementServerService.getExtensionManagementServer(extension.location); } -} - -registerSingleton(IExtensionManagementService, MultiExtensionManagementService); \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/workbench/services/extensionManagement/node/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/node/extensionManagement.ts new file mode 100644 index 00000000000..de81feb1842 --- /dev/null +++ b/src/vs/workbench/services/extensionManagement/node/extensionManagement.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; +import { URI } from 'vs/base/common/uri'; +import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; +import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil'; +import { ExtensionManagementService as BaseExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; + +export class ExtensionManagementService extends BaseExtensionManagementService { + + async install(vsix: URI): Promise { + if (this.extensionManagementServerService.remoteExtensionManagementServer) { + const manifest = await getManifest(vsix.fsPath); + if (isLanguagePackExtension(manifest)) { + // Install on both servers + const [local] = await Promise.all(this.servers.map(server => server.extensionManagementService.install(vsix))); + return local; + } + if (isUIExtension(manifest, this.productService, this.configurationService)) { + // Install only on local server + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + } + // Install only on remote server + return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(vsix); + } + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + } + +} diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index ee9cf6d2318..5b722ecff0b 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -64,7 +64,7 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { AccessibilityService } from 'vs/workbench/services/accessibility/node/accessibilityService'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; @@ -127,7 +127,6 @@ import 'vs/workbench/services/themes/browser/workbenchThemeService'; import 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import 'vs/workbench/services/extensions/electron-browser/extensionService'; import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; -import 'vs/workbench/services/extensionManagement/node/multiExtensionManagement'; import 'vs/workbench/services/label/common/labelService'; import 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; @@ -139,6 +138,7 @@ import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService'; +registerSingleton(IExtensionManagementService, ExtensionManagementService); registerSingleton(IBackupFileService, BackupFileService); registerSingleton(IMenuService, MenuService, true); registerSingleton(IListService, ListService, true); @@ -344,5 +344,6 @@ import 'vs/workbench/contrib/experiments/electron-browser/experiments.contributi // Issues import 'vs/workbench/contrib/issue/electron-browser/issue.contribution'; +import { ExtensionManagementService } from './services/extensionManagement/node/extensionManagement'; //#endregion From 569d2dc334bbf8d29d854fec40890abb5cdf2d7e Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 16 Jul 2019 17:02:08 +0200 Subject: [PATCH 075/190] terminal wsl recommendations --- .../terminal/browser/terminalConfigHelper.ts | 57 +++++++++++++++++-- .../browser/terminalProcessManager.ts | 1 + .../contrib/terminal/common/terminal.ts | 1 + 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts index 899cbf7f524..48d1cd513b4 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts @@ -8,12 +8,15 @@ import * as platform from 'vs/base/common/platform'; import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { ITerminalConfiguration, ITerminalFont, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING, LinuxDistro } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalConfiguration, ITerminalFont, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING, LinuxDistro, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import Severity from 'vs/base/common/severity'; import { Terminal as XTermTerminal } from 'xterm'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IBrowserTerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminal'; import { Emitter, Event } from 'vs/base/common/event'; +import { basename } from 'vs/base/common/path'; +import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ExtensionType } from 'vs/platform/extensions/common/extensions'; const MINIMUM_FONT_SIZE = 6; const MAXIMUM_FONT_SIZE = 25; @@ -35,7 +38,7 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { public constructor( private readonly _linuxDistro: LinuxDistro, @IConfigurationService private readonly _configurationService: IConfigurationService, - @IConfigurationService private readonly _workspaceConfigurationService: IConfigurationService, + @IExtensionManagementService private readonly _extensionManagementService: IExtensionManagementService, @INotificationService private readonly _notificationService: INotificationService, @IStorageService private readonly _storageService: IStorageService ) { @@ -174,9 +177,9 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { public checkWorkspaceShellPermissions(osOverride: platform.OperatingSystem = platform.OS): boolean { // Check whether there is a workspace setting const platformKey = osOverride === platform.OperatingSystem.Windows ? 'windows' : osOverride === platform.OperatingSystem.Macintosh ? 'osx' : 'linux'; - const shellConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shell.${platformKey}`); - const shellArgsConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shellArgs.${platformKey}`); - const envConfigValue = this._workspaceConfigurationService.inspect<{ [key: string]: string }>(`terminal.integrated.env.${platformKey}`); + const shellConfigValue = this._configurationService.inspect(`terminal.integrated.shell.${platformKey}`); + const shellArgsConfigValue = this._configurationService.inspect(`terminal.integrated.shellArgs.${platformKey}`); + const envConfigValue = this._configurationService.inspect<{ [key: string]: string }>(`terminal.integrated.env.${platformKey}`); // Check if workspace setting exists and whether it's whitelisted let isWorkspaceShellAllowed: boolean | undefined = false; @@ -244,4 +247,48 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { } return r; } + + private readonly NO_RECOMMENDATIONS_KEY = 'terminalConfigHelper/launchRecommendationsIgnore'; + private recommendationsShown = false; + + public async showRecommendations(shellLaunchConfig: IShellLaunchConfig): Promise { + if (this.recommendationsShown) { + return; + } + this.recommendationsShown = true; + + if (platform.isWindows && shellLaunchConfig.executable && basename(shellLaunchConfig.executable).toLowerCase() === 'wsl.exe') { + if (this._storageService.getBoolean(this.NO_RECOMMENDATIONS_KEY, StorageScope.WORKSPACE, false)) { + return; + } + + if (! await this.isExtensionInstalled('ms-vscode-remote.remote-wsl')) { + this._notificationService.prompt( + Severity.Info, + nls.localize( + 'useWslExtension.title', + "Use the 'Remote WSL' extension for developping in WSL . Click [here]({0}) to learn more.", + 'https://go.microsoft.com/fwlink/?linkid=2097212' + ), + [ + { + label: nls.localize('doNotShowAgain', "Don't Show Again"), + run: () => { + this._storageService.store(this.NO_RECOMMENDATIONS_KEY, true, StorageScope.WORKSPACE); + } + } + ], + { + sticky: true + } + ); + } + } + } + + private isExtensionInstalled(id: string): Promise { + return this._extensionManagementService.getInstalled(ExtensionType.User).then(extensions => { + return extensions.some(e => e.identifier.id === id); + }); + } } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index 5bbb0612709..3d6317a6078 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -197,6 +197,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { const lastActiveWorkspace = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; const envFromConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.env.${platformKey}`); const isWorkspaceShellAllowed = this._configHelper.checkWorkspaceShellPermissions(); + this._configHelper.showRecommendations(shellLaunchConfig); const baseEnv = this._configHelper.config.inheritEnv ? process.env as platform.IProcessEnvironment : await this._terminalInstanceService.getMainProcessParentEnv(); const env = terminalEnvironment.createTerminalEnvironment(shellLaunchConfig, lastActiveWorkspace, envFromConfigValue, this._configurationResolverService, isWorkspaceShellAllowed, this._productService.version, this._configHelper.config.setLocaleVariables, baseEnv); diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index dfd82834397..c126bf70978 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -122,6 +122,7 @@ export interface ITerminalConfigHelper { /** Sets whether a workspace shell configuration is allowed or not */ setWorkspaceShellAllowed(isAllowed: boolean): void; checkWorkspaceShellPermissions(osOverride?: OperatingSystem): boolean; + showRecommendations(shellLaunchConfig: IShellLaunchConfig): void; } export interface ITerminalFont { From 0f90403c57c5f50193984b6ab710f82c511084a4 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 16 Jul 2019 17:05:57 +0200 Subject: [PATCH 076/190] windows/code.sh: convert to sh --- resources/win32/bin/code.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/resources/win32/bin/code.sh b/resources/win32/bin/code.sh index 4a312474df1..6ae88507877 100644 --- a/resources/win32/bin/code.sh +++ b/resources/win32/bin/code.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -11,7 +11,7 @@ VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")" ELECTRON="$VSCODE_PATH/$NAME.exe" if grep -qi Microsoft /proc/version; then # in a wsl shell - if ! [ -z "$WSL_DISTRO_NAME" ]; then + if [ "$WSL_DISTRO_NAME" ]; then # $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2 WSL_BUILD=18362 else @@ -26,21 +26,16 @@ if grep -qi Microsoft /proc/version; then # WSLPATH is available since WSL build 17046 # WSLENV is available since WSL build 17063 export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV + CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js") # use the Remote WSL extension if installed - pushd "$VSCODE_PATH" > /dev/null WSL_EXT_ID="ms-vscode-remote.remote-wsl" - WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ELECTRON" ".\resources\app\out\cli.js" --locate-extension $WSL_EXT_ID) - popd > /dev/null - - if ! [ -z "$WSL_EXT_WLOC" ]; then + WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID) + if [ -n "$WSL_EXT_WLOC" ]; then # replace \r\n with \n in WSL_EXT_WLOC WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh - WIN_CODE_CMD=$ELECTRON - "$WSL_CODE" "$COMMIT" "$QUALITY" "$WIN_CODE_CMD" "$APP_NAME" "$DATAFOLDER" "$@" + "$WSL_CODE" "$COMMIT" "$QUALITY" "$ELECTRON" "$APP_NAME" "$DATAFOLDER" "$@" exit $? - else - CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js") fi else # If running under older WSL, don't pass cli.js to Electron as From c08d8b424c9aa5120155b0ae8a03f95cff2c90bd Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 16 Jul 2019 17:09:34 +0200 Subject: [PATCH 077/190] introduce gallery machine id resource in env --- .../environment/common/environment.ts | 2 + .../environment/node/environmentService.ts | 3 ++ .../common/extensionGalleryService.ts | 49 ++++++++++--------- .../environment/browser/environmentService.ts | 1 + 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index d889e685a0b..e5e0f59d3ef 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -170,4 +170,6 @@ export interface IEnvironmentService { webviewEndpoint?: string; readonly webviewResourceRoot: string; readonly webviewCspSource: string; + + readonly galleryMachineIdResource?: URI; } diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index dcda4352784..e4635b7fc32 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -266,6 +266,9 @@ export class EnvironmentService implements IEnvironmentService { @memoize get nodeCachedDataDir(): string | undefined { return process.env['VSCODE_NODE_CACHED_DATA_DIR'] || undefined; } + @memoize + get galleryMachineIdResource(): URI { return resources.joinPath(URI.file(this.userDataPath), 'machineid'); } + get disableUpdates(): boolean { return !!this._args['disable-updates']; } get disableCrashReporter(): boolean { return !!this._args['disable-crash-reporter']; } diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index 08c4c3a022f..3c7e35fb2f3 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -9,7 +9,7 @@ import { getGalleryExtensionId, getGalleryExtensionTelemetryData, adoptToGallery import { assign, getOrDefault } from 'vs/base/common/objects'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IPager } from 'vs/base/common/paging'; -import { IRequestService, IRequestOptions, IRequestContext, asJson, asText } from 'vs/platform/request/common/request'; +import { IRequestService, IRequestOptions, IRequestContext, asJson, asText, IHeaders } from 'vs/platform/request/common/request'; import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { generateUuid, isUUID } from 'vs/base/common/uuid'; @@ -774,29 +774,30 @@ export class ExtensionGalleryService implements IExtensionGalleryService { } export async function resolveMarketplaceHeaders(version: string, environmentService: IEnvironmentService, fileService: IFileService): Promise<{ [key: string]: string; }> { - const marketplaceMachineIdFile = joinPath(URI.file(environmentService.userDataPath), 'machineid'); - - let uuid: string | null = null; - - try { - const contents = await fileService.readFile(marketplaceMachineIdFile); - const value = contents.value.toString(); - uuid = isUUID(value) ? value : null; - } catch (e) { - uuid = null; - } - - if (!uuid) { - uuid = generateUuid(); - try { - await fileService.writeFile(marketplaceMachineIdFile, VSBuffer.fromString(uuid)); - } catch (error) { - //noop - } - } - return { + const headers: IHeaders = { 'X-Market-Client-Id': `VSCode ${version}`, - 'User-Agent': `VSCode ${version}`, - 'X-Market-User-Id': uuid + 'User-Agent': `VSCode ${version}` }; + let uuid: string | null = null; + if (environmentService.galleryMachineIdResource) { + try { + const contents = await fileService.readFile(environmentService.galleryMachineIdResource); + const value = contents.value.toString(); + uuid = isUUID(value) ? value : null; + } catch (e) { + uuid = null; + } + + if (!uuid) { + uuid = generateUuid(); + try { + await fileService.writeFile(environmentService.galleryMachineIdResource, VSBuffer.fromString(uuid)); + } catch (error) { + //noop + } + } + headers['X-Market-User-Id'] = uuid; + } + return headers; + } \ No newline at end of file diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index 6ee56a1d50e..f6d67298ba0 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -143,6 +143,7 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService { driverHandle?: string; driverVerbose: boolean; webviewEndpoint?: string; + galleryMachineIdResource?: URI; get webviewResourceRoot(): string { return this.webviewEndpoint ? this.webviewEndpoint + '/vscode-resource{{resource}}' : 'vscode-resource:{{resource}}'; From 7a8e27f205de2e4ec727a94ff5a4d0f9cba180ed Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 16 Jul 2019 17:26:42 +0200 Subject: [PATCH 078/190] wording --- .../workbench/contrib/terminal/browser/terminalConfigHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts index 48d1cd513b4..0da7d6c690b 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts @@ -267,7 +267,7 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { Severity.Info, nls.localize( 'useWslExtension.title', - "Use the 'Remote WSL' extension for developping in WSL . Click [here]({0}) to learn more.", + "Check out the 'Visual Studio Code Remote - WSL' extension for a great development experience in WSL. Click [here]({0}) to learn more.", 'https://go.microsoft.com/fwlink/?linkid=2097212' ), [ From dbf2651e868c26647aa99cb6aa921f82b5a3e4f8 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Tue, 16 Jul 2019 08:32:57 -0700 Subject: [PATCH 079/190] Update tree filter icons --- src/vs/base/browser/ui/list/list.css | 6 ++-- .../base/browser/ui/list/media/close-dark.svg | 4 ++- .../base/browser/ui/list/media/close-hc.svg | 34 ++----------------- .../browser/ui/list/media/close-light.svg | 3 ++ src/vs/base/browser/ui/list/media/close.svg | 1 - .../browser/ui/list/media/filter-dark.svg | 4 +-- .../base/browser/ui/list/media/filter-hc.svg | 4 +-- .../browser/ui/list/media/filter-light.svg | 3 ++ src/vs/base/browser/ui/list/media/filter.svg | 5 --- .../browser/ui/list/media/no-filter-dark.svg | 4 +-- .../browser/ui/list/media/no-filter-hc.svg | 4 +-- .../browser/ui/list/media/no-filter-light.svg | 3 ++ .../base/browser/ui/list/media/no-filter.svg | 5 --- 13 files changed, 21 insertions(+), 59 deletions(-) create mode 100644 src/vs/base/browser/ui/list/media/close-light.svg delete mode 100644 src/vs/base/browser/ui/list/media/close.svg create mode 100644 src/vs/base/browser/ui/list/media/filter-light.svg delete mode 100644 src/vs/base/browser/ui/list/media/filter.svg create mode 100644 src/vs/base/browser/ui/list/media/no-filter-light.svg delete mode 100644 src/vs/base/browser/ui/list/media/no-filter.svg diff --git a/src/vs/base/browser/ui/list/list.css b/src/vs/base/browser/ui/list/list.css index 3aa2e653473..1c1fa4c8223 100644 --- a/src/vs/base/browser/ui/list/list.css +++ b/src/vs/base/browser/ui/list/list.css @@ -126,13 +126,13 @@ -webkit-appearance: none; width: 16px; height: 16px; - background: url("media/no-filter.svg"); + background: url("media/no-filter-light.svg"); background-position: 50% 50%; cursor: pointer; } .monaco-list-type-filter > .controls > .filter:checked { - background-image: url("media/filter.svg"); + background-image: url("media/filter-light.svg"); } .vs-dark .monaco-list-type-filter > .controls > .filter { @@ -153,7 +153,7 @@ .monaco-list-type-filter > .controls > .clear { border: none; - background: url("media/close.svg"); + background: url("media/close-light.svg"); cursor: pointer; } diff --git a/src/vs/base/browser/ui/list/media/close-dark.svg b/src/vs/base/browser/ui/list/media/close-dark.svg index 751e89b3b02..7305a8f099a 100644 --- a/src/vs/base/browser/ui/list/media/close-dark.svg +++ b/src/vs/base/browser/ui/list/media/close-dark.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/vs/base/browser/ui/list/media/close-hc.svg b/src/vs/base/browser/ui/list/media/close-hc.svg index c20895c60aa..7305a8f099a 100644 --- a/src/vs/base/browser/ui/list/media/close-hc.svg +++ b/src/vs/base/browser/ui/list/media/close-hc.svg @@ -1,33 +1,3 @@ - - - - - - image/svg+xml - - - - - - - + + diff --git a/src/vs/base/browser/ui/list/media/close-light.svg b/src/vs/base/browser/ui/list/media/close-light.svg new file mode 100644 index 00000000000..ecddcd665b5 --- /dev/null +++ b/src/vs/base/browser/ui/list/media/close-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/base/browser/ui/list/media/close.svg b/src/vs/base/browser/ui/list/media/close.svg deleted file mode 100644 index fde34404d4e..00000000000 --- a/src/vs/base/browser/ui/list/media/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/base/browser/ui/list/media/filter-dark.svg b/src/vs/base/browser/ui/list/media/filter-dark.svg index 0925909a117..46c35f4374d 100644 --- a/src/vs/base/browser/ui/list/media/filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/filter-dark.svg @@ -1,5 +1,3 @@ - - - + diff --git a/src/vs/base/browser/ui/list/media/filter-hc.svg b/src/vs/base/browser/ui/list/media/filter-hc.svg index 0e2724f52e2..d7b6bdd3923 100644 --- a/src/vs/base/browser/ui/list/media/filter-hc.svg +++ b/src/vs/base/browser/ui/list/media/filter-hc.svg @@ -1,5 +1,3 @@ - - - + diff --git a/src/vs/base/browser/ui/list/media/filter-light.svg b/src/vs/base/browser/ui/list/media/filter-light.svg new file mode 100644 index 00000000000..2550d80cb70 --- /dev/null +++ b/src/vs/base/browser/ui/list/media/filter-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/base/browser/ui/list/media/filter.svg b/src/vs/base/browser/ui/list/media/filter.svg deleted file mode 100644 index f8c011064b1..00000000000 --- a/src/vs/base/browser/ui/list/media/filter.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/vs/base/browser/ui/list/media/no-filter-dark.svg b/src/vs/base/browser/ui/list/media/no-filter-dark.svg index 5f495c006dc..6fc07d81a55 100644 --- a/src/vs/base/browser/ui/list/media/no-filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/no-filter-dark.svg @@ -1,5 +1,3 @@ - - - + diff --git a/src/vs/base/browser/ui/list/media/no-filter-hc.svg b/src/vs/base/browser/ui/list/media/no-filter-hc.svg index 31d8f70f05a..6fc07d81a55 100644 --- a/src/vs/base/browser/ui/list/media/no-filter-hc.svg +++ b/src/vs/base/browser/ui/list/media/no-filter-hc.svg @@ -1,5 +1,3 @@ - - - + diff --git a/src/vs/base/browser/ui/list/media/no-filter-light.svg b/src/vs/base/browser/ui/list/media/no-filter-light.svg new file mode 100644 index 00000000000..3608b15d29e --- /dev/null +++ b/src/vs/base/browser/ui/list/media/no-filter-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/base/browser/ui/list/media/no-filter.svg b/src/vs/base/browser/ui/list/media/no-filter.svg deleted file mode 100644 index 760cc3c4403..00000000000 --- a/src/vs/base/browser/ui/list/media/no-filter.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From 0a8ca638f1f64ee0d330b74f8a04d8a22d83efbe Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Tue, 16 Jul 2019 09:23:38 -0700 Subject: [PATCH 080/190] Resolve Terminal arguments (#76895) * Resolved terminal argds * Move location of resolution * Fix routing of resolver in extHost * Remove unnecessary comma * Compilation errors * some async stuff * Undo changes * Variable resolver in constructor * Load resolver upon construction of extHostTerminalService * Utilize last active workspace root * Reevaluate variableReoslver whenever the workspace gets new folder * Fix types for string shellArgs * Use async one level higher * Fix compile issue * Initialize resolver when exthost is created * Fix ext host in remote case with no folder open * Resolve args that an ecxctension passes in * Remove TODO * Resolve extension arguments --- .../api/node/extHostTerminalService.ts | 53 ++++++++++++++++--- .../browser/terminalProcessManager.ts | 20 +++++-- .../terminal/common/terminalEnvironment.ts | 26 +++++++-- .../terminalInstanceService.ts | 17 +++++- 4 files changed, 99 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 56d11496bb0..37044a2f362 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -286,6 +286,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { private _terminalProcesses: { [id: number]: ITerminalChildProcess } = {}; private _terminalRenderers: ExtHostTerminalRenderer[] = []; private _getTerminalPromises: { [id: number]: Promise } = {}; + private _variableResolver: ExtHostVariableResolverService | undefined; + private _lastActiveWorkspace: IWorkspaceFolder | undefined; // TODO: Pull this from main side private _isWorkspaceShellAllowed: boolean = false; @@ -307,9 +309,12 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { private _extHostConfiguration: ExtHostConfiguration, private _extHostWorkspace: ExtHostWorkspace, private _extHostDocumentsAndEditors: ExtHostDocumentsAndEditors, - private _logService: ILogService, + private _logService: ILogService ) { this._proxy = mainContext.getProxy(MainContext.MainThreadTerminalService); + this.updateLastActiveWorkspace(); + this.updateVariableResolver(); + this.registerListeners(); } public createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal { @@ -366,18 +371,21 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._isWorkspaceShellAllowed, getSystemShell(platform.platform), process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432'), - process.env.windir + process.env.windir, + this._lastActiveWorkspace, + this._variableResolver ); } - private _getDefaultShellArgs(configProvider: ExtHostConfigProvider): string[] | string | undefined { + private _getDefaultShellArgs(configProvider: ExtHostConfigProvider): string[] | string { const fetchSetting = (key: string) => { const setting = configProvider .getConfiguration(key.substr(0, key.lastIndexOf('.'))) .inspect(key.substr(key.lastIndexOf('.') + 1)); return this._apiInspectConfigToPlain(setting); }; - return terminalEnvironment.getDefaultShellArgs(fetchSetting, this._isWorkspaceShellAllowed); + + return terminalEnvironment.getDefaultShellArgs(fetchSetting, this._isWorkspaceShellAllowed, this._lastActiveWorkspace, this._variableResolver); } public async resolveTerminalRenderer(id: number): Promise { @@ -526,6 +534,24 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { return env; } + private registerListeners(): void { + this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(() => this.updateLastActiveWorkspace()); + this._extHostWorkspace.onDidChangeWorkspace(() => this.updateVariableResolver()); + } + + private updateLastActiveWorkspace(): void { + const activeEditor = this._extHostDocumentsAndEditors.activeEditor(); + if (activeEditor) { + this._lastActiveWorkspace = this._extHostWorkspace.getWorkspaceFolder(activeEditor.document.uri) as IWorkspaceFolder; + } + } + + private async updateVariableResolver(): Promise { + const configProvider = await this._extHostConfiguration.getConfigProvider(); + const workspaceFolders = await this._extHostWorkspace.getWorkspaceFolders2(); + this._variableResolver = new ExtHostVariableResolverService(workspaceFolders || [], this._extHostDocumentsAndEditors, configProvider); + } + public async $createProcess(id: number, shellLaunchConfigDto: ShellLaunchConfigDto, activeWorkspaceRootUriComponents: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): Promise { const shellLaunchConfig: IShellLaunchConfig = { name: shellLaunchConfigDto.name, @@ -541,6 +567,21 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { if (!shellLaunchConfig.executable) { shellLaunchConfig.executable = this.getDefaultShell(configProvider); shellLaunchConfig.args = this._getDefaultShellArgs(configProvider); + } else { + if (this._variableResolver) { + shellLaunchConfig.executable = this._variableResolver.resolve(this._lastActiveWorkspace, shellLaunchConfig.executable); + if (shellLaunchConfig.args) { + if (Array.isArray(shellLaunchConfig.args)) { + const resolvedArgs: string[] = []; + for (const arg of shellLaunchConfig.args) { + resolvedArgs.push(this._variableResolver.resolve(this._lastActiveWorkspace, arg)); + } + shellLaunchConfig.args = resolvedArgs; + } else { + shellLaunchConfig.args = this._variableResolver.resolve(this._lastActiveWorkspace, shellLaunchConfig.args); + } + } + } } // Get the initial cwd @@ -559,14 +600,12 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { } } as IWorkspaceFolder : null; const envFromConfig = this._apiInspectConfigToPlain(configProvider.getConfiguration('terminal.integrated').inspect(`env.${platformKey}`)); - const workspaceFolders = await this._extHostWorkspace.getWorkspaceFolders2(); - const variableResolver = workspaceFolders ? new ExtHostVariableResolverService(workspaceFolders, this._extHostDocumentsAndEditors, configProvider) : undefined; const baseEnv = terminalConfig.get('inheritEnv', true) ? process.env as platform.IProcessEnvironment : await this._getNonInheritedEnv(); const env = terminalEnvironment.createTerminalEnvironment( shellLaunchConfig, lastActiveWorkspace, envFromConfig, - variableResolver, + this._variableResolver, isWorkspaceShellAllowed, pkg.version, terminalConfig.get('setLocaleVariables', false), diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index 5bbb0612709..bfa9741748e 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -184,17 +184,29 @@ export class TerminalProcessManager implements ITerminalProcessManager { rows: number, isScreenReaderModeEnabled: boolean ): Promise { + const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file); + const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); + const lastActiveWorkspace = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; if (!shellLaunchConfig.executable) { const defaultConfig = await this._terminalInstanceService.getDefaultShellAndArgs(); shellLaunchConfig.executable = defaultConfig.shell; shellLaunchConfig.args = defaultConfig.args; + } else { + shellLaunchConfig.executable = this._configurationResolverService.resolve(lastActiveWorkspace === null ? undefined : lastActiveWorkspace, shellLaunchConfig.executable); + if (shellLaunchConfig.args) { + if (Array.isArray(shellLaunchConfig.args)) { + const resolvedArgs: string[] = []; + for (const arg of shellLaunchConfig.args) { + resolvedArgs.push(this._configurationResolverService.resolve(lastActiveWorkspace === null ? undefined : lastActiveWorkspace, arg)); + } + shellLaunchConfig.args = resolvedArgs; + } else { + shellLaunchConfig.args = this._configurationResolverService.resolve(lastActiveWorkspace === null ? undefined : lastActiveWorkspace, shellLaunchConfig.args); + } + } } - const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file); const initialCwd = terminalEnvironment.getCwd(shellLaunchConfig, this._environmentService.userHome, activeWorkspaceRootUri, this._configHelper.config.cwd); - - const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); - const lastActiveWorkspace = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; const envFromConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.env.${platformKey}`); const isWorkspaceShellAllowed = this._configHelper.checkWorkspaceShellPermissions(); const baseEnv = this._configHelper.config.inheritEnv ? process.env as platform.IProcessEnvironment : await this._terminalInstanceService.getMainProcessParentEnv(); diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index db22a46964d..58b897d4aa6 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -169,7 +169,9 @@ export function getDefaultShell( defaultShell: string, isWoW64: boolean, windir: string | undefined, - platformOverride: platform.Platform = platform.platform + lastActiveWorkspace: IWorkspaceFolder | undefined, + configurationResolverService: IConfigurationResolverService | undefined, + platformOverride: platform.Platform = platform.platform, ): string { const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux'; const shellConfigValue = fetchSetting(`terminal.integrated.shell.${platformKey}`); @@ -190,17 +192,33 @@ export function getDefaultShell( executable = executable.replace(/\//g, '\\'); } + if (configurationResolverService) { + executable = configurationResolverService.resolve(lastActiveWorkspace, executable); + } + return executable; } export function getDefaultShellArgs( fetchSetting: (key: string) => { user: string | string[] | undefined, value: string | string[] | undefined, default: string | string[] | undefined }, isWorkspaceShellAllowed: boolean, - platformOverride: platform.Platform = platform.platform -): string[] { + lastActiveWorkspace: IWorkspaceFolder | undefined, + configurationResolverService: IConfigurationResolverService | undefined, + platformOverride: platform.Platform = platform.platform, +): string | string[] { const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux'; const shellArgsConfigValue = fetchSetting(`terminal.integrated.shellArgs.${platformKey}`); - const args = (isWorkspaceShellAllowed ? shellArgsConfigValue.value : shellArgsConfigValue.user) || shellArgsConfigValue.default; + let args = ((isWorkspaceShellAllowed ? shellArgsConfigValue.value : shellArgsConfigValue.user) || shellArgsConfigValue.default); + if (typeof args === 'string' && platformOverride === platform.Platform.Windows) { + return configurationResolverService ? configurationResolverService.resolve(lastActiveWorkspace, args) : args; + } + if (configurationResolverService) { + const resolvedArgs: string[] = []; + for (const arg of args) { + resolvedArgs.push(configurationResolverService.resolve(lastActiveWorkspace, arg)); + } + args = resolvedArgs; + } return args; } diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts index 94b5a713671..e9b13c0d68f 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts @@ -17,6 +17,9 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { getDefaultShell, getDefaultShellArgs } from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage'; import { getMainProcessParentEnv } from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; +import { IHistoryService } from 'vs/workbench/services/history/common/history'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; let Terminal: typeof XTermTerminal; let WebLinksAddon: typeof XTermWebLinksAddon; @@ -28,7 +31,10 @@ export class TerminalInstanceService implements ITerminalInstanceService { constructor( @IInstantiationService private readonly _instantiationService: IInstantiationService, @IConfigurationService private readonly _configurationService: IConfigurationService, - @IStorageService private readonly _storageService: IStorageService + @IStorageService private readonly _storageService: IStorageService, + @IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService, + @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, + @IHistoryService private readonly _historyService: IHistoryService ) { } @@ -65,19 +71,26 @@ export class TerminalInstanceService implements ITerminalInstanceService { return this._storageService.getBoolean(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, StorageScope.WORKSPACE, false); } - public getDefaultShellAndArgs(platformOverride: Platform = platform): Promise<{ shell: string, args: string[] | undefined }> { + public getDefaultShellAndArgs(platformOverride: Platform = platform): Promise<{ shell: string, args: string | string[] }> { const isWorkspaceShellAllowed = this._isWorkspaceShellAllowed(); + const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(); + let lastActiveWorkspace = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : undefined; + lastActiveWorkspace = lastActiveWorkspace === null ? undefined : lastActiveWorkspace; const shell = getDefaultShell( (key) => this._configurationService.inspect(key), isWorkspaceShellAllowed, getSystemShell(platformOverride), process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432'), process.env.windir, + lastActiveWorkspace, + this._configurationResolverService, platformOverride ); const args = getDefaultShellArgs( (key) => this._configurationService.inspect(key), isWorkspaceShellAllowed, + lastActiveWorkspace, + this._configurationResolverService, platformOverride ); return Promise.resolve({ shell, args }); From 67605407a69c34853b300d8b848492b36ed00b64 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 16 Jul 2019 11:56:51 -0700 Subject: [PATCH 081/190] Don't sanitize terminal config env vars Fixes #77440 --- .../contrib/terminal/common/terminalEnvironment.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index 58b897d4aa6..7442639d505 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -255,14 +255,14 @@ export function createTerminalEnvironment( } } - // Merge config (settings) and ShellLaunchConfig environments - mergeEnvironments(env, allowedEnvFromConfig); - mergeEnvironments(env, shellLaunchConfig.env); - // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables sanitizeProcessEnvironment(env, 'VSCODE_IPC_HOOK_CLI'); + // Merge config (settings) and ShellLaunchConfig environments + mergeEnvironments(env, allowedEnvFromConfig); + mergeEnvironments(env, shellLaunchConfig.env); + // Adding other env keys necessary to create the process addTerminalEnvironmentKeys(env, version, platform.locale, setLocaleVariables); } From 1ed9be719ce6f0ffd78bf418c670997bc1479ea4 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Tue, 16 Jul 2019 11:56:49 -0700 Subject: [PATCH 082/190] Warning in console when keyboard layout mismatch --- src/vs/workbench/services/keybinding/browser/keymapService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vs/workbench/services/keybinding/browser/keymapService.ts b/src/vs/workbench/services/keybinding/browser/keymapService.ts index 401dede8db9..a0d6e007f79 100644 --- a/src/vs/workbench/services/keybinding/browser/keymapService.ts +++ b/src/vs/workbench/services/keybinding/browser/keymapService.ts @@ -200,6 +200,8 @@ export class BrowserKeyboardMapperFactoryBase { }] ); + console.warn('Active keymap/keyevent does not match current keyboard layout', JSON.stringify(keymap), this._activeKeymapInfo ? JSON.stringify(this._activeKeymapInfo.layout) : ''); + return; } From 8d09c994e8ddb4b2df625a79533a7d8f94e55892 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 14:40:14 -0700 Subject: [PATCH 083/190] Extract WebviewIconsManager --- .../webview/browser/webviewEditorInput.ts | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index d6133b09e04..aadd6394c0b 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -3,49 +3,59 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as dom from 'vs/base/browser/dom'; +import { memoize } from 'vs/base/common/decorators'; import { Emitter } from 'vs/base/common/event'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IEditorModel } from 'vs/platform/editor/common/editor'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { EditorInput, EditorModel, GroupIdentifier, IEditorInput } from 'vs/workbench/common/editor'; +import { Webview, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { WebviewEvents, WebviewInputOptions } from './webviewEditorService'; -import { Webview, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; -export class WebviewEditorInput extends EditorInput { +class WebviewIconsManager { + private readonly _icons = new Map(); - private static _styleElement?: HTMLStyleElement; + @memoize + private get _styleElement(): HTMLStyleElement { + const element = dom.createStyleSheet(); + element.className = 'webview-icons'; + return element; + } - private static _icons = new Map(); - - private static updateStyleElement( - id: string, + public setIcons( + webviewId: string, iconPath: { light: URI, dark: URI } | undefined ) { - if (!this._styleElement) { - this._styleElement = dom.createStyleSheet(); - this._styleElement.className = 'webview-icons'; - } - - if (!iconPath) { - this._icons.delete(id); + if (iconPath) { + this._icons.set(webviewId, iconPath); } else { - this._icons.set(id, iconPath); + this._icons.delete(webviewId); } + this.updateStyleSheet(); + } + + private updateStyleSheet() { const cssRules: string[] = []; this._icons.forEach((value, key) => { const webviewSelector = `.show-file-icons .webview-${key}-name-file-icon::before`; if (URI.isUri(value)) { cssRules.push(`${webviewSelector} { content: ""; background-image: url(${dom.asDomUri(value).toString()}); }`); - } else { + } + else { cssRules.push(`.vs ${webviewSelector} { content: ""; background-image: url(${dom.asDomUri(value.light).toString()}); }`); cssRules.push(`.vs-dark ${webviewSelector} { content: ""; background-image: url(${dom.asDomUri(value.dark).toString()}); }`); } }); this._styleElement.innerHTML = cssRules.join('\n'); } +} + +export class WebviewEditorInput extends EditorInput { + + private readonly iconsManager = new WebviewIconsManager(); public static readonly typeId = 'workbench.editors.webviewInput'; @@ -144,7 +154,7 @@ export class WebviewEditorInput extends EditorInput { public set iconPath(value: { light: URI, dark: URI } | undefined) { this._iconPath = value; - WebviewEditorInput.updateStyleElement(this.id, value); + this.iconsManager.setIcons(this.id, value); } public matches(other: IEditorInput): boolean { From cdfa3c541813c07f3432d5db6e7f5717352f0930 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 14:45:15 -0700 Subject: [PATCH 084/190] Mark that property may not be initialized yet --- .../contrib/update/electron-browser/releaseNotesEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts index b4803e191fa..c6d72b3e1f8 100644 --- a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts @@ -51,7 +51,7 @@ export class ReleaseNotesManager { private _releaseNotesCache: { [version: string]: Promise; } = Object.create(null); private _currentReleaseNotes: WebviewEditorInput | undefined = undefined; - private _lastText: string; + private _lastText: string | undefined; public constructor( @IEnvironmentService private readonly _environmentService: IEnvironmentService, From 112fa76c775ecb79ac2c9e9e5dba0d711d523543 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:02:31 -0700 Subject: [PATCH 085/190] Remove empty ctor and mark readonly --- src/vs/base/common/lifecycle.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vs/base/common/lifecycle.ts b/src/vs/base/common/lifecycle.ts index 66143bb94b7..79f206f23be 100644 --- a/src/vs/base/common/lifecycle.ts +++ b/src/vs/base/common/lifecycle.ts @@ -213,9 +213,7 @@ export interface IReference extends IDisposable { export abstract class ReferenceCollection { - private references: Map = new Map(); - - constructor() { } + private readonly references: Map = new Map(); acquire(key: string): IReference { let reference = this.references.get(key); From e51ecc4699230605485a8f516e5c339464361f28 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 00:55:07 +0200 Subject: [PATCH 086/190] Make local extension managment server optional --- .../common/extensionManagement.ts | 2 +- .../extensions/browser/extensionsActions.ts | 54 ++++++-------- .../extensions/browser/extensionsViewlet.ts | 13 ++-- .../extensions/browser/extensionsWidgets.ts | 21 +++--- .../browser/extensionsWorkbenchService.ts | 54 +++++++++----- .../extensionsActions.test.ts | 2 +- .../electron-browser/extensionsViews.test.ts | 3 +- .../extensionManagementServerService.ts | 17 +++-- ...ement.ts => extensionManagementService.ts} | 71 +++++++++++++------ .../extensionManagementServerService.ts | 10 ++- .../node/extensionEnablementService.ts | 2 +- ...ement.ts => extensionManagementService.ts} | 9 ++- src/vs/workbench/workbench.main.ts | 3 +- src/vs/workbench/workbench.web.main.ts | 15 ++-- 14 files changed, 158 insertions(+), 118 deletions(-) rename src/vs/workbench/services/extensionManagement/common/{extensionManagement.ts => extensionManagementService.ts} (74%) rename src/vs/workbench/services/extensionManagement/node/{extensionManagement.ts => extensionManagementService.ts} (79%) diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 0edfddb4904..0c4035b4a8f 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -216,7 +216,7 @@ export interface IExtensionManagementServer { export interface IExtensionManagementServerService { _serviceBrand: any; - readonly localExtensionManagementServer: IExtensionManagementServer; + readonly localExtensionManagementServer: IExtensionManagementServer | null; readonly remoteExtensionManagementServer: IExtensionManagementServer | null; getExtensionManagementServer(location: URI): IExtensionManagementServer | null; } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index dce34147deb..5ba999de322 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -15,7 +15,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; -import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; @@ -54,9 +54,7 @@ import { alert } from 'vs/base/browser/ui/aria/aria'; import { coalesce } from 'vs/base/common/arrays'; import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING, IFileIconTheme, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { ILabelService } from 'vs/platform/label/common/label'; -import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IProductService } from 'vs/platform/product/common/product'; @@ -162,10 +160,10 @@ export class InstallAction extends ExtensionAction { @IOpenerService private readonly openerService: IOpenerService, @IExtensionService private readonly runtimeExtensionService: IExtensionService, @IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService, @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService private readonly productService: IProductService, - @ILabelService private readonly labelService: ILabelService + @ILabelService private readonly labelService: ILabelService, + @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService ) { super(`extensions.install`, InstallAction.INSTALL_LABEL, InstallAction.Class, false); this.update(); @@ -193,12 +191,12 @@ export class InstallAction extends ExtensionAction { this.label = InstallAction.INSTALLING_LABEL; this.tooltip = InstallAction.INSTALLING_LABEL; } else { - if (this._manifest && this.workbenchEnvironmentService.configuration.remoteAuthority) { + if (this._manifest && this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { if (isUIExtension(this._manifest, this.productService, this.configurationService)) { this.label = `${InstallAction.INSTALL_LABEL} ${localize('locally', "Locally")}`; this.tooltip = `${InstallAction.INSTALL_LABEL} ${localize('locally', "Locally")}`; } else { - const host = this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.workbenchEnvironmentService.configuration.remoteAuthority) || localize('remote', "Remote"); + const host = this.extensionManagementServerService.remoteExtensionManagementServer.label; this.label = `${InstallAction.INSTALL_LABEL} on ${host}`; this.tooltip = `${InstallAction.INSTALL_LABEL} on ${host}`; } @@ -285,7 +283,6 @@ export class RemoteInstallAction extends ExtensionAction { constructor( @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @ILabelService private readonly labelService: ILabelService, - @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService private readonly productService: IProductService, @@ -302,10 +299,9 @@ export class RemoteInstallAction extends ExtensionAction { this.tooltip = this.label; return; } - const remoteAuthority = this.environmentService.configuration.remoteAuthority; - if (remoteAuthority) { - const host = this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.environmentService.configuration.remoteAuthority) || localize('remote', "Remote"); - this.label = `${RemoteInstallAction.INSTALL_LABEL} on ${host}`; + const remoteServer = this.extensionManagementServerService.remoteExtensionManagementServer; + if (remoteServer) { + this.label = `${RemoteInstallAction.INSTALL_LABEL} on ${remoteServer.label}`; this.tooltip = this.label; return; } @@ -320,7 +316,7 @@ export class RemoteInstallAction extends ExtensionAction { this.updateLabel(); return; } - if (this.environmentService.configuration.remoteAuthority + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer // Installed User Extension && this.extension && this.extension.local && this.extension.type === ExtensionType.User && this.extension.state === ExtensionState.Installed // Local Workspace Extension @@ -364,7 +360,6 @@ export class LocalInstallAction extends ExtensionAction { constructor( @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @ILabelService private readonly labelService: ILabelService, - @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService private readonly productService: IProductService, @@ -394,7 +389,7 @@ export class LocalInstallAction extends ExtensionAction { this.updateLabel(); return; } - if (this.environmentService.configuration.remoteAuthority + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer // Installed User Extension && this.extension && this.extension.local && this.extension.type === ExtensionType.User && this.extension.state === ExtensionState.Installed // Remote UI or Language pack Extension @@ -410,7 +405,7 @@ export class LocalInstallAction extends ExtensionAction { } async run(): Promise { - if (!this.installing) { + if (this.extensionManagementServerService.localExtensionManagementServer && !this.installing) { this.installing = true; this.update(); this.extensionsWorkbenchService.open(this.extension); @@ -1206,7 +1201,6 @@ export class ReloadAction extends ExtensionAction { @IExtensionService private readonly extensionService: IExtensionService, @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService, @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService, @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService private readonly productService: IProductService, ) { @@ -1287,7 +1281,7 @@ export class ReloadAction extends ExtensionAction { this.tooltip = localize('postEnableTooltip', "Please reload Visual Studio Code to enable this extension."); return; } - if (this.workbenchEnvironmentService.configuration.remoteAuthority) { + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { const uiExtension = isUIExtension(this.extension.local.manifest, this.productService, this.configurationService); // Local Workspace Extension if (!uiExtension && this.extension.server === this.extensionManagementServerService.localExtensionManagementServer) { @@ -1716,8 +1710,10 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action { try { if (extension.local && extension.gallery) { if (isUIExtension(extension.local.manifest, this.productService, this.configurationService)) { - await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(extension.gallery); - return; + if (this.extensionManagementServerService.localExtensionManagementServer) { + await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(extension.gallery); + return; + } } else if (this.extensionManagementServerService.remoteExtensionManagementServer) { await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(extension.gallery); return; @@ -2629,7 +2625,6 @@ export class SystemDisabledWarningAction extends ExtensionAction { @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService private readonly productService: IProductService, @ILabelService private readonly labelService: ILabelService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionService private readonly extensionService: IExtensionService, ) { @@ -2652,8 +2647,7 @@ export class SystemDisabledWarningAction extends ExtensionAction { !this.extension.local || !this.extension.server || !this._runningExtensions || - !this.workbenchEnvironmentService.configuration.remoteAuthority || - !this.extensionManagementServerService.remoteExtensionManagementServer || + !(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) || this.extension.state !== ExtensionState.Installed ) { return; @@ -2662,7 +2656,7 @@ export class SystemDisabledWarningAction extends ExtensionAction { if (!this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server)) { this.class = `${SystemDisabledWarningAction.INFO_CLASS}`; this.tooltip = this.extension.server === this.extensionManagementServerService.localExtensionManagementServer - ? localize('Install language pack also in remote server', "Install the language pack extension on '{0}' to enable it also there.", this.getServerLabel(this.extensionManagementServerService.remoteExtensionManagementServer)) + ? localize('Install language pack also in remote server', "Install the language pack extension on '{0}' to enable it also there.", this.extensionManagementServerService.remoteExtensionManagementServer.label) : localize('Install language pack also locally', "Install the language pack extension locally to enable it also there."); } return; @@ -2674,19 +2668,19 @@ export class SystemDisabledWarningAction extends ExtensionAction { if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && !isUIExtension(this.extension.local.manifest, this.productService, this.configurationService)) { if (runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) { this.class = `${SystemDisabledWarningAction.INFO_CLASS}`; - this.tooltip = localize('disabled locally', "Extension is enabled on '{0}' and disabled locally.", this.getServerLabel(this.extensionManagementServerService.remoteExtensionManagementServer)); + this.tooltip = localize('disabled locally', "Extension is enabled on '{0}' and disabled locally.", this.extensionManagementServerService.remoteExtensionManagementServer.label); return; } if (localExtensionServer !== this.extensionManagementServerService.remoteExtensionManagementServer) { this.class = `${SystemDisabledWarningAction.WARNING_CLASS}`; - this.tooltip = localize('Install in remote server', "Install the extension on '{0}' to enable.", this.getServerLabel(this.extensionManagementServerService.remoteExtensionManagementServer)); + this.tooltip = localize('Install in remote server', "Install the extension on '{0}' to enable.", this.extensionManagementServerService.remoteExtensionManagementServer.label); return; } } if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && isUIExtension(this.extension.local.manifest, this.productService, this.configurationService)) { if (runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) { this.class = `${SystemDisabledWarningAction.INFO_CLASS}`; - this.tooltip = localize('disabled remotely', "Extension is enabled locally and disabled on '{0}'.", this.getServerLabel(this.extensionManagementServerService.remoteExtensionManagementServer)); + this.tooltip = localize('disabled remotely', "Extension is enabled locally and disabled on '{0}'.", this.extensionManagementServerService.remoteExtensionManagementServer.label); return; } if (localExtensionServer !== this.extensionManagementServerService.localExtensionManagementServer) { @@ -2697,12 +2691,6 @@ export class SystemDisabledWarningAction extends ExtensionAction { } } - private getServerLabel(server: IExtensionManagementServer): string { - if (server === this.extensionManagementServerService.remoteExtensionManagementServer) { - return this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.workbenchEnvironmentService.configuration.remoteAuthority) || localize('remote', "Remote"); - } - return server.label; - } run(): Promise { return Promise.resolve(null); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index bbfe3e75868..d9272d6d014 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -55,8 +55,6 @@ import { ExtensionType } from 'vs/platform/extensions/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; import { ViewContainerViewlet } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { RemoteAuthorityContext } from 'vs/workbench/browser/contextkeys'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { ILabelService } from 'vs/platform/label/common/label'; import { MementoObject } from 'vs/workbench/common/memento'; @@ -96,7 +94,6 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio constructor( @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, @ILabelService private readonly labelService: ILabelService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService ) { this.registerViews(); } @@ -116,7 +113,9 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio viewDescriptors.push(this.createOtherRecommendedExtensionsListViewDescriptor()); viewDescriptors.push(this.createWorkspaceRecommendedExtensionsListViewDescriptor()); - viewDescriptors.push(...this.createExtensionsViewDescriptorsForServer(this.extensionManagementServerService.localExtensionManagementServer)); + if (this.extensionManagementServerService.localExtensionManagementServer) { + viewDescriptors.push(...this.createExtensionsViewDescriptorsForServer(this.extensionManagementServerService.localExtensionManagementServer)); + } if (this.extensionManagementServerService.remoteExtensionManagementServer) { viewDescriptors.push(...this.createExtensionsViewDescriptorsForServer(this.extensionManagementServerService.remoteExtensionManagementServer)); } @@ -183,15 +182,15 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio private createExtensionsViewDescriptorsForServer(server: IExtensionManagementServer): IViewDescriptor[] { const getViewName = (viewTitle: string, server: IExtensionManagementServer): string => { - const serverLabel = this.workbenchEnvironmentService.configuration.remoteAuthority === server.authority ? this.labelService.getHostLabel(REMOTE_HOST_SCHEME, server.authority) || server.label : server.label; - if (viewTitle && this.workbenchEnvironmentService.configuration.remoteAuthority) { + const serverLabel = server.label; + if (viewTitle && this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { return `${serverLabel} - ${viewTitle}`; } return viewTitle ? viewTitle : serverLabel; }; const getInstalledViewName = (): string => getViewName(localize('installed', "Installed"), server); const getOutdatedViewName = (): string => getViewName(localize('outdated', "Outdated"), server); - const onDidChangeServerLabel: EventOf = this.workbenchEnvironmentService.configuration.remoteAuthority ? EventOf.map(this.labelService.onDidChangeFormatters, () => undefined) : EventOf.None; + const onDidChangeServerLabel: EventOf = EventOf.map(this.labelService.onDidChangeFormatters, () => undefined); return [{ id: `extensions.${server.authority}.installed`, get name() { return getInstalledViewName(); }, diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts index 13ec15781cd..6d8e9578422 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts @@ -14,8 +14,6 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { extensionButtonProminentBackground, extensionButtonProminentForeground, DisabledLabelAction, ReloadAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { EXTENSION_BADGE_REMOTE_BACKGROUND, EXTENSION_BADGE_REMOTE_FOREGROUND } from 'vs/workbench/common/theme'; -import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { Emitter, Event } from 'vs/base/common/event'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -151,8 +149,7 @@ export class TooltipWidget extends ExtensionWidget { private readonly recommendationWidget: RecommendationWidget, private readonly reloadAction: ReloadAction, @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, - @ILabelService private readonly labelService: ILabelService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService + @ILabelService private readonly labelService: ILabelService ) { super(); this._register(Event.any( @@ -184,7 +181,7 @@ export class TooltipWidget extends ExtensionWidget { } if (this.extension.local && this.extension.state === ExtensionState.Installed) { if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer) { - return localize('extension enabled on remote', "Extension is enabled on '{0}'", this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.workbenchEnvironmentService.configuration.remoteAuthority)); + return localize('extension enabled on remote', "Extension is enabled on '{0}'", this.extension.server.label); } return localize('extension enabled locally', "Extension is enabled locally."); } @@ -281,13 +278,11 @@ export class RemoteBadgeWidget extends ExtensionWidget { render(): void { this.clear(); - if (!this.extension || !this.extension.local || !this.extension.server) { + if (!this.extension || !this.extension.local || !this.extension.server || !(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) || this.extension.server !== this.extensionManagementServerService.remoteExtensionManagementServer) { return; } - if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer) { - this.remoteBadge.value = this.instantiationService.createInstance(RemoteBadge, this.tooltip); - append(this.element, this.remoteBadge.value.element); - } + this.remoteBadge.value = this.instantiationService.createInstance(RemoteBadge, this.tooltip); + append(this.element, this.remoteBadge.value.element); } } @@ -299,7 +294,7 @@ class RemoteBadge extends Disposable { private readonly tooltip: boolean, @ILabelService private readonly labelService: ILabelService, @IThemeService private readonly themeService: IThemeService, - @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService + @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService ) { super(); this.element = $('div.extension-remote-badge'); @@ -323,8 +318,8 @@ class RemoteBadge extends Disposable { if (this.tooltip) { const updateTitle = () => { - if (this.element) { - this.element.title = localize('remote extension title', "Extension in {0}", this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.environmentService.configuration.remoteAuthority)); + if (this.element && this.extensionManagementServerService.remoteExtensionManagementServer) { + this.element.title = localize('remote extension title', "Extension in {0}", this.extensionManagementServerService.remoteExtensionManagementServer.label); } }; this._register(this.labelService.onDidChangeFormatters(() => updateTitle())); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 6b5f5bfafed..f9f0abe3e5c 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -472,8 +472,8 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension private static readonly SyncPeriod = 1000 * 60 * 60 * 12; // 12 hours _serviceBrand: any; - private readonly localExtensions: Extensions; - private readonly remoteExtensions: Extensions | null; + private readonly localExtensions: Extensions | null = null; + private readonly remoteExtensions: Extensions | null = null; private syncDelayer: ThrottledDelayer; private autoUpdateDelayer: ThrottledDelayer; @@ -501,13 +501,13 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension @IProductService private readonly productService: IProductService ) { super(); - this.localExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.localExtensionManagementServer, ext => this.getExtensionState(ext))); - this._register(this.localExtensions.onChange(e => this._onChange.fire(e))); + if (this.extensionManagementServerService.localExtensionManagementServer) { + this.localExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.localExtensionManagementServer, ext => this.getExtensionState(ext))); + this._register(this.localExtensions.onChange(e => this._onChange.fire(e))); + } if (this.extensionManagementServerService.remoteExtensionManagementServer) { this.remoteExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.remoteExtensionManagementServer, ext => this.getExtensionState(ext))); this._register(this.remoteExtensions.onChange(e => this._onChange.fire(e))); - } else { - this.remoteExtensions = null; } this.syncDelayer = new ThrottledDelayer(ExtensionsWorkbenchService.SyncPeriod); @@ -541,7 +541,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } get installed(): IExtension[] { - const result = [...this.localExtensions.local]; + const result = []; + if (this.localExtensions) { + result.push(...this.localExtensions.local); + } if (this.remoteExtensions) { result.push(...this.remoteExtensions.local); } @@ -549,7 +552,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } get outdated(): IExtension[] { - const allLocal = [...this.localExtensions.local]; + const allLocal = []; + if (this.localExtensions) { + allLocal.push(...this.localExtensions.local); + } if (this.remoteExtensions) { allLocal.push(...this.remoteExtensions.local); } @@ -558,7 +564,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension async queryLocal(server?: IExtensionManagementServer): Promise { if (server) { - if (this.extensionManagementServerService.localExtensionManagementServer === server) { + if (this.localExtensions && this.extensionManagementServerService.localExtensionManagementServer === server) { return this.localExtensions.queryInstalled(); } if (this.remoteExtensions && this.extensionManagementServerService.remoteExtensionManagementServer === server) { @@ -566,12 +572,12 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } } - await this.localExtensions.queryInstalled(); - if (this.remoteExtensions) { - await Promise.all([this.localExtensions.queryInstalled(), this.remoteExtensions.queryInstalled()]); - } else { + if (this.localExtensions) { await this.localExtensions.queryInstalled(); } + if (this.remoteExtensions) { + await this.remoteExtensions.queryInstalled(); + } return this.local; } @@ -635,7 +641,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } private fromGallery(gallery: IGalleryExtension, maliciousExtensionSet: Set): IExtension { - Promise.all([this.localExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet), this.remoteExtensions ? this.remoteExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false)]) + Promise.all([ + this.localExtensions ? this.localExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false), + this.remoteExtensions ? this.remoteExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false) + ]) .then(result => { if (result[0] || result[1]) { this.eventuallyAutoUpdateExtensions(); @@ -671,7 +680,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension private getExtensionState(extension: Extension): ExtensionState { const isInstalling = this.installing.some(i => areSameExtensions(i.identifier, extension.identifier)); if (extension.server) { - const state = (extension.server === this.extensionManagementServerService.localExtensionManagementServer ? this.localExtensions : this.remoteExtensions!).getExtensionState(extension); + const state = (extension.server === this.extensionManagementServerService.localExtensionManagementServer ? this.localExtensions! : this.remoteExtensions!).getExtensionState(extension); return state === ExtensionState.Uninstalled && isInstalling ? ExtensionState.Installing : state; } else if (isInstalling) { return ExtensionState.Installing; @@ -682,7 +691,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension return state; } } - return this.localExtensions.getExtensionState(extension); + if (this.localExtensions) { + return this.localExtensions.getExtensionState(extension); + } + return ExtensionState.Uninstalled; } checkForUpdates(): Promise { @@ -752,7 +764,15 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension return false; } - return !!(extension as Extension).gallery; + if (!extension.gallery) { + return false; + } + + if (this.extensionManagementServerService.localExtensionManagementServer || this.extensionManagementServerService.remoteExtensionManagementServer) { + return true; + } + + return false; } install(extension: string | IExtension): Promise { diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index e8ac33ea50b..19740cf5365 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -79,7 +79,7 @@ suite('ExtensionsActions Test', () => { instantiationService.stub(IExtensionManagementServerService, new class extends ExtensionManagementServerService { private _localExtensionManagementServer: IExtensionManagementServer = { extensionManagementService: instantiationService.get(IExtensionManagementService), label: 'local', authority: 'vscode-local' }; constructor() { - super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IConfigurationService), instantiationService.get(IProductService), instantiationService.get(ILogService)); + super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IConfigurationService), instantiationService.get(IProductService), instantiationService.get(ILogService), instantiationService.get(ILabelService)); } get localExtensionManagementServer(): IExtensionManagementServer { return this._localExtensionManagementServer; } set localExtensionManagementServer(server: IExtensionManagementServer) { } diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 883b6829f6e..67ae23cae17 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -42,6 +42,7 @@ import { ExtensionIdentifier, ExtensionType, IExtensionDescription } from 'vs/pl import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import { IProductService } from 'vs/platform/product/common/product'; +import { ILabelService } from 'vs/platform/label/common/label'; suite('ExtensionsListView Tests', () => { @@ -95,7 +96,7 @@ suite('ExtensionsListView Tests', () => { instantiationService.stub(IExtensionManagementServerService, new class extends ExtensionManagementServerService { private _localExtensionManagementServer: IExtensionManagementServer = { extensionManagementService: instantiationService.get(IExtensionManagementService), label: 'local', authority: 'vscode-local' }; constructor() { - super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IConfigurationService), instantiationService.get(IProductService), instantiationService.get(ILogService)); + super(instantiationService.get(ISharedProcessService), instantiationService.get(IRemoteAgentService), instantiationService.get(IExtensionGalleryService), instantiationService.get(IConfigurationService), instantiationService.get(IProductService), instantiationService.get(ILogService), instantiationService.get(ILabelService)); } get localExtensionManagementServer(): IExtensionManagementServer { return this._localExtensionManagementServer; } set localExtensionManagementServer(server: IExtensionManagementServer) { } diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts index f4c386d50f9..fda5c0332b9 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts @@ -11,27 +11,32 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; - -const localExtensionManagementServerAuthority: string = 'vscode-local'; +import { ILabelService } from 'vs/platform/label/common/label'; export class ExtensionManagementServerService implements IExtensionManagementServerService { _serviceBrand: any; - readonly localExtensionManagementServer: IExtensionManagementServer; + readonly localExtensionManagementServer: IExtensionManagementServer | null = null; readonly remoteExtensionManagementServer: IExtensionManagementServer | null = null; constructor( @IRemoteAgentService remoteAgentService: IRemoteAgentService, + @ILabelService labelService: ILabelService, ) { const remoteAgentConnection = remoteAgentService.getConnection(); - const localExtensionManagementService = new ExtensionManagementChannelClient(remoteAgentConnection!.getChannel('extensions')); - this.localExtensionManagementServer = { extensionManagementService: localExtensionManagementService, authority: localExtensionManagementServerAuthority, label: localize('local', "Local") }; + if (remoteAgentConnection) { + const extensionManagementService = new ExtensionManagementChannelClient(remoteAgentConnection!.getChannel('extensions')); + this.remoteExtensionManagementServer = { + authority: remoteAgentConnection.remoteAuthority, extensionManagementService, + get label() { return labelService.getHostLabel(REMOTE_HOST_SCHEME, remoteAgentConnection!.remoteAuthority) || localize('remote', "Remote"); } + }; + } } getExtensionManagementServer(location: URI): IExtensionManagementServer | null { if (location.scheme === REMOTE_HOST_SCHEME) { - return this.localExtensionManagementServer; + return this.remoteExtensionManagementServer; } return null; } diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts similarity index 74% rename from src/vs/workbench/services/extensionManagement/common/extensionManagement.ts rename to src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts index bbb99a6504f..a22015cf40c 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts @@ -27,7 +27,7 @@ export class ExtensionManagementService extends Disposable implements IExtension readonly onUninstallExtension: Event; readonly onDidUninstallExtension: Event; - protected readonly servers: IExtensionManagementServer[]; + protected readonly servers: IExtensionManagementServer[] = []; constructor( @IExtensionManagementServerService protected readonly extensionManagementServerService: IExtensionManagementServerService, @@ -36,7 +36,12 @@ export class ExtensionManagementService extends Disposable implements IExtension @IProductService protected readonly productService: IProductService, ) { super(); - this.servers = this.extensionManagementServerService.remoteExtensionManagementServer ? [this.extensionManagementServerService.localExtensionManagementServer, this.extensionManagementServerService.remoteExtensionManagementServer] : [this.extensionManagementServerService.localExtensionManagementServer]; + if (this.extensionManagementServerService.localExtensionManagementServer) { + this.servers.push(this.extensionManagementServerService.localExtensionManagementServer); + } + if (this.extensionManagementServerService.remoteExtensionManagementServer) { + this.servers.push(this.extensionManagementServerService.remoteExtensionManagementServer); + } this.onInstallExtension = this._register(this.servers.reduce((emitter: EventMultiplexer, server) => { emitter.add(server.extensionManagementService.onInstallExtension); return emitter; }, new EventMultiplexer())).event; this.onDidInstallExtension = this._register(this.servers.reduce((emitter: EventMultiplexer, server) => { emitter.add(server.extensionManagementService.onDidInstallExtension); return emitter; }, new EventMultiplexer())).event; @@ -51,31 +56,33 @@ export class ExtensionManagementService extends Disposable implements IExtension .catch(e => installedExtensions); } - async uninstall(extension: ILocalExtension, force?: boolean): Promise { - if (this.extensionManagementServerService.remoteExtensionManagementServer) { - const server = this.getServer(extension); - if (!server) { - return Promise.reject(`Invalid location ${extension.location.toString()}`); - } - if (isLanguagePackExtension(extension.manifest)) { - return this.uninstallEverywhere(extension, force); - } - return this.uninstallInServer(extension, server, force); + async uninstall(extension: ILocalExtension): Promise { + const server = this.getServer(extension); + if (!server) { + return Promise.reject(`Invalid location ${extension.location.toString()}`); } - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.uninstall(extension, force); + if (this.servers.length > 1) { + if (isLanguagePackExtension(extension.manifest)) { + return this.uninstallEverywhere(extension); + } + return this.uninstallInServer(extension, server); + } + return server.extensionManagementService.uninstall(extension); } - private async uninstallEverywhere(extension: ILocalExtension, force?: boolean): Promise { + private async uninstallEverywhere(extension: ILocalExtension): Promise { const server = this.getServer(extension); if (!server) { return Promise.reject(`Invalid location ${extension.location.toString()}`); } const promise = server.extensionManagementService.uninstall(extension); - const anotherServer: IExtensionManagementServer = server === this.extensionManagementServerService.localExtensionManagementServer ? this.extensionManagementServerService.remoteExtensionManagementServer! : this.extensionManagementServerService.localExtensionManagementServer; - const installed = await anotherServer.extensionManagementService.getInstalled(ExtensionType.User); - extension = installed.filter(i => areSameExtensions(i.identifier, extension.identifier))[0]; - if (extension) { - await anotherServer.extensionManagementService.uninstall(extension); + const anotherServer: IExtensionManagementServer | null = server === this.extensionManagementServerService.localExtensionManagementServer ? this.extensionManagementServerService.remoteExtensionManagementServer! : this.extensionManagementServerService.localExtensionManagementServer; + if (anotherServer) { + const installed = await anotherServer.extensionManagementService.getInstalled(ExtensionType.User); + extension = installed.filter(i => areSameExtensions(i.identifier, extension.identifier))[0]; + if (extension) { + await anotherServer.extensionManagementService.uninstall(extension); + } } return promise; } @@ -131,11 +138,17 @@ export class ExtensionManagementService extends Disposable implements IExtension } async install(vsix: URI): Promise { - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + if (this.extensionManagementServerService.localExtensionManagementServer) { + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + } + if (this.extensionManagementServerService.remoteExtensionManagementServer) { + return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(vsix); + } + return Promise.reject('No Servers to Install'); } async installFromGallery(gallery: IGalleryExtension): Promise { - if (this.extensionManagementServerService.remoteExtensionManagementServer) { + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { const manifest = await this.extensionGalleryService.getManifest(gallery, CancellationToken.None); if (manifest) { if (isLanguagePackExtension(manifest)) { @@ -152,11 +165,23 @@ export class ExtensionManagementService extends Disposable implements IExtension return Promise.reject(localize('Manifest is not found', "Installing Extension {0} failed: Manifest is not found.", gallery.displayName || gallery.name)); } } - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(gallery); + if (this.extensionManagementServerService.localExtensionManagementServer) { + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(gallery); + } + if (this.extensionManagementServerService.remoteExtensionManagementServer) { + return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(gallery); + } + return Promise.reject('No Servers to Install'); } getExtensionsReport(): Promise { - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getExtensionsReport(); + if (this.extensionManagementServerService.localExtensionManagementServer) { + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getExtensionsReport(); + } + if (this.extensionManagementServerService.remoteExtensionManagementServer) { + return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getExtensionsReport(); + } + return Promise.resolve([]); } private getServer(extension: ILocalExtension): IExtensionManagementServer | null { diff --git a/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts index 9af2b50701d..c5b08097ce4 100644 --- a/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts @@ -17,6 +17,7 @@ import { ILogService } from 'vs/platform/log/common/log'; import { RemoteExtensionManagementChannelClient } from 'vs/workbench/services/extensions/electron-browser/remoteExtensionManagementIpc'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IProductService } from 'vs/platform/product/common/product'; +import { ILabelService } from 'vs/platform/label/common/label'; const localExtensionManagementServerAuthority: string = 'vscode-local'; @@ -26,6 +27,7 @@ export class ExtensionManagementServerService implements IExtensionManagementSer readonly localExtensionManagementServer: IExtensionManagementServer; readonly remoteExtensionManagementServer: IExtensionManagementServer | null = null; + readonly isSingleServer: boolean = false; constructor( @ISharedProcessService sharedProcessService: ISharedProcessService, @@ -33,7 +35,8 @@ export class ExtensionManagementServerService implements IExtensionManagementSer @IExtensionGalleryService galleryService: IExtensionGalleryService, @IConfigurationService configurationService: IConfigurationService, @IProductService productService: IProductService, - @ILogService logService: ILogService + @ILogService logService: ILogService, + @ILabelService labelService: ILabelService, ) { const localExtensionManagementService = new ExtensionManagementChannelClient(sharedProcessService.getChannel('extensions')); @@ -41,7 +44,10 @@ export class ExtensionManagementServerService implements IExtensionManagementSer const remoteAgentConnection = remoteAgentService.getConnection(); if (remoteAgentConnection) { const extensionManagementService = new RemoteExtensionManagementChannelClient(remoteAgentConnection.getChannel('extensions'), this.localExtensionManagementServer.extensionManagementService, galleryService, logService, configurationService, productService); - this.remoteExtensionManagementServer = { authority: remoteAgentConnection.remoteAuthority, extensionManagementService, label: localize('remote', "Remote") }; + this.remoteExtensionManagementServer = { + authority: remoteAgentConnection.remoteAuthority, extensionManagementService, + get label() { return labelService.getHostLabel(REMOTE_HOST_SCHEME, remoteAgentConnection!.remoteAuthority) || localize('remote', "Remote"); } + }; } } diff --git a/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts index 4e1a3788010..705ea4028c1 100644 --- a/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts @@ -138,7 +138,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension if (Array.isArray(disabledExtensions)) { return disabledExtensions.some(id => areSameExtensions({ id }, extension.identifier)); } - if (this.environmentService.configuration.remoteAuthority) { + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { const server = isUIExtension(extension.manifest, this.productService, this.configurationService) ? this.extensionManagementServerService.localExtensionManagementServer : this.extensionManagementServerService.remoteExtensionManagementServer; return this.extensionManagementServerService.getExtensionManagementServer(extension.location) !== server; } diff --git a/src/vs/workbench/services/extensionManagement/node/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/node/extensionManagementService.ts similarity index 79% rename from src/vs/workbench/services/extensionManagement/node/extensionManagement.ts rename to src/vs/workbench/services/extensionManagement/node/extensionManagementService.ts index de81feb1842..46db06b9d1a 100644 --- a/src/vs/workbench/services/extensionManagement/node/extensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/node/extensionManagementService.ts @@ -8,12 +8,12 @@ import { isLanguagePackExtension } from 'vs/platform/extensions/common/extension import { URI } from 'vs/base/common/uri'; import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil'; -import { ExtensionManagementService as BaseExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { ExtensionManagementService as BaseExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagementService'; export class ExtensionManagementService extends BaseExtensionManagementService { async install(vsix: URI): Promise { - if (this.extensionManagementServerService.remoteExtensionManagementServer) { + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { const manifest = await getManifest(vsix.fsPath); if (isLanguagePackExtension(manifest)) { // Install on both servers @@ -27,7 +27,10 @@ export class ExtensionManagementService extends BaseExtensionManagementService { // Install only on remote server return this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(vsix); } - return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + if (this.extensionManagementServerService.localExtensionManagementServer) { + return this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix); + } + return Promise.reject('No Servers to Install'); } } diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 5b722ecff0b..7ade525b350 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -136,7 +136,7 @@ import 'vs/workbench/services/telemetry/electron-browser/telemetryService'; import 'vs/workbench/services/configurationResolver/electron-browser/configurationResolverService'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService'; - +import { ExtensionManagementService } from 'vs/workbench/services/extensionManagement/node/extensionManagementService'; registerSingleton(IExtensionManagementService, ExtensionManagementService); registerSingleton(IBackupFileService, BackupFileService); @@ -344,6 +344,5 @@ import 'vs/workbench/contrib/experiments/electron-browser/experiments.contributi // Issues import 'vs/workbench/contrib/issue/electron-browser/issue.contribution'; -import { ExtensionManagementService } from './services/extensionManagement/node/extensionManagement'; //#endregion diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 9c63cffd384..476f87ecf79 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -63,7 +63,7 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { BrowserAccessibilityService } from 'vs/platform/accessibility/common/accessibilityService'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; import { BrowserLifecycleService } from 'vs/platform/lifecycle/browser/lifecycleService'; @@ -124,6 +124,7 @@ import 'vs/workbench/services/themes/browser/workbenchThemeService'; import 'vs/workbench/services/extensions/browser/extensionService'; // import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; import 'vs/workbench/services/label/common/labelService'; +import 'vs/workbench/services/extensionManagement/common/extensionManagementServerService'; // import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; // import 'vs/workbench/services/window/electron-browser/windowService'; @@ -133,9 +134,11 @@ import { IContextViewService, IContextMenuService } from 'vs/platform/contextvie import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { BackupFileService } from 'vs/workbench/services/backup/common/backupFileService'; +import { ExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagementService'; import 'vs/workbench/browser/web.simpleservices'; +registerSingleton(IExtensionManagementService, ExtensionManagementService); registerSingleton(IBackupFileService, BackupFileService); registerSingleton(IDialogService, DialogService, true); registerSingleton(IMenuService, MenuService, true); @@ -167,10 +170,6 @@ registerSingleton(IContextMenuService, ContextMenuService); //#endregion -//#region --- Extensions Management -import 'vs/workbench/services/extensionManagement/common/extensionManagementServerService'; -//#endregion - //#region --- workbench parts @@ -264,9 +263,9 @@ registerSingleton(IWebviewService, WebviewService, true); registerSingleton(IWebviewEditorService, WebviewEditorService, true); // Extensions Management -// import 'vs/workbench/contrib/extensions/electron-browser/extensions.contribution'; -// import 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; -// import 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; +import 'vs/workbench/contrib/extensions/browser/extensions.contribution'; +import 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; +import 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; // Output Panel import 'vs/workbench/contrib/output/browser/output.contribution'; From 8ac5b7a963778f88b1c5d2ecfd75821b6afb5fd4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 00:55:31 +0200 Subject: [PATCH 087/190] fix extension management simple services --- .../workbench/browser/web.simpleservices.ts | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 3384986b4ad..5d611022667 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -28,7 +28,6 @@ import { ITunnelService } from 'vs/platform/remote/common/tunnel'; import { IReloadSessionEvent, IExtensionHostDebugService, ICloseSessionEvent, IAttachSessionEvent, ILogToSessionEvent, ITerminateSessionEvent } from 'vs/workbench/services/extensions/common/extensionHostDebug'; import { IRemoteConsoleLog } from 'vs/base/common/console'; // tslint:disable-next-line: import-patterns -import { IExtensionsWorkbenchService, IExtension as IExtension2 } from 'vs/workbench/contrib/extensions/common/extensions'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService'; @@ -58,28 +57,6 @@ registerSingleton(IDownloadService, SimpleDownloadService, true); //#endregion -//#endregion IExtensionsWorkbenchService -export class SimpleExtensionsWorkbenchService implements IExtensionsWorkbenchService { - _serviceBrand: any; - onChange: Event; - local: IExtension2[]; - installed: IExtension2[]; - outdated: IExtension2[]; - queryLocal: any; - queryGallery: any; - canInstall: any; - install: any; - uninstall: any; - installVersion: any; - reinstall: any; - setEnablement: any; - open: any; - checkForUpdates: any; - allowedBadgeProviders: string[]; -} -registerSingleton(IExtensionsWorkbenchService, SimpleExtensionsWorkbenchService, true); -//#endregion - //#region Extension Management //#region Extension Enablement @@ -145,7 +122,7 @@ export class SimpleExtensionTipsService implements IExtensionTipsService { } getAllIgnoredRecommendations(): { global: string[]; workspace: string[]; } { - return Object.create(null); + return { global: [], workspace: [] }; } } From 960123749de86371952f1c8aff49d490cc0538d7 Mon Sep 17 00:00:00 2001 From: Angelo Date: Wed, 17 Jul 2019 07:15:00 +0200 Subject: [PATCH 088/190] Add '.ent' and '.mod' file extensions for the XML language This PR adds `.ent` and `.mod` file extensions which are used as DTD file. --- extensions/xml/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/xml/package.json b/extensions/xml/package.json index 2e6cc49fd65..d76a632b10c 100644 --- a/extensions/xml/package.json +++ b/extensions/xml/package.json @@ -23,6 +23,8 @@ ".dita", ".ditamap", ".dtd", + ".ent", + ".mod", ".dtml", ".fsproj", ".fxml", From 59876172bf02d15ffccf6151fa620fc7359b58fd Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 17 Jul 2019 12:43:22 +0200 Subject: [PATCH 089/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c27f0802eeb..285547b6a75 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "18f781db7cf104b1156ee97a29d4938296ea4616", + "distro": "68290ed01405cdd0adb6defb3796e52f3d71d615", "author": { "name": "Microsoft Corporation" }, From cf6ccf137143a88d5571268aaf1fb17438915ebd Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 16:52:50 +0200 Subject: [PATCH 090/190] Use semver umd module --- package.json | 1 + remote/package.json | 1 + remote/web/package.json | 3 ++- remote/web/yarn.lock | 5 +++++ remote/yarn.lock | 12 ++++++------ src/vs/code/browser/workbench/workbench.js | 1 + yarn.lock | 5 +++++ 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c27f0802eeb..17862c19dbb 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", "semver": "^5.5.0", + "semver-umd": "^5.5.0", "spdlog": "^0.9.0", "sudo-prompt": "9.0.0", "v8-inspect-profiler": "^0.0.20", diff --git a/remote/package.json b/remote/package.json index 6fc6471a2ce..16edc649482 100644 --- a/remote/package.json +++ b/remote/package.json @@ -15,6 +15,7 @@ "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", "semver": "^5.5.0", + "semver-umd": "^5.5.0", "spdlog": "^0.9.0", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", diff --git a/remote/web/package.json b/remote/web/package.json index 38f730e7dab..6c18cb53937 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -6,6 +6,7 @@ "vscode-textmate": "^4.1.1", "xterm": "3.15.0-beta67", "xterm-addon-search": "0.2.0-beta2", - "xterm-addon-web-links": "0.1.0-beta10" + "xterm-addon-web-links": "0.1.0-beta10", + "semver-umd": "^5.5.0" } } \ No newline at end of file diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 3f790e1f281..6839b2e5af6 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -19,6 +19,11 @@ oniguruma@^7.2.0: dependencies: nan "^2.14.0" +semver-umd@^5.5.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" + integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== + vscode-textmate@^4.1.1: version "4.2.2" resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-4.2.2.tgz#0b4dabc69a6fba79a065cb6b615f66eac07c8f4c" diff --git a/remote/yarn.lock b/remote/yarn.lock index 7d522e2901b..2e8118c8bc3 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -876,17 +876,17 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +semver-umd@^5.5.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" + integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== + semver@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - -semver@^5.6.0: +semver@^5.5.0, semver@^5.6.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js index 34f321f90df..2f62dceb9ed 100644 --- a/src/vs/code/browser/workbench/workbench.js +++ b/src/vs/code/browser/workbench/workbench.js @@ -15,6 +15,7 @@ 'xterm': `${window.location.origin}/node_modules/xterm/lib/xterm.js`, 'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`, 'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`, + 'semver': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`, } }); diff --git a/yarn.lock b/yarn.lock index 574bd317d96..6aa4b28cf28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7975,6 +7975,11 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" +semver-umd@^5.5.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" + integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== + "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" From 242386942610e31d0b6d6b47b039016ce24458e4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 17:04:22 +0200 Subject: [PATCH 091/190] fix tests --- .../test/electron-browser/extensionEnablementService.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts index cdb4509a617..ec939ce04b0 100644 --- a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts +++ b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts @@ -70,6 +70,11 @@ suite('ExtensionEnablementService Test', () => { setup(() => { instantiationService = new TestInstantiationService(); instantiationService.stub(IExtensionManagementService, { onDidUninstallExtension: didUninstallEvent.event, onDidInstallExtension: didInstallEvent.event, getInstalled: () => Promise.resolve([] as ILocalExtension[]) } as IExtensionManagementService); + instantiationService.stub(IExtensionManagementServerService, { + localExtensionManagementServer: { + extensionManagementService: instantiationService.get(IExtensionManagementService) + } + }); testObject = new TestExtensionEnablementService(instantiationService); }); From 1e05dac61cf7136c3b1d6fe830e50d36b1546e32 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 17:09:50 +0200 Subject: [PATCH 092/190] :lipstick: --- .../extensionManagement/common/extensionManagementService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts index a22015cf40c..825d9ef62e6 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts @@ -61,7 +61,7 @@ export class ExtensionManagementService extends Disposable implements IExtension if (!server) { return Promise.reject(`Invalid location ${extension.location.toString()}`); } - if (this.servers.length > 1) { + if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { if (isLanguagePackExtension(extension.manifest)) { return this.uninstallEverywhere(extension); } From f41d90ab6619a883894fd9142bcf546c1027b857 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 17 Jul 2019 17:21:08 +0200 Subject: [PATCH 093/190] update distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 15062ee6b76..f8883efbe59 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "68290ed01405cdd0adb6defb3796e52f3d71d615", + "distro": "3b7db3f93b5efe73eedab147ee9eb72a9abadc9d", "author": { "name": "Microsoft Corporation" }, @@ -159,4 +159,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.4" } -} +} \ No newline at end of file From f50a0430c3e45e5ff3c6a525958766e95f1bb214 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Wed, 17 Jul 2019 08:29:25 -0700 Subject: [PATCH 094/190] More strongly typed telemetry (#77412) * More strongly typed telemetry * Updated update service to not duplicate typings --- .../diagnostics/node/diagnosticsService.ts | 19 +++--- .../common/extensionGalleryService.ts | 16 ++--- .../electron-main/abstractUpdateService.ts | 4 ++ .../electron-main/updateService.darwin.ts | 20 ++----- .../electron-main/updateService.linux.ts | 19 +----- .../electron-main/updateService.snap.ts | 17 +----- .../electron-main/updateService.win32.ts | 9 +-- .../api/node/extHostRequireInterceptor.ts | 20 +++---- .../electron-browser/experimentService.ts | 10 ++-- .../tasks/browser/abstractTaskService.ts | 18 +++--- .../browser/telemetry.contribution.ts | 58 ++++++++++++------- .../electron-browser/telemetryOptOut.ts | 14 +++-- .../walkThrough/browser/walkThroughPart.ts | 38 +++++------- src/vs/workbench/electron-browser/window.ts | 12 ++-- 14 files changed, 122 insertions(+), 152 deletions(-) diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts index b83d063a245..f1e6a82fb1a 100644 --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts @@ -520,14 +520,17 @@ export class DiagnosticsService implements IDiagnosticsService { if (folderUri.scheme === 'file') { const folder = folderUri.fsPath; collectWorkspaceStats(folder, ['node_modules', '.git']).then(stats => { - /* __GDPR__ - "workspace.stats" : { - "fileTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "configTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "launchConfigs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('workspace.stats', { + type WorkspaceStatsClassification = { + fileTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + configTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + launchConfigs: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + type WorkspaceStatsEvent = { + fileTypes: WorkspaceStatItem[]; + configTypes: WorkspaceStatItem[]; + launchConfigs: WorkspaceStatItem[]; + }; + this.telemetryService.publicLog2('workspace.stats', { fileTypes: stats.fileTypes, configTypes: stats.configFiles, launchConfigs: stats.launchConfigFiles diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index 3c7e35fb2f3..fa54ffc156d 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -411,13 +411,15 @@ export class ExtensionGalleryService implements IExtensionGalleryService { let text = options.text || ''; const pageSize = getOrDefault(options, o => o.pageSize, 50); - /* __GDPR__ - "galleryService:query" : { - "type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "text": { "classification": "CustomerContent", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('galleryService:query', { type, text }); + type GalleryServiceQueryClassification = { + type: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + text: { classification: 'CustomerContent', purpose: 'FeatureInsight' }; + }; + type GalleryServiceQueryEvent = { + type: string; + text: string; + }; + this.telemetryService.publicLog2('galleryService:query', { type, text }); let query = new Query() .withFlags(Flags.IncludeLatestVersionOnly, Flags.IncludeAssetUri, Flags.IncludeStatistics, Flags.IncludeFiles, Flags.IncludeVersionProperties) diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index f8059fb04b6..2a1240b1eb9 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -18,6 +18,10 @@ export function createUpdateURL(platform: string, quality: string): string { return `${product.updateUrl}/api/update/${platform}/${quality}/${product.commit}`; } +export type UpdateNotAvailableClassification = { + explicit: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; +}; + export abstract class AbstractUpdateService implements IUpdateService { _serviceBrand: any; diff --git a/src/vs/platform/update/electron-main/updateService.darwin.ts b/src/vs/platform/update/electron-main/updateService.darwin.ts index 352d4d91633..da534803b83 100644 --- a/src/vs/platform/update/electron-main/updateService.darwin.ts +++ b/src/vs/platform/update/electron-main/updateService.darwin.ts @@ -13,7 +13,7 @@ import { State, IUpdate, StateType, UpdateType } from 'vs/platform/update/common import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractUpdateService, createUpdateURL } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { AbstractUpdateService, createUpdateURL, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; import { IRequestService } from 'vs/platform/request/common/request'; export class DarwinUpdateService extends AbstractUpdateService { @@ -81,12 +81,10 @@ export class DarwinUpdateService extends AbstractUpdateService { return; } - /* __GDPR__ - "update:downloaded" : { - "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('update:downloaded', { version: update.version }); + type UpdateDownloadedClassification = { + version: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this.telemetryService.publicLog2<{ version: String }, UpdateDownloadedClassification>('update:downloaded', { version: update.version }); this.setState(State.Ready(update)); } @@ -95,13 +93,7 @@ export class DarwinUpdateService extends AbstractUpdateService { if (this.state.type !== StateType.CheckingForUpdates) { return; } - - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!this.state.context }); + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!this.state.context }); this.setState(State.Idle(UpdateType.Archive)); } diff --git a/src/vs/platform/update/electron-main/updateService.linux.ts b/src/vs/platform/update/electron-main/updateService.linux.ts index 52c4ac7dc2b..07eaf22cb09 100644 --- a/src/vs/platform/update/electron-main/updateService.linux.ts +++ b/src/vs/platform/update/electron-main/updateService.linux.ts @@ -10,7 +10,7 @@ import { State, IUpdate, AvailableForDownload, UpdateType } from 'vs/platform/up import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; -import { createUpdateURL, AbstractUpdateService } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { createUpdateURL, AbstractUpdateService, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; import { IRequestService, asJson } from 'vs/platform/request/common/request'; import { shell } from 'electron'; import { CancellationToken } from 'vs/base/common/cancellation'; @@ -40,17 +40,11 @@ export class LinuxUpdateService extends AbstractUpdateService { } this.setState(State.CheckingForUpdates(context)); - this.requestService.request({ url: this.url }, CancellationToken.None) .then(asJson) .then(update => { if (!update || !update.url || !update.version || !update.productVersion) { - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!context }); + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!context }); this.setState(State.Idle(UpdateType.Archive)); } else { @@ -59,14 +53,7 @@ export class LinuxUpdateService extends AbstractUpdateService { }) .then(undefined, err => { this.logService.error(err); - - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!context }); - + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!context }); // only show message when explicitly checking for updates const message: string | undefined = !!context ? (err.message || err) : undefined; this.setState(State.Idle(UpdateType.Archive, message)); diff --git a/src/vs/platform/update/electron-main/updateService.snap.ts b/src/vs/platform/update/electron-main/updateService.snap.ts index ad64d8adfe0..54f63ca59e4 100644 --- a/src/vs/platform/update/electron-main/updateService.snap.ts +++ b/src/vs/platform/update/electron-main/updateService.snap.ts @@ -13,6 +13,7 @@ import * as path from 'vs/base/common/path'; import { realpath, watch } from 'fs'; import { spawn } from 'child_process'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; abstract class AbstractUpdateService2 implements IUpdateService { @@ -159,29 +160,17 @@ export class SnapUpdateService extends AbstractUpdateService2 { protected doCheckForUpdates(context: any): void { this.setState(State.CheckingForUpdates(context)); - this.isUpdateAvailable().then(result => { if (result) { this.setState(State.Ready({ version: 'something', productVersion: 'something' })); } else { - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!context }); + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!context }); this.setState(State.Idle(UpdateType.Snap)); } }, err => { this.logService.error(err); - - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!context }); + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!context }); this.setState(State.Idle(UpdateType.Snap, err.message || err)); }); } diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index cbff0bf1c74..31c7818a737 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -14,7 +14,7 @@ import { State, IUpdate, StateType, AvailableForDownload, UpdateType } from 'vs/ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; -import { createUpdateURL, AbstractUpdateService } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { createUpdateURL, AbstractUpdateService, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; import { IRequestService, asJson } from 'vs/platform/request/common/request'; import { checksum } from 'vs/base/node/crypto'; import { tmpdir } from 'os'; @@ -168,12 +168,7 @@ export class Win32UpdateService extends AbstractUpdateService { }) .then(undefined, err => { this.logService.error(err); - /* __GDPR__ - "update:notAvailable" : { - "explicit" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('update:notAvailable', { explicit: !!context }); + this.telemetryService.publicLog2<{ explicit: boolean }, UpdateNotAvailableClassification>('update:notAvailable', { explicit: !!context }); // only show message when explicitly checking for updates const message: string | undefined = !!context ? (err.message || err) : undefined; diff --git a/src/vs/workbench/api/node/extHostRequireInterceptor.ts b/src/vs/workbench/api/node/extHostRequireInterceptor.ts index c73c005de92..789ece36253 100644 --- a/src/vs/workbench/api/node/extHostRequireInterceptor.ts +++ b/src/vs/workbench/api/node/extHostRequireInterceptor.ts @@ -231,23 +231,19 @@ export class OpenNodeModuleFactory implements INodeModuleFactory { if (!this._extensionId) { return; } - /* __GDPR__ - "shimming.open" : { - "extension": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this._mainThreadTelemerty.$publicLog('shimming.open', { extension: this._extensionId }); + type ShimmingOpenClassification = { + extension: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this._mainThreadTelemerty.$publicLog2<{ extension: string }, ShimmingOpenClassification>('shimming.open', { extension: this._extensionId }); } private sendNoForwardTelemetry(): void { if (!this._extensionId) { return; } - /* __GDPR__ - "shimming.open.call.noForward" : { - "extension": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this._mainThreadTelemerty.$publicLog('shimming.open.call.noForward', { extension: this._extensionId }); + type ShimmingOpenCallNoForwardClassification = { + extension: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this._mainThreadTelemerty.$publicLog2<{ extension: string }, ShimmingOpenCallNoForwardClassification>('shimming.open.call.noForward', { extension: this._extensionId }); } } diff --git a/src/vs/workbench/contrib/experiments/electron-browser/experimentService.ts b/src/vs/workbench/contrib/experiments/electron-browser/experimentService.ts index ada56e8df4d..643b404f191 100644 --- a/src/vs/workbench/contrib/experiments/electron-browser/experimentService.ts +++ b/src/vs/workbench/contrib/experiments/electron-browser/experimentService.ts @@ -220,12 +220,10 @@ export class ExperimentService extends Disposable implements IExperimentService }); return Promise.all(promises).then(() => { - /* __GDPR__ - "experiments" : { - "experiments" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('experiments', { experiments: this._experiments }); + type ExperimentsClassification = { + experiments: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this.telemetryService.publicLog2<{ experiments: IExperiment[] }, ExperimentsClassification>('experiments', { experiments: this._experiments }); }); }); } diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 676f63a171d..894a0b10e7a 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -168,8 +168,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer private static readonly IgnoreTask010DonotShowAgain_key = 'workbench.tasks.ignoreTask010Shown'; private static CustomizationTelemetryEventName: string = 'taskService.customize'; - public static TemplateTelemetryEventName: string = 'taskService.template'; - public _serviceBrand: any; public static OutputChannelId: string = 'tasks'; public static OutputChannelLabel: string = nls.localize('tasks', "Tasks"); @@ -2057,14 +2055,16 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize)); } configFileCreated = true; - /* __GDPR__ - "taskService.template" : { - "templateId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "autoDetect" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ + type TaskServiceTemplateClassification = { + templateId?: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + autoDetect: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + type TaskServiceEvent = { + templateId?: string; + autoDetect: boolean; + }; return this.textFileService.create(resource, content).then((result): URI => { - this.telemetryService.publicLog(AbstractTaskService.TemplateTelemetryEventName, { + this.telemetryService.publicLog2('taskService.template', { templateId: selection.id, autoDetect: selection.autoDetect }); diff --git a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts index 3e73903b7d2..35c131834e0 100644 --- a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts +++ b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts @@ -5,7 +5,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { LifecyclePhase, ILifecycleService, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService'; @@ -39,27 +39,41 @@ export class TelemetryContribution extends Disposable implements IWorkbenchContr const { filesToOpenOrCreate, filesToDiff } = environmentService.configuration; const activeViewlet = viewletService.getActiveViewlet(); - /* __GDPR__ - "workspaceLoad" : { - "userAgent" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "windowSize.innerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "windowSize.innerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "windowSize.outerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "windowSize.outerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "emptyWorkbench": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbench.filesToOpenOrCreate": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbench.filesToDiff": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "customKeybindingsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "theme": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "language": { "classification": "SystemMetaData", "purpose": "BusinessInsight" }, - "pinnedViewlets": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "restoredViewlet": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "restoredEditors": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "pinnedViewlets": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - telemetryService.publicLog('workspaceLoad', { + type WindowSizeFragment = { + innerHeight: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + innerWidth: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + outerHeight: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + outerWidth: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + type WorkspaceLoadClassification = { + userAgent: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + emptyWorkbench: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + windowSize: WindowSizeFragment; + 'workbench.filesToOpenOrCreate': { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + 'workbench.filesToDiff': { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + customKeybindingsCount: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + theme: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + language: { classification: 'SystemMetaData', purpose: 'BusinessInsight' }; + pinnedViewlets: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + restoredViewlet?: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + restoredEditors: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + startupKind: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + type WorkspaceLoadEvent = { + userAgent: string; + windowSize: { innerHeight: number, innerWidth: number, outerHeight: number, outerWidth: number }; + emptyWorkbench: boolean; + 'workbench.filesToOpenOrCreate': number; + 'workbench.filesToDiff': number; + customKeybindingsCount: number; + theme: string; + language: string; + pinnedViewlets: string[]; + restoredViewlet?: string; + restoredEditors: number; + startupKind: StartupKind; + }; + telemetryService.publicLog2('workspaceLoad', { userAgent: navigator.userAgent, windowSize: { innerHeight: window.innerHeight, innerWidth: window.innerWidth, outerHeight: window.outerHeight, outerWidth: window.outerWidth }, emptyWorkbench: contextService.getWorkbenchState() === WorkbenchState.EMPTY, diff --git a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts index 78b36054376..f137c1a6fce 100644 --- a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts +++ b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts @@ -109,12 +109,14 @@ export class TelemetryOptOut implements IWorkbenchContribution { } const logTelemetry = (optout?: boolean) => { - /* __GDPR__ - "experiments:optout" : { - "optOut": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('experiments:optout', typeof optout === 'boolean' ? { optout } : {}); + type ExperimentsOptOutClassification = { + optout?: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + + type ExperimentsOptOutEvent = { + optout?: boolean; + }; + this.telemetryService.publicLog2('experiments:optout', typeof optout === 'boolean' ? { optout } : {}); }; queryPromise.then(() => { diff --git a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts index 7bae52d70b7..d78d47b4535 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts @@ -356,43 +356,33 @@ export class WalkThroughPart extends BaseEditor { } })); + type WalkThroughSnippetInteractionClassification = { + from?: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + type: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + snippet: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; + type WalkThroughSnippetInteractionEvent = { + from?: string, + type: string, + snippet: number + }; + this.contentDisposables.push(Event.once(editor.onMouseDown)(() => { - /* __GDPR__ - "walkThroughSnippetInteraction" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "snippet": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('walkThroughSnippetInteraction', { + this.telemetryService.publicLog2('walkThroughSnippetInteraction', { from: this.input instanceof WalkThroughInput ? this.input.getTelemetryFrom() : undefined, type: 'mouseDown', snippet: i }); })); this.contentDisposables.push(Event.once(editor.onKeyDown)(() => { - /* __GDPR__ - "walkThroughSnippetInteraction" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "snippet": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('walkThroughSnippetInteraction', { + this.telemetryService.publicLog2('walkThroughSnippetInteraction', { from: this.input instanceof WalkThroughInput ? this.input.getTelemetryFrom() : undefined, type: 'keyDown', snippet: i }); })); this.contentDisposables.push(Event.once(editor.onDidChangeModelContent)(() => { - /* __GDPR__ - "walkThroughSnippetInteraction" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "snippet": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('walkThroughSnippetInteraction', { + this.telemetryService.publicLog2('walkThroughSnippetInteraction', { from: this.input instanceof WalkThroughInput ? this.input.getTelemetryFrom() : undefined, type: 'changeModelContent', snippet: i diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index d3c48734060..e10a49baee6 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -135,13 +135,11 @@ export class ElectronWindow extends Disposable { try { await this.commandService.executeCommand(request.id, ...args); - /* __GDPR__ - "commandExecuted" : { - "id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('commandExecuted', { id: request.id, from: request.from }); + type CommandExecutedClassifcation = { + id: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + from: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this.telemetryService.publicLog2<{ id: String, from: String }, CommandExecutedClassifcation>('commandExecuted', { id: request.id, from: request.from }); } catch (error) { this.notificationService.error(error); } From b11b93ed8c2ee5e400c080c09a9585eecec81a34 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Wed, 17 Jul 2019 18:19:37 +0100 Subject: [PATCH 095/190] Fix incrementing of variables in cpuUsage.sh --- src/vs/base/node/cpuUsage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/node/cpuUsage.sh b/src/vs/base/node/cpuUsage.sh index 3d42b36dc20..8e07feffaf7 100755 --- a/src/vs/base/node/cpuUsage.sh +++ b/src/vs/base/node/cpuUsage.sh @@ -30,7 +30,7 @@ for PID in "$@"; do fi PROCESS_BEFORE_TIMES[$ITER]=$PROCESS_TIME_BEFORE - ((ITER++)) + ((++ITER)) done # Wait for a second @@ -60,5 +60,5 @@ for PID in "$@"; do # Parent script reads from stdout, so echo result to be read echo $CPU_USAGE - ((ITER++)) + ((++ITER)) done From 750ea458cd1efc21d941399cb552acc6bf9fbfcf Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 17 Jul 2019 10:47:05 -0700 Subject: [PATCH 096/190] [css] Upgrade service and add dynamic link support --- .../css-language-features/server/package.json | 2 +- .../server/src/cssServerMain.ts | 56 ++++++++++++++++--- .../server/src/utils/runner.ts | 21 +++++++ .../css-language-features/server/yarn.lock | 14 +++-- 4 files changed, 80 insertions(+), 13 deletions(-) diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 6f2e734a109..d1913a26acf 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -9,7 +9,7 @@ }, "main": "./out/cssServerMain", "dependencies": { - "vscode-css-languageservice": "^4.0.2", + "vscode-css-languageservice": "^4.0.3-next.0", "vscode-languageserver": "^5.3.0-next.8" }, "devDependencies": { diff --git a/extensions/css-language-features/server/src/cssServerMain.ts b/extensions/css-language-features/server/src/cssServerMain.ts index cf539df1e1d..76374165b7c 100644 --- a/extensions/css-language-features/server/src/cssServerMain.ts +++ b/extensions/css-language-features/server/src/cssServerMain.ts @@ -8,11 +8,12 @@ import { } from 'vscode-languageserver'; import URI from 'vscode-uri'; import { TextDocument, CompletionList, Position } from 'vscode-languageserver-types'; +import { stat as fsStat } from 'fs'; -import { getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet } from 'vscode-css-languageservice'; +import { getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet, FileSystemProvider, FileType } from 'vscode-css-languageservice'; import { getLanguageModelCache } from './languageModelCache'; import { getPathCompletionParticipant } from './pathCompletion'; -import { formatError, runSafe } from './utils/runner'; +import { formatError, runSafe, runSafeAsync } from './utils/runner'; import { getDocumentContext } from './utils/documentContext'; import { getDataProviders } from './customData'; @@ -52,6 +53,45 @@ let workspaceFolders: WorkspaceFolder[]; const languageServices: { [id: string]: LanguageService } = {}; +const fileSystemProvider: FileSystemProvider = { + stat(documentUri: string) { + const filePath = URI.parse(documentUri).fsPath; + + return new Promise((c, e) => { + fsStat(filePath, (err, stats) => { + if (err) { + if (err.code === 'ENOENT') { + return c({ + type: FileType.Unknown, + ctime: -1, + mtime: -1, + size: -1 + }); + } else { + return e(err); + } + } + + let type = FileType.Unknown; + if (stats.isFile()) { + type = FileType.File; + } else if (stats.isDirectory) { + type = FileType.Directory; + } else if (stats.isSymbolicLink) { + type = FileType.SymbolicLink; + } + + c({ + type, + ctime: stats.ctime.getTime(), + mtime: stats.mtime.getTime(), + size: stats.size + }); + }); + }); + } +}; + // After the server has started the client sends an initialize request. The server receives // in the passed params the rootPath of the workspace plus the client capabilities. connection.onInitialize((params: InitializeParams): InitializeResult => { @@ -81,9 +121,9 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { scopedSettingsSupport = !!getClientCapability('workspace.configuration', false); foldingRangeLimit = getClientCapability('textDocument.foldingRange.rangeLimit', Number.MAX_VALUE); - languageServices.css = getCSSLanguageService({ customDataProviders }); - languageServices.scss = getSCSSLanguageService({ customDataProviders }); - languageServices.less = getLESSLanguageService({ customDataProviders }); + languageServices.css = getCSSLanguageService({ customDataProviders, fileSystemProvider }); + languageServices.scss = getSCSSLanguageService({ customDataProviders, fileSystemProvider }); + languageServices.less = getLESSLanguageService({ customDataProviders, fileSystemProvider }); const capabilities: ServerCapabilities = { // Tell the client that the server works in FULL text document sync mode @@ -256,13 +296,13 @@ connection.onDocumentHighlight((documentHighlightParams, token) => { }); -connection.onDocumentLinks((documentLinkParams, token) => { - return runSafe(() => { +connection.onDocumentLinks(async (documentLinkParams, token) => { + return runSafeAsync(async () => { const document = documents.get(documentLinkParams.textDocument.uri); if (document) { const documentContext = getDocumentContext(document.uri, workspaceFolders); const stylesheet = stylesheets.get(document); - return getLanguageService(document).findDocumentLinks(document, stylesheet, documentContext); + return await getLanguageService(document).findDocumentLinks2(document, stylesheet, documentContext); } return []; }, [], `Error while computing document links for ${documentLinkParams.textDocument.uri}`, token); diff --git a/extensions/css-language-features/server/src/utils/runner.ts b/extensions/css-language-features/server/src/utils/runner.ts index df024167dab..98a7a96f9aa 100644 --- a/extensions/css-language-features/server/src/utils/runner.ts +++ b/extensions/css-language-features/server/src/utils/runner.ts @@ -17,6 +17,27 @@ export function formatError(message: string, err: any): string { return message; } +export function runSafeAsync(func: () => Thenable, errorVal: T, errorMessage: string, token: CancellationToken): Thenable> { + return new Promise>((resolve) => { + setImmediate(() => { + if (token.isCancellationRequested) { + resolve(cancelValue()); + } + return func().then(result => { + if (token.isCancellationRequested) { + resolve(cancelValue()); + return; + } else { + resolve(result); + } + }, e => { + console.error(formatError(errorMessage, e)); + resolve(errorVal); + }); + }); + }); +} + export function runSafe(func: () => T, errorVal: T, errorMessage: string, token: CancellationToken): Thenable> { return new Promise>((resolve) => { setImmediate(() => { diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index c5bfa63c869..3537a3d2ecd 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -781,13 +781,14 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.2.tgz#7496e538b0c151feac16d5888cc0b1b104f4c736" - integrity sha512-pTnfXbsME3pl+yDfhUp/mtvPyIJk0Le4zqJxDn56s9GY9LqY0RmkSEh0oHH6D0HXR3Ni6wKosIaqu8a2G0+jdw== +vscode-css-languageservice@^4.0.3-next.0: + version "4.0.3-next.0" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.3-next.0.tgz#ba96894cf2a0c86c744a1274590f27e55ea60f58" + integrity sha512-ku58Y5jDFNfDicv2AAhgu1edgfGcRZPwlKu6EBK2ck/O/Vco7Zy64FDoClJghcYBhJiDs7sy2q/UtQD0IoGbRw== dependencies: vscode-languageserver-types "^3.15.0-next.2" vscode-nls "^4.1.1" + vscode-uri "^2.0.3" vscode-jsonrpc@^4.1.0-next.2: version "4.1.0-next.2" @@ -831,6 +832,11 @@ vscode-uri@^1.0.6: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d" integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww== +vscode-uri@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.3.tgz#25e5f37f552fbee3cec7e5f80cef8469cefc6543" + integrity sha512-4D3DI3F4uRy09WNtDGD93H9q034OHImxiIcSq664Hq1Y1AScehlP3qqZyTkX/RWxeu0MRMHGkrxYqm2qlDF/aw== + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" From 16219067b1e1f40fccfa504c02bf3857cc971374 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Wed, 17 Jul 2019 11:17:30 -0700 Subject: [PATCH 097/190] Respond to theme changes for minimap decorations, fixes #77487 --- src/vs/editor/browser/viewParts/minimap/minimap.ts | 10 ++++++++++ src/vs/editor/common/model/textModel.ts | 4 ++++ src/vs/editor/common/viewModel/viewModel.ts | 1 + src/vs/editor/common/viewModel/viewModelImpl.ts | 12 +++++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 8184682f4ae..c883223ae31 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -451,6 +451,7 @@ export class Minimap extends ViewPart { private _options: MinimapOptions; private _lastRenderData: RenderData | null; + private _lastDecorations: ViewModelDecoration[] | undefined; private _renderDecorations: boolean = false; private _buffers: MinimapBuffers | null; @@ -675,6 +676,13 @@ export class Minimap extends ViewPart { return true; } + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + this._context.model.invalidateMinimapColorCache(); + // Only bother calling render if decorations are currently shown + this._renderDecorations = !!this._lastDecorations; + return !!this._lastDecorations; + } + // --- end event handlers public prepareRender(ctx: RenderingContext): void { @@ -751,6 +759,8 @@ export class Minimap extends ViewPart { this.renderDecorationOnLine(canvasContext, lineOffsetMap, decoration, layout, line, height, lineHeight, tabSize, characterWidth); } } + + this._lastDecorations = decorations; } } diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index c8b89e889cf..3b7bb2d1365 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -2703,6 +2703,10 @@ export class ModelDecorationMinimapOptions extends DecorationOptions { return this._resolvedColor; } + public invalidateCachedColor(): void { + this._resolvedColor = undefined; + } + private _resolveColor(color: string | ThemeColor, theme: ITheme): Color | undefined { if (typeof color === 'string') { return Color.fromHex(color); diff --git a/src/vs/editor/common/viewModel/viewModel.ts b/src/vs/editor/common/viewModel/viewModel.ts index 1c889284c76..fe832ef3707 100644 --- a/src/vs/editor/common/viewModel/viewModel.ts +++ b/src/vs/editor/common/viewModel/viewModel.ts @@ -141,6 +141,7 @@ export interface IViewModel { getLineLastNonWhitespaceColumn(lineNumber: number): number; getAllOverviewRulerDecorations(theme: ITheme): IOverviewRulerDecorations; invalidateOverviewRulerColorCache(): void; + invalidateMinimapColorCache(): void; getValueInRange(range: Range, eol: EndOfLinePreference): string; getModelLineMaxColumn(modelLineNumber: number): number; diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index e721c4af6cf..5161636aa45 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -11,7 +11,7 @@ import { IPosition, Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { EndOfLinePreference, IActiveIndentGuideInfo, ITextModel, TrackedRangeStickiness, TextModelResolvedOptions } from 'vs/editor/common/model'; -import { ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel'; +import { ModelDecorationOverviewRulerOptions, ModelDecorationMinimapOptions } from 'vs/editor/common/model/textModel'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; import { ColorId, LanguageId, TokenizationRegistry } from 'vs/editor/common/modes'; import { tokenizeLineToHTML } from 'vs/editor/common/modes/textToHtmlTokenizer'; @@ -565,6 +565,16 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel } } + public invalidateMinimapColorCache(): void { + const decorations = this.model.getAllDecorations(); + for (const decoration of decorations) { + const opts = decoration.options.minimap; + if (opts) { + opts.invalidateCachedColor(); + } + } + } + public getValueInRange(range: Range, eol: EndOfLinePreference): string { const modelRange = this.coordinatesConverter.convertViewRangeToModelRange(range); return this.model.getValueInRange(modelRange, eol); From 4a38038457a3af3bdeea822f9c1a877e8a0d7597 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 13:52:16 -0400 Subject: [PATCH 098/190] Added clear input method to clear disposables. --- src/vs/base/browser/ui/sash/sash.ts | 158 +++---- .../extensions/browser/extensionEditor.ts | 439 +++++++++--------- 2 files changed, 300 insertions(+), 297 deletions(-) diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 874bc9482e1..100076e5c11 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -208,93 +208,95 @@ export class Sash extends Disposable { } } - if (!this.state) { - return; - } + if (this.state) { - // Select both iframes and webviews; internally Electron nests an iframe - // in its component, but this isn't queryable. - const iframes = [ - ...getElementsByTagName('iframe'), - ...getElementsByTagName('webview'), - ]; - for (const iframe of iframes) { - iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash - } - const mouseDownEvent = new StandardMouseEvent(e); - const startX = mouseDownEvent.posx; - const startY = mouseDownEvent.posy; - const altKey = mouseDownEvent.altKey; - const startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; - - addClass(this.el, 'active'); - this._onDidStart.fire(startEvent); - - // fix https://github.com/Microsoft/vscode/issues/21675 - const style = createStyleSheet(this.el); - const updateStyle = () => { - let cursor = ''; - - if (isMultisashResize) { - cursor = 'all-scroll'; - } else if (this.orientation === Orientation.HORIZONTAL) { - if (this.state === SashState.Minimum) { - cursor = 's-resize'; - } else if (this.state === SashState.Maximum) { - cursor = 'n-resize'; - } else { - cursor = isMacintosh ? 'row-resize' : 'ns-resize'; - } - } else { - if (this.state === SashState.Minimum) { - cursor = 'e-resize'; - } else if (this.state === SashState.Maximum) { - cursor = 'w-resize'; - } else { - cursor = isMacintosh ? 'col-resize' : 'ew-resize'; - } - } - - style.innerHTML = `* { cursor: ${cursor} !important; }`; - }; - - const disposables = new DisposableStore(); - - updateStyle(); - - if (!isMultisashResize) { - this.onDidEnablementChange(updateStyle, null, disposables); - } - - const onMouseMove = (e: MouseEvent) => { - EventHelper.stop(e, false); - const mouseMoveEvent = new StandardMouseEvent(e); - const event: ISashEvent = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey }; - - this._onDidChange.fire(event); - }; - - const onMouseUp = (e: MouseEvent) => { - EventHelper.stop(e, false); - - this.el.removeChild(style); - - removeClass(this.el, 'active'); - this._onDidEnd.fire(); - - disposables.dispose(); + // Select both iframes and webviews; internally Electron nests an iframe + // in its component, but this isn't queryable. + const iframes = [ + ...getElementsByTagName('webview'), + ...getElementsByTagName('iframe'), + ]; for (const iframe of iframes) { - iframe.style.pointerEvents = 'auto'; + iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash } - }; - domEvent(window, 'mousemove')(onMouseMove, null, disposables); - domEvent(window, 'mouseup')(onMouseUp, null, disposables); + const mouseDownEvent = new StandardMouseEvent(e); + const startX = mouseDownEvent.posx; + const startY = mouseDownEvent.posy; + const altKey = mouseDownEvent.altKey; + const startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; + + addClass(this.el, 'active'); + this._onDidStart.fire(startEvent); + + // fix https://github.com/Microsoft/vscode/issues/21675 + const style = createStyleSheet(this.el); + const updateStyle = () => { + let cursor = ''; + + if (isMultisashResize) { + cursor = 'all-scroll'; + } else if (this.orientation === Orientation.HORIZONTAL) { + if (this.state === SashState.Minimum) { + cursor = 's-resize'; + } else if (this.state === SashState.Maximum) { + cursor = 'n-resize'; + } else { + cursor = isMacintosh ? 'row-resize' : 'ns-resize'; + } + } else { + if (this.state === SashState.Minimum) { + cursor = 'e-resize'; + } else if (this.state === SashState.Maximum) { + cursor = 'w-resize'; + } else { + cursor = isMacintosh ? 'col-resize' : 'ew-resize'; + } + } + + style.innerHTML = `* { cursor: ${cursor} !important; }`; + }; + + const disposables = new DisposableStore(); + + updateStyle(); + + if (!isMultisashResize) { + this.onDidEnablementChange(updateStyle, null, disposables); + } + + const onMouseMove = (e: MouseEvent) => { + EventHelper.stop(e, false); + const mouseMoveEvent = new StandardMouseEvent(e); + const event: ISashEvent = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey }; + + this._onDidChange.fire(event); + }; + + const onMouseUp = (e: MouseEvent) => { + EventHelper.stop(e, false); + + this.el.removeChild(style); + + removeClass(this.el, 'active'); + this._onDidEnd.fire(); + + disposables.dispose(); + + for (const iframe of iframes) { + iframe.style.pointerEvents = 'auto'; + } + }; + + domEvent(window, 'mousemove')(onMouseMove, null, disposables); + domEvent(window, 'mouseup')(onMouseUp, null, disposables); + } } + private onMouseDoubleClick(event: MouseEvent): void { this._onDidReset.fire(); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 2ab1851bda6..2608272f4ce 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -483,6 +483,13 @@ export class ExtensionEditor extends BaseEditor { })); } + clearInput(): void { + this.contentDisposables.clear(); + this.transientDisposables.clear(); + + super.clearInput(); + } + focus(): void { if (this.activeElement) { this.activeElement.focus(); @@ -584,39 +591,38 @@ export class ExtensionEditor extends BaseEditor { const content = $('div', { class: 'subcontent', tabindex: '0' }); return this.loadContents(() => this.extensionManifest!.get()) .then(manifest => { - if (!manifest) { - return content; - } + if (manifest) { - const scrollableContent = new DomScrollableElement(content, {}); + const scrollableContent = new DomScrollableElement(content, {}); - const layout = () => scrollableContent.scanDomNode(); - const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout }); - this.contentDisposables.add(toDisposable(removeLayoutParticipant)); + const layout = () => scrollableContent.scanDomNode(); + const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout }); + this.contentDisposables.add(toDisposable(removeLayoutParticipant)); - const renders = [ - this.renderSettings(content, manifest, layout), - this.renderCommands(content, manifest, layout), - this.renderLanguages(content, manifest, layout), - this.renderColorThemes(content, manifest, layout), - this.renderIconThemes(content, manifest, layout), - this.renderColors(content, manifest, layout), - this.renderJSONValidation(content, manifest, layout), - this.renderDebuggers(content, manifest, layout), - this.renderViewContainers(content, manifest, layout), - this.renderViews(content, manifest, layout), - this.renderLocalizations(content, manifest, layout) - ]; + const renders = [ + this.renderSettings(content, manifest, layout), + this.renderCommands(content, manifest, layout), + this.renderLanguages(content, manifest, layout), + this.renderColorThemes(content, manifest, layout), + this.renderIconThemes(content, manifest, layout), + this.renderColors(content, manifest, layout), + this.renderJSONValidation(content, manifest, layout), + this.renderDebuggers(content, manifest, layout), + this.renderViewContainers(content, manifest, layout), + this.renderViews(content, manifest, layout), + this.renderLocalizations(content, manifest, layout) + ]; - scrollableContent.scanDomNode(); + scrollableContent.scanDomNode(); - const isEmpty = !renders.some(x => x); - if (isEmpty) { - append(content, $('p.nocontent')).textContent = localize('noContributions', "No Contributions"); - append(this.content, content); - } else { - append(this.content, scrollableContent.getDomNode()); - this.contentDisposables.add(scrollableContent); + const isEmpty = !renders.some(x => x); + if (isEmpty) { + append(content, $('p.nocontent')).textContent = localize('noContributions', "No Contributions"); + append(this.content, content); + } else { + append(this.content, scrollableContent.getDomNode()); + this.contentDisposables.add(scrollableContent); + } } return content; }, () => { @@ -684,53 +690,51 @@ export class ExtensionEditor extends BaseEditor { } const contrib = properties ? Object.keys(properties) : []; - if (!contrib.length) { - return false; + if (contrib.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('settings', "Settings ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('setting name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('default', "Default")) + ), + ...contrib.map(key => $('tr', undefined, + $('td', undefined, $('code', undefined, key)), + $('td', undefined, properties[key].description), + $('td', undefined, $('code', undefined, `${isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default}`)) + )) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('settings', "Settings ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('setting name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('default', "Default")) - ), - ...contrib.map(key => $('tr', undefined, - $('td', undefined, $('code', undefined, key)), - $('td', undefined, properties[key].description), - $('td', undefined, $('code', undefined, `${isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default}`)) - )) - ) - ); - - append(container, details); - return true; + return false; } private renderDebuggers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.debuggers || []; - if (!contrib.length) { - return false; + if (contrib.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('debugger name', "Name")), + $('th', undefined, localize('debugger type', "Type")), + ), + ...contrib.map(d => $('tr', undefined, + $('td', undefined, d.label!), + $('td', undefined, d.type))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('debugger name', "Name")), - $('th', undefined, localize('debugger type', "Type")), - ), - ...contrib.map(d => $('tr', undefined, - $('td', undefined, d.label!), - $('td', undefined, d.type))) - ) - ); - - append(container, details); - return true; + return false; } private renderViewContainers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -743,20 +747,19 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, title: string, location: string }>); - if (!viewContainers.length) { - return false; + if (viewContainers.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), + ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), - ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) - ) - ); - - append(container, details); - return true; + return false; } private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -769,20 +772,19 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, name: string, location: string }>); - if (!views.length) { - return false; + if (views.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('views', "Views ({0})", views.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), + ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('views', "Views ({0})", views.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), - ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) - ) - ); - - append(container, details); - return true; + return false; } private renderLocalizations(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -843,44 +845,46 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const colors = contributes && contributes.colors; - if (!colors || !colors.length) { - return false; - } + if (colors && colors.length) { - function colorPreview(colorReference: string): Node[] { - let result: Node[] = []; - if (colorReference && colorReference[0] === '#') { - let color = Color.fromHex(colorReference); - if (color) { - result.push($('span', { class: 'colorBox', style: 'background-color: ' + Color.Format.CSS.format(color) }, '')); + + + function colorPreview(colorReference: string): Node[] { + let result: Node[] = []; + if (colorReference && colorReference[0] === '#') { + let color = Color.fromHex(colorReference); + if (color) { + result.push($('span', { class: 'colorBox', style: 'background-color: ' + Color.Format.CSS.format(color) }, '')); + } } + result.push($('code', undefined, colorReference)); + return result; } - result.push($('code', undefined, colorReference)); - return result; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('colors', "Colors ({0})", colors.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('colorId', "Id")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('defaultDark', "Dark Default")), + $('th', undefined, localize('defaultLight', "Light Default")), + $('th', undefined, localize('defaultHC', "High Contrast Default")) + ), + ...colors.map(color => $('tr', undefined, + $('td', undefined, $('code', undefined, color.id)), + $('td', undefined, color.description), + $('td', undefined, ...colorPreview(color.defaults.dark)), + $('td', undefined, ...colorPreview(color.defaults.light)), + $('td', undefined, ...colorPreview(color.defaults.highContrast)) + )) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('colors', "Colors ({0})", colors.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('colorId', "Id")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('defaultDark', "Dark Default")), - $('th', undefined, localize('defaultLight', "Light Default")), - $('th', undefined, localize('defaultHC', "High Contrast Default")) - ), - ...colors.map(color => $('tr', undefined, - $('td', undefined, $('code', undefined, color.id)), - $('td', undefined, color.description), - $('td', undefined, ...colorPreview(color.defaults.dark)), - $('td', undefined, ...colorPreview(color.defaults.light)), - $('td', undefined, ...colorPreview(color.defaults.highContrast)) - )) - ) - ); - - append(container, details); - return true; + return false; } @@ -888,24 +892,23 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const contrib = contributes && contributes.jsonValidation || []; - if (!contrib.length) { - return false; + if (contrib.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('JSON Validation', "JSON Validation ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('fileMatch', "File Match")), + $('th', undefined, localize('schema', "Schema")) + ), + ...contrib.map(v => $('tr', undefined, + $('td', undefined, $('code', undefined, v.fileMatch)), + $('td', undefined, v.url) + )))); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('JSON Validation', "JSON Validation ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('fileMatch', "File Match")), - $('th', undefined, localize('schema', "Schema")) - ), - ...contrib.map(v => $('tr', undefined, - $('td', undefined, $('code', undefined, v.fileMatch)), - $('td', undefined, v.url) - )))); - - append(container, details); - return true; + return false; } private renderCommands(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -941,51 +944,52 @@ export class ExtensionEditor extends BaseEditor { rawKeybindings.forEach(rawKeybinding => { const keybinding = this.resolveKeybinding(rawKeybinding); - if (!keybinding) { - return; - } + if (keybinding) { - let command = byId[rawKeybinding.command]; + let command = byId[rawKeybinding.command]; - if (!command) { - command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; - byId[command.id] = command; - commands.push(command); - } else { - command.keybindings.push(keybinding); + if (command) { + command.keybindings.push(keybinding); + } else { + command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; + byId[command.id] = command; + commands.push(command); + } } + return; }); - if (!commands.length) { - return false; + if (commands.length) { + + + const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { + const element = $(''); + new KeybindingLabel(element, OS).set(keybinding); + return element; + }; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('command name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), + $('th', undefined, localize('menuContexts', "Menu Contexts")) + ), + ...commands.map(c => $('tr', undefined, + $('td', undefined, $('code', undefined, c.id)), + $('td', undefined, c.title), + $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), + $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) + )) + ) + ); + + append(container, details); + return true; } - - const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { - const element = $(''); - new KeybindingLabel(element, OS).set(keybinding); - return element; - }; - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('command name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), - $('th', undefined, localize('menuContexts', "Menu Contexts")) - ), - ...commands.map(c => $('tr', undefined, - $('td', undefined, $('code', undefined, c.id)), - $('td', undefined, c.title), - $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), - $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) - )) - ) - ); - - append(container, details); - return true; + return false; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1006,12 +1010,12 @@ export class ExtensionEditor extends BaseEditor { grammars.forEach(grammar => { let language = byId[grammar.language]; - if (!language) { + if (language) { + language.hasGrammar = true; + } else { language = { id: grammar.language, name: grammar.language, extensions: [], hasGrammar: true, hasSnippets: false }; byId[language.id] = language; languages.push(language); - } else { - language.hasGrammar = true; } }); @@ -1020,41 +1024,40 @@ export class ExtensionEditor extends BaseEditor { snippets.forEach(snippet => { let language = byId[snippet.language]; - if (!language) { + if (language) { + language.hasSnippets = true; + } else { language = { id: snippet.language, name: snippet.language, extensions: [], hasGrammar: false, hasSnippets: true }; byId[language.id] = language; languages.push(language); - } else { - language.hasSnippets = true; } }); - if (!languages.length) { - return false; + if (languages.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('language id', "ID")), + $('th', undefined, localize('language name', "Name")), + $('th', undefined, localize('file extensions', "File Extensions")), + $('th', undefined, localize('grammar', "Grammar")), + $('th', undefined, localize('snippets', "Snippets")) + ), + ...languages.map(l => $('tr', undefined, + $('td', undefined, l.id), + $('td', undefined, l.name), + $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), + $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), + $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) + )) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('language id', "ID")), - $('th', undefined, localize('language name', "Name")), - $('th', undefined, localize('file extensions', "File Extensions")), - $('th', undefined, localize('grammar', "Grammar")), - $('th', undefined, localize('snippets', "Snippets")) - ), - ...languages.map(l => $('tr', undefined, - $('td', undefined, l.id), - $('td', undefined, l.name), - $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), - $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), - $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) - )) - ) - ); - - append(container, details); - return true; + return false; } private resolveKeybinding(rawKeyBinding: IKeyBinding): ResolvedKeybinding | null { @@ -1067,11 +1070,10 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS); - if (!keyBinding) { - return null; + if (keyBinding) { + return this.keybindingService.resolveKeybinding(keyBinding)[0]; } - - return this.keybindingService.resolveKeybinding(keyBinding)[0]; + return null; } private loadContents(loadingTask: () => CacheResult): Promise { @@ -1094,7 +1096,6 @@ export class ExtensionEditor extends BaseEditor { if (isPromiseCanceledError(err)) { return; } - this.notificationService.error(err); } } From d79071a49fcc7e381b268a829bf3aec306e62938 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 13:58:57 -0400 Subject: [PATCH 099/190] Fixed formatting to pass the hygiene tests --- src/vs/base/common/uri.ts | 61 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 966555e04d0..91f4c82cf37 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -48,10 +48,9 @@ function _validateUri(ret: URI, _strict?: boolean): void { if (!_singleSlashStart.test(ret.path)) { throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); } - } else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } + } else if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } } } @@ -64,11 +63,11 @@ function _schemeFix(scheme: string, _strict: boolean): string { if (_strict || _throwOnMissingSchema) { return scheme || _empty; } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; + if (scheme) { + return scheme; } - return scheme; + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 @@ -116,17 +115,17 @@ export class URI implements UriComponents { if (thing instanceof URI) { return true; } - if (!thing) { - return false; + if (thing) { + return typeof (thing).authority === 'string' + && typeof (thing).fragment === 'string' + && typeof (thing).path === 'string' + && typeof (thing).query === 'string' + && typeof (thing).scheme === 'string' + && typeof (thing).fsPath === 'function' + && typeof (thing).with === 'function' + && typeof (thing).toString === 'function'; } - return typeof (thing).authority === 'string' - && typeof (thing).fragment === 'string' - && typeof (thing).path === 'string' - && typeof (thing).query === 'string' - && typeof (thing).scheme === 'string' - && typeof (thing).fsPath === 'function' - && typeof (thing).with === 'function' - && typeof (thing).toString === 'function'; + return false; } /** @@ -281,17 +280,17 @@ export class URI implements UriComponents { */ static parse(value: string, _strict: boolean = false): URI { const match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); + if (match) { + return new _URI( + match[2] || _empty, + decodeURIComponent(match[4] || _empty), + decodeURIComponent(match[5] || _empty), + decodeURIComponent(match[7] || _empty), + decodeURIComponent(match[9] || _empty), + _strict + ); } - return new _URI( - match[2] || _empty, - decodeURIComponent(match[4] || _empty), - decodeURIComponent(match[5] || _empty), - decodeURIComponent(match[7] || _empty), - decodeURIComponent(match[9] || _empty), - _strict - ); + return new _URI(_empty, _empty, _empty, _empty, _empty); } /** @@ -560,10 +559,8 @@ function encodeURIComponentMinimal(path: string): string { res = path.substr(0, pos); } res += encodeTable[code]; - } else { - if (res !== undefined) { - res += path[pos]; - } + } else if (res !== undefined) { + res += path[pos]; } } return res !== undefined ? res : path; From 5746289634e036335ccdec84575a1173189a8ca7 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:09:45 -0400 Subject: [PATCH 100/190] Fixed formatting --- .../telemetry/common/errorTelemetry.ts | 44 +++++++------- .../contrib/files/browser/fileActions.ts | 60 ++++++++----------- 2 files changed, 47 insertions(+), 57 deletions(-) diff --git a/src/vs/platform/telemetry/common/errorTelemetry.ts b/src/vs/platform/telemetry/common/errorTelemetry.ts index d58610ecc67..c3ec801c0a1 100644 --- a/src/vs/platform/telemetry/common/errorTelemetry.ts +++ b/src/vs/platform/telemetry/common/errorTelemetry.ts @@ -34,7 +34,9 @@ export namespace ErrorEvent { export function compare(a: ErrorEvent, b: ErrorEvent) { if (a.callstack < b.callstack) { return -1; - } else if (a.callstack > b.callstack) { + } + + if (a.callstack > b.callstack) { return 1; } return 0; @@ -75,25 +77,21 @@ export default abstract class BaseErrorTelemetry { private _onErrorEvent(err: any): void { - if (!err) { - return; + if (err) { + // unwrap nested errors from loader + if (err.detail && err.detail.stack) { + err = err.detail; + } + + // work around behavior in workerServer.ts that breaks up Error.stack + let callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack; + let msg = err.message ? err.message : safeStringify(err); + + // errors without a stack are not useful telemetry + if (callstack) { + this._enqueue({ msg, callstack }); + } } - - // unwrap nested errors from loader - if (err.detail && err.detail.stack) { - err = err.detail; - } - - // work around behavior in workerServer.ts that breaks up Error.stack - let callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack; - let msg = err.message ? err.message : safeStringify(err); - - // errors without a stack are not useful telemetry - if (!callstack) { - return; - } - - this._enqueue({ msg, callstack }); } protected _enqueue(e: ErrorEvent): void { @@ -102,10 +100,10 @@ export default abstract class BaseErrorTelemetry { if (idx < 0) { e.count = 1; this._buffer.splice(~idx, 0, e); - } else { - if (!this._buffer[idx].count) { - this._buffer[idx].count = 0; - } + } else if (!this._buffer[idx].count) { + this._buffer[idx].count = 0; + } + else { this._buffer[idx].count! += 1; } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 4bde241c886..1a8089bde4a 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -332,11 +332,7 @@ export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste let name = resources.basenameOrAuthority(fileToPaste.resource); let candidate = resources.joinPath(targetFolder.resource, name); - while (true && !fileToPaste.allowOverwrite) { - if (!targetFolder.root.find(candidate)) { - break; - } - + while (!(fileToPaste.allowOverwrite || targetFolder.root.find(candidate))) { name = incrementFileName(name, !!fileToPaste.isDirectory); candidate = resources.joinPath(targetFolder.resource, name); } @@ -951,46 +947,42 @@ export const deleteFileHandler = (accessor: ServicesAccessor) => { let pasteShouldMove = false; export const copyFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (!listService.lastFocusedList) { - return; - } - const explorerContext = getContext(listService.lastFocusedList); - const explorerService = accessor.get(IExplorerService); - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - explorerService.setToCopy(stats, false); - pasteShouldMove = false; + if (listService.lastFocusedList) { + const explorerContext = getContext(listService.lastFocusedList); + const explorerService = accessor.get(IExplorerService); + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + explorerService.setToCopy(stats, false); + pasteShouldMove = false; + } } }; export const cutFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (!listService.lastFocusedList) { - return; - } - const explorerContext = getContext(listService.lastFocusedList); - const explorerService = accessor.get(IExplorerService); - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - explorerService.setToCopy(stats, true); - pasteShouldMove = true; + if (listService.lastFocusedList) { + const explorerContext = getContext(listService.lastFocusedList); + const explorerService = accessor.get(IExplorerService); + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + explorerService.setToCopy(stats, true); + pasteShouldMove = true; + } } }; export const DOWNLOAD_COMMAND_ID = 'explorer.download'; const downloadFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (!listService.lastFocusedList) { - return; - } - const explorerContext = getContext(listService.lastFocusedList); - const textFileService = accessor.get(ITextFileService); - - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - stats.forEach(async s => { - await textFileService.saveAs(s.resource, undefined, { availableFileSystems: [Schemas.file] }); - }); + if (listService.lastFocusedList) { + const explorerContext = getContext(listService.lastFocusedList); + const textFileService = accessor.get(ITextFileService); + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + stats.forEach(async s => { + await textFileService.saveAs(s.resource, undefined, { availableFileSystems: [Schemas.file] }); + }); + } } }; CommandsRegistry.registerCommand({ From c77c6603f9b489a03665a45a97bddca26b6358b1 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:27:42 -0400 Subject: [PATCH 101/190] Fixed compilation errors --- src/vs/base/common/uri.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 91f4c82cf37..b095d410d3f 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -67,7 +67,7 @@ function _schemeFix(scheme: string, _strict: boolean): string { return scheme; } console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; + return 'file'; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 From bc78d5230aeea90d4bf0d1f0460adb701f79ec10 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:29:41 -0400 Subject: [PATCH 102/190] Revert "Fixed compilation errors" This reverts commit b59ecadf6b1c3c84213b8300df8ba8ce962e6625. --- src/vs/base/common/uri.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index b095d410d3f..91f4c82cf37 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -67,7 +67,7 @@ function _schemeFix(scheme: string, _strict: boolean): string { return scheme; } console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - return 'file'; + scheme = 'file'; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 From eecec905e42466fc8d64bdd621eb43740c7ceee2 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:29:43 -0400 Subject: [PATCH 103/190] Revert "Fixed formatting" This reverts commit ff8fc9aa75edd7d30d135ef49738754d421fa4fd. --- .../telemetry/common/errorTelemetry.ts | 44 +++++++------- .../contrib/files/browser/fileActions.ts | 60 +++++++++++-------- 2 files changed, 57 insertions(+), 47 deletions(-) diff --git a/src/vs/platform/telemetry/common/errorTelemetry.ts b/src/vs/platform/telemetry/common/errorTelemetry.ts index c3ec801c0a1..d58610ecc67 100644 --- a/src/vs/platform/telemetry/common/errorTelemetry.ts +++ b/src/vs/platform/telemetry/common/errorTelemetry.ts @@ -34,9 +34,7 @@ export namespace ErrorEvent { export function compare(a: ErrorEvent, b: ErrorEvent) { if (a.callstack < b.callstack) { return -1; - } - - if (a.callstack > b.callstack) { + } else if (a.callstack > b.callstack) { return 1; } return 0; @@ -77,21 +75,25 @@ export default abstract class BaseErrorTelemetry { private _onErrorEvent(err: any): void { - if (err) { - // unwrap nested errors from loader - if (err.detail && err.detail.stack) { - err = err.detail; - } - - // work around behavior in workerServer.ts that breaks up Error.stack - let callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack; - let msg = err.message ? err.message : safeStringify(err); - - // errors without a stack are not useful telemetry - if (callstack) { - this._enqueue({ msg, callstack }); - } + if (!err) { + return; } + + // unwrap nested errors from loader + if (err.detail && err.detail.stack) { + err = err.detail; + } + + // work around behavior in workerServer.ts that breaks up Error.stack + let callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack; + let msg = err.message ? err.message : safeStringify(err); + + // errors without a stack are not useful telemetry + if (!callstack) { + return; + } + + this._enqueue({ msg, callstack }); } protected _enqueue(e: ErrorEvent): void { @@ -100,10 +102,10 @@ export default abstract class BaseErrorTelemetry { if (idx < 0) { e.count = 1; this._buffer.splice(~idx, 0, e); - } else if (!this._buffer[idx].count) { - this._buffer[idx].count = 0; - } - else { + } else { + if (!this._buffer[idx].count) { + this._buffer[idx].count = 0; + } this._buffer[idx].count! += 1; } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 1a8089bde4a..4bde241c886 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -332,7 +332,11 @@ export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste let name = resources.basenameOrAuthority(fileToPaste.resource); let candidate = resources.joinPath(targetFolder.resource, name); - while (!(fileToPaste.allowOverwrite || targetFolder.root.find(candidate))) { + while (true && !fileToPaste.allowOverwrite) { + if (!targetFolder.root.find(candidate)) { + break; + } + name = incrementFileName(name, !!fileToPaste.isDirectory); candidate = resources.joinPath(targetFolder.resource, name); } @@ -947,42 +951,46 @@ export const deleteFileHandler = (accessor: ServicesAccessor) => { let pasteShouldMove = false; export const copyFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (listService.lastFocusedList) { - const explorerContext = getContext(listService.lastFocusedList); - const explorerService = accessor.get(IExplorerService); - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - explorerService.setToCopy(stats, false); - pasteShouldMove = false; - } + if (!listService.lastFocusedList) { + return; + } + const explorerContext = getContext(listService.lastFocusedList); + const explorerService = accessor.get(IExplorerService); + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + explorerService.setToCopy(stats, false); + pasteShouldMove = false; } }; export const cutFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (listService.lastFocusedList) { - const explorerContext = getContext(listService.lastFocusedList); - const explorerService = accessor.get(IExplorerService); - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - explorerService.setToCopy(stats, true); - pasteShouldMove = true; - } + if (!listService.lastFocusedList) { + return; + } + const explorerContext = getContext(listService.lastFocusedList); + const explorerService = accessor.get(IExplorerService); + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + explorerService.setToCopy(stats, true); + pasteShouldMove = true; } }; export const DOWNLOAD_COMMAND_ID = 'explorer.download'; const downloadFileHandler = (accessor: ServicesAccessor) => { const listService = accessor.get(IListService); - if (listService.lastFocusedList) { - const explorerContext = getContext(listService.lastFocusedList); - const textFileService = accessor.get(ITextFileService); - if (explorerContext.stat) { - const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; - stats.forEach(async s => { - await textFileService.saveAs(s.resource, undefined, { availableFileSystems: [Schemas.file] }); - }); - } + if (!listService.lastFocusedList) { + return; + } + const explorerContext = getContext(listService.lastFocusedList); + const textFileService = accessor.get(ITextFileService); + + if (explorerContext.stat) { + const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat]; + stats.forEach(async s => { + await textFileService.saveAs(s.resource, undefined, { availableFileSystems: [Schemas.file] }); + }); } }; CommandsRegistry.registerCommand({ From 47365df63c66a026a4255f1eff6a922ceec5610a Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:30:25 -0400 Subject: [PATCH 104/190] Revert "Added clear input method to clear disposables." This reverts commit ce17e06dc3849db00e377f221c9e98fc3f11ba6c. --- src/vs/base/browser/ui/sash/sash.ts | 158 +++--- .../extensions/browser/extensionEditor.ts | 449 +++++++++--------- 2 files changed, 302 insertions(+), 305 deletions(-) diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 100076e5c11..874bc9482e1 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -208,95 +208,93 @@ export class Sash extends Disposable { } } - if (this.state) { + if (!this.state) { + return; + } + // Select both iframes and webviews; internally Electron nests an iframe + // in its component, but this isn't queryable. + const iframes = [ + ...getElementsByTagName('iframe'), + ...getElementsByTagName('webview'), + ]; + for (const iframe of iframes) { + iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash + } - // Select both iframes and webviews; internally Electron nests an iframe - // in its component, but this isn't queryable. - const iframes = [ - ...getElementsByTagName('webview'), - ...getElementsByTagName('iframe'), - ]; + const mouseDownEvent = new StandardMouseEvent(e); + const startX = mouseDownEvent.posx; + const startY = mouseDownEvent.posy; + const altKey = mouseDownEvent.altKey; + const startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; + + addClass(this.el, 'active'); + this._onDidStart.fire(startEvent); + + // fix https://github.com/Microsoft/vscode/issues/21675 + const style = createStyleSheet(this.el); + const updateStyle = () => { + let cursor = ''; + + if (isMultisashResize) { + cursor = 'all-scroll'; + } else if (this.orientation === Orientation.HORIZONTAL) { + if (this.state === SashState.Minimum) { + cursor = 's-resize'; + } else if (this.state === SashState.Maximum) { + cursor = 'n-resize'; + } else { + cursor = isMacintosh ? 'row-resize' : 'ns-resize'; + } + } else { + if (this.state === SashState.Minimum) { + cursor = 'e-resize'; + } else if (this.state === SashState.Maximum) { + cursor = 'w-resize'; + } else { + cursor = isMacintosh ? 'col-resize' : 'ew-resize'; + } + } + + style.innerHTML = `* { cursor: ${cursor} !important; }`; + }; + + const disposables = new DisposableStore(); + + updateStyle(); + + if (!isMultisashResize) { + this.onDidEnablementChange(updateStyle, null, disposables); + } + + const onMouseMove = (e: MouseEvent) => { + EventHelper.stop(e, false); + const mouseMoveEvent = new StandardMouseEvent(e); + const event: ISashEvent = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey }; + + this._onDidChange.fire(event); + }; + + const onMouseUp = (e: MouseEvent) => { + EventHelper.stop(e, false); + + this.el.removeChild(style); + + removeClass(this.el, 'active'); + this._onDidEnd.fire(); + + disposables.dispose(); for (const iframe of iframes) { - iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash + iframe.style.pointerEvents = 'auto'; } + }; - const mouseDownEvent = new StandardMouseEvent(e); - const startX = mouseDownEvent.posx; - const startY = mouseDownEvent.posy; - const altKey = mouseDownEvent.altKey; - const startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; - - addClass(this.el, 'active'); - this._onDidStart.fire(startEvent); - - // fix https://github.com/Microsoft/vscode/issues/21675 - const style = createStyleSheet(this.el); - const updateStyle = () => { - let cursor = ''; - - if (isMultisashResize) { - cursor = 'all-scroll'; - } else if (this.orientation === Orientation.HORIZONTAL) { - if (this.state === SashState.Minimum) { - cursor = 's-resize'; - } else if (this.state === SashState.Maximum) { - cursor = 'n-resize'; - } else { - cursor = isMacintosh ? 'row-resize' : 'ns-resize'; - } - } else { - if (this.state === SashState.Minimum) { - cursor = 'e-resize'; - } else if (this.state === SashState.Maximum) { - cursor = 'w-resize'; - } else { - cursor = isMacintosh ? 'col-resize' : 'ew-resize'; - } - } - - style.innerHTML = `* { cursor: ${cursor} !important; }`; - }; - - const disposables = new DisposableStore(); - - updateStyle(); - - if (!isMultisashResize) { - this.onDidEnablementChange(updateStyle, null, disposables); - } - - const onMouseMove = (e: MouseEvent) => { - EventHelper.stop(e, false); - const mouseMoveEvent = new StandardMouseEvent(e); - const event: ISashEvent = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey }; - - this._onDidChange.fire(event); - }; - - const onMouseUp = (e: MouseEvent) => { - EventHelper.stop(e, false); - - this.el.removeChild(style); - - removeClass(this.el, 'active'); - this._onDidEnd.fire(); - - disposables.dispose(); - - for (const iframe of iframes) { - iframe.style.pointerEvents = 'auto'; - } - }; - - domEvent(window, 'mousemove')(onMouseMove, null, disposables); - domEvent(window, 'mouseup')(onMouseUp, null, disposables); - } + domEvent(window, 'mousemove')(onMouseMove, null, disposables); + domEvent(window, 'mouseup')(onMouseUp, null, disposables); } - private onMouseDoubleClick(event: MouseEvent): void { this._onDidReset.fire(); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 2608272f4ce..2ab1851bda6 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -483,13 +483,6 @@ export class ExtensionEditor extends BaseEditor { })); } - clearInput(): void { - this.contentDisposables.clear(); - this.transientDisposables.clear(); - - super.clearInput(); - } - focus(): void { if (this.activeElement) { this.activeElement.focus(); @@ -591,38 +584,39 @@ export class ExtensionEditor extends BaseEditor { const content = $('div', { class: 'subcontent', tabindex: '0' }); return this.loadContents(() => this.extensionManifest!.get()) .then(manifest => { - if (manifest) { + if (!manifest) { + return content; + } - const scrollableContent = new DomScrollableElement(content, {}); + const scrollableContent = new DomScrollableElement(content, {}); - const layout = () => scrollableContent.scanDomNode(); - const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout }); - this.contentDisposables.add(toDisposable(removeLayoutParticipant)); + const layout = () => scrollableContent.scanDomNode(); + const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout }); + this.contentDisposables.add(toDisposable(removeLayoutParticipant)); - const renders = [ - this.renderSettings(content, manifest, layout), - this.renderCommands(content, manifest, layout), - this.renderLanguages(content, manifest, layout), - this.renderColorThemes(content, manifest, layout), - this.renderIconThemes(content, manifest, layout), - this.renderColors(content, manifest, layout), - this.renderJSONValidation(content, manifest, layout), - this.renderDebuggers(content, manifest, layout), - this.renderViewContainers(content, manifest, layout), - this.renderViews(content, manifest, layout), - this.renderLocalizations(content, manifest, layout) - ]; + const renders = [ + this.renderSettings(content, manifest, layout), + this.renderCommands(content, manifest, layout), + this.renderLanguages(content, manifest, layout), + this.renderColorThemes(content, manifest, layout), + this.renderIconThemes(content, manifest, layout), + this.renderColors(content, manifest, layout), + this.renderJSONValidation(content, manifest, layout), + this.renderDebuggers(content, manifest, layout), + this.renderViewContainers(content, manifest, layout), + this.renderViews(content, manifest, layout), + this.renderLocalizations(content, manifest, layout) + ]; - scrollableContent.scanDomNode(); + scrollableContent.scanDomNode(); - const isEmpty = !renders.some(x => x); - if (isEmpty) { - append(content, $('p.nocontent')).textContent = localize('noContributions', "No Contributions"); - append(this.content, content); - } else { - append(this.content, scrollableContent.getDomNode()); - this.contentDisposables.add(scrollableContent); - } + const isEmpty = !renders.some(x => x); + if (isEmpty) { + append(content, $('p.nocontent')).textContent = localize('noContributions', "No Contributions"); + append(this.content, content); + } else { + append(this.content, scrollableContent.getDomNode()); + this.contentDisposables.add(scrollableContent); } return content; }, () => { @@ -690,51 +684,53 @@ export class ExtensionEditor extends BaseEditor { } const contrib = properties ? Object.keys(properties) : []; - if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('settings', "Settings ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('setting name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('default', "Default")) - ), - ...contrib.map(key => $('tr', undefined, - $('td', undefined, $('code', undefined, key)), - $('td', undefined, properties[key].description), - $('td', undefined, $('code', undefined, `${isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default}`)) - )) - ) - ); - - append(container, details); - return true; + if (!contrib.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('settings', "Settings ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('setting name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('default', "Default")) + ), + ...contrib.map(key => $('tr', undefined, + $('td', undefined, $('code', undefined, key)), + $('td', undefined, properties[key].description), + $('td', undefined, $('code', undefined, `${isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default}`)) + )) + ) + ); + + append(container, details); + return true; } private renderDebuggers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.debuggers || []; - if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('debugger name', "Name")), - $('th', undefined, localize('debugger type', "Type")), - ), - ...contrib.map(d => $('tr', undefined, - $('td', undefined, d.label!), - $('td', undefined, d.type))) - ) - ); - - append(container, details); - return true; + if (!contrib.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('debugger name', "Name")), + $('th', undefined, localize('debugger type', "Type")), + ), + ...contrib.map(d => $('tr', undefined, + $('td', undefined, d.label!), + $('td', undefined, d.type))) + ) + ); + + append(container, details); + return true; } private renderViewContainers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -747,19 +743,20 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, title: string, location: string }>); - if (viewContainers.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), - ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) - ) - ); - - append(container, details); - return true; + if (!viewContainers.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), + ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) + ) + ); + + append(container, details); + return true; } private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -772,19 +769,20 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, name: string, location: string }>); - if (views.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('views', "Views ({0})", views.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), - ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) - ) - ); - - append(container, details); - return true; + if (!views.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('views', "Views ({0})", views.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), + ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) + ) + ); + + append(container, details); + return true; } private renderLocalizations(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -845,46 +843,44 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const colors = contributes && contributes.colors; - if (colors && colors.length) { - - - - function colorPreview(colorReference: string): Node[] { - let result: Node[] = []; - if (colorReference && colorReference[0] === '#') { - let color = Color.fromHex(colorReference); - if (color) { - result.push($('span', { class: 'colorBox', style: 'background-color: ' + Color.Format.CSS.format(color) }, '')); - } - } - result.push($('code', undefined, colorReference)); - return result; - } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('colors', "Colors ({0})", colors.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('colorId', "Id")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('defaultDark', "Dark Default")), - $('th', undefined, localize('defaultLight', "Light Default")), - $('th', undefined, localize('defaultHC', "High Contrast Default")) - ), - ...colors.map(color => $('tr', undefined, - $('td', undefined, $('code', undefined, color.id)), - $('td', undefined, color.description), - $('td', undefined, ...colorPreview(color.defaults.dark)), - $('td', undefined, ...colorPreview(color.defaults.light)), - $('td', undefined, ...colorPreview(color.defaults.highContrast)) - )) - ) - ); - - append(container, details); - return true; + if (!colors || !colors.length) { + return false; } - return false; + + function colorPreview(colorReference: string): Node[] { + let result: Node[] = []; + if (colorReference && colorReference[0] === '#') { + let color = Color.fromHex(colorReference); + if (color) { + result.push($('span', { class: 'colorBox', style: 'background-color: ' + Color.Format.CSS.format(color) }, '')); + } + } + result.push($('code', undefined, colorReference)); + return result; + } + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('colors', "Colors ({0})", colors.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('colorId', "Id")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('defaultDark', "Dark Default")), + $('th', undefined, localize('defaultLight', "Light Default")), + $('th', undefined, localize('defaultHC', "High Contrast Default")) + ), + ...colors.map(color => $('tr', undefined, + $('td', undefined, $('code', undefined, color.id)), + $('td', undefined, color.description), + $('td', undefined, ...colorPreview(color.defaults.dark)), + $('td', undefined, ...colorPreview(color.defaults.light)), + $('td', undefined, ...colorPreview(color.defaults.highContrast)) + )) + ) + ); + + append(container, details); + return true; } @@ -892,23 +888,24 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const contrib = contributes && contributes.jsonValidation || []; - if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('JSON Validation', "JSON Validation ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('fileMatch', "File Match")), - $('th', undefined, localize('schema', "Schema")) - ), - ...contrib.map(v => $('tr', undefined, - $('td', undefined, $('code', undefined, v.fileMatch)), - $('td', undefined, v.url) - )))); - - append(container, details); - return true; + if (!contrib.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('JSON Validation', "JSON Validation ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('fileMatch', "File Match")), + $('th', undefined, localize('schema', "Schema")) + ), + ...contrib.map(v => $('tr', undefined, + $('td', undefined, $('code', undefined, v.fileMatch)), + $('td', undefined, v.url) + )))); + + append(container, details); + return true; } private renderCommands(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -944,52 +941,51 @@ export class ExtensionEditor extends BaseEditor { rawKeybindings.forEach(rawKeybinding => { const keybinding = this.resolveKeybinding(rawKeybinding); - if (keybinding) { - - let command = byId[rawKeybinding.command]; - - if (command) { - command.keybindings.push(keybinding); - } else { - command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; - byId[command.id] = command; - commands.push(command); - } + if (!keybinding) { + return; + } + + let command = byId[rawKeybinding.command]; + + if (!command) { + command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; + byId[command.id] = command; + commands.push(command); + } else { + command.keybindings.push(keybinding); } - return; }); - if (commands.length) { - - - const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { - const element = $(''); - new KeybindingLabel(element, OS).set(keybinding); - return element; - }; - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('command name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), - $('th', undefined, localize('menuContexts', "Menu Contexts")) - ), - ...commands.map(c => $('tr', undefined, - $('td', undefined, $('code', undefined, c.id)), - $('td', undefined, c.title), - $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), - $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) - )) - ) - ); - - append(container, details); - return true; + if (!commands.length) { + return false; } - return false; + + const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { + const element = $(''); + new KeybindingLabel(element, OS).set(keybinding); + return element; + }; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('command name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), + $('th', undefined, localize('menuContexts', "Menu Contexts")) + ), + ...commands.map(c => $('tr', undefined, + $('td', undefined, $('code', undefined, c.id)), + $('td', undefined, c.title), + $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), + $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) + )) + ) + ); + + append(container, details); + return true; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1010,12 +1006,12 @@ export class ExtensionEditor extends BaseEditor { grammars.forEach(grammar => { let language = byId[grammar.language]; - if (language) { - language.hasGrammar = true; - } else { + if (!language) { language = { id: grammar.language, name: grammar.language, extensions: [], hasGrammar: true, hasSnippets: false }; byId[language.id] = language; languages.push(language); + } else { + language.hasGrammar = true; } }); @@ -1024,40 +1020,41 @@ export class ExtensionEditor extends BaseEditor { snippets.forEach(snippet => { let language = byId[snippet.language]; - if (language) { - language.hasSnippets = true; - } else { + if (!language) { language = { id: snippet.language, name: snippet.language, extensions: [], hasGrammar: false, hasSnippets: true }; byId[language.id] = language; languages.push(language); + } else { + language.hasSnippets = true; } }); - if (languages.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('language id', "ID")), - $('th', undefined, localize('language name', "Name")), - $('th', undefined, localize('file extensions', "File Extensions")), - $('th', undefined, localize('grammar', "Grammar")), - $('th', undefined, localize('snippets', "Snippets")) - ), - ...languages.map(l => $('tr', undefined, - $('td', undefined, l.id), - $('td', undefined, l.name), - $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), - $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), - $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) - )) - ) - ); - - append(container, details); - return true; + if (!languages.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('language id', "ID")), + $('th', undefined, localize('language name', "Name")), + $('th', undefined, localize('file extensions', "File Extensions")), + $('th', undefined, localize('grammar', "Grammar")), + $('th', undefined, localize('snippets', "Snippets")) + ), + ...languages.map(l => $('tr', undefined, + $('td', undefined, l.id), + $('td', undefined, l.name), + $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), + $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), + $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) + )) + ) + ); + + append(container, details); + return true; } private resolveKeybinding(rawKeyBinding: IKeyBinding): ResolvedKeybinding | null { @@ -1070,10 +1067,11 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS); - if (keyBinding) { - return this.keybindingService.resolveKeybinding(keyBinding)[0]; + if (!keyBinding) { + return null; } - return null; + + return this.keybindingService.resolveKeybinding(keyBinding)[0]; } private loadContents(loadingTask: () => CacheResult): Promise { @@ -1096,6 +1094,7 @@ export class ExtensionEditor extends BaseEditor { if (isPromiseCanceledError(err)) { return; } + this.notificationService.error(err); } } From 2d7f80baad30033428e6b8393eb3ce15e1a27c72 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:32:32 -0400 Subject: [PATCH 105/190] Undid unneccesary changes for the sake of the pull request. --- src/vs/base/common/uri.ts | 3 +-- .../contrib/extensions/browser/extensionEditor.ts | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 91f4c82cf37..84ec8f67caf 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -50,7 +50,6 @@ function _validateUri(ret: URI, _strict?: boolean): void { } } else if (_doubleSlashStart.test(ret.path)) { throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } } } @@ -67,7 +66,7 @@ function _schemeFix(scheme: string, _strict: boolean): string { return scheme; } console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; + return 'file'; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 2ab1851bda6..97c6b0ddc9a 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -483,6 +483,13 @@ export class ExtensionEditor extends BaseEditor { })); } + clearInput(): void { + this.contentDisposables.clear(); + this.transientDisposables.clear(); + + super.clearInput(); + } + focus(): void { if (this.activeElement) { this.activeElement.focus(); From 920963a1c8ffa777222b18f7fe0dd5db5cb151bb Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:35:26 -0400 Subject: [PATCH 106/190] Revert "Fixed compilation errors" This reverts commit b59ecadf6b1c3c84213b8300df8ba8ce962e6625. --- src/vs/base/common/uri.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 84ec8f67caf..801b515cc7d 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -66,7 +66,7 @@ function _schemeFix(scheme: string, _strict: boolean): string { return scheme; } console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - return 'file'; + scheme = 'file'; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 From 1b0fd26a4ce284548d2d4b7322adf2ced3369bd7 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Tue, 16 Jul 2019 14:36:34 -0400 Subject: [PATCH 107/190] Undid uri.ts changes --- src/vs/base/common/uri.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 801b515cc7d..8f9274c8531 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -62,11 +62,11 @@ function _schemeFix(scheme: string, _strict: boolean): string { if (_strict || _throwOnMissingSchema) { return scheme || _empty; } - if (scheme) { - return scheme; + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; } - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; + return scheme; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 From a1f354204e7888a199a51162379e9ca7e9ce1a5e Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:09:01 -0400 Subject: [PATCH 108/190] Update uri.ts --- src/vs/base/common/uri.ts | 52 +++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 8f9274c8531..966555e04d0 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -48,8 +48,10 @@ function _validateUri(ret: URI, _strict?: boolean): void { if (!_singleSlashStart.test(ret.path)) { throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); } - } else if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } } } } @@ -114,17 +116,17 @@ export class URI implements UriComponents { if (thing instanceof URI) { return true; } - if (thing) { - return typeof (thing).authority === 'string' - && typeof (thing).fragment === 'string' - && typeof (thing).path === 'string' - && typeof (thing).query === 'string' - && typeof (thing).scheme === 'string' - && typeof (thing).fsPath === 'function' - && typeof (thing).with === 'function' - && typeof (thing).toString === 'function'; + if (!thing) { + return false; } - return false; + return typeof (thing).authority === 'string' + && typeof (thing).fragment === 'string' + && typeof (thing).path === 'string' + && typeof (thing).query === 'string' + && typeof (thing).scheme === 'string' + && typeof (thing).fsPath === 'function' + && typeof (thing).with === 'function' + && typeof (thing).toString === 'function'; } /** @@ -279,17 +281,17 @@ export class URI implements UriComponents { */ static parse(value: string, _strict: boolean = false): URI { const match = _regexp.exec(value); - if (match) { - return new _URI( - match[2] || _empty, - decodeURIComponent(match[4] || _empty), - decodeURIComponent(match[5] || _empty), - decodeURIComponent(match[7] || _empty), - decodeURIComponent(match[9] || _empty), - _strict - ); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); } - return new _URI(_empty, _empty, _empty, _empty, _empty); + return new _URI( + match[2] || _empty, + decodeURIComponent(match[4] || _empty), + decodeURIComponent(match[5] || _empty), + decodeURIComponent(match[7] || _empty), + decodeURIComponent(match[9] || _empty), + _strict + ); } /** @@ -558,8 +560,10 @@ function encodeURIComponentMinimal(path: string): string { res = path.substr(0, pos); } res += encodeTable[code]; - } else if (res !== undefined) { - res += path[pos]; + } else { + if (res !== undefined) { + res += path[pos]; + } } } return res !== undefined ? res : path; From 083cca443a23ce9728e84bd7fa6c15286e9df326 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:25:59 -0400 Subject: [PATCH 109/190] Edits --- .../extensions/browser/extensionEditor.ts | 158 +++++++++--------- 1 file changed, 82 insertions(+), 76 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 97c6b0ddc9a..9bd3c5a5ba0 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -719,25 +719,25 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const contrib = contributes && contributes.debuggers || []; - if (!contrib.length) { - return false; + if (contrib.length) { + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('debugger name', "Name")), + $('th', undefined, localize('debugger type', "Type")), + ), + ...contrib.map(d => $('tr', undefined, + $('td', undefined, d.label!), + $('td', undefined, d.type))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('debugger name', "Name")), - $('th', undefined, localize('debugger type', "Type")), - ), - ...contrib.map(d => $('tr', undefined, - $('td', undefined, d.label!), - $('td', undefined, d.type))) - ) - ); - - append(container, details); - return true; + return false; } private renderViewContainers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -750,20 +750,21 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, title: string, location: string }>); - if (!viewContainers.length) { - return false; + if (viewContainers.length) { + + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), + ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), - ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) - ) - ); - - append(container, details); - return true; + return false; } private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -776,49 +777,49 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, name: string, location: string }>); - if (!views.length) { - return false; + if (views.length) { + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('views', "Views ({0})", views.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), + ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('views', "Views ({0})", views.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), - ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) - ) - ); - - append(container, details); - return true; + return false; } private renderLocalizations(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const localizations = contributes && contributes.localizations || []; - if (!localizations.length) { - return false; + if (localizations.length) { + + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('localizations', "Localizations ({0})", localizations.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('localizations language id', "Language Id")), $('th', undefined, localize('localizations language name', "Language Name")), $('th', undefined, localize('localizations localized language name', "Language Name (Localized)"))), + ...localizations.map(localization => $('tr', undefined, $('td', undefined, localization.languageId), $('td', undefined, localization.languageName || ''), $('td', undefined, localization.localizedLanguageName || ''))) + ) + ); + + append(container, details); + return true; } - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('localizations', "Localizations ({0})", localizations.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('localizations language id', "Language Id")), $('th', undefined, localize('localizations language name', "Language Name")), $('th', undefined, localize('localizations localized language name', "Language Name (Localized)"))), - ...localizations.map(localization => $('tr', undefined, $('td', undefined, localization.languageId), $('td', undefined, localization.languageName || ''), $('td', undefined, localization.localizedLanguageName || ''))) - ) - ); - - append(container, details); - return true; + return false; } private renderColorThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.themes || []; - if (!contrib.length) { - return false; - } + if (contrib.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), @@ -827,15 +828,15 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; + } return false; } private renderIconThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.iconThemes || []; - if (!contrib.length) { - return false; - } + if (contrib.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), @@ -844,13 +845,15 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; + } + return false; } private renderColors(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const colors = contributes && contributes.colors; - if (!colors || !colors.length) { + if (!(colors && colors.length)) { return false; } @@ -954,18 +957,18 @@ export class ExtensionEditor extends BaseEditor { let command = byId[rawKeybinding.command]; - if (!command) { + if (command) { + command.keybindings.push(keybinding); + + } else { command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; byId[command.id] = command; commands.push(command); - } else { - command.keybindings.push(keybinding); } }); - if (!commands.length) { - return false; - } + if (commands.length) { + const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { const element = $(''); @@ -993,6 +996,7 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; + } return false; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1036,9 +1040,8 @@ export class ExtensionEditor extends BaseEditor { } }); - if (!languages.length) { - return false; - } + if (languages.length) { + const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), @@ -1062,6 +1065,7 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; + } return false; } private resolveKeybinding(rawKeyBinding: IKeyBinding): ResolvedKeybinding | null { @@ -1074,11 +1078,13 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS); - if (!keyBinding) { - return null; + if (keyBinding) { + return this.keybindingService.resolveKeybinding(keyBinding)[0]; } - return this.keybindingService.resolveKeybinding(keyBinding)[0]; + return null; + + } private loadContents(loadingTask: () => CacheResult): Promise { From afcd2bc310cbf2703d9e817a2d38a804d86b7072 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:33:58 -0400 Subject: [PATCH 110/190] Fixed formatting --- .../extensions/browser/extensionEditor.ts | 117 +++++++++--------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 9bd3c5a5ba0..0e9dc8ff736 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -821,13 +821,13 @@ export class ExtensionEditor extends BaseEditor { if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), - $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), + $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -838,13 +838,13 @@ export class ExtensionEditor extends BaseEditor { if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), - $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), + $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -970,33 +970,33 @@ export class ExtensionEditor extends BaseEditor { if (commands.length) { - const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { - const element = $(''); - new KeybindingLabel(element, OS).set(keybinding); - return element; - }; + const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { + const element = $(''); + new KeybindingLabel(element, OS).set(keybinding); + return element; + }; - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('command name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), - $('th', undefined, localize('menuContexts', "Menu Contexts")) - ), - ...commands.map(c => $('tr', undefined, - $('td', undefined, $('code', undefined, c.id)), - $('td', undefined, c.title), - $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), - $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) - )) - ) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('command name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), + $('th', undefined, localize('menuContexts', "Menu Contexts")) + ), + ...commands.map(c => $('tr', undefined, + $('td', undefined, $('code', undefined, c.id)), + $('td', undefined, c.title), + $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), + $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) + )) + ) + ); - append(container, details); - return true; - } return false; + append(container, details); + return true; + } return false; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1043,28 +1043,28 @@ export class ExtensionEditor extends BaseEditor { if (languages.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('language id', "ID")), - $('th', undefined, localize('language name', "Name")), - $('th', undefined, localize('file extensions', "File Extensions")), - $('th', undefined, localize('grammar', "Grammar")), - $('th', undefined, localize('snippets', "Snippets")) - ), - ...languages.map(l => $('tr', undefined, - $('td', undefined, l.id), - $('td', undefined, l.name), - $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), - $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), - $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) - )) - ) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('language id', "ID")), + $('th', undefined, localize('language name', "Name")), + $('th', undefined, localize('file extensions', "File Extensions")), + $('th', undefined, localize('grammar', "Grammar")), + $('th', undefined, localize('snippets', "Snippets")) + ), + ...languages.map(l => $('tr', undefined, + $('td', undefined, l.id), + $('td', undefined, l.name), + $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), + $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), + $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) + )) + ) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -1084,7 +1084,6 @@ export class ExtensionEditor extends BaseEditor { return null; - } private loadContents(loadingTask: () => CacheResult): Promise { From d928313dd581b56645f75525b8ea6f6a48eab3b2 Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:45:25 -0400 Subject: [PATCH 111/190] Revert "Fixed formatting" This reverts commit 30d7dc8a3f5ef8a8d8a702da2dc4517a0f64f1d4. --- .../extensions/browser/extensionEditor.ts | 117 +++++++++--------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 0e9dc8ff736..9bd3c5a5ba0 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -821,13 +821,13 @@ export class ExtensionEditor extends BaseEditor { if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), - $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), + $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -838,13 +838,13 @@ export class ExtensionEditor extends BaseEditor { if (contrib.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), - $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), + $('ul', undefined, ...contrib.map(theme => $('li', undefined, theme.label))) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -970,33 +970,33 @@ export class ExtensionEditor extends BaseEditor { if (commands.length) { - const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { - const element = $(''); - new KeybindingLabel(element, OS).set(keybinding); - return element; - }; + const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { + const element = $(''); + new KeybindingLabel(element, OS).set(keybinding); + return element; + }; - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('command name', "Name")), - $('th', undefined, localize('description', "Description")), - $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), - $('th', undefined, localize('menuContexts', "Menu Contexts")) - ), - ...commands.map(c => $('tr', undefined, - $('td', undefined, $('code', undefined, c.id)), - $('td', undefined, c.title), - $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), - $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) - )) - ) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('commands', "Commands ({0})", commands.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('command name', "Name")), + $('th', undefined, localize('description', "Description")), + $('th', undefined, localize('keyboard shortcuts', "Keyboard Shortcuts")), + $('th', undefined, localize('menuContexts', "Menu Contexts")) + ), + ...commands.map(c => $('tr', undefined, + $('td', undefined, $('code', undefined, c.id)), + $('td', undefined, c.title), + $('td', undefined, ...c.keybindings.map(keybinding => renderKeybinding(keybinding))), + $('td', undefined, ...c.menus.map(context => $('code', undefined, context))) + )) + ) + ); - append(container, details); - return true; - } return false; + append(container, details); + return true; + } return false; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1043,28 +1043,28 @@ export class ExtensionEditor extends BaseEditor { if (languages.length) { - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('language id', "ID")), - $('th', undefined, localize('language name', "Name")), - $('th', undefined, localize('file extensions', "File Extensions")), - $('th', undefined, localize('grammar', "Grammar")), - $('th', undefined, localize('snippets', "Snippets")) - ), - ...languages.map(l => $('tr', undefined, - $('td', undefined, l.id), - $('td', undefined, l.name), - $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), - $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), - $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) - )) - ) - ); + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('language id', "ID")), + $('th', undefined, localize('language name', "Name")), + $('th', undefined, localize('file extensions', "File Extensions")), + $('th', undefined, localize('grammar', "Grammar")), + $('th', undefined, localize('snippets', "Snippets")) + ), + ...languages.map(l => $('tr', undefined, + $('td', undefined, l.id), + $('td', undefined, l.name), + $('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')), + $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')), + $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—')) + )) + ) + ); - append(container, details); - return true; + append(container, details); + return true; } return false; } @@ -1084,6 +1084,7 @@ export class ExtensionEditor extends BaseEditor { return null; + } private loadContents(loadingTask: () => CacheResult): Promise { From 5b1d433ab9174969c02a10fb29830e16ee62a95d Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:45:33 -0400 Subject: [PATCH 112/190] Revert "Edits" This reverts commit ce404be0b7b7d0c2c5675cf73311f7d5fdc52bfb. --- .../extensions/browser/extensionEditor.ts | 158 +++++++++--------- 1 file changed, 76 insertions(+), 82 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 9bd3c5a5ba0..97c6b0ddc9a 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -719,25 +719,25 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const contrib = contributes && contributes.debuggers || []; - if (contrib.length) { - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), - $('table', undefined, - $('tr', undefined, - $('th', undefined, localize('debugger name', "Name")), - $('th', undefined, localize('debugger type', "Type")), - ), - ...contrib.map(d => $('tr', undefined, - $('td', undefined, d.label!), - $('td', undefined, d.type))) - ) - ); - - append(container, details); - return true; + if (!contrib.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('debuggers', "Debuggers ({0})", contrib.length)), + $('table', undefined, + $('tr', undefined, + $('th', undefined, localize('debugger name', "Name")), + $('th', undefined, localize('debugger type', "Type")), + ), + ...contrib.map(d => $('tr', undefined, + $('td', undefined, d.label!), + $('td', undefined, d.type))) + ) + ); + + append(container, details); + return true; } private renderViewContainers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -750,21 +750,20 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, title: string, location: string }>); - if (viewContainers.length) { - - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), - ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) - ) - ); - - append(container, details); - return true; + if (!viewContainers.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('viewContainers', "View Containers ({0})", viewContainers.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view container id', "ID")), $('th', undefined, localize('view container title', "Title")), $('th', undefined, localize('view container location', "Where"))), + ...viewContainers.map(viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))) + ) + ); + + append(container, details); + return true; } private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -777,49 +776,49 @@ export class ExtensionEditor extends BaseEditor { return result; }, [] as Array<{ id: string, name: string, location: string }>); - if (views.length) { - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('views', "Views ({0})", views.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), - ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) - ) - ); - - append(container, details); - return true; + if (!views.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('views', "Views ({0})", views.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('view id', "ID")), $('th', undefined, localize('view name', "Name")), $('th', undefined, localize('view location', "Where"))), + ...views.map(view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))) + ) + ); + + append(container, details); + return true; } private renderLocalizations(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const localizations = contributes && contributes.localizations || []; - if (localizations.length) { - - - const details = $('details', { open: true, ontoggle: onDetailsToggle }, - $('summary', undefined, localize('localizations', "Localizations ({0})", localizations.length)), - $('table', undefined, - $('tr', undefined, $('th', undefined, localize('localizations language id', "Language Id")), $('th', undefined, localize('localizations language name', "Language Name")), $('th', undefined, localize('localizations localized language name', "Language Name (Localized)"))), - ...localizations.map(localization => $('tr', undefined, $('td', undefined, localization.languageId), $('td', undefined, localization.languageName || ''), $('td', undefined, localization.localizedLanguageName || ''))) - ) - ); - - append(container, details); - return true; + if (!localizations.length) { + return false; } - return false; + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', undefined, localize('localizations', "Localizations ({0})", localizations.length)), + $('table', undefined, + $('tr', undefined, $('th', undefined, localize('localizations language id', "Language Id")), $('th', undefined, localize('localizations language name', "Language Name")), $('th', undefined, localize('localizations localized language name', "Language Name (Localized)"))), + ...localizations.map(localization => $('tr', undefined, $('td', undefined, localization.languageId), $('td', undefined, localization.languageName || ''), $('td', undefined, localization.localizedLanguageName || ''))) + ) + ); + + append(container, details); + return true; } private renderColorThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.themes || []; - if (contrib.length) { - + if (!contrib.length) { + return false; + } const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('colorThemes', "Color Themes ({0})", contrib.length)), @@ -828,15 +827,15 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; - } return false; } private renderIconThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.iconThemes || []; - if (contrib.length) { - + if (!contrib.length) { + return false; + } const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('iconThemes', "Icon Themes ({0})", contrib.length)), @@ -845,15 +844,13 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; - } - return false; } private renderColors(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const colors = contributes && contributes.colors; - if (!(colors && colors.length)) { + if (!colors || !colors.length) { return false; } @@ -957,18 +954,18 @@ export class ExtensionEditor extends BaseEditor { let command = byId[rawKeybinding.command]; - if (command) { - command.keybindings.push(keybinding); - - } else { + if (!command) { command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; byId[command.id] = command; commands.push(command); + } else { + command.keybindings.push(keybinding); } }); - if (commands.length) { - + if (!commands.length) { + return false; + } const renderKeybinding = (keybinding: ResolvedKeybinding): HTMLElement => { const element = $(''); @@ -996,7 +993,6 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; - } return false; } private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { @@ -1040,8 +1036,9 @@ export class ExtensionEditor extends BaseEditor { } }); - if (languages.length) { - + if (!languages.length) { + return false; + } const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', undefined, localize('languages', "Languages ({0})", languages.length)), @@ -1065,7 +1062,6 @@ export class ExtensionEditor extends BaseEditor { append(container, details); return true; - } return false; } private resolveKeybinding(rawKeyBinding: IKeyBinding): ResolvedKeybinding | null { @@ -1078,13 +1074,11 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS); - if (keyBinding) { - return this.keybindingService.resolveKeybinding(keyBinding)[0]; + if (!keyBinding) { + return null; } - return null; - - + return this.keybindingService.resolveKeybinding(keyBinding)[0]; } private loadContents(loadingTask: () => CacheResult): Promise { From b5136de090f43dfb8e5741e42275d028e12d611f Mon Sep 17 00:00:00 2001 From: pi1024e Date: Wed, 17 Jul 2019 11:49:16 -0400 Subject: [PATCH 113/190] Fixed changes and refactored so method structures in the file are same, allowing the new method to fit naturally. --- .../extensions/browser/extensionEditor.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 97c6b0ddc9a..714ee465961 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -850,7 +850,7 @@ export class ExtensionEditor extends BaseEditor { const contributes = manifest.contributes; const colors = contributes && contributes.colors; - if (!colors || !colors.length) { + if (!(colors && colors.length)) { return false; } @@ -933,12 +933,12 @@ export class ExtensionEditor extends BaseEditor { menus[context].forEach(menu => { let command = byId[menu.command]; - if (!command) { + if (command) { + command.menus.push(context); + } else { command = { id: menu.command, title: '', keybindings: [], menus: [context] }; byId[command.id] = command; commands.push(command); - } else { - command.menus.push(context); } }); }); @@ -954,12 +954,12 @@ export class ExtensionEditor extends BaseEditor { let command = byId[rawKeybinding.command]; - if (!command) { + if (command) { + command.keybindings.push(keybinding); + } else { command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] }; byId[command.id] = command; commands.push(command); - } else { - command.keybindings.push(keybinding); } }); @@ -1013,12 +1013,12 @@ export class ExtensionEditor extends BaseEditor { grammars.forEach(grammar => { let language = byId[grammar.language]; - if (!language) { + if (language) { + language.hasGrammar = true; + } else { language = { id: grammar.language, name: grammar.language, extensions: [], hasGrammar: true, hasSnippets: false }; byId[language.id] = language; languages.push(language); - } else { - language.hasGrammar = true; } }); @@ -1027,12 +1027,12 @@ export class ExtensionEditor extends BaseEditor { snippets.forEach(snippet => { let language = byId[snippet.language]; - if (!language) { + if (language) { + language.hasSnippets = true; + } else { language = { id: snippet.language, name: snippet.language, extensions: [], hasGrammar: false, hasSnippets: true }; byId[language.id] = language; languages.push(language); - } else { - language.hasSnippets = true; } }); @@ -1074,11 +1074,11 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS); - if (!keyBinding) { - return null; - } + if (keyBinding) { + return this.keybindingService.resolveKeybinding(keyBinding)[0]; - return this.keybindingService.resolveKeybinding(keyBinding)[0]; + } + return null; } private loadContents(loadingTask: () => CacheResult): Promise { From 891d29ab55116a1c88c2927a1e2d8b0b3506bdd4 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 17 Jul 2019 13:32:04 -0700 Subject: [PATCH 114/190] Fix #77535 --- src/vs/workbench/contrib/preferences/browser/settingsTree.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 63571356cc2..4c48aa744d3 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -70,6 +70,10 @@ function getExcludeDisplayValue(element: SettingsTreeSettingElement): IListDataI } function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem[] { + if (!element.value || !isArray(element.value)) { + return []; + } + return element.value.map((key: string) => { return { value: key From 7d58f5f95bc058e9c403d70184b4adee21b88fb9 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Fri, 12 Jul 2019 16:30:55 +0200 Subject: [PATCH 115/190] fix typo --- src/vs/base/parts/ipc/common/ipc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 6292487e1c1..9715105baa3 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -23,7 +23,7 @@ export interface IChannel { } /** - * An `IServerChannel` is the couter part to `IChannel`, + * An `IServerChannel` is the counter part to `IChannel`, * on the server-side. You should implement this interface * if you'd like to handle remote promises or events. */ From 31d1b50c9ff5bf207a5ef7a6261312e2ecc30a2f Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Wed, 17 Jul 2019 23:06:44 +0200 Subject: [PATCH 116/190] extensionHostDebugService for web --- .../workbench/browser/web.simpleservices.ts | 112 ++++++++++++++++-- .../environment/browser/environmentService.ts | 30 +++++ 2 files changed, 132 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 5d611022667..b6e17d60b4e 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -40,6 +40,10 @@ import { IProcessEnvironment } from 'vs/base/common/platform'; import { toStoreData, restoreRecentlyOpened } from 'vs/platform/history/common/historyStorage'; // tslint:disable-next-line: import-patterns import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; +//import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; +import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; +import { IChannel } from 'vs/base/parts/ipc/common/ipc'; +//import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; //#region Download @@ -649,20 +653,61 @@ registerSingleton(IWindowService, SimpleWindowService); export class SimpleExtensionHostDebugService implements IExtensionHostDebugService { _serviceBrand: any; - reload(sessionId: string): void { } - onReload: Event = Event.None; + private channel: IChannel; - close(sessionId: string): void { } - onClose: Event = Event.None; + constructor( + @IRemoteAgentService private remoteAgentService: IRemoteAgentService + ) { + const connection = this.remoteAgentService.getConnection(); + if (connection) { + this.channel = connection.getChannel('extensionhostdebugservice'); + } + } - attachSession(sessionId: string, port: number, subId?: string): void { } - onAttachSession: Event = Event.None; + reload(sessionId: string): void { + if (this.channel) { + this.channel.call('reload', [sessionId]); + } + } + get onReload(): Event { + return this.channel ? this.channel.listen('reload') : Event.None; + } - logToSession(sessionId: string, log: IRemoteConsoleLog): void { } - onLogToSession: Event = Event.None; + close(sessionId: string): void { + if (this.channel) { + this.channel.call('close', [sessionId]); + } + } + get onClose(): Event { + return this.channel ? this.channel.listen('close') : Event.None; + } - terminateSession(sessionId: string, subId?: string): void { } - onTerminateSession: Event = Event.None; + attachSession(sessionId: string, port: number, subId?: string): void { + if (this.channel) { + this.channel.call('attach', [sessionId, port, subId]); + } + } + get onAttachSession(): Event { + return this.channel ? this.channel.listen('attach') : Event.None; + } + + logToSession(sessionId: string, log: IRemoteConsoleLog): void { + if (this.channel) { + this.channel.call('log', [sessionId, log]); + } + } + get onLogToSession(): Event { + return this.channel ? this.channel.listen('log') : Event.None; + } + + terminateSession(sessionId: string, subId?: string): void { + if (this.channel) { + this.channel.call('terminate', [sessionId, subId]); + } + } + get onTerminateSession(): Event { + return this.channel ? this.channel.listen('terminate') : Event.None; + } } registerSingleton(IExtensionHostDebugService, SimpleExtensionHostDebugService); @@ -807,6 +852,53 @@ export class SimpleWindowsService implements IWindowsService { } openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise { + + // we pass the "ParsedArgs" as query parameters of the URL + + let newAddress = `${document.location.origin}/?`; + + const f = args['folder-uri']; + if (f) { + let u: URI | undefined; + if (Array.isArray(f)) { + if (f.length > 0) { + u = URI.parse(f[0]); + } + } else { + u = URI.parse(f); + } + if (u) { + newAddress += `folder=${encodeURIComponent(u.path)}`; + } + } + + const ep = args['extensionDevelopmentPath']; + if (ep) { + let u: string | undefined; + if (Array.isArray(ep)) { + if (ep.length > 0) { + u = ep[0]; + } + } else { + u = ep; + } + if (u) { + newAddress += `&edp=${encodeURIComponent(u)}`; + } + } + + const di = args['debugId']; + if (di) { + newAddress += `&di=${encodeURIComponent(di)}`; + } + + const ibe = args['inspect-brk-extensions']; + if (ibe) { + newAddress += `&ibe=${encodeURIComponent(ibe)}`; + } + + window.open(newAddress); + return Promise.resolve(); } diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index f6d67298ba0..ff6cefe4491 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -91,6 +91,36 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService { this.webviewEndpoint = configuration.webviewEndpoint; this.untitledWorkspacesHome = URI.from({ scheme: Schemas.untitled, path: 'Workspaces' }); + + if (document && document.location && document.location.search) { + + const map = new Map(); + const query = document.location.search.substring(1); + const vars = query.split('&'); + for (let p of vars) { + const pair = p.split('='); + if (pair.length >= 2) { + map.set(decodeURIComponent(pair[0]), decodeURIComponent(pair[1])); + } + } + + const edp = map.get('edp'); + if (edp) { + this.extensionDevelopmentLocationURI = [URI.parse(edp)]; + this.isExtensionDevelopment = true; + } + + const di = map.get('di'); + if (di) { + this.debugExtensionHost.debugId = di; + } + + const ibe = map.get('ibe'); + if (ibe) { + this.debugExtensionHost.port = parseInt(ibe); + this.debugExtensionHost.break = false; + } + } } untitledWorkspacesHome: URI; From 279e5cdf8879c9e7aef2d20d6b0f6e80281b2716 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Wed, 17 Jul 2019 14:23:43 -0700 Subject: [PATCH 117/190] Fix #77501, center triangle in status bar notification bell --- .../workbench/browser/parts/statusbar/media/statusbarpart.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css b/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css index 5c4e22b033c..ad1d1498654 100644 --- a/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css +++ b/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css @@ -40,7 +40,7 @@ .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak:before { content: ''; position: absolute; - left: 11px; + left: calc(50% - 8px); /* 3px (margin) + 5px (padding) = 8px */ top: -5px; border-bottom-width: 5px; border-bottom-style: solid; From 326c26b9e0edc9eeaa5738739b57b60e9f6dfe37 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Wed, 17 Jul 2019 15:58:09 -0700 Subject: [PATCH 118/190] Create browser version of telemetry service --- src/vs/base/common/platform.ts | 10 +- src/vs/code/browser/workbench/workbench.html | 5 +- .../product/browser/productService.ts | 4 +- src/vs/platform/product/common/product.ts | 4 + .../browser/workbenchCommonProperties.ts | 86 +++++++++ .../telemetry/common/telemetryUtils.ts | 73 ++++++++ .../telemetry/node/appInsightsAppender.ts | 76 +------- .../workbench/browser/web.simpleservices.ts | 34 ---- .../telemetry/browser/telemetryService.ts | 170 ++++++++++++++++++ src/vs/workbench/workbench.web.main.ts | 4 +- 10 files changed, 350 insertions(+), 116 deletions(-) create mode 100644 src/vs/platform/telemetry/browser/workbenchCommonProperties.ts create mode 100644 src/vs/workbench/services/telemetry/browser/telemetryService.ts diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts index 4cba839fe52..d7371552d30 100644 --- a/src/vs/base/common/platform.ts +++ b/src/vs/base/common/platform.ts @@ -13,6 +13,7 @@ let _isWeb = false; let _locale: string | undefined = undefined; let _language: string = LANGUAGE_DEFAULT; let _translationsConfigFile: string | undefined = undefined; +let _userAgent: string | undefined = undefined; interface NLSConfig { locale: string; @@ -48,10 +49,10 @@ const isElectronRenderer = (typeof process !== 'undefined' && typeof process.ver // OS detection if (typeof navigator === 'object' && !isElectronRenderer) { - const userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; + _userAgent = navigator.userAgent; + _isWindows = _userAgent.indexOf('Windows') >= 0; + _isMacintosh = _userAgent.indexOf('Macintosh') >= 0; + _isLinux = _userAgent.indexOf('Linux') >= 0; _isWeb = true; _locale = navigator.language; _language = _locale; @@ -108,6 +109,7 @@ export const isLinux = _isLinux; export const isNative = _isNative; export const isWeb = _isWeb; export const platform = _platform; +export const userAgent = _userAgent; export function isRootUser(): boolean { return _isNative && !_isWindows && (process.getuid() === 0); diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 1e742447047..829ce5e4aea 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -10,7 +10,7 @@ + content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote:; media-src 'none'; child-src 'self' {{WEBVIEW_ENDPOINT}}; script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss: https:; font-src 'self' blob: vscode-remote:;"> @@ -27,6 +27,9 @@ + + + diff --git a/src/vs/platform/product/browser/productService.ts b/src/vs/platform/product/browser/productService.ts index d40b86aa0d2..fbdf03fd3e4 100644 --- a/src/vs/platform/product/browser/productService.ts +++ b/src/vs/platform/product/browser/productService.ts @@ -19,7 +19,7 @@ export class ProductService implements IProductService { get version(): string { return '1.35.0'; } - get commit(): string | undefined { return undefined; } + get commit(): string | undefined { return this.productConfiguration ? this.productConfiguration.commit : undefined; } get nameLong(): string { return ''; } @@ -44,4 +44,6 @@ export class ProductService implements IProductService { get extensionKeywords(): { [extension: string]: readonly string[]; } | undefined { return this.productConfiguration ? this.productConfiguration.extensionKeywords : undefined; } get extensionAllowedBadgeProviders(): readonly string[] | undefined { return this.productConfiguration ? this.productConfiguration.extensionAllowedBadgeProviders : undefined; } + + get aiConfig() { return this.productConfiguration ? this.productConfiguration.aiConfig : undefined; } } \ No newline at end of file diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 63ea4836512..45c31ca0f3d 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -37,6 +37,10 @@ export interface IProductService { readonly experimentsUrl?: string; readonly extensionKeywords?: { [extension: string]: readonly string[]; }; readonly extensionAllowedBadgeProviders?: readonly string[]; + + readonly aiConfig?: { + readonly asimovKey: string; + }; } export interface IProductConfiguration { diff --git a/src/vs/platform/telemetry/browser/workbenchCommonProperties.ts b/src/vs/platform/telemetry/browser/workbenchCommonProperties.ts new file mode 100644 index 00000000000..3e6c88bd451 --- /dev/null +++ b/src/vs/platform/telemetry/browser/workbenchCommonProperties.ts @@ -0,0 +1,86 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; + +export const instanceStorageKey = 'telemetry.instanceId'; +export const currentSessionDateStorageKey = 'telemetry.currentSessionDate'; +export const firstSessionDateStorageKey = 'telemetry.firstSessionDate'; +export const lastSessionDateStorageKey = 'telemetry.lastSessionDate'; + +import * as Platform from 'vs/base/common/platform'; +import * as uuid from 'vs/base/common/uuid'; + +export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> { + const result: { [name: string]: string | undefined; } = Object.create(null); + const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!; + const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!; + const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!; + + // __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.firstSessionDate'] = firstSessionDate; + // __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.lastSessionDate'] = lastSessionDate || ''; + // __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.isNewSession'] = !lastSessionDate ? '1' : '0'; + // __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.instanceId'] = instanceId; + // __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } + result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority); + + // __GDPR__COMMON__ "common.machineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } + result['common.machineId'] = machineId; + // __GDPR__COMMON__ "sessionID" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['sessionID'] = uuid.generateUuid() + Date.now(); + // __GDPR__COMMON__ "commitHash" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } + result['commitHash'] = commit; + // __GDPR__COMMON__ "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['version'] = version; + // __GDPR__COMMON__ "common.platform" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.platform'] = Platform.PlatformToString(Platform.platform); + // __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } + result['common.product'] = 'web'; + // __GDPR__COMMON__ "common.userAgent" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.userAgent'] = Platform.userAgent; + + // dynamic properties which value differs on each call + let seq = 0; + const startTime = Date.now(); + Object.defineProperties(result, { + // __GDPR__COMMON__ "timestamp" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + 'timestamp': { + get: () => new Date(), + enumerable: true + }, + // __GDPR__COMMON__ "common.timesincesessionstart" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } + 'common.timesincesessionstart': { + get: () => Date.now() - startTime, + enumerable: true + }, + // __GDPR__COMMON__ "common.sequence" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } + 'common.sequence': { + get: () => seq++, + enumerable: true + } + }); + + return result; +} + +function cleanRemoteAuthority(remoteAuthority?: string): string { + if (!remoteAuthority) { + return 'none'; + } + + let ret = 'other'; + // Whitelisted remote authorities + ['ssh-remote', 'dev-container', 'wsl'].forEach((res: string) => { + if (remoteAuthority!.indexOf(`${res}+`) === 0) { + ret = res; + } + }); + + return ret; +} diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index 37b4f848681..e2fca2ba8c6 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -9,6 +9,8 @@ import { IKeybindingService, KeybindingSource } from 'vs/platform/keybinding/com import { ITelemetryService, ITelemetryInfo, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; import { ILogService } from 'vs/platform/log/common/log'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; +import { safeStringify } from 'vs/base/common/objects'; +import { isObject } from 'vs/base/common/types'; export const NullTelemetryService = new class implements ITelemetryService { _serviceBrand: undefined; @@ -243,6 +245,77 @@ export function keybindingsTelemetry(telemetryService: ITelemetryService, keybin }); } + +export interface Properties { + [key: string]: string; +} + +export interface Measurements { + [key: string]: number; +} + +export function validateTelemetryData(data?: any): { properties: Properties, measurements: Measurements } { + + const properties: Properties = Object.create(null); + const measurements: Measurements = Object.create(null); + + const flat = Object.create(null); + flatten(data, flat); + + for (let prop in flat) { + // enforce property names less than 150 char, take the last 150 char + prop = prop.length > 150 ? prop.substr(prop.length - 149) : prop; + const value = flat[prop]; + + if (typeof value === 'number') { + measurements[prop] = value; + + } else if (typeof value === 'boolean') { + measurements[prop] = value ? 1 : 0; + + } else if (typeof value === 'string') { + //enforce property value to be less than 1024 char, take the first 1024 char + properties[prop] = value.substring(0, 1023); + + } else if (typeof value !== 'undefined' && value !== null) { + properties[prop] = value; + } + } + + return { + properties, + measurements + }; +} + +function flatten(obj: any, result: { [key: string]: any }, order: number = 0, prefix?: string): void { + if (!obj) { + return; + } + + for (let item of Object.getOwnPropertyNames(obj)) { + const value = obj[item]; + const index = prefix ? prefix + item : item; + + if (Array.isArray(value)) { + result[index] = safeStringify(value); + + } else if (value instanceof Date) { + // TODO unsure why this is here and not in _getData + result[index] = value.toISOString(); + + } else if (isObject(value)) { + if (order < 2) { + flatten(value, result, order + 1, index + '.'); + } else { + result[index] = safeStringify(value); + } + } else { + result[index] = value; + } + } +} + function flattenKeys(value: Object | undefined): string[] { if (!value) { return []; diff --git a/src/vs/platform/telemetry/node/appInsightsAppender.ts b/src/vs/platform/telemetry/node/appInsightsAppender.ts index 5f6f7e3dbe8..2ed0150ac1f 100644 --- a/src/vs/platform/telemetry/node/appInsightsAppender.ts +++ b/src/vs/platform/telemetry/node/appInsightsAppender.ts @@ -4,9 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import * as appInsights from 'applicationinsights'; -import { isObject } from 'vs/base/common/types'; -import { safeStringify, mixin } from 'vs/base/common/objects'; -import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; +import { mixin } from 'vs/base/common/objects'; +import { ITelemetryAppender, validateTelemetryData } from 'vs/platform/telemetry/common/telemetryUtils'; import { ILogService } from 'vs/platform/log/common/log'; function getClient(aiKey: string): appInsights.TelemetryClient { @@ -35,13 +34,6 @@ function getClient(aiKey: string): appInsights.TelemetryClient { return client; } -interface Properties { - [key: string]: string; -} - -interface Measurements { - [key: string]: number; -} export class AppInsightsAppender implements ITelemetryAppender { @@ -64,74 +56,12 @@ export class AppInsightsAppender implements ITelemetryAppender { } } - private static _getData(data?: any): { properties: Properties, measurements: Measurements } { - - const properties: Properties = Object.create(null); - const measurements: Measurements = Object.create(null); - - const flat = Object.create(null); - AppInsightsAppender._flaten(data, flat); - - for (let prop in flat) { - // enforce property names less than 150 char, take the last 150 char - prop = prop.length > 150 ? prop.substr(prop.length - 149) : prop; - const value = flat[prop]; - - if (typeof value === 'number') { - measurements[prop] = value; - - } else if (typeof value === 'boolean') { - measurements[prop] = value ? 1 : 0; - - } else if (typeof value === 'string') { - //enforce property value to be less than 1024 char, take the first 1024 char - properties[prop] = value.substring(0, 1023); - - } else if (typeof value !== 'undefined' && value !== null) { - properties[prop] = value; - } - } - - return { - properties, - measurements - }; - } - - private static _flaten(obj: any, result: { [key: string]: any }, order: number = 0, prefix?: string): void { - if (!obj) { - return; - } - - for (let item of Object.getOwnPropertyNames(obj)) { - const value = obj[item]; - const index = prefix ? prefix + item : item; - - if (Array.isArray(value)) { - result[index] = safeStringify(value); - - } else if (value instanceof Date) { - // TODO unsure why this is here and not in _getData - result[index] = value.toISOString(); - - } else if (isObject(value)) { - if (order < 2) { - AppInsightsAppender._flaten(value, result, order + 1, index + '.'); - } else { - result[index] = safeStringify(value); - } - } else { - result[index] = value; - } - } - } - log(eventName: string, data?: any): void { if (!this._aiClient) { return; } data = mixin(data, this._defaultData); - data = AppInsightsAppender._getData(data); + data = validateTelemetryData(data); if (this._logService) { this._logService.trace(`telemetry/${eventName}`, data); diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 9cfaf411337..e5d4842aaa8 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -14,7 +14,6 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation, IExtensionEnablementService, EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionType, ExtensionIdentifier, IExtension } from 'vs/platform/extensions/common/extensions'; import { IURLHandler, IURLService } from 'vs/platform/url/common/url'; -import { ITelemetryService, ITelemetryData, ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry'; import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; @@ -35,7 +34,6 @@ import { pathsToEditors } from 'vs/workbench/common/editor'; import { IFileService } from 'vs/platform/files/common/files'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; -import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { toStoreData, restoreRecentlyOpened } from 'vs/platform/history/common/historyStorage'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; @@ -275,38 +273,6 @@ export class SimpleMultiExtensionsManagementService implements IExtensionManagem //#endregion -//#region Telemetry - -export class SimpleTelemetryService implements ITelemetryService { - - _serviceBrand: undefined; - - isOptedIn: true; - - publicLog(eventName: string, data?: ITelemetryData) { - return Promise.resolve(undefined); - } - - publicLog2 = never, T extends GDPRClassification = never>(eventName: string, data?: StrictPropertyCheck) { - return this.publicLog(eventName, data as ITelemetryData); - } - - setEnabled(value: boolean): void { - } - - getTelemetryInfo(): Promise { - return Promise.resolve({ - instanceId: 'someValue.instanceId', - sessionId: 'someValue.sessionId', - machineId: 'someValue.machineId' - }); - } -} - -registerSingleton(ITelemetryService, SimpleTelemetryService); - -//#endregion - //#region Update export class SimpleUpdateService implements IUpdateService { diff --git a/src/vs/workbench/services/telemetry/browser/telemetryService.ts b/src/vs/workbench/services/telemetry/browser/telemetryService.ts new file mode 100644 index 00000000000..13af5766086 --- /dev/null +++ b/src/vs/workbench/services/telemetry/browser/telemetryService.ts @@ -0,0 +1,170 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ITelemetryService, ITelemetryInfo, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; +import { NullTelemetryService, combinedAppender, LogAppender, ITelemetryAppender, validateTelemetryData } from 'vs/platform/telemetry/common/telemetryUtils'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { ILogService } from 'vs/platform/log/common/log'; +import { TelemetryService as BaseTelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { resolveWorkbenchCommonProperties } from 'vs/platform/telemetry/browser/workbenchCommonProperties'; +import { IProductService } from 'vs/platform/product/common/product'; + +interface IConfig { + instrumentationKey?: string; + endpointUrl?: string; + emitLineDelimitedJson?: boolean; + accountId?: string; + sessionRenewalMs?: number; + sessionExpirationMs?: number; + maxBatchSizeInBytes?: number; + maxBatchInterval?: number; + enableDebug?: boolean; + disableExceptionTracking?: boolean; + disableTelemetry?: boolean; + verboseLogging?: boolean; + diagnosticLogInterval?: number; + samplingPercentage?: number; + autoTrackPageVisitTime?: boolean; + disableAjaxTracking?: boolean; + overridePageViewDuration?: boolean; + maxAjaxCallsPerView?: number; + disableDataLossAnalysis?: boolean; + disableCorrelationHeaders?: boolean; + correlationHeaderExcludedDomains?: string[]; + disableFlushOnBeforeUnload?: boolean; + enableSessionStorageBuffer?: boolean; + isCookieUseDisabled?: boolean; + cookieDomain?: string; + isRetryDisabled?: boolean; + url?: string; + isStorageUseDisabled?: boolean; + isBeaconApiDisabled?: boolean; + sdkExtension?: string; + isBrowserLinkTrackingEnabled?: boolean; + appId?: string; + enableCorsCorrelation?: boolean; +} + +declare class Microsoft { + public static ApplicationInsights: { + Initialization: { + new(init: { config: IConfig }): AppInsights; + } + }; +} + +declare interface IAppInsightsClient { + config: IConfig; + + /** Log a user action or other occurrence. */ + trackEvent: (name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number }) => void; + + /** Immediately send all queued telemetry. Synchronous. */ + flush(): void; +} + +interface AppInsights { + loadAppInsights: () => IAppInsightsClient; +} + +export class WebTelemetryAppender implements ITelemetryAppender { + private _aiClient?: IAppInsightsClient; + + constructor(aiKey: string, private _logService: ILogService) { + const initConfig = { + config: { + instrumentationKey: aiKey, + endpointUrl: 'https://vortex.data.microsoft.com/collect/v1', + emitLineDelimitedJson: true, + autoTrackPageVisitTime: false, + disableExceptionTracking: true, + disableAjaxTracking: true + } + }; + + const appInsights = new Microsoft.ApplicationInsights.Initialization(initConfig); + this._aiClient = appInsights.loadAppInsights(); + } + + log(eventName: string, data: any): void { + if (!this._aiClient) { + return; + } + + data = validateTelemetryData(data); + this._logService.trace(`telemetry/${eventName}`, data); + + this._aiClient.trackEvent('monacoworkbench/' + eventName, data.properties, data.measurements); + } + + dispose(): Promise | undefined { + if (this._aiClient) { + return new Promise(resolve => { + this._aiClient!.flush(); + this._aiClient = undefined; + resolve(undefined); + }); + } + + return undefined; + } +} + +export class TelemetryService extends Disposable implements ITelemetryService { + + _serviceBrand: any; + + private impl: ITelemetryService; + + constructor( + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, + @ILogService logService: ILogService, + @IConfigurationService configurationService: IConfigurationService, + @IStorageService storageService: IStorageService, + @IProductService productService: IProductService + ) { + super(); + + const aiKey = productService.aiConfig && productService.aiConfig.asimovKey; + if (!environmentService.isExtensionDevelopment && !environmentService.args['disable-telemetry'] && !!productService.enableTelemetry && !!aiKey) { + const config: ITelemetryServiceConfig = { + appender: combinedAppender(new WebTelemetryAppender(aiKey, logService), new LogAppender(logService)), + commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.configuration.remoteAuthority), + piiPaths: [environmentService.appRoot] + }; + + this.impl = this._register(new BaseTelemetryService(config, configurationService)); + } else { + this.impl = NullTelemetryService; + } + } + + setEnabled(value: boolean): void { + return this.impl.setEnabled(value); + } + + get isOptedIn(): boolean { + return this.impl.isOptedIn; + } + + publicLog(eventName: string, data?: ITelemetryData, anonymizeFilePaths?: boolean): Promise { + return this.impl.publicLog(eventName, data, anonymizeFilePaths); + } + + publicLog2 = never, T extends GDPRClassification = never>(eventName: string, data?: StrictPropertyCheck, anonymizeFilePaths?: boolean) { + return this.publicLog(eventName, data as ITelemetryData, anonymizeFilePaths); + } + + getTelemetryInfo(): Promise { + return this.impl.getTelemetryInfo(); + } +} + +registerSingleton(ITelemetryService, TelemetryService); \ No newline at end of file diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 476f87ecf79..da6555d131f 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -73,8 +73,6 @@ import { DialogService } from 'vs/platform/dialogs/browser/dialogService'; // import { ILocalizationsService } from 'vs/platform/localizations/common/localizations'; // import { LocalizationsService } from 'vs/platform/localizations/electron-browser/localizationsService'; // import { ISharedProcessService, SharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; -// import { IProductService } from 'vs/platform/product/common/product'; -// import { ProductService } from 'vs/platform/product/node/productService'; // import { IWindowsService } from 'vs/platform/windows/common/windows'; // import { WindowsService } from 'vs/platform/windows/electron-browser/windowsService'; // import { IUpdateService } from 'vs/platform/update/common/update'; @@ -128,7 +126,7 @@ import 'vs/workbench/services/extensionManagement/common/extensionManagementServ // import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; // import 'vs/workbench/services/window/electron-browser/windowService'; -// import 'vs/workbench/services/telemetry/electron-browser/telemetryService'; +import 'vs/workbench/services/telemetry/browser/telemetryService'; import 'vs/workbench/services/configurationResolver/browser/configurationResolverService'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; From 6d5e584e20c9dab4fd943e820abbd0922683249b Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 17 Jul 2019 16:36:26 -0700 Subject: [PATCH 119/190] chore: Bump windows-foreground-love@0.2.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f8883efbe59..b5b38a4cd1c 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "optionalDependencies": { "vscode-windows-ca-certs": "0.1.0", "vscode-windows-registry": "1.0.1", - "windows-foreground-love": "0.1.0", + "windows-foreground-love": "0.2.0", "windows-mutex": "0.2.1", "windows-process-tree": "0.2.4" } diff --git a/yarn.lock b/yarn.lock index 6aa4b28cf28..bb7c51d4e9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9730,10 +9730,10 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -windows-foreground-love@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/windows-foreground-love/-/windows-foreground-love-0.1.0.tgz#948e4beac0733cd58624710cc09432b7e8bf3521" - integrity sha1-lI5L6sBzPNWGJHEMwJQyt+i/NSE= +windows-foreground-love@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/windows-foreground-love/-/windows-foreground-love-0.2.0.tgz#b291832d8a02a966bc046ba0e498cc789809076b" + integrity sha512-72ZDshnt8Q3/ImLMt4wxsY8eVnUd1KDb5QfvZX09AxJJJa0hGdyzPfd/ms0pKSYYwKlEhB1ri+WDKNvdIpJknQ== windows-mutex@0.2.1: version "0.2.1" From c898cc34899bb3b3d5e2bcae881ae9a3f5fa3162 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 9 Jun 2019 10:15:25 -0600 Subject: [PATCH 120/190] Add the .rbi file extension as a Ruby file type. .rbi files are type definition files that are currently used by some community type checkers, most notably Stripe's Sorbet, and will be part of the main language in Ruby 3. --- extensions/ruby/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/ruby/package.json b/extensions/ruby/package.json index a88b790d86f..4572f2526d8 100644 --- a/extensions/ruby/package.json +++ b/extensions/ruby/package.json @@ -12,7 +12,7 @@ "contributes": { "languages": [{ "id": "ruby", - "extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru", ".erb",".podspec" ], + "extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru", ".erb", ".podspec", ".rbi" ], "filenames": [ "rakefile", "gemfile", "guardfile", "podfile", "capfile" ], "aliases": [ "Ruby", "rb" ], "firstLine": "^#!\\s*/.*\\bruby\\b", From 3000b68b6a3a97011caeee98247481b391fceb02 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 17 Jul 2019 17:36:22 -0700 Subject: [PATCH 121/190] keymap tests. --- .../services/keybinding/test/browserKeyboardMapper.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts index acf45e1358d..2c707c50278 100644 --- a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts @@ -33,12 +33,12 @@ suite('keyboard layout loader', () => { let commandService = instantiationService.stub(ICommandService, {}); let instance = new TestKeyboardMapperFactory(notitifcationService, storageService, commandService); - test.skip('load default US keyboard layout', () => { + test('load default US keyboard layout', () => { assert.notEqual(instance.activeKeyboardLayout, null); assert.equal(instance.activeKeyboardLayout!.isUSStandard, true); }); - test.skip('isKeyMappingActive', () => { + test('isKeyMappingActive', () => { assert.equal(instance.isKeyMappingActive({ KeyA: { value: 'a', From c742363dfc889ead24861412795d25df7f3cd5f2 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 17 Jul 2019 17:45:09 -0700 Subject: [PATCH 122/190] Revert "keymap tests." This reverts commit 3000b68b6a3a97011caeee98247481b391fceb02. --- .../services/keybinding/test/browserKeyboardMapper.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts index 2c707c50278..acf45e1358d 100644 --- a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts @@ -33,12 +33,12 @@ suite('keyboard layout loader', () => { let commandService = instantiationService.stub(ICommandService, {}); let instance = new TestKeyboardMapperFactory(notitifcationService, storageService, commandService); - test('load default US keyboard layout', () => { + test.skip('load default US keyboard layout', () => { assert.notEqual(instance.activeKeyboardLayout, null); assert.equal(instance.activeKeyboardLayout!.isUSStandard, true); }); - test('isKeyMappingActive', () => { + test.skip('isKeyMappingActive', () => { assert.equal(instance.isKeyMappingActive({ KeyA: { value: 'a', From b185e5b77cce1d861950c38bba3a5406706f02f8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:12:32 -0700 Subject: [PATCH 123/190] Remove unsed event --- .../workbench/contrib/webview/browser/webviewEditorInput.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index aadd6394c0b..71f9a9754a5 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as dom from 'vs/base/browser/dom'; import { memoize } from 'vs/base/common/decorators'; -import { Emitter } from 'vs/base/common/event'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IEditorModel } from 'vs/platform/editor/common/editor'; @@ -104,9 +103,6 @@ export class WebviewEditorInput extends EditorInput { return WebviewEditorInput.typeId; } - private readonly _onDidChangeIcon = this._register(new Emitter()); - public readonly onDidChangeIcon = this._onDidChangeIcon.event; - public dispose() { this.disposeWebview(); From e26db506b7c85ac1d8023449f41650eb99ba6724 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:15:01 -0700 Subject: [PATCH 124/190] Mark that state may be undefined --- src/vs/workbench/api/browser/mainThreadWebview.ts | 2 +- .../workbench/contrib/webview/browser/webviewEditorInput.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index d26b5440d47..e1f0616efe6 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -230,7 +230,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews if (!webview || webview.isDisposed()) { return; } - (webview as WebviewEditorInput).state.state = newState; + (webview as WebviewEditorInput).state!.state = newState; } }; } diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index 71f9a9754a5..0d340e912b1 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -70,7 +70,7 @@ export class WebviewEditorInput extends EditorInput { private readonly _webviewDisposables = this._register(new DisposableStore()); private _group?: GroupIdentifier; private _scrollYPercentage: number = 0; - private _state: State; + private _state: State | undefined; public readonly extension?: { readonly location: URI; @@ -178,11 +178,11 @@ export class WebviewEditorInput extends EditorInput { } } - public get state(): State { + public get state(): State | undefined { return this._state; } - public set state(value: State) { + public set state(value: State | undefined) { this._state = value; } From 46294799205b65ac5fe691b6f0f44cc6025ae2b3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:18:19 -0700 Subject: [PATCH 125/190] Don't require using state to check if we can revive --- src/vs/workbench/api/browser/mainThreadWebview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index e1f0616efe6..efa06d54b4b 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -176,7 +176,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews this._revivers.set(viewType, this._webviewEditorService.registerReviver({ canRevive: (webview) => { - return webview.state && webview.state.viewType === viewType; + return webview.state && webview.viewType === this.getInternalWebviewViewType(viewType); }, reviveWebview: async (webview): Promise => { const viewType = webview.state.viewType; From 8b69b981de528a7bbeaba40624d6164309f09551 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:52:05 -0700 Subject: [PATCH 126/190] Simplify state used for webviews We previously used nested states to store some additional metadata alongside the real webview state. This is overly complicated. This change switches us to using a single top level state field, while also adding some code to handle migration from the old state structure --- .../api/browser/mainThreadWebview.ts | 52 +++++++++++++------ .../contrib/webview/browser/webviewEditor.ts | 2 +- .../webview/browser/webviewEditorInput.ts | 18 ++----- .../browser/webviewEditorInputFactory.ts | 23 +++++++- 4 files changed, 65 insertions(+), 30 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index efa06d54b4b..6d96547134d 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -22,8 +22,9 @@ import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/commo import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { extHostNamedCustomer } from '../common/extHostCustomers'; import { IProductService } from 'vs/platform/product/common/product'; +import { startsWith } from 'vs/base/common/strings'; -interface MainThreadWebviewState { +interface OldMainThreadWebviewState { readonly viewType: string; state: any; } @@ -43,7 +44,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews private readonly _proxy: ExtHostWebviewsShape; - private readonly _webviews = new Map>(); + private readonly _webviews = new Map(); private readonly _revivers = new Map(); private _activeWebview: WebviewPanelHandle | undefined = undefined; @@ -67,8 +68,12 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews // This reviver's only job is to activate webview extensions // This should trigger the real reviver to be registered from the extension host side. this._register(_webviewEditorService.registerReviver({ - canRevive: (webview: WebviewEditorInput) => { - const viewType = webview.state && webview.state.viewType; + canRevive: (webview: WebviewEditorInput) => { + if (!webview.state) { + return false; + } + + const viewType = this.fromInternalWebviewViewType(webview.viewType); if (typeof viewType === 'string') { extensionService.activateByEvent(`onWebviewPanel:${viewType}`); } @@ -96,11 +101,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews const webview = this._webviewEditorService.createWebview(handle, this.getInternalWebviewViewType(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), { location: URI.revive(extensionLocation), id: extensionId - }, this.createWebviewEventDelegate(handle)) as WebviewEditorInput; - webview.state = { - viewType: viewType, - state: undefined - }; + }, this.createWebviewEventDelegate(handle)) as WebviewEditorInput; this._webviews.set(handle, webview); @@ -176,17 +177,31 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews this._revivers.set(viewType, this._webviewEditorService.registerReviver({ canRevive: (webview) => { - return webview.state && webview.viewType === this.getInternalWebviewViewType(viewType); + return !!webview.state && webview.viewType === this.getInternalWebviewViewType(viewType); }, reviveWebview: async (webview): Promise => { - const viewType = webview.state.viewType; - const handle = 'revival-' + MainThreadWebviews.revivalPool++; + const viewType = this.fromInternalWebviewViewType(webview.viewType); + if (!viewType) { + webview.html = MainThreadWebviews.getDeserializationFailedContents(webview.viewType); + return; + } + + const handle = `revival-${MainThreadWebviews.revivalPool++}`; this._webviews.set(handle, webview); webview._events = this.createWebviewEventDelegate(handle); let state = undefined; - if (webview.state.state) { + if (webview.state) { try { - state = JSON.parse(webview.state.state); + // Check for old-style webview state first which stored state inside another state object + // TODO: remove this after 1.37 ships. + if ( + typeof (webview.state as unknown as OldMainThreadWebviewState).viewType === 'string' && + 'state' in (webview.state as unknown as OldMainThreadWebviewState) + ) { + state = JSON.parse((webview.state as any).state); + } else { + state = JSON.parse(webview.state); + } } catch { // noop } @@ -216,6 +231,13 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews return `mainThreadWebview-${viewType}`; } + private fromInternalWebviewViewType(viewType: string): string | undefined { + if (!startsWith(viewType, 'mainThreadWebview-')) { + return undefined; + } + return viewType.replace(/^mainThreadWebview-/, ''); + } + private createWebviewEventDelegate(handle: WebviewPanelHandle) { return { onDidClickLink: (uri: URI) => this.onDidClickLink(handle, uri), @@ -230,7 +252,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews if (!webview || webview.isDisposed()) { return; } - (webview as WebviewEditorInput).state!.state = newState; + webview.state = newState; } }; } diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index b128f150afb..fc68d1dc91d 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -256,7 +256,7 @@ export class WebviewEditor extends BaseEditor { this._webview.initialScrollProgress = input.scrollYPercentage; } - this._webview.state = input.state ? input.state.state : undefined; + this._webview.state = input.state; this._content!.setAttribute('aria-flowto', this._webviewContent.id); diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index 0d340e912b1..fa553aef2e7 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -52,7 +52,7 @@ class WebviewIconsManager { } } -export class WebviewEditorInput extends EditorInput { +export class WebviewEditorInput extends EditorInput { private readonly iconsManager = new WebviewIconsManager(); @@ -70,7 +70,7 @@ export class WebviewEditorInput extends EditorInput { private readonly _webviewDisposables = this._register(new DisposableStore()); private _group?: GroupIdentifier; private _scrollYPercentage: number = 0; - private _state: State | undefined; + public state: string | undefined; public readonly extension?: { readonly location: URI; @@ -82,7 +82,7 @@ export class WebviewEditorInput extends EditorInput { public readonly viewType: string, name: string, options: WebviewInputOptions, - state: State, + state: string, events: WebviewEvents, extension: undefined | { readonly location: URI; @@ -95,7 +95,7 @@ export class WebviewEditorInput extends EditorInput { this._name = name; this._options = options; this._events = events; - this._state = state; + this.state = state; this.extension = extension; } @@ -178,14 +178,6 @@ export class WebviewEditorInput extends EditorInput { } } - public get state(): State | undefined { - return this._state; - } - - public set state(value: State | undefined) { - this._state = value; - } - public get options(): WebviewInputOptions { return this._options; } @@ -308,7 +300,7 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput { viewType: string, name: string, options: WebviewInputOptions, - state: any, + state: string, events: WebviewEvents, extension: undefined | { readonly location: URI; diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts index 6c565b87ada..2b4eb4551ff 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts @@ -68,12 +68,15 @@ export class WebviewEditorInputFactory implements IEditorInputFactory { const extensionLocation = reviveUri(data.extensionLocation); const extensionId = data.extensionId ? new ExtensionIdentifier(data.extensionId) : undefined; const iconPath = reviveIconPath(data.iconPath); - return this._webviewService.reviveWebview(generateUuid(), data.viewType, data.title, iconPath, data.state, data.options, extensionLocation ? { + const state = reviveState(data.state); + + return this._webviewService.reviveWebview(generateUuid(), data.viewType, data.title, iconPath, state, data.options, extensionLocation ? { location: extensionLocation, id: extensionId } : undefined, data.group); } } + function reviveIconPath(data: SerializedIconPath | undefined) { if (!data) { return undefined; @@ -98,3 +101,21 @@ function reviveUri(data: string | UriComponents | undefined): URI | undefined { return undefined; } } + + +function reviveState(state: unknown | undefined): undefined | string { + if (!state) { + return undefined; + } + + if (typeof state === 'string') { + return state; + } + + // Likely an old style state. Unwrap to a simple state object + // Remove after 1.37 + if ('state' in (state as any) && typeof (state as any).state === 'string') { + return (state as any).state; + } + return undefined; +} \ No newline at end of file From 5ea2f5a75d5d734c13d2ae1de9661fb29e112834 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 15:57:46 -0700 Subject: [PATCH 127/190] Use regular map instead of object literal map --- .../update/electron-browser/releaseNotesEditor.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts index c6d72b3e1f8..b1660fd9e5c 100644 --- a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts @@ -48,7 +48,7 @@ function renderBody( export class ReleaseNotesManager { - private _releaseNotesCache: { [version: string]: Promise; } = Object.create(null); + private readonly _releaseNotesCache = new Map>(); private _currentReleaseNotes: WebviewEditorInput | undefined = undefined; private _lastText: string | undefined; @@ -162,8 +162,8 @@ export class ReleaseNotesManager { .replace(/kbstyle\(([^\)]+)\)/gi, kbstyle); }; - if (!this._releaseNotesCache[version]) { - this._releaseNotesCache[version] = this._requestService.request({ url }, CancellationToken.None) + if (!this._releaseNotesCache.has(version)) { + this._releaseNotesCache.set(version, this._requestService.request({ url }, CancellationToken.None) .then(asText) .then(text => { if (!text || !/^#\s/.test(text)) { // release notes always starts with `#` followed by whitespace @@ -172,10 +172,10 @@ export class ReleaseNotesManager { return Promise.resolve(text); }) - .then(text => patchKeybindings(text)); + .then(text => patchKeybindings(text))); } - return this._releaseNotesCache[version]; + return this._releaseNotesCache.get(version)!; } private onDidClickLink(uri: URI) { From 8bdcd22b623d210e38c805502521e3dd81bb07ed Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 16 Jul 2019 16:39:07 -0700 Subject: [PATCH 128/190] Start with no state, instead of empty object state --- .../workbench/contrib/webview/browser/webviewEditorInput.ts | 4 ++-- .../workbench/contrib/webview/browser/webviewEditorService.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index fa553aef2e7..6c95600c417 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -82,7 +82,7 @@ export class WebviewEditorInput extends EditorInput { public readonly viewType: string, name: string, options: WebviewInputOptions, - state: string, + state: string | undefined, events: WebviewEvents, extension: undefined | { readonly location: URI; @@ -300,7 +300,7 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput { viewType: string, name: string, options: WebviewInputOptions, - state: string, + state: string | undefined, events: WebviewEvents, extension: undefined | { readonly location: URI; diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts index 1a5fa997a1e..ead9999212d 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts @@ -146,7 +146,7 @@ export class WebviewEditorService implements IWebviewEditorService { }, events: WebviewEvents ): WebviewEditorInput { - const webviewInput = this._instantiationService.createInstance(WebviewEditorInput, id, viewType, title, options, {}, events, extension); + const webviewInput = this._instantiationService.createInstance(WebviewEditorInput, id, viewType, title, options, undefined, events, extension); this._editorService.openEditor(webviewInput, { pinned: true, preserveFocus: showOptions.preserveFocus }, showOptions.group); return webviewInput; } From 928ae46457461558a4894c0257c8144124a621ee Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:13:31 -0700 Subject: [PATCH 129/190] Rewrite how webviews are managed internally This change attempts to do the following: - Encapsult most of the logic for handling the webviews used for webview editors into a new WebviewEditorOverlay class - Greatly simplify WebviewEditorInput and make it take a webview when it is created - Move the webview creation logic up into the webviewEditorService instead of having it be inside the webviewEditor class itself This aim of these changes is to make it possible to re-use more of the webview logic for custom editors --- .../api/browser/mainThreadCodeInsets.ts | 7 +- .../api/browser/mainThreadWebview.ts | 92 ++++---- .../electron-browser/releaseNotesEditor.ts | 14 +- .../contrib/webview/browser/webviewEditor.ts | 213 ++++++------------ .../webview/browser/webviewEditorInput.ts | 176 +-------------- .../browser/webviewEditorInputFactory.ts | 4 +- .../webview/browser/webviewEditorService.ts | 66 ++++-- .../contrib/webview/browser/webviewElement.ts | 2 +- .../contrib/webview/browser/webviewService.ts | 187 ++++++++++++++- .../contrib/webview/common/webview.ts | 28 ++- .../electron-browser/webviewCommands.ts | 6 +- .../electron-browser/webviewElement.ts | 26 +-- .../electron-browser/webviewService.ts | 19 +- 13 files changed, 389 insertions(+), 451 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts index 05cfa4cdc4c..48938ad1f5b 100644 --- a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts +++ b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts @@ -8,7 +8,7 @@ import * as modes from 'vs/editor/common/modes'; import { MainContext, MainThreadEditorInsetsShape, IExtHostContext, ExtHostEditorInsetsShape, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; import { extHostNamedCustomer } from '../common/extHostCustomers'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/common/webview'; +import { IWebviewService, WebviewElement } from 'vs/workbench/contrib/webview/common/webview'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { IActiveCodeEditor, IViewZone } from 'vs/editor/browser/editorBrowser'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; @@ -33,7 +33,7 @@ class EditorWebviewZone implements IViewZone { readonly editor: IActiveCodeEditor, readonly line: number, readonly height: number, - readonly webview: Webview, + readonly webview: WebviewElement, ) { this.domNode = document.createElement('div'); this.domNode.style.zIndex = '10'; // without this, the webview is not interactive @@ -124,12 +124,11 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape { $setHtml(handle: number, value: string): void { const inset = this.getInset(handle); inset.webview.html = value; - } $setOptions(handle: number, options: modes.IWebviewOptions): void { const inset = this.getInset(handle); - inset.webview.options = options; + inset.webview.contentOptions = options; } async $postMessage(handle: number, value: any): Promise { diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index 6d96547134d..94413dd49a7 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -14,7 +14,6 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ExtHostContext, ExtHostWebviewsShape, IExtHostContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelShowOptions } from 'vs/workbench/api/common/extHost.protocol'; import { editorGroupToViewColumn, EditorViewColumn, viewColumnToEditorGroup } from 'vs/workbench/api/common/shared/editor'; -import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor'; import { WebviewEditorInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput'; import { ICreateWebViewShowOptions, IWebviewEditorService, WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; @@ -69,7 +68,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews // This should trigger the real reviver to be registered from the extension host side. this._register(_webviewEditorService.registerReviver({ canRevive: (webview: WebviewEditorInput) => { - if (!webview.state) { + if (!webview.webview.state) { return false; } @@ -101,7 +100,8 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews const webview = this._webviewEditorService.createWebview(handle, this.getInternalWebviewViewType(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), { location: URI.revive(extensionLocation), id: extensionId - }, this.createWebviewEventDelegate(handle)) as WebviewEditorInput; + }); + this.hookupWebviewEventDelegate(handle, webview); this._webviews.set(handle, webview); @@ -130,12 +130,12 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews public $setHtml(handle: WebviewPanelHandle, value: string): void { const webview = this.getWebview(handle); - webview.html = value; + webview.webview.html = value; } public $setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void { const webview = this.getWebview(handle); - webview.setOptions(reviveWebviewOptions(options as any /*todo@mat */)); + webview.webview.contentOptions = reviveWebviewOptions(options as any /*todo@mat */); } public $reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void { @@ -152,22 +152,8 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews public async $postMessage(handle: WebviewPanelHandle, message: any): Promise { const webview = this.getWebview(handle); - const editors = this._editorService.visibleControls - .filter(e => e instanceof WebviewEditor) - .map(e => e as WebviewEditor) - .filter(e => e.input!.matches(webview)); - - if (editors.length > 0) { - editors[0].sendMessage(message); - return true; - } - - if (webview.webview) { - webview.webview.sendMessage(message); - return true; - } - - return false; + webview.webview.sendMessage(message); + return true; } public $registerSerializer(viewType: string): void { @@ -176,31 +162,31 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews } this._revivers.set(viewType, this._webviewEditorService.registerReviver({ - canRevive: (webview) => { - return !!webview.state && webview.viewType === this.getInternalWebviewViewType(viewType); + canRevive: (webviewEditorInput) => { + return !!webviewEditorInput.webview.state && webviewEditorInput.viewType === this.getInternalWebviewViewType(viewType); }, - reviveWebview: async (webview): Promise => { - const viewType = this.fromInternalWebviewViewType(webview.viewType); + reviveWebview: async (webviewEditorInput): Promise => { + const viewType = this.fromInternalWebviewViewType(webviewEditorInput.viewType); if (!viewType) { - webview.html = MainThreadWebviews.getDeserializationFailedContents(webview.viewType); + webviewEditorInput.webview.html = MainThreadWebviews.getDeserializationFailedContents(webviewEditorInput.viewType); return; } const handle = `revival-${MainThreadWebviews.revivalPool++}`; - this._webviews.set(handle, webview); - webview._events = this.createWebviewEventDelegate(handle); + this._webviews.set(handle, webviewEditorInput); + this.hookupWebviewEventDelegate(handle, webviewEditorInput); let state = undefined; - if (webview.state) { + if (webviewEditorInput.webview.state) { try { // Check for old-style webview state first which stored state inside another state object // TODO: remove this after 1.37 ships. if ( - typeof (webview.state as unknown as OldMainThreadWebviewState).viewType === 'string' && - 'state' in (webview.state as unknown as OldMainThreadWebviewState) + typeof (webviewEditorInput.webview.state as unknown as OldMainThreadWebviewState).viewType === 'string' && + 'state' in (webviewEditorInput.webview.state as unknown as OldMainThreadWebviewState) ) { - state = JSON.parse((webview.state as any).state); + state = JSON.parse((webviewEditorInput.webview.state as any).state); } else { - state = JSON.parse(webview.state); + state = JSON.parse(webviewEditorInput.webview.state); } } catch { // noop @@ -208,10 +194,10 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews } try { - await this._proxy.$deserializeWebviewPanel(handle, viewType, webview.getTitle(), state, editorGroupToViewColumn(this._editorGroupService, webview.group || 0), webview.options); + await this._proxy.$deserializeWebviewPanel(handle, viewType, webviewEditorInput.getTitle(), state, editorGroupToViewColumn(this._editorGroupService, webviewEditorInput.group || 0), webviewEditorInput.webview.options); } catch (error) { onUnexpectedError(error); - webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType); + webviewEditorInput.webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType); } } })); @@ -238,23 +224,21 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews return viewType.replace(/^mainThreadWebview-/, ''); } - private createWebviewEventDelegate(handle: WebviewPanelHandle) { - return { - onDidClickLink: (uri: URI) => this.onDidClickLink(handle, uri), - onMessage: (message: any) => this._proxy.$onMessage(handle, message), - onDispose: () => { - this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => { - this._webviews.delete(handle); - }); - }, - onDidUpdateWebviewState: (newState: any) => { - const webview = this.tryGetWebview(handle); - if (!webview || webview.isDisposed()) { - return; - } - webview.state = newState; + private hookupWebviewEventDelegate(handle: WebviewPanelHandle, input: WebviewEditorInput) { + input.webview.onDidClickLink((uri: URI) => this.onDidClickLink(handle, uri)); + input.webview.onMessage((message: any) => this._proxy.$onMessage(handle, message)); + input.onDispose(() => { + this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => { + this._webviews.delete(handle); + }); + }); + input.webview.onDidUpdateState((newState: any) => { + const webview = this.tryGetWebview(handle); + if (!webview || webview.isDisposed()) { + return; } - }; + webview.webview.state = newState; + }); } private onActiveEditorChanged() { @@ -341,7 +325,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews if (this._productService.urlProtocol === link.scheme) { return true; } - return !!webview.options.enableCommandUris && link.scheme === 'command'; + return !!webview.webview.contentOptions.enableCommandUris && link.scheme === 'command'; } private getWebview(handle: WebviewPanelHandle): WebviewEditorInput { @@ -369,13 +353,15 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews } } -function reviveWebviewOptions(options: WebviewInputOptions): WebviewInputOptions { +function reviveWebviewOptions(options: modes.IWebviewOptions): WebviewInputOptions { return { ...options, + allowScripts: options.enableScripts, localResourceRoots: Array.isArray(options.localResourceRoots) ? options.localResourceRoots.map(r => URI.revive(r)) : undefined, }; } + function reviveWebviewIcon( value: { light: UriComponents, dark: UriComponents } | undefined ): { light: URI, dark: URI } | undefined { diff --git a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts index b1660fd9e5c..65d12c80877 100644 --- a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts @@ -71,7 +71,7 @@ export class ReleaseNotesManager { } const html = await this.renderBody(this._lastText); if (this._currentReleaseNotes) { - this._currentReleaseNotes.html = html; + this._currentReleaseNotes.webview.html = html; } }); } @@ -88,7 +88,7 @@ export class ReleaseNotesManager { const activeControl = this._editorService.activeControl; if (this._currentReleaseNotes) { this._currentReleaseNotes.setName(title); - this._currentReleaseNotes.html = html; + this._currentReleaseNotes.webview.html = html; this._webviewEditorService.revealWebview(this._currentReleaseNotes, activeControl ? activeControl.group : this._editorGroupService.activeGroup, false); } else { this._currentReleaseNotes = this._webviewEditorService.createWebview( @@ -103,17 +103,17 @@ export class ReleaseNotesManager { URI.parse(require.toUrl('./media')) ] }, - undefined, { - onDidClickLink: uri => this.onDidClickLink(uri), - onDispose: () => { this._currentReleaseNotes = undefined; } - }); + undefined); + + this._currentReleaseNotes.webview.onDidClickLink(uri => this.onDidClickLink(uri)); + this._currentReleaseNotes.onDispose(() => { this._currentReleaseNotes = undefined; }); const iconPath = URI.parse(require.toUrl('./media/code-icon.svg')); this._currentReleaseNotes.iconPath = { light: iconPath, dark: iconPath }; - this._currentReleaseNotes.html = html; + this._currentReleaseNotes.webview.html = html; } return true; diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index fc68d1dc91d..61a722d32c9 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -7,31 +7,27 @@ import * as DOM from 'vs/base/browser/dom'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Emitter, Event } from 'vs/base/common/event'; import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorOptions } from 'vs/workbench/common/editor'; import { WebviewEditorInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput'; -import { IWebviewService, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, Webview } from 'vs/workbench/contrib/webview/common/webview'; +import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, Webview, WebviewEditorOverlay } from 'vs/workbench/contrib/webview/common/webview'; import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; - export class WebviewEditor extends BaseEditor { public static readonly ID = 'WebviewEditor'; - private _webview: Webview | undefined; + private _webview: WebviewEditorOverlay | undefined; private _findWidgetVisible: IContextKey; - private _editorFrame: HTMLElement; + private _editorFrame?: HTMLElement; private _content?: HTMLElement; - private _webviewContent: HTMLElement | undefined; private readonly _webviewFocusTrackerDisposables = this._register(new DisposableStore()); private readonly _onFocusWindowHandler = this._register(new MutableDisposable()); @@ -39,14 +35,10 @@ export class WebviewEditor extends BaseEditor { private readonly _onDidFocusWebview = this._register(new Emitter()); public get onDidFocus(): Event { return this._onDidFocusWebview.event; } - private _pendingMessages: any[] = []; - constructor( @ITelemetryService telemetryService: ITelemetryService, @IThemeService themeService: IThemeService, @IContextKeyService private _contextKeyService: IContextKeyService, - @IWebviewService private readonly _webviewService: IWebviewService, - @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @IEditorService private readonly _editorService: IEditorService, @IWindowService private readonly _windowService: IWindowService, @IStorageService storageService: IStorageService @@ -57,64 +49,35 @@ export class WebviewEditor extends BaseEditor { } } + public get isWebviewEditor() { + return true; + } + protected createEditor(parent: HTMLElement): void { this._editorFrame = parent; this._content = document.createElement('div'); parent.appendChild(this._content); } - private doUpdateContainer() { - const webviewContainer = this.input && (this.input as WebviewEditorInput).container; - if (webviewContainer && webviewContainer.parentElement) { - const frameRect = this._editorFrame.getBoundingClientRect(); - const containerRect = webviewContainer.parentElement.getBoundingClientRect(); - - webviewContainer.style.position = 'absolute'; - webviewContainer.style.top = `${frameRect.top - containerRect.top}px`; - webviewContainer.style.left = `${frameRect.left - containerRect.left}px`; - webviewContainer.style.width = `${frameRect.width}px`; - webviewContainer.style.height = `${frameRect.height}px`; - } - } - public dispose(): void { - this._pendingMessages = []; - - // Let the editor input dispose of the webview. - this._webview = undefined; - this._webviewContent = undefined; - - if (this._content && this._content.parentElement) { - this._content.parentElement.removeChild(this._content); + if (this._content) { + this._content.remove(); this._content = undefined; } super.dispose(); } - public sendMessage(data: any): void { - if (this._webview) { - this._webview.sendMessage(data); - } else { - this._pendingMessages.push(data); - } - } public showFind() { - if (this._webview) { - this._webview.showFind(); + this.withWebview(webview => { + webview.showFind(); this._findWidgetVisible.set(true); - } + }); } public hideFind() { this._findWidgetVisible.reset(); - if (this._webview) { - this._webview.hideFind(); - } - } - - public get isWebviewEditor() { - return true; + this.withWebview(webview => webview.hideFind()); } public reload() { @@ -122,10 +85,10 @@ export class WebviewEditor extends BaseEditor { } public layout(_dimension: DOM.Dimension): void { - this.withWebview(webview => { - this.doUpdateContainer(); - webview.layout(); - }); + if (this._webview) { + this.doUpdateContainer(this._webview); + this._webview.layout(); + } } public focus(): void { @@ -149,23 +112,14 @@ export class WebviewEditor extends BaseEditor { } protected setEditorVisible(visible: boolean, group: IEditorGroup): void { - if (this.input && this.input instanceof WebviewEditorInput) { + const webview = (this.input && (this.input as WebviewEditorInput).webview) || this._webview; + if (webview) { if (visible) { - this.input.claimWebview(this); + webview.claim(this); } else { - this.input.releaseWebview(this); - } - - this.updateWebview(this.input as WebviewEditorInput); - } - - if (this._webviewContent) { - if (visible) { - this._webviewContent.style.visibility = 'visible'; - this.doUpdateContainer(); - } else { - this._webviewContent.style.visibility = 'hidden'; + webview.release(this); } + this.claimWebview(this.input as WebviewEditorInput); } super.setEditorVisible(visible, group); @@ -173,115 +127,76 @@ export class WebviewEditor extends BaseEditor { public clearInput() { if (this.input && this.input instanceof WebviewEditorInput) { - this.input.releaseWebview(this); + this.input.webview.release(this); } this._webview = undefined; - this._webviewContent = undefined; - this._pendingMessages = []; - super.clearInput(); } - setInput(input: WebviewEditorInput, options: EditorOptions, token: CancellationToken): Promise { - if (this.input) { - (this.input as WebviewEditorInput).releaseWebview(this); + public async setInput(input: WebviewEditorInput, options: EditorOptions, token: CancellationToken): Promise { + if (this.input && (this.input as WebviewEditorInput).webview) { + (this.input as WebviewEditorInput).webview!.release(this); this._webview = undefined; - this._webviewContent = undefined; - } - this._pendingMessages = []; - return super.setInput(input, options, token) - .then(() => input.resolve()) - .then(() => { - if (token.isCancellationRequested) { - return; - } - if (this.group) { - input.updateGroup(this.group.id); - } - this.updateWebview(input); - }); - } - - private updateWebview(input: WebviewEditorInput) { - const webview = this.getWebview(input); - input.claimWebview(this); - webview.update(input.html, { - allowScripts: input.options.enableScripts, - localResourceRoots: input.options.localResourceRoots || this.getDefaultLocalResourceRoots(), - portMappings: input.options.portMapping, - }, !!input.options.retainContextWhenHidden); - - if (this._webviewContent) { - this._webviewContent.style.visibility = 'visible'; } - this.doUpdateContainer(); - } - - private getDefaultLocalResourceRoots(): URI[] { - const rootPaths = this._contextService.getWorkspace().folders.map(x => x.uri); - const extension = (this.input as WebviewEditorInput).extension; - if (extension) { - rootPaths.push(extension.location); + await super.setInput(input, options, token); + await input.resolve(); + if (token.isCancellationRequested) { + return; } - return rootPaths; + + if (this.group) { + input.updateGroup(this.group.id); + } + this.claimWebview(input); } - private getWebview(input: WebviewEditorInput): Webview { + private claimWebview(input: WebviewEditorInput): void { if (this._webview) { - return this._webview; + this._webview.claim(this); + return; } - this._webviewContent = input.container; + this._webview = input.webview; + this._webview.claim(this); - if (input.webview) { - this._webview = input.webview; - } else { - if (input.options.enableFindWidget) { - this._contextKeyService = this._register(this._contextKeyService.createScoped(this._webviewContent)); - this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); - } - - this._webview = this._webviewService.createWebview(input.id, - { - allowSvgs: true, - extension: input.extension, - enableFindWidget: input.options.enableFindWidget - }, {}); - this._webview.mountTo(this._webviewContent); - input.webview = this._webview; - - if (input.options.tryRestoreScrollPosition) { - this._webview.initialScrollProgress = input.scrollYPercentage; - } - - this._webview.state = input.state; - - this._content!.setAttribute('aria-flowto', this._webviewContent.id); - - this.doUpdateContainer(); + if (this._webview.options.enableFindWidget) { + this._contextKeyService = this._register(this._contextKeyService.createScoped(this._webview.container)); + this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); } - for (const message of this._pendingMessages) { - this._webview.sendMessage(message); + if (this._content) { + this._content.setAttribute('aria-flowto', this._webview.container.id); } - this._pendingMessages = []; - this.trackFocus(); - - return this._webview; + this.doUpdateContainer(this._webview); + this.trackFocus(this._webview); } - private trackFocus() { + private doUpdateContainer(webview: WebviewEditorOverlay) { + const webviewContainer = webview.container; + if (webviewContainer && webviewContainer.parentElement && this._editorFrame) { + const frameRect = this._editorFrame.getBoundingClientRect(); + const containerRect = webviewContainer.parentElement.getBoundingClientRect(); + + webviewContainer.style.position = 'absolute'; + webviewContainer.style.top = `${frameRect.top - containerRect.top}px`; + webviewContainer.style.left = `${frameRect.left - containerRect.left}px`; + webviewContainer.style.width = `${frameRect.width}px`; + webviewContainer.style.height = `${frameRect.height}px`; + } + } + + private trackFocus(webview: WebviewEditorOverlay): void { this._webviewFocusTrackerDisposables.clear(); // Track focus in webview content - const webviewContentFocusTracker = DOM.trackFocus(this._webviewContent!); + const webviewContentFocusTracker = DOM.trackFocus(webview.container); this._webviewFocusTrackerDisposables.add(webviewContentFocusTracker); this._webviewFocusTrackerDisposables.add(webviewContentFocusTracker.onDidFocus(() => this._onDidFocusWebview.fire())); // Track focus in webview element - this._webviewFocusTrackerDisposables.add(this._webview!.onDidFocus(() => this._onDidFocusWebview.fire())); + this._webviewFocusTrackerDisposables.add(webview.onDidFocus(() => this._onDidFocusWebview.fire())); } } diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index 6c95600c417..a5a176a42b9 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -4,14 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as dom from 'vs/base/browser/dom'; import { memoize } from 'vs/base/common/decorators'; -import { DisposableStore } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IEditorModel } from 'vs/platform/editor/common/editor'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { EditorInput, EditorModel, GroupIdentifier, IEditorInput } from 'vs/workbench/common/editor'; -import { Webview, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { WebviewEvents, WebviewInputOptions } from './webviewEditorService'; +import { WebviewEditorOverlay } from 'vs/workbench/contrib/webview/common/webview'; class WebviewIconsManager { private readonly _icons = new Map(); @@ -54,72 +51,36 @@ class WebviewIconsManager { export class WebviewEditorInput extends EditorInput { - private readonly iconsManager = new WebviewIconsManager(); - public static readonly typeId = 'workbench.editors.webviewInput'; + private readonly iconsManager = new WebviewIconsManager(); private _name: string; private _iconPath?: { light: URI, dark: URI }; - private _options: WebviewInputOptions; - private _html: string = ''; - private _currentWebviewHtml: string = ''; - public _events: WebviewEvents | undefined; - private _container?: HTMLElement; - private _webview?: Webview; - private _webviewOwner: any; - private readonly _webviewDisposables = this._register(new DisposableStore()); private _group?: GroupIdentifier; - private _scrollYPercentage: number = 0; - public state: string | undefined; - public readonly extension?: { - readonly location: URI; - readonly id: ExtensionIdentifier; - }; constructor( public readonly id: string, public readonly viewType: string, name: string, - options: WebviewInputOptions, - state: string | undefined, - events: WebviewEvents, - extension: undefined | { + public readonly extension: undefined | { readonly location: URI; readonly id: ExtensionIdentifier; }, - @IWorkbenchLayoutService private readonly _layoutService: IWorkbenchLayoutService, + public readonly webview: WebviewEditorOverlay, ) { super(); this._name = name; - this._options = options; - this._events = events; - this.state = state; this.extension = extension; + + this._register(webview); // The input owns this webview } public getTypeId(): string { return WebviewEditorInput.typeId; } - public dispose() { - this.disposeWebview(); - - if (this._container) { - this._container.remove(); - this._container = undefined; - } - - if (this._events && this._events.onDispose) { - this._events.onDispose(); - } - this._events = undefined; - - this._webview = undefined; - super.dispose(); - } - public getResource(): URI { return URI.from({ scheme: 'webview-panel', @@ -161,42 +122,6 @@ export class WebviewEditorInput extends EditorInput { return this._group; } - public get html(): string { - return this._html; - } - - public set html(value: string) { - if (value === this._currentWebviewHtml) { - return; - } - - this._html = value; - - if (this._webview) { - this._webview.html = value; - this._currentWebviewHtml = value; - } - } - - public get options(): WebviewInputOptions { - return this._options; - } - - public setOptions(value: WebviewOptions) { - this._options = { - ...this._options, - ...value - }; - - if (this._webview) { - this._webview.options = { - allowScripts: this._options.enableScripts, - localResourceRoots: this._options.localResourceRoots, - portMappings: this._options.portMapping, - }; - } - } - public resolve(): Promise { return Promise.resolve(new EditorModel()); } @@ -205,93 +130,11 @@ export class WebviewEditorInput extends EditorInput { return false; } - public get container(): HTMLElement { - if (!this._container) { - this._container = document.createElement('div'); - this._container.id = `webview-${this.id}`; - const part = this._layoutService.getContainer(Parts.EDITOR_PART); - part.appendChild(this._container); - } - return this._container; - } - - public get webview(): Webview | undefined { - return this._webview; - } - - public set webview(value: Webview | undefined) { - this._webviewDisposables.clear(); - - this._webview = value; - if (!this._webview) { - return; - } - - this._webview.onDidClickLink(link => { - if (this._events && this._events.onDidClickLink) { - this._events.onDidClickLink(link, this._options); - } - }, null, this._webviewDisposables); - - this._webview.onMessage(message => { - if (this._events && this._events.onMessage) { - this._events.onMessage(message); - } - }, null, this._webviewDisposables); - - this._webview.onDidScroll(message => { - this._scrollYPercentage = message.scrollYPercentage; - }, null, this._webviewDisposables); - - this._webview.onDidUpdateState(newState => { - if (this._events && this._events.onDidUpdateWebviewState) { - this._events.onDidUpdateWebviewState(newState); - } - }, null, this._webviewDisposables); - } - - public get scrollYPercentage() { - return this._scrollYPercentage; - } - - public claimWebview(owner: any) { - this._webviewOwner = owner; - } - - public releaseWebview(owner: any) { - if (this._webviewOwner === owner) { - this._webviewOwner = undefined; - if (this._options.retainContextWhenHidden && this._container) { - this._container.style.visibility = 'hidden'; - } else { - this.disposeWebview(); - } - } - } - - public disposeWebview() { - // The input owns the webview and its parent - if (this._webview) { - this._webview.dispose(); - this._webview = undefined; - } - - this._webviewDisposables.clear(); - this._webviewOwner = undefined; - - if (this._container) { - this._container.style.visibility = 'hidden'; - } - - this._currentWebviewHtml = ''; - } - public updateGroup(group: GroupIdentifier): void { this._group = group; } } - export class RevivedWebviewEditorInput extends WebviewEditorInput { private _revived: boolean = false; @@ -299,17 +142,14 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput { id: string, viewType: string, name: string, - options: WebviewInputOptions, - state: string | undefined, - events: WebviewEvents, extension: undefined | { readonly location: URI; readonly id: ExtensionIdentifier }, private readonly reviver: (input: WebviewEditorInput) => Promise, - @IWorkbenchLayoutService partService: IWorkbenchLayoutService, + webview: WebviewEditorOverlay, ) { - super(id, viewType, name, options, state, events, extension, partService); + super(id, viewType, name, extension, webview); } public async resolve(): Promise { diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts index 2b4eb4551ff..b5f3ce40819 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts @@ -45,10 +45,10 @@ export class WebviewEditorInputFactory implements IEditorInputFactory { const data: SerializedWebview = { viewType: input.viewType, title: input.getName(), - options: input.options, + options: input.webview.options, extensionLocation: input.extension ? input.extension.location : undefined, extensionId: input.extension && input.extension.id ? input.extension.id.value : undefined, - state: input.state, + state: input.webview.state, iconPath: input.iconPath ? { light: input.iconPath.light, dark: input.iconPath.dark, } : undefined, group: input.group }; diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts index ead9999212d..3173d0afc4a 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts @@ -7,13 +7,14 @@ import { equals } from 'vs/base/common/arrays'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { values } from 'vs/base/common/map'; import { URI } from 'vs/base/common/uri'; -import { IWebviewOptions, IWebviewPanelOptions } from 'vs/editor/common/modes'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { GroupIdentifier } from 'vs/workbench/common/editor'; +import { IWebviewService, WebviewOptions, WebviewContentOptions } from 'vs/workbench/contrib/webview/common/webview'; import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { ACTIVE_GROUP_TYPE, IEditorService, SIDE_GROUP_TYPE } from 'vs/workbench/services/editor/common/editorService'; import { RevivedWebviewEditorInput, WebviewEditorInput } from './webviewEditorInput'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; export const IWebviewEditorService = createDecorator('webviewEditorService'); @@ -35,7 +36,6 @@ export interface IWebviewEditorService { location: URI, id: ExtensionIdentifier }, - events: WebviewEvents ): WebviewEditorInput; reviveWebview( @@ -77,25 +77,20 @@ export interface WebviewReviver { ): Promise; } -export interface WebviewEvents { - onMessage?(message: any): void; - onDispose?(): void; - onDidClickLink?(link: URI, options: IWebviewOptions): void; - onDidUpdateWebviewState?(newState: any): void; -} - -export interface WebviewInputOptions extends IWebviewOptions, IWebviewPanelOptions { - tryRestoreScrollPosition?: boolean; +export interface WebviewInputOptions extends WebviewOptions, WebviewContentOptions { + readonly tryRestoreScrollPosition?: boolean; + readonly retainContextWhenHidden?: boolean; + readonly enableCommandUris?: boolean; } export function areWebviewInputOptionsEqual(a: WebviewInputOptions, b: WebviewInputOptions): boolean { return a.enableCommandUris === b.enableCommandUris && a.enableFindWidget === b.enableFindWidget - && a.enableScripts === b.enableScripts + && a.allowScripts === b.allowScripts && a.retainContextWhenHidden === b.retainContextWhenHidden && a.tryRestoreScrollPosition === b.tryRestoreScrollPosition && (a.localResourceRoots === b.localResourceRoots || (Array.isArray(a.localResourceRoots) && Array.isArray(b.localResourceRoots) && equals(a.localResourceRoots, b.localResourceRoots, (a, b) => a.toString() === b.toString()))) - && (a.portMapping === b.portMapping || (Array.isArray(a.portMapping) && Array.isArray(b.portMapping) && equals(a.portMapping, b.portMapping, (a, b) => a.extensionHostPort === b.extensionHostPort && a.webviewPort === b.webviewPort))); + && (a.portMappings === b.portMappings || (Array.isArray(a.portMappings) && Array.isArray(b.portMappings) && equals(a.portMappings, b.portMappings, (a, b) => a.extensionHostPort === b.extensionHostPort && a.webviewPort === b.webviewPort))); } function canRevive(reviver: WebviewReviver, webview: WebviewEditorInput): boolean { @@ -132,6 +127,8 @@ export class WebviewEditorService implements IWebviewEditorService { @IEditorService private readonly _editorService: IEditorService, @IInstantiationService private readonly _instantiationService: IInstantiationService, @IEditorGroupsService private readonly _editorGroupService: IEditorGroupsService, + @IWebviewService private readonly _webviewService: IWebviewService, + @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, ) { } public createWebview( @@ -139,14 +136,15 @@ export class WebviewEditorService implements IWebviewEditorService { viewType: string, title: string, showOptions: ICreateWebViewShowOptions, - options: IWebviewOptions, + options: WebviewInputOptions, extension: undefined | { location: URI, id: ExtensionIdentifier }, - events: WebviewEvents ): WebviewEditorInput { - const webviewInput = this._instantiationService.createInstance(WebviewEditorInput, id, viewType, title, options, undefined, events, extension); + const webview = this.createWebiew(id, extension, options); + + const webviewInput = this._instantiationService.createInstance(WebviewEditorInput, id, viewType, title, extension, webview); this._editorService.openEditor(webviewInput, { pinned: true, preserveFocus: showOptions.preserveFocus }, showOptions.group); return webviewInput; } @@ -175,11 +173,14 @@ export class WebviewEditorService implements IWebviewEditorService { options: WebviewInputOptions, extension: undefined | { readonly location: URI, - readonly id?: ExtensionIdentifier + readonly id: ExtensionIdentifier }, group: number | undefined, ): WebviewEditorInput { - const webviewInput = this._instantiationService.createInstance(RevivedWebviewEditorInput, id, viewType, title, options, state, {}, extension, async (webview: WebviewEditorInput): Promise => { + const webview = this.createWebiew(id, extension, options); + webview.state = state; + + const webviewInput = new RevivedWebviewEditorInput(id, viewType, title, extension, async (webview: WebviewEditorInput): Promise => { const didRevive = await this.tryRevive(webview); if (didRevive) { return Promise.resolve(undefined); @@ -190,8 +191,10 @@ export class WebviewEditorService implements IWebviewEditorService { const promise = new Promise(r => { resolve = r; }); this._revivalPool.add(webview, resolve!); return promise; - }); + }, webview); + webviewInput.iconPath = iconPath; + if (typeof group === 'number') { webviewInput.updateGroup(group); } @@ -213,7 +216,7 @@ export class WebviewEditorService implements IWebviewEditorService { webview: WebviewEditorInput ): boolean { // Has no state, don't persist - if (!webview.state) { + if (!webview.webview.state) { return false; } @@ -237,4 +240,27 @@ export class WebviewEditorService implements IWebviewEditorService { } return false; } + + private createWebiew(id: string, extension: { location: URI; id: ExtensionIdentifier; } | undefined, options: WebviewInputOptions) { + return this._webviewService.createWebviewEditorOverlay(id, { + allowSvgs: true, + extension: extension, + enableFindWidget: options.enableFindWidget, + retainContextWhenHidden: options.retainContextWhenHidden + }, { + ...options, + localResourceRoots: options.localResourceRoots || this.getDefaultLocalResourceRoots(extension), + }); + } + + private getDefaultLocalResourceRoots(extension: undefined | { + location: URI, + id: ExtensionIdentifier + }): URI[] { + const rootPaths = this._contextService.getWorkspace().folders.map(x => x.uri); + if (extension) { + rootPaths.push(extension.location); + } + return rootPaths; + } } diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index 4c202ecef2c..22a9a4f7532 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -155,7 +155,7 @@ export class IFrameWebview extends Disposable implements Webview { } } - public set options(options: WebviewContentOptions) { + public set contentOptions(options: WebviewContentOptions) { if (areWebviewInputOptionsEqual(options, this.content.options)) { return; } diff --git a/src/vs/workbench/contrib/webview/browser/webviewService.ts b/src/vs/workbench/contrib/webview/browser/webviewService.ts index a4125927d7b..8b326fa23aa 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewService.ts @@ -3,9 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { Emitter, Event } from 'vs/base/common/event'; +import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { URI } from 'vs/base/common/uri'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IFrameWebview as WebviewElement } from 'vs/workbench/contrib/webview/browser/webviewElement'; -import { IWebviewService, WebviewOptions, WebviewContentOptions, Webview } from 'vs/workbench/contrib/webview/common/webview'; +import { IFrameWebview } from 'vs/workbench/contrib/webview/browser/webviewElement'; +import { IWebviewService, Webview, WebviewContentOptions, WebviewEditorOverlay, WebviewElement, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; +import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; +import { memoize } from 'vs/base/common/decorators'; export class WebviewService implements IWebviewService { _serviceBrand: any; @@ -18,10 +23,178 @@ export class WebviewService implements IWebviewService { id: string, options: WebviewOptions, contentOptions: WebviewContentOptions - ): Webview { - return this._instantiationService.createInstance(WebviewElement, - id, - options, - contentOptions); + ): WebviewElement { + return this._instantiationService.createInstance(IFrameWebview, id, options, contentOptions); + } + + createWebviewEditorOverlay( + id: string, + options: WebviewOptions, + contentOptions: WebviewContentOptions, + ): WebviewEditorOverlay { + return this._instantiationService.createInstance(DynamicWebviewEditorOverlay, id, options, contentOptions); + } +} + +/** + * Webview editor overlay that creates and destroys the underlying webview as needed. + */ +class DynamicWebviewEditorOverlay extends Disposable implements WebviewEditorOverlay { + + private readonly _pendingMessages = new Set(); + private readonly _webview = this._register(new MutableDisposable()); + private readonly _webviewEvents = this._register(new DisposableStore()); + + private _html: string = ''; + private _initialScrollProgress: number = 0; + private _state: string | undefined = undefined; + private _owner: any = undefined; + + public constructor( + private readonly id: string, + public readonly options: WebviewOptions, + private _contentOptions: WebviewContentOptions, + @IWorkbenchLayoutService private readonly _layoutService: IWorkbenchLayoutService, + @IWebviewService private readonly _webviewService: IWebviewService, + ) { + super(); + + this._register(toDisposable(() => this.container.remove())); + } + + @memoize + public get container() { + const container = document.createElement('div'); + container.id = `webview-${this.id}`; + this._layoutService.getContainer(Parts.EDITOR_PART).appendChild(container); + return container; + } + + public claim(owner: any) { + this._owner = owner; + this.show(); + } + + public release(owner: any) { + if (this._owner !== owner) { + return; + } + + this._owner = undefined; + if (this.options.retainContextWhenHidden) { + this.container.style.visibility = 'hidden'; + } else { + this._webview.clear(); + this._webviewEvents.clear(); + } + } + + private show() { + if (!this._webview.value) { + const webview = this._webviewService.createWebview(this.id, this.options, this._contentOptions); + this._webview.value = webview; + webview.html = this._html; + webview.state = this._state; + + if (this.options.tryRestoreScrollPosition) { + webview.initialScrollProgress = this._initialScrollProgress; + } + + this._webview.value.mountTo(this.container); + + this._webviewEvents.clear(); + + webview.onDidFocus(() => { + this._onDidFocus.fire(); + }, undefined, this._webviewEvents); + + webview.onDidClickLink(x => { + this._onDidClickLink.fire(x); + }, undefined, this._webviewEvents); + + webview.onDidScroll(x => { + this._initialScrollProgress = x.scrollYPercentage; + this._onDidScroll.fire(x); + }, undefined, this._webviewEvents); + + webview.onDidUpdateState(state => { + this._state = state; + this._onDidUpdateState.fire(state); + }, undefined, this._webviewEvents); + + webview.onMessage(x => { + this._onMessage.fire(x); + }, undefined, this._webviewEvents); + + this._pendingMessages.forEach(msg => webview.sendMessage(msg)); + this._pendingMessages.clear(); + } + this.container.style.visibility = 'visible'; + } + + public get html(): string { return this._html; } + public set html(value: string) { + this._html = value; + this.withWebview(webview => webview.html = value); + } + + public get initialScrollProgress(): number { return this._initialScrollProgress; } + public set initialScrollProgress(value: number) { + this._initialScrollProgress = value; + this.withWebview(webview => webview.initialScrollProgress = value); + } + + public get state(): string | undefined { return this._state; } + public set state(value: string | undefined) { + this._state = value; + this.withWebview(webview => webview.state = value); + } + + public get contentOptions(): WebviewContentOptions { return this._contentOptions; } + public set contentOptions(value: WebviewContentOptions) { + this._contentOptions = value; + this.withWebview(webview => webview.contentOptions = value); + } + + private readonly _onDidFocus = this._register(new Emitter()); + public readonly onDidFocus: Event = this._onDidFocus.event; + + private readonly _onDidClickLink = this._register(new Emitter()); + public readonly onDidClickLink: Event = this._onDidClickLink.event; + + private readonly _onDidScroll = this._register(new Emitter<{ scrollYPercentage: number; }>()); + public readonly onDidScroll: Event<{ scrollYPercentage: number; }> = this._onDidScroll.event; + + private readonly _onDidUpdateState = this._register(new Emitter()); + public readonly onDidUpdateState: Event = this._onDidUpdateState.event; + + private readonly _onMessage = this._register(new Emitter()); + public readonly onMessage: Event = this._onMessage.event; + + sendMessage(data: any): void { + if (this._webview.value) { + this._webview.value.sendMessage(data); + } else { + this._pendingMessages.add(data); + } + } + + update(value: string, options: WebviewContentOptions, retainContextWhenHidden: boolean): void { + this._contentOptions = options; + this.withWebview(webview => { + webview.update(value, options, retainContextWhenHidden); + }); + } + + layout(): void { this.withWebview(webview => webview.layout()); } + focus(): void { this.withWebview(webview => webview.focus()); } + reload(): void { this.withWebview(webview => webview.reload()); } + showFind(): void { this.withWebview(webview => webview.showFind()); } + hideFind(): void { this.withWebview(webview => webview.hideFind()); } + + private withWebview(f: (webview: Webview) => void): void { + if (this._webview.value) { + f(this._webview.value); + } } } \ No newline at end of file diff --git a/src/vs/workbench/contrib/webview/common/webview.ts b/src/vs/workbench/contrib/webview/common/webview.ts index bcc186c375e..c96522f5fab 100644 --- a/src/vs/workbench/contrib/webview/common/webview.ts +++ b/src/vs/workbench/contrib/webview/common/webview.ts @@ -7,10 +7,10 @@ import { Event } from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import * as modes from 'vs/editor/common/modes'; +import * as nls from 'vs/nls'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import * as nls from 'vs/nls'; /** * Set when the find widget in a webview is visible. @@ -29,7 +29,13 @@ export interface IWebviewService { id: string, options: WebviewOptions, contentOptions: WebviewContentOptions, - ): Webview; + ): WebviewElement; + + createWebviewEditorOverlay( + id: string, + options: WebviewOptions, + contentOptions: WebviewContentOptions, + ): WebviewEditorOverlay; } export const WebviewResourceScheme = 'vscode-resource'; @@ -41,6 +47,8 @@ export interface WebviewOptions { readonly id?: ExtensionIdentifier; }; readonly enableFindWidget?: boolean; + readonly tryRestoreScrollPosition?: boolean; + readonly retainContextWhenHidden?: boolean; } export interface WebviewContentOptions { @@ -48,12 +56,13 @@ export interface WebviewContentOptions { readonly svgWhiteList?: string[]; readonly localResourceRoots?: ReadonlyArray; readonly portMappings?: ReadonlyArray; + readonly enableCommandUris?: boolean; } export interface Webview extends IDisposable { html: string; - options: WebviewContentOptions; + contentOptions: WebviewContentOptions; initialScrollProgress: number; state: string | undefined; @@ -71,7 +80,6 @@ export interface Webview extends IDisposable { ): void; layout(): void; - mountTo(parent: HTMLElement): void; focus(): void; reload(): void; @@ -79,4 +87,16 @@ export interface Webview extends IDisposable { hideFind(): void; } +export interface WebviewElement extends Webview { + mountTo(parent: HTMLElement): void; +} + +export interface WebviewEditorOverlay extends Webview { + readonly container: HTMLElement; + readonly options: WebviewOptions; + + claim(owner: any): void; + release(owner: any): void; +} + export const webviewDeveloperCategory = nls.localize('developer', "Developer"); diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts index 15f320ce9f1..d2b6f7d531b 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts @@ -8,7 +8,7 @@ import * as nls from 'vs/nls'; import { Command, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; +import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; export class OpenWebviewDeveloperToolsAction extends Action { static readonly ID = 'workbench.action.webview.openDeveloperTools'; @@ -86,11 +86,11 @@ function getActiveWebviewEditor(accessor: ServicesAccessor): WebviewEditor | und return activeControl.isWebviewEditor ? activeControl : undefined; } -function withActiveWebviewBasedWebview(accessor: ServicesAccessor, f: (webview: WebviewElement) => void): void { +function withActiveWebviewBasedWebview(accessor: ServicesAccessor, f: (webview: ElectronWebviewBasedWebview) => void): void { const webViewEditor = getActiveWebviewEditor(accessor); if (webViewEditor) { webViewEditor.withWebview(webview => { - if (webview instanceof WebviewElement) { + if (webview instanceof ElectronWebviewBasedWebview) { f(webview); } }); diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index e0c1d79deb1..e42e1a4b401 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -13,7 +13,6 @@ import { endsWith } from 'vs/base/common/strings'; import { URI } from 'vs/base/common/uri'; import * as modes from 'vs/editor/common/modes'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITunnelService } from 'vs/platform/remote/common/tunnel'; @@ -25,27 +24,6 @@ import { registerFileProtocol } from 'vs/workbench/contrib/webview/electron-brow import { areWebviewInputOptionsEqual } from '../browser/webviewEditorService'; import { WebviewFindWidget } from '../browser/webviewFindWidget'; -export interface WebviewPortMapping { - readonly port: number; - readonly resolvedPort: number; -} - -export interface WebviewOptions { - readonly allowSvgs?: boolean; - readonly extension?: { - readonly location: URI; - readonly id?: ExtensionIdentifier; - }; - readonly enableFindWidget?: boolean; -} - -export interface WebviewContentOptions { - readonly allowScripts?: boolean; - readonly svgWhiteList?: string[]; - readonly localResourceRoots?: ReadonlyArray; - readonly portMappings?: ReadonlyArray; -} - interface IKeydownEvent { key: string; keyCode: number; @@ -285,7 +263,7 @@ interface WebviewContent { readonly state: string | undefined; } -export class WebviewElement extends Disposable implements Webview { +export class ElectronWebviewBasedWebview extends Disposable implements Webview { private _webview: Electron.WebviewTag | undefined; private _ready: Promise; @@ -508,7 +486,7 @@ export class WebviewElement extends Disposable implements Webview { }; } - public set options(options: WebviewContentOptions) { + public set contentOptions(options: WebviewContentOptions) { if (areWebviewInputOptionsEqual(options, this.content.options)) { return; } diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts index aa7ffc5d9bc..75727aa6389 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts @@ -4,23 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IWebviewService, Webview, WebviewContentOptions, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; -import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; +import { WebviewService as BrowserWebviewService } from 'vs/workbench/contrib/webview/browser/webviewService'; +import { IWebviewService, WebviewContentOptions, WebviewElement, WebviewOptions } from 'vs/workbench/contrib/webview/common/webview'; +import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -export class WebviewService implements IWebviewService { +export class WebviewService extends BrowserWebviewService implements IWebviewService { _serviceBrand: any; constructor( - @IInstantiationService private readonly _instantiationService: IInstantiationService, - ) { } + @IInstantiationService private readonly instantiationService: IInstantiationService, + ) { + super(instantiationService); + } createWebview( _id: string, options: WebviewOptions, contentOptions: WebviewContentOptions - ): Webview { - return this._instantiationService.createInstance(WebviewElement, - options, - contentOptions); + ): WebviewElement { + return this.instantiationService.createInstance(ElectronWebviewBasedWebview, options, contentOptions); } } \ No newline at end of file From 06c418c0dcb6328e936a862d2db74bf7d5994205 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:28:02 -0700 Subject: [PATCH 130/190] Fix state being lost on first update of a revived webview --- src/vs/workbench/contrib/webview/browser/webviewService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewService.ts b/src/vs/workbench/contrib/webview/browser/webviewService.ts index 8b326fa23aa..344331a4898 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewService.ts @@ -93,8 +93,8 @@ class DynamicWebviewEditorOverlay extends Disposable implements WebviewEditorOve if (!this._webview.value) { const webview = this._webviewService.createWebview(this.id, this.options, this._contentOptions); this._webview.value = webview; - webview.html = this._html; webview.state = this._state; + webview.html = this._html; if (this.options.tryRestoreScrollPosition) { webview.initialScrollProgress = this._initialScrollProgress; From 7d842fa5d3c7907e331bff2cae9d04112f6f2ca6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:29:19 -0700 Subject: [PATCH 131/190] Make sure we update our stored html when using the update function too --- src/vs/workbench/contrib/webview/browser/webviewService.ts | 5 +++-- src/vs/workbench/contrib/webview/common/webview.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewService.ts b/src/vs/workbench/contrib/webview/browser/webviewService.ts index 344331a4898..18857b50296 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewService.ts @@ -179,10 +179,11 @@ class DynamicWebviewEditorOverlay extends Disposable implements WebviewEditorOve } } - update(value: string, options: WebviewContentOptions, retainContextWhenHidden: boolean): void { + update(html: string, options: WebviewContentOptions, retainContextWhenHidden: boolean): void { this._contentOptions = options; + this._html = html; this.withWebview(webview => { - webview.update(value, options, retainContextWhenHidden); + webview.update(html, options, retainContextWhenHidden); }); } diff --git a/src/vs/workbench/contrib/webview/common/webview.ts b/src/vs/workbench/contrib/webview/common/webview.ts index c96522f5fab..5f2d3053ff1 100644 --- a/src/vs/workbench/contrib/webview/common/webview.ts +++ b/src/vs/workbench/contrib/webview/common/webview.ts @@ -74,7 +74,7 @@ export interface Webview extends IDisposable { sendMessage(data: any): void; update( - value: string, + html: string, options: WebviewContentOptions, retainContextWhenHidden: boolean ): void; From eb0dc4c561ef1eba641b421ee57d0df4f2b38e68 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:30:54 -0700 Subject: [PATCH 132/190] Use a single instance of webviewIconsManager --- .../workbench/contrib/webview/browser/webviewEditorInput.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index a5a176a42b9..dd83d24f297 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -53,7 +53,8 @@ export class WebviewEditorInput extends EditorInput { public static readonly typeId = 'workbench.editors.webviewInput'; - private readonly iconsManager = new WebviewIconsManager(); + private static readonly iconsManager = new WebviewIconsManager(); + private _name: string; private _iconPath?: { light: URI, dark: URI }; private _group?: GroupIdentifier; @@ -111,7 +112,7 @@ export class WebviewEditorInput extends EditorInput { public set iconPath(value: { light: URI, dark: URI } | undefined) { this._iconPath = value; - this.iconsManager.setIcons(this.id, value); + WebviewEditorInput.iconsManager.setIcons(this.id, value); } public matches(other: IEditorInput): boolean { From 2091f715f00fa8eb8bdc456a54c9accd2cc57734 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:51:16 -0700 Subject: [PATCH 133/190] Don't hang on to webview in `WebviewEditor` --- .../contrib/webview/browser/webviewEditor.ts | 51 ++++++++----------- .../webview/browser/webviewEditorInput.ts | 5 +- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts index 61a722d32c9..d01dc751d00 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditor.ts @@ -23,7 +23,7 @@ export class WebviewEditor extends BaseEditor { public static readonly ID = 'WebviewEditor'; - private _webview: WebviewEditorOverlay | undefined; + private readonly _scopedContextKeyService = this._register(new MutableDisposable()); private _findWidgetVisible: IContextKey; private _editorFrame?: HTMLElement; @@ -38,15 +38,14 @@ export class WebviewEditor extends BaseEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, @IThemeService themeService: IThemeService, - @IContextKeyService private _contextKeyService: IContextKeyService, + @IContextKeyService private readonly _contextKeyService: IContextKeyService, @IEditorService private readonly _editorService: IEditorService, @IWindowService private readonly _windowService: IWindowService, @IStorageService storageService: IStorageService ) { super(WebviewEditor.ID, telemetryService, themeService, storageService); - if (_contextKeyService) { - this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(_contextKeyService); - } + + this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(_contextKeyService); } public get isWebviewEditor() { @@ -85,16 +84,15 @@ export class WebviewEditor extends BaseEditor { } public layout(_dimension: DOM.Dimension): void { - if (this._webview) { - this.doUpdateContainer(this._webview); - this._webview.layout(); + if (this.input && this.input instanceof WebviewEditorInput) { + this.synchronizeWebviewContainerDimensions(this.input.webview); + this.input.webview.layout(); } } public focus(): void { super.focus(); if (!this._onFocusWindowHandler.value) { - // Make sure we restore focus when switching back to a VS Code window this._onFocusWindowHandler.value = this._windowService.onDidChangeFocus(focused => { if (focused && this._editorService.activeControl === this) { @@ -106,13 +104,13 @@ export class WebviewEditor extends BaseEditor { } public withWebview(f: (element: Webview) => void): void { - if (this._webview) { - f(this._webview); + if (this.input && this.input instanceof WebviewEditorInput) { + f(this.input.webview); } } protected setEditorVisible(visible: boolean, group: IEditorGroup): void { - const webview = (this.input && (this.input as WebviewEditorInput).webview) || this._webview; + const webview = this.input && (this.input as WebviewEditorInput).webview; if (webview) { if (visible) { webview.claim(this); @@ -130,14 +128,12 @@ export class WebviewEditor extends BaseEditor { this.input.webview.release(this); } - this._webview = undefined; super.clearInput(); } public async setInput(input: WebviewEditorInput, options: EditorOptions, token: CancellationToken): Promise { - if (this.input && (this.input as WebviewEditorInput).webview) { - (this.input as WebviewEditorInput).webview!.release(this); - this._webview = undefined; + if (this.input && this.input instanceof WebviewEditorInput) { + this.input.webview.release(this); } await super.setInput(input, options, token); @@ -149,32 +145,27 @@ export class WebviewEditor extends BaseEditor { if (this.group) { input.updateGroup(this.group.id); } + this.claimWebview(input); } private claimWebview(input: WebviewEditorInput): void { - if (this._webview) { - this._webview.claim(this); - return; - } + input.webview.claim(this); - this._webview = input.webview; - this._webview.claim(this); - - if (this._webview.options.enableFindWidget) { - this._contextKeyService = this._register(this._contextKeyService.createScoped(this._webview.container)); - this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); + if (input.webview.options.enableFindWidget) { + this._scopedContextKeyService.value = this._contextKeyService.createScoped(input.webview.container); + this._findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._scopedContextKeyService.value); } if (this._content) { - this._content.setAttribute('aria-flowto', this._webview.container.id); + this._content.setAttribute('aria-flowto', input.webview.container.id); } - this.doUpdateContainer(this._webview); - this.trackFocus(this._webview); + this.synchronizeWebviewContainerDimensions(input.webview); + this.trackFocus(input.webview); } - private doUpdateContainer(webview: WebviewEditorOverlay) { + private synchronizeWebviewContainerDimensions(webview: WebviewEditorOverlay) { const webviewContainer = webview.container; if (webviewContainer && webviewContainer.parentElement && this._editorFrame) { const frameRect = this._editorFrame.getBoundingClientRect(); diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index dd83d24f297..591784f328b 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -59,7 +59,6 @@ export class WebviewEditorInput extends EditorInput { private _iconPath?: { light: URI, dark: URI }; private _group?: GroupIdentifier; - constructor( public readonly id: string, public readonly viewType: string, @@ -123,8 +122,8 @@ export class WebviewEditorInput extends EditorInput { return this._group; } - public resolve(): Promise { - return Promise.resolve(new EditorModel()); + public async resolve(): Promise { + return new EditorModel(); } public supportsSplitEditor() { From 52b6e7c4f58466e5b67348fb67d359f6bc3bb7e8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 17 Jul 2019 18:53:02 -0700 Subject: [PATCH 134/190] Make sure we hide the webview overlay when it is not in use --- src/vs/workbench/contrib/webview/browser/webviewService.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewService.ts b/src/vs/workbench/contrib/webview/browser/webviewService.ts index 18857b50296..a151f3840df 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewService.ts @@ -81,9 +81,8 @@ class DynamicWebviewEditorOverlay extends Disposable implements WebviewEditorOve } this._owner = undefined; - if (this.options.retainContextWhenHidden) { - this.container.style.visibility = 'hidden'; - } else { + this.container.style.visibility = 'hidden'; + if (!this.options.retainContextWhenHidden) { this._webview.clear(); this._webviewEvents.clear(); } From 5e0bcd6afebf9aebddd90f1ce92dbb2e8946510e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 18 Jul 2019 08:37:35 +0200 Subject: [PATCH 135/190] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f8883efbe59..e722982183c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "3b7db3f93b5efe73eedab147ee9eb72a9abadc9d", + "distro": "efabeb59b721e11ddcfadfdd91810ca5bf54b51d", "author": { "name": "Microsoft Corporation" }, From 28473ed5f7ee886c2bff2c7dcdbf74a6059b9b95 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 18 Jul 2019 11:10:02 +0200 Subject: [PATCH 136/190] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e722982183c..1dd944ac9ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "efabeb59b721e11ddcfadfdd91810ca5bf54b51d", + "distro": "fbc5990ccee25d91cab59677ff6624708306a412", "author": { "name": "Microsoft Corporation" }, From 8ffcb49f4fbeb2504050726990452c1bb5b129fd Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 11:19:54 +0200 Subject: [PATCH 137/190] disable some extension commands in web --- .../issue/issueReporterMain.ts | 2 +- .../sharedProcess/sharedProcessMain.ts | 2 +- src/vs/code/electron-main/app.ts | 2 +- src/vs/code/electron-main/main.ts | 4 +- src/vs/code/node/cliProcessMain.ts | 7 +- .../environment/common/environment.ts | 2 +- .../node/extensionManagementService.ts | 2 +- src/vs/platform/telemetry/node/telemetry.ts | 46 ++++++------ .../browser/extensions.contribution.ts | 72 ++++++++++++------- .../extensions/browser/extensionsActions.ts | 24 ++++--- .../environment/browser/environmentService.ts | 2 +- .../electron-browser/telemetryService.ts | 2 +- 12 files changed, 98 insertions(+), 69 deletions(-) diff --git a/src/vs/code/electron-browser/issue/issueReporterMain.ts b/src/vs/code/electron-browser/issue/issueReporterMain.ts index a6bb5723f58..2302d162f34 100644 --- a/src/vs/code/electron-browser/issue/issueReporterMain.ts +++ b/src/vs/code/electron-browser/issue/issueReporterMain.ts @@ -312,7 +312,7 @@ export class IssueReporter extends Disposable { const channel = getDelayedChannel(sharedProcess.then(c => c.getChannel('telemetryAppender'))); const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService)); const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', pkg.version, configuration.machineId, this.environmentService.installSourcePath); - const piiPaths = [this.environmentService.appRoot, this.environmentService.extensionsPath]; + const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot]; const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths }; const telemetryService = instantiationService.createInstance(TelemetryService, config); diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 31e2fa0a8fa..baeaa641903 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -158,7 +158,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat const config: ITelemetryServiceConfig = { appender: combinedAppender(appInsightsAppender, new LogAppender(logService)), commonProperties: resolveCommonProperties(product.commit, pkg.version, configuration.machineId, installSourcePath), - piiPaths: [appRoot, extensionsPath] + piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot] }; telemetryService = new TelemetryService(config, configurationService); diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index cd81cc3dbb2..5682c0664c6 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -484,7 +484,7 @@ export class CodeApplication extends Disposable { const channel = getDelayedChannel(sharedProcessClient.then(client => client.getChannel('telemetryAppender'))); const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(this.logService)); const commonProperties = resolveCommonProperties(product.commit, pkg.version, machineId, this.environmentService.installSourcePath); - const piiPaths = [this.environmentService.appRoot, this.environmentService.extensionsPath]; + const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot]; const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths, trueMachineId }; services.set(ITelemetryService, new SyncDescriptor(TelemetryService, [config])); diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 897fe6ef386..71891c9bafd 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -332,7 +332,9 @@ class CodeMain { if (error.code === 'EACCES' || error.code === 'EPERM') { this.showStartupWarningDialog( localize('startupDataDirError', "Unable to write program user data."), - localize('startupDataDirErrorDetail', "Please make sure the directories {0} and {1} are writeable.", environmentService.userDataPath, environmentService.extensionsPath) + environmentService.extensionsPath + ? localize('startupUserDataAndExtensionsDirErrorDetail', "Please make sure the directories {0} and {1} are writeable.", environmentService.userDataPath, environmentService.extensionsPath) + : localize('startupUserDataDirErrorDetail', "Please make sure the directory {0} is writeable.", environmentService.userDataPath) ); } } diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 3a7b44232e3..68978614625 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -102,7 +102,7 @@ export class Main { const ids: string[] = typeof arg === 'string' ? [arg] : arg; await this.locateExtension(ids); } else if (argv['telemetry']) { - console.log(buildTelemetryMessage(this.environmentService.appRoot, this.environmentService.extensionsPath)); + console.log(buildTelemetryMessage(this.environmentService.appRoot, this.environmentService.extensionsPath ? this.environmentService.extensionsPath : undefined)); } } @@ -293,7 +293,8 @@ export async function main(argv: ParsedArgs): Promise { process.once('exit', () => logService.dispose()); logService.info('main', argv); - await Promise.all([environmentService.appSettingsHome.fsPath, environmentService.extensionsPath].map(p => mkdirp(p))); + await Promise.all([environmentService.appSettingsHome.fsPath, environmentService.extensionsPath] + .map((path): undefined | Promise => path ? mkdirp(path) : undefined)); const configurationService = new ConfigurationService(environmentService.settingsResource); disposables.add(configurationService); @@ -339,7 +340,7 @@ export async function main(argv: ParsedArgs): Promise { const config: ITelemetryServiceConfig = { appender: combinedAppender(...appenders), commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), installSourcePath), - piiPaths: [appRoot, extensionsPath] + piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot] }; services.set(ITelemetryService, new SyncDescriptor(TelemetryService, [config])); diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index e5e0f59d3ef..440b393833d 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -132,7 +132,7 @@ export interface IEnvironmentService { isExtensionDevelopment: boolean; disableExtensions: boolean | string[]; builtinExtensionsPath: string; - extensionsPath: string; + extensionsPath?: string; extensionDevelopmentLocationURI?: URI[]; extensionTestsLocationURI?: URI; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index fdad3b308e7..725e477449a 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -135,7 +135,7 @@ export class ExtensionManagementService extends Disposable implements IExtension ) { super(); this.systemExtensionsPath = environmentService.builtinExtensionsPath; - this.extensionsPath = environmentService.extensionsPath; + this.extensionsPath = environmentService.extensionsPath!; this.uninstalledPath = path.join(this.extensionsPath, '.obsolete'); this.uninstalledFileLimiter = new Queue(); this.manifestCache = this._register(new ExtensionsManifestCache(environmentService, this)); diff --git a/src/vs/platform/telemetry/node/telemetry.ts b/src/vs/platform/telemetry/node/telemetry.ts index 31b4ca31d46..626af4983ca 100644 --- a/src/vs/platform/telemetry/node/telemetry.ts +++ b/src/vs/platform/telemetry/node/telemetry.ts @@ -8,34 +8,36 @@ import { readdirSync } from 'vs/base/node/pfs'; import { statSync, readFileSync } from 'fs'; import { join } from 'vs/base/common/path'; -export function buildTelemetryMessage(appRoot: string, extensionsPath: string): string { - // Gets all the directories inside the extension directory - const dirs = readdirSync(extensionsPath).filter(files => { - // This handles case where broken symbolic links can cause statSync to throw and error - try { - return statSync(join(extensionsPath, files)).isDirectory(); - } catch { - return false; - } - }); - const telemetryJsonFolders: string[] = []; - dirs.forEach((dir) => { - const files = readdirSync(join(extensionsPath, dir)).filter(file => file === 'telemetry.json'); - // We know it contains a telemetry.json file so we add it to the list of folders which have one - if (files.length === 1) { - telemetryJsonFolders.push(dir); - } - }); +export function buildTelemetryMessage(appRoot: string, extensionsPath?: string): string { const mergedTelemetry = Object.create(null); // Simple function to merge the telemetry into one json object const mergeTelemetry = (contents: string, dirName: string) => { const telemetryData = JSON.parse(contents); mergedTelemetry[dirName] = telemetryData; }; - telemetryJsonFolders.forEach((folder) => { - const contents = readFileSync(join(extensionsPath, folder, 'telemetry.json')).toString(); - mergeTelemetry(contents, folder); - }); + if (extensionsPath) { + // Gets all the directories inside the extension directory + const dirs = readdirSync(extensionsPath).filter(files => { + // This handles case where broken symbolic links can cause statSync to throw and error + try { + return statSync(join(extensionsPath, files)).isDirectory(); + } catch { + return false; + } + }); + const telemetryJsonFolders: string[] = []; + dirs.forEach((dir) => { + const files = readdirSync(join(extensionsPath, dir)).filter(file => file === 'telemetry.json'); + // We know it contains a telemetry.json file so we add it to the list of folders which have one + if (files.length === 1) { + telemetryJsonFolders.push(dir); + } + }); + telemetryJsonFolders.forEach((folder) => { + const contents = readFileSync(join(extensionsPath, folder, 'telemetry.json')).toString(); + mergeTelemetry(contents, folder); + }); + } let contents = readFileSync(join(appRoot, 'telemetry-core.json')).toString(); mergeTelemetry(contents, 'vscode-core'); contents = readFileSync(join(appRoot, 'telemetry-extensions.json')).toString(); diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts index 56cb0142584..7e7448ef8ea 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -9,9 +9,9 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; -import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; @@ -42,19 +42,11 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { ExtensionDependencyChecker } from 'vs/workbench/contrib/extensions/browser/extensionsDependencyChecker'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; // Singletons registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService); -const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ConfigureRecommendedExtensionsCommandsContributor, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, LifecyclePhase.Starting); -workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, LifecyclePhase.Eventually); - Registry.as(OutputExtensions.OutputChannels) .registerChannel({ id: ExtensionsChannelId, label: ExtensionsLabel, log: false }); @@ -70,17 +62,6 @@ Registry.as(Extensions.Quickopen).registerQuickOpenHandler( ) ); -Registry.as(Extensions.Quickopen).registerQuickOpenHandler( - new QuickOpenHandlerDescriptor( - GalleryExtensionsHandler, - GalleryExtensionsHandler.ID, - 'ext install ', - undefined, - localize('galleryExtensionsCommands', "Install Gallery Extensions"), - true - ) -); - // Editor const editorDescriptor = new EditorDescriptor( ExtensionEditor, @@ -145,9 +126,6 @@ actionRegistry.registerWorkbenchAction(builtinActionDescriptor, 'Extensions: Sho const updateAllActionDescriptor = new SyncActionDescriptor(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL); actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, 'Extensions: Update All Extensions', ExtensionsLabel); -const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL); -actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel); - const installVSIXActionDescriptor = new SyncActionDescriptor(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL); actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel); @@ -349,4 +327,46 @@ MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { title: localize('showExtensions', "Extensions") }, order: 3 -}); \ No newline at end of file +}); + +const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); + +class ExtensionsContributions implements IWorkbenchContribution { + + constructor( + @IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService, + @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService + ) { + + const canManageExtensions = extensionManagementServerService.localExtensionManagementServer || extensionManagementServerService.remoteExtensionManagementServer; + + if (canManageExtensions) { + Registry.as(Extensions.Quickopen).registerQuickOpenHandler( + new QuickOpenHandlerDescriptor( + GalleryExtensionsHandler, + GalleryExtensionsHandler.ID, + 'ext install ', + undefined, + localize('galleryExtensionsCommands', "Install Gallery Extensions"), + true + ) + ); + } + + if (workbenchEnvironmentService.extensionsPath) { + const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL); + actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel); + } + + } + +} + +workbenchRegistry.registerWorkbenchContribution(ExtensionsContributions, LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ConfigureRecommendedExtensionsCommandsContributor, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 5ba999de322..c1fe0d73c90 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -2815,18 +2815,22 @@ export class OpenExtensionsFolderAction extends Action { } run(): Promise { - const extensionsHome = URI.file(this.environmentService.extensionsPath); + if (this.environmentService.extensionsPath) { - return Promise.resolve(this.fileService.resolve(extensionsHome)).then(file => { - let itemToShow: URI; - if (file.children && file.children.length > 0) { - itemToShow = file.children[0].resource; - } else { - itemToShow = extensionsHome; - } + const extensionsHome = URI.file(this.environmentService.extensionsPath); - return this.windowsService.showItemInFolder(itemToShow); - }); + return Promise.resolve(this.fileService.resolve(extensionsHome)).then(file => { + let itemToShow: URI; + if (file.children && file.children.length > 0) { + itemToShow = file.children[0].resource; + } else { + itemToShow = extensionsHome; + } + + return this.windowsService.showItemInFolder(itemToShow); + }); + } + return Promise.resolve(); } } diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index ff6cefe4491..2bd39c97554 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -149,7 +149,7 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService { isExtensionDevelopment: boolean; disableExtensions: boolean | string[]; builtinExtensionsPath: string; - extensionsPath: string; + extensionsPath?: string; extensionDevelopmentLocationURI?: URI[]; extensionTestsPath?: string; debugExtensionHost: IExtensionHostDebugParams; diff --git a/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts b/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts index 5583a243cb2..6eaaf220ce5 100644 --- a/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts +++ b/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts @@ -39,7 +39,7 @@ export class TelemetryService extends Disposable implements ITelemetryService { const config: ITelemetryServiceConfig = { appender: combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService)), commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.installSourcePath, environmentService.configuration.remoteAuthority), - piiPaths: [environmentService.appRoot, environmentService.extensionsPath] + piiPaths: environmentService.extensionsPath ? [environmentService.appRoot, environmentService.extensionsPath] : [environmentService.appRoot] }; this.impl = this._register(new BaseTelemetryService(config, configurationService)); From 88ac0fd7cf6364dbd41422fac99703157a43c035 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 18 Jul 2019 11:24:17 +0200 Subject: [PATCH 138/190] update gulp-atom-electron --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1dd944ac9ee..4177d62c91a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "fast-plist": "0.1.2", "glob": "^5.0.13", "gulp": "^4.0.0", - "gulp-atom-electron": "^1.20.0", + "gulp-atom-electron": "^1.21.1", "gulp-azure-storage": "^0.10.0", "gulp-buffer": "0.0.2", "gulp-concat": "^2.6.1", @@ -159,4 +159,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.4" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 6aa4b28cf28..00537c4bdfd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3763,10 +3763,10 @@ growl@1.9.2: resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8= -gulp-atom-electron@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/gulp-atom-electron/-/gulp-atom-electron-1.20.0.tgz#10b01f6a4c0257a8468c4da4ec9c67ecb28a32ed" - integrity sha512-gs7xvZvq8Mq60+DmbfCeXZnhqhOaJa/wrctix0RP/lCfSgusJnBTBssC6er1JIiqdHmQ8zFiYaYZh41mdG36kQ== +gulp-atom-electron@^1.21.1: + version "1.21.1" + resolved "https://registry.yarnpkg.com/gulp-atom-electron/-/gulp-atom-electron-1.21.1.tgz#4017144bf659fbbf7d0644664fcc47c64efac0f0" + integrity sha512-UHEf2pZrJD/u+AAzKCbhdPXaKrReFDa+OEJjBCAdN2SHnD+dfZqSJAz/u2OD6YR/eREuUbQOCw+VWUwex20klQ== dependencies: event-stream "3.3.4" github-releases-ms "^0.5.0" From 71b6beff35c7df83c6a2e4d78b01e0e67e41882c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 11:26:32 +0200 Subject: [PATCH 139/190] :lipstick: --- .../contrib/extensions/browser/extensionsActions.ts | 2 +- .../extensions/browser/extensionsWorkbenchService.ts | 6 +++--- src/vs/workbench/contrib/extensions/common/extensions.ts | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index c1fe0d73c90..1fb6bc1692c 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -2862,7 +2862,7 @@ export class InstallVSIXAction extends Action { return Promise.resolve(); } - return Promise.all(result.map(vsix => this.extensionsWorkbenchService.install(vsix))) + return Promise.all(result.map(vsix => this.extensionsWorkbenchService.install(URI.file(vsix)))) .then(extensions => { for (const extension of extensions) { const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local))); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index f9f0abe3e5c..572272c85c7 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -775,10 +775,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension return false; } - install(extension: string | IExtension): Promise { - if (typeof extension === 'string') { + install(extension: URI | IExtension): Promise { + if (extension instanceof URI) { return this.installWithProgress(async () => { - const { identifier } = await this.extensionService.install(URI.file(extension)); + const { identifier } = await this.extensionService.install(extension); this.checkAndEnableDisabledDependencies(identifier); return this.local.filter(local => areSameExtensions(local.identifier, identifier))[0]; }); diff --git a/src/vs/workbench/contrib/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts index e0e9a941d9c..86ca4b4b4fe 100644 --- a/src/vs/workbench/contrib/extensions/common/extensions.ts +++ b/src/vs/workbench/contrib/extensions/common/extensions.ts @@ -14,6 +14,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { Disposable } from 'vs/base/common/lifecycle'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IExtensionManifest, ExtensionType } from 'vs/platform/extensions/common/extensions'; +import { URI } from 'vs/base/common/uri'; export const VIEWLET_ID = 'workbench.view.extensions'; export const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID); @@ -81,7 +82,7 @@ export interface IExtensionsWorkbenchService { queryGallery(token: CancellationToken): Promise>; queryGallery(options: IQueryOptions, token: CancellationToken): Promise>; canInstall(extension: IExtension): boolean; - install(vsix: string): Promise; + install(vsix: URI): Promise; install(extension: IExtension, promptToInstallDependencies?: boolean): Promise; uninstall(extension: IExtension): Promise; installVersion(extension: IExtension, version: string): Promise; From fb0e9f7d0337ade4dd5fbd8450123140aba880bc Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Thu, 18 Jul 2019 11:56:22 +0200 Subject: [PATCH 140/190] cleanup ExtensionHostDebugService --- src/vs/code/electron-main/app.ts | 10 +- .../debug}/common/extensionHostDebug.ts | 0 .../debug}/common/extensionHostDebugIpc.ts | 61 ++++++++- .../api/browser/mainThreadConsole.ts | 2 +- .../workbench/browser/web.simpleservices.ts | 62 ++------- .../contrib/debug/browser/debugService.ts | 2 +- .../common/remoteExtensionHostClient.ts | 2 +- .../electron-browser/extensionHost.ts | 2 +- .../extensionHostDebugService.ts | 123 +----------------- 9 files changed, 77 insertions(+), 187 deletions(-) rename src/vs/{workbench/services/extensions => platform/debug}/common/extensionHostDebug.ts (100%) rename src/vs/{workbench/services/extensions => platform/debug}/common/extensionHostDebugIpc.ts (50%) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 5682c0664c6..f7e670c79b6 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -86,6 +86,7 @@ import { DiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsIpc' import { FileService } from 'vs/platform/files/common/fileService'; import { IFileService } from 'vs/platform/files/common/files'; import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; +import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; export class CodeApplication extends Disposable { @@ -279,12 +280,6 @@ export class CodeApplication extends Disposable { } }); - ipc.on('vscode:extensionHostDebug', (_: Event, windowId: number, broadcast: any) => { - if (this.windowsMainService) { - this.windowsMainService.sendToAll('vscode:extensionHostDebug', broadcast, [windowId]); // Send to all windows (except sender window) - } - }); - ipc.on('vscode:toggleDevTools', (event: Event) => event.sender.toggleDevTools()); ipc.on('vscode:openDevTools', (event: Event) => event.sender.openDevTools()); @@ -577,6 +572,9 @@ export class CodeApplication extends Disposable { electronIpcServer.registerChannel('loglevel', logLevelChannel); sharedProcessClient.then(client => client.registerChannel('loglevel', logLevelChannel)); + // ExtensionHost Debug broadcast service + electronIpcServer.registerChannel(ExtensionHostDebugBroadcastChannel.ChannelName, new ExtensionHostDebugBroadcastChannel()); + // Signal phase: ready (services set) this.lifecycleService.phase = LifecycleMainPhase.Ready; diff --git a/src/vs/workbench/services/extensions/common/extensionHostDebug.ts b/src/vs/platform/debug/common/extensionHostDebug.ts similarity index 100% rename from src/vs/workbench/services/extensions/common/extensionHostDebug.ts rename to src/vs/platform/debug/common/extensionHostDebug.ts diff --git a/src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts b/src/vs/platform/debug/common/extensionHostDebugIpc.ts similarity index 50% rename from src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts rename to src/vs/platform/debug/common/extensionHostDebugIpc.ts index e9410a83c83..af7f1e526b8 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts +++ b/src/vs/platform/debug/common/extensionHostDebugIpc.ts @@ -3,12 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { IReloadSessionEvent, ICloseSessionEvent, IAttachSessionEvent, ILogToSessionEvent, ITerminateSessionEvent } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { IServerChannel, IChannel } from 'vs/base/parts/ipc/common/ipc'; +import { IReloadSessionEvent, ICloseSessionEvent, IAttachSessionEvent, ILogToSessionEvent, ITerminateSessionEvent, IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; import { Event, Emitter } from 'vs/base/common/event'; +import { IRemoteConsoleLog } from 'vs/base/common/console'; -export class EchoChannel implements IServerChannel { +export class ExtensionHostDebugBroadcastChannel implements IServerChannel { + + static readonly ChannelName = 'extensionhostdebugservice'; private _onCloseEmitter = new Emitter(); private _onReloadEmitter = new Emitter(); @@ -16,7 +18,7 @@ export class EchoChannel implements IServerChannel private _onLogToEmitter = new Emitter(); private _onAttachEmitter = new Emitter(); - call(ctx: RemoteAgentConnectionContext, command: string, arg?: any): Promise { + call(ctx: TContext, command: string, arg?: any): Promise { switch (command) { case 'close': return Promise.resolve(this._onCloseEmitter.fire({ sessionId: arg[0] })); @@ -32,7 +34,7 @@ export class EchoChannel implements IServerChannel throw new Error('Method not implemented.'); } - listen(ctx: RemoteAgentConnectionContext, event: string, arg?: any): Event { + listen(ctx: TContext, event: string, arg?: any): Event { switch (event) { case 'close': return this._onCloseEmitter.event; @@ -48,3 +50,50 @@ export class EchoChannel implements IServerChannel throw new Error('Method not implemented.'); } } + +export class ExtensionHostDebugChannelClient implements IExtensionHostDebugService { + + _serviceBrand: any; + + constructor(private channel: IChannel) { } + + reload(sessionId: string): void { + this.channel.call('reload', [sessionId]); + } + + get onReload(): Event { + return this.channel.listen('reload'); + } + + close(sessionId: string): void { + this.channel.call('close', [sessionId]); + } + + get onClose(): Event { + return this.channel.listen('close'); + } + + attachSession(sessionId: string, port: number, subId?: string): void { + this.channel.call('attach', [sessionId, port, subId]); + } + + get onAttachSession(): Event { + return this.channel.listen('attach'); + } + + logToSession(sessionId: string, log: IRemoteConsoleLog): void { + this.channel.call('log', [sessionId, log]); + } + + get onLogToSession(): Event { + return this.channel.listen('log'); + } + + terminateSession(sessionId: string, subId?: string): void { + this.channel.call('terminate', [sessionId, subId]); + } + + get onTerminateSession(): Event { + return this.channel.listen('terminate'); + } +} \ No newline at end of file diff --git a/src/vs/workbench/api/browser/mainThreadConsole.ts b/src/vs/workbench/api/browser/mainThreadConsole.ts index af983213492..160f9f0b773 100644 --- a/src/vs/workbench/api/browser/mainThreadConsole.ts +++ b/src/vs/workbench/api/browser/mainThreadConsole.ts @@ -9,7 +9,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IRemoteConsoleLog, log, parse } from 'vs/base/common/console'; import { parseExtensionDevOptions } from 'vs/workbench/services/extensions/common/extensionDevOptions'; import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; @extHostNamedCustomer(MainContext.MainThreadConsole) export class MainThreadConsole implements MainThreadConsoleShape { diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index e5d4842aaa8..06e190a6ad8 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -24,8 +24,7 @@ import { IRecentlyOpened, IRecent, isRecentFile, isRecentFolder } from 'vs/platf import { ISerializableCommandAction } from 'vs/platform/actions/common/actions'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; import { ITunnelService } from 'vs/platform/remote/common/tunnel'; -import { IReloadSessionEvent, IExtensionHostDebugService, ICloseSessionEvent, IAttachSessionEvent, ILogToSessionEvent, ITerminateSessionEvent } from 'vs/workbench/services/extensions/common/extensionHostDebug'; -import { IRemoteConsoleLog } from 'vs/base/common/console'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; // tslint:disable-next-line: import-patterns import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; @@ -37,9 +36,9 @@ import { ParsedArgs } from 'vs/platform/environment/common/environment'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { toStoreData, restoreRecentlyOpened } from 'vs/platform/history/common/historyStorage'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { IChannel } from 'vs/base/parts/ipc/common/ipc'; // tslint:disable-next-line: import-patterns import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; +import { ExtensionHostDebugChannelClient, ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; //#region Download @@ -614,63 +613,18 @@ registerSingleton(IWindowService, SimpleWindowService); //#region ExtensionHostDebugService -export class SimpleExtensionHostDebugService implements IExtensionHostDebugService { - _serviceBrand: any; - - private channel: IChannel; +export class SimpleExtensionHostDebugService extends ExtensionHostDebugChannelClient { constructor( - @IRemoteAgentService private remoteAgentService: IRemoteAgentService + @IRemoteAgentService remoteAgentService: IRemoteAgentService ) { - const connection = this.remoteAgentService.getConnection(); - if (connection) { - this.channel = connection.getChannel('extensionhostdebugservice'); - } - } + const connection = remoteAgentService.getConnection(); - reload(sessionId: string): void { - if (this.channel) { - this.channel.call('reload', [sessionId]); + if (!connection) { + throw new Error('Missing agent connection'); } - } - get onReload(): Event { - return this.channel ? this.channel.listen('reload') : Event.None; - } - close(sessionId: string): void { - if (this.channel) { - this.channel.call('close', [sessionId]); - } - } - get onClose(): Event { - return this.channel ? this.channel.listen('close') : Event.None; - } - - attachSession(sessionId: string, port: number, subId?: string): void { - if (this.channel) { - this.channel.call('attach', [sessionId, port, subId]); - } - } - get onAttachSession(): Event { - return this.channel ? this.channel.listen('attach') : Event.None; - } - - logToSession(sessionId: string, log: IRemoteConsoleLog): void { - if (this.channel) { - this.channel.call('log', [sessionId, log]); - } - } - get onLogToSession(): Event { - return this.channel ? this.channel.listen('log') : Event.None; - } - - terminateSession(sessionId: string, subId?: string): void { - if (this.channel) { - this.channel.call('terminate', [sessionId, subId]); - } - } - get onTerminateSession(): Event { - return this.channel ? this.channel.listen('terminate') : Event.None; + super(connection.getChannel(ExtensionHostDebugBroadcastChannel.ChannelName)); } } registerSingleton(IExtensionHostDebugService, SimpleExtensionHostDebugService); diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index 0b24d9395b1..1ae35d5a248 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -45,7 +45,7 @@ import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_ import { isExtensionHostDebugging } from 'vs/workbench/contrib/debug/common/debugUtils'; import { isErrorWithActions, createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { RunOnceScheduler } from 'vs/base/common/async'; -import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; import { isCodeEditor } from 'vs/editor/browser/editorBrowser'; const DEBUG_BREAKPOINTS_KEY = 'debug.breakpoint'; diff --git a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts index 9dc5b940cf1..c9b9ef57c67 100644 --- a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts +++ b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts @@ -24,7 +24,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { PersistentProtocol } from 'vs/base/parts/ipc/common/ipc.net'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { VSBuffer } from 'vs/base/common/buffer'; -import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; import { IProductService } from 'vs/platform/product/common/product'; import { ISignService } from 'vs/platform/sign/common/sign'; diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index 7b8225ca6ac..4d11f6a9459 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -35,7 +35,7 @@ import { withNullAsUndefined } from 'vs/base/common/types'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { parseExtensionDevOptions } from '../common/extensionDevOptions'; import { VSBuffer } from 'vs/base/common/buffer'; -import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; import { IExtensionHostStarter } from 'vs/workbench/services/extensions/common/extensions'; import { isEqualOrParent } from 'vs/base/common/resources'; diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts index aa4a35f54dd..e292a9ecd31 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts @@ -3,128 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, Emitter } from 'vs/base/common/event'; -import { IWindowService } from 'vs/platform/windows/common/windows'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IExtensionHostDebugService, IAttachSessionEvent, ITerminateSessionEvent, ILogToSessionEvent, IReloadSessionEvent, ICloseSessionEvent } from 'vs/workbench/services/extensions/common/extensionHostDebug'; -import { IRemoteConsoleLog } from 'vs/base/common/console'; -import { ipcRenderer as ipc } from 'electron'; +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; +import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService'; +import { ExtensionHostDebugChannelClient, ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; -interface IReloadBroadcast extends IReloadSessionEvent { - type: 'vscode:extensionReload'; -} - -interface IAttachSessionBroadcast extends IAttachSessionEvent { - type: 'vscode:extensionAttach'; -} - -interface ICloseBroadcast extends ICloseSessionEvent { - type: 'vscode:extensionCloseExtensionHost'; -} - -interface ILogToSessionBroadcast extends ILogToSessionEvent { - type: 'vscode:extensionLog'; -} - -interface ITerminateSessionBroadcast extends ITerminateSessionEvent { - type: 'vscode:extensionTerminate'; -} - -const CHANNEL = 'vscode:extensionHostDebug'; - -class ExtensionHostDebugService implements IExtensionHostDebugService { - _serviceBrand: any; - - private windowId: number; - private readonly _onReload = new Emitter(); - private readonly _onClose = new Emitter(); - private readonly _onAttachSession = new Emitter(); - private readonly _onLogToSession = new Emitter(); - private readonly _onTerminateSession = new Emitter(); +export class ExtensionHostDebugService extends ExtensionHostDebugChannelClient { constructor( - @IWindowService readonly windowService: IWindowService, + @IMainProcessService readonly windowService: IMainProcessService, ) { - this.windowId = windowService.windowId; - - ipc.on(CHANNEL, (_: unknown, broadcast: IReloadBroadcast | ICloseBroadcast | IAttachSessionBroadcast | ILogToSessionBroadcast | ITerminateSessionBroadcast) => { - switch (broadcast.type) { - case 'vscode:extensionReload': - this._onReload.fire(broadcast); - break; - case 'vscode:extensionCloseExtensionHost': - this._onClose.fire(broadcast); - break; - case 'vscode:extensionAttach': - this._onAttachSession.fire(broadcast); - break; - case 'vscode:extensionLog': - this._onLogToSession.fire(broadcast); - break; - case 'vscode:extensionTerminate': - this._onTerminateSession.fire(broadcast); - break; - } - }); - } - - reload(sessionId: string): void { - ipc.send(CHANNEL, this.windowId, { - type: 'vscode:extensionReload', - sessionId - }); - } - - get onReload(): Event { - return this._onReload.event; - } - - close(sessionId: string): void { - ipc.send(CHANNEL, this.windowId, { - type: 'vscode:extensionCloseExtensionHost', - sessionId - }); - } - - get onClose(): Event { - return this._onClose.event; - } - - attachSession(sessionId: string, port: number, subId?: string): void { - ipc.send(CHANNEL, this.windowId, { - type: 'vscode:extensionAttach', - sessionId, - port, - subId - }); - } - - get onAttachSession(): Event { - return this._onAttachSession.event; - } - - logToSession(sessionId: string, log: IRemoteConsoleLog): void { - ipc.send(CHANNEL, this.windowId, { - type: 'vscode:extensionLog', - sessionId, - log - }); - } - - get onLogToSession(): Event { - return this._onLogToSession.event; - } - - terminateSession(sessionId: string, subId?: string): void { - ipc.send(CHANNEL, this.windowId, { - type: 'vscode:extensionTerminate', - sessionId, - subId - }); - } - - get onTerminateSession(): Event { - return this._onTerminateSession.event; + super(windowService.getChannel(ExtensionHostDebugBroadcastChannel.ChannelName)); } } From db8cc94a06f7767e8273a7407ba7aaed57ac130e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 11:44:35 +0200 Subject: [PATCH 141/190] Move enablement and servers to workbench --- .../common/extensionManagement.ts | 61 ---------------- .../api/browser/mainThreadExtensionService.ts | 2 +- .../workbench/browser/web.simpleservices.ts | 3 +- .../experimentService.test.ts | 4 +- .../browser/extensions.contribution.ts | 3 +- .../extensions/browser/extensionsActions.ts | 3 +- .../extensions/browser/extensionsList.ts | 2 +- .../extensions/browser/extensionsViewlet.ts | 3 +- .../extensions/browser/extensionsViews.ts | 3 +- .../extensions/browser/extensionsWidgets.ts | 3 +- .../browser/extensionsWorkbenchService.ts | 3 +- .../contrib/extensions/common/extensions.ts | 3 +- .../extensions/common/extensionsUtils.ts | 3 +- .../runtimeExtensionsEditor.ts | 2 +- .../extensionsActions.test.ts | 5 +- .../extensionsTipsService.test.ts | 3 +- .../electron-browser/extensionsViews.test.ts | 5 +- .../extensionsWorkbenchService.test.ts | 5 +- .../format/browser/formatActionsMultiple.ts | 2 +- .../issue/electron-browser/issueService.ts | 3 +- .../preferences/browser/preferencesSearch.ts | 3 +- .../welcome/page/browser/welcomePage.ts | 3 +- .../common/extensionManagement.ts | 71 +++++++++++++++++++ .../extensionManagementServerService.ts | 2 +- .../common/extensionManagementService.ts | 4 +- .../extensionManagementServerService.ts | 3 +- .../node/extensionEnablementService.ts | 3 +- .../extensionEnablementService.test.ts | 3 +- .../extensions/browser/extensionService.ts | 2 +- .../common/abstractExtensionService.ts | 2 +- .../common/inactiveExtensionUrlHandler.ts | 3 +- .../cachedExtensionScanner.ts | 2 +- .../electron-browser/extensionService.ts | 3 +- 33 files changed, 128 insertions(+), 97 deletions(-) create mode 100644 src/vs/workbench/services/extensionManagement/common/extensionManagement.ts diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 0c4035b4a8f..21b66fa717c 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -206,67 +206,6 @@ export interface IExtensionManagementService { updateMetadata(local: ILocalExtension, metadata: IGalleryMetadata): Promise; } -export const IExtensionManagementServerService = createDecorator('extensionManagementServerService'); - -export interface IExtensionManagementServer { - extensionManagementService: IExtensionManagementService; - authority: string; - label: string; -} - -export interface IExtensionManagementServerService { - _serviceBrand: any; - readonly localExtensionManagementServer: IExtensionManagementServer | null; - readonly remoteExtensionManagementServer: IExtensionManagementServer | null; - getExtensionManagementServer(location: URI): IExtensionManagementServer | null; -} - -export const enum EnablementState { - Disabled, - WorkspaceDisabled, - Enabled, - WorkspaceEnabled -} - -export const IExtensionEnablementService = createDecorator('extensionEnablementService'); - -export interface IExtensionEnablementService { - _serviceBrand: any; - - readonly allUserExtensionsDisabled: boolean; - - /** - * Event to listen on for extension enablement changes - */ - onEnablementChanged: Event; - - /** - * Returns the enablement state for the given extension - */ - getEnablementState(extension: IExtension): EnablementState; - - /** - * Returns `true` if the enablement can be changed. - */ - canChangeEnablement(extension: IExtension): boolean; - - /** - * Returns `true` if the given extension identifier is enabled. - */ - isEnabled(extension: IExtension): boolean; - - /** - * Enable or disable the given extension. - * if `workspace` is `true` then enablement is done for workspace, otherwise globally. - * - * Returns a promise that resolves to boolean value. - * if resolves to `true` then requires restart for the change to take effect. - * - * Throws error if enablement is requested for workspace and there is no workspace - */ - setEnablement(extensions: IExtension[], state: EnablementState): Promise; -} - export interface IExtensionsConfigContent { recommendations: string[]; unwantedRecommendations: string[]; diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts index 3089f46e97b..8a63fccb827 100644 --- a/src/vs/workbench/api/browser/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/browser/mainThreadExtensionService.ts @@ -12,7 +12,7 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio import { INotificationService } from 'vs/platform/notification/common/notification'; import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions'; diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 06e190a6ad8..e92ca34d171 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -11,7 +11,8 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' // tslint:disable-next-line: import-patterns no-standalone-editor import { IDownloadService } from 'vs/platform/download/common/download'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation, IExtensionEnablementService, EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionType, ExtensionIdentifier, IExtension } from 'vs/platform/extensions/common/extensions'; import { IURLHandler, IURLService } from 'vs/platform/url/common/url'; import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts index fdea7523dbb..f44b4d3904e 100644 --- a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts +++ b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts @@ -10,9 +10,9 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; import { - IExtensionManagementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, - IExtensionEnablementService, ILocalExtension + IExtensionManagementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { Emitter } from 'vs/base/common/event'; import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts index 7e7448ef8ea..eb55efed49b 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -9,7 +9,8 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 1fb6bc1692c..b4e68f57be4 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -15,7 +15,8 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; -import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts index 0946dc134d9..cbb9f190f03 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts @@ -17,7 +17,7 @@ import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, Malic import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { Label, RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget, TooltipWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index d9272d6d014..9d24e8584de 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -24,7 +24,8 @@ import { ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ShowBuiltInExtensionsAction, InstallVSIXAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; -import { IExtensionManagementService, IExtensionManagementServerService, IExtensionManagementServer, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import { ExtensionsListView, EnabledExtensionsView, DisabledExtensionsView, RecommendedExtensionsView, WorkspaceRecommendedExtensionsView, BuiltInExtensionsView, BuiltInThemesExtensionsView, BuiltInBasicsExtensionsView, ServerExtensionsView, DefaultRecommendedExtensionsView } from 'vs/workbench/contrib/extensions/browser/extensionsViews'; import { OpenGlobalSettingsAction } from 'vs/workbench/contrib/preferences/browser/preferencesActions'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts index 4b160a91004..8aad9e22872 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts @@ -9,7 +9,8 @@ import { assign } from 'vs/base/common/objects'; import { Event, Emitter } from 'vs/base/common/event'; import { isPromiseCanceledError, getErrorMessage } from 'vs/base/common/errors'; import { PagedModel, IPagedModel, IPager, DelayedPagedModel } from 'vs/base/common/paging'; -import { SortBy, SortOrder, IQueryOptions, IExtensionTipsService, IExtensionRecommendation, IExtensionManagementServer, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { SortBy, SortOrder, IQueryOptions, IExtensionTipsService, IExtensionRecommendation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts index 6d8e9578422..9b27879aa2e 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts @@ -9,7 +9,8 @@ import { IExtension, IExtensionsWorkbenchService, IExtensionContainer, Extension import { append, $, addClass } from 'vs/base/browser/dom'; import * as platform from 'vs/base/common/platform'; import { localize } from 'vs/nls'; -import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ILabelService } from 'vs/platform/label/common/label'; import { extensionButtonProminentBackground, extensionButtonProminentForeground, DisabledLabelAction, ReloadAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 572272c85c7..a3084a6de46 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -14,8 +14,9 @@ import { IPager, mapPager, singlePagePager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, IQueryOptions, - InstallExtensionEvent, DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionIdentifier, EnablementState, IExtensionManagementServerService, IExtensionManagementServer + InstallExtensionEvent, DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData, areSameExtensions, getMaliciousExtensionsSet, groupByExtension, ExtensionIdentifierWithVersion } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; diff --git a/src/vs/workbench/contrib/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts index 86ca4b4b4fe..5e6d7cf3993 100644 --- a/src/vs/workbench/contrib/extensions/common/extensions.ts +++ b/src/vs/workbench/contrib/extensions/common/extensions.ts @@ -7,7 +7,8 @@ import { IViewlet } from 'vs/workbench/common/viewlet'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Event } from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; -import { IQueryOptions, EnablementState, ILocalExtension, IGalleryExtension, IExtensionIdentifier, IExtensionManagementServer } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IQueryOptions, ILocalExtension, IGalleryExtension, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { EnablementState, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views'; import { Registry } from 'vs/platform/registry/common/platform'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts index edf2a12d6fd..87af1da1d88 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts @@ -9,7 +9,8 @@ import { Event } from 'vs/base/common/event'; import { onUnexpectedError } from 'vs/base/common/errors'; import { Disposable } from 'vs/base/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService, IExtensionTipsService, IExtensionIdentifier, EnablementState, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, ILocalExtension, IExtensionTipsService, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts index d5666b2f5f8..92c40276e84 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -23,7 +23,7 @@ import { ActionBar, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { RunOnceScheduler } from 'vs/base/common/async'; import { clipboard } from 'electron'; -import { EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { writeFile } from 'vs/base/node/pfs'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 19740cf5365..e9b47535d20 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -10,9 +10,10 @@ import { IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/c import * as ExtensionsActions from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, - DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService, IExtensionManagementServer + IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, + DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts index eb1c1c0aa08..cd6d14c858d 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts @@ -12,8 +12,9 @@ import * as uuid from 'vs/base/common/uuid'; import { mkdirp, rimraf, RimRafMode } from 'vs/base/node/pfs'; import { IExtensionGalleryService, IGalleryExtensionAssets, IGalleryExtension, IExtensionManagementService, - IExtensionEnablementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier + DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 67ae23cae17..84a2299389a 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -11,9 +11,10 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions, - DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, IExtensionManagementServerService, EnablementState, ExtensionRecommendationReason, SortBy, IExtensionManagementServer + IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions, + DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, ExtensionRecommendationReason, SortBy } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index a6b3f07d04c..d2285753ef2 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -11,9 +11,10 @@ import { generateUuid } from 'vs/base/common/uuid'; import { IExtensionsWorkbenchService, ExtensionState, AutoCheckUpdatesConfigurationKey, AutoUpdateConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, - DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IGalleryExtensionAssets, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService + IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, + DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IGalleryExtensionAssets, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts index 496534157ce..4b726da442f 100644 --- a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts +++ b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts @@ -27,7 +27,7 @@ import { ITextModel } from 'vs/editor/common/model'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ILabelService } from 'vs/platform/label/common/label'; -import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; type FormattingEditProvider = DocumentFormattingEditProvider | DocumentRangeFormattingEditProvider; diff --git a/src/vs/workbench/contrib/issue/electron-browser/issueService.ts b/src/vs/workbench/contrib/issue/electron-browser/issueService.ts index 203cacfd8e1..e93eac14556 100644 --- a/src/vs/workbench/contrib/issue/electron-browser/issueService.ts +++ b/src/vs/workbench/contrib/issue/electron-browser/issueService.ts @@ -7,7 +7,8 @@ import { IssueReporterStyles, IIssueService, IssueReporterData, ProcessExplorerD import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { textLinkForeground, inputBackground, inputBorder, inputForeground, buttonBackground, buttonHoverBackground, buttonForeground, inputValidationErrorBorder, foreground, inputActiveOptionBorder, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, editorBackground, editorForeground, listHoverBackground, listHoverForeground, listHighlightForeground, textLinkActiveForeground } from 'vs/platform/theme/common/colorRegistry'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; -import { IExtensionManagementService, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { webFrame } from 'electron'; import { assign } from 'vs/base/common/objects'; import { IWorkbenchIssueService } from 'vs/workbench/contrib/issue/electron-browser/issue'; diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts index ac442c4d75e..2887abfc0f3 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts @@ -15,7 +15,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { Disposable } from 'vs/base/common/lifecycle'; import { IPreferencesSearchService, ISearchProvider, IWorkbenchSettingsConfiguration } from 'vs/workbench/contrib/preferences/common/preferences'; import { IRequestService, asJson } from 'vs/platform/request/common/request'; -import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ILogService } from 'vs/platform/log/common/log'; import { CancellationToken } from 'vs/base/common/cancellation'; import { canceled } from 'vs/base/common/errors'; diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts index 64a9afe8fe8..b33fed82b15 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts @@ -22,7 +22,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Schemas } from 'vs/base/common/network'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/contrib/extensions/common/extensionsUtils'; -import { IExtensionEnablementService, IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, EnablementState, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { used } from 'vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page'; import { ILifecycleService, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { Disposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts new file mode 100644 index 00000000000..be68a990b34 --- /dev/null +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts @@ -0,0 +1,71 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Event } from 'vs/base/common/event'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { URI } from 'vs/base/common/uri'; +import { IExtension } from 'vs/platform/extensions/common/extensions'; +import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; + +export const IExtensionManagementServerService = createDecorator('extensionManagementServerService'); + +export interface IExtensionManagementServer { + extensionManagementService: IExtensionManagementService; + authority: string; + label: string; +} + +export interface IExtensionManagementServerService { + _serviceBrand: any; + readonly localExtensionManagementServer: IExtensionManagementServer | null; + readonly remoteExtensionManagementServer: IExtensionManagementServer | null; + getExtensionManagementServer(location: URI): IExtensionManagementServer | null; +} + +export const enum EnablementState { + Disabled, + WorkspaceDisabled, + Enabled, + WorkspaceEnabled +} + +export const IExtensionEnablementService = createDecorator('extensionEnablementService'); + +export interface IExtensionEnablementService { + _serviceBrand: any; + + readonly allUserExtensionsDisabled: boolean; + + /** + * Event to listen on for extension enablement changes + */ + onEnablementChanged: Event; + + /** + * Returns the enablement state for the given extension + */ + getEnablementState(extension: IExtension): EnablementState; + + /** + * Returns `true` if the enablement can be changed. + */ + canChangeEnablement(extension: IExtension): boolean; + + /** + * Returns `true` if the given extension identifier is enabled. + */ + isEnabled(extension: IExtension): boolean; + + /** + * Enable or disable the given extension. + * if `workspace` is `true` then enablement is done for workspace, otherwise globally. + * + * Returns a promise that resolves to boolean value. + * if resolves to `true` then requires restart for the change to take effect. + * + * Throws error if enablement is requested for workspace and there is no workspace + */ + setEnablement(extensions: IExtension[], state: EnablementState): Promise; +} diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts index fda5c0332b9..0a48d2989fb 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { URI } from 'vs/base/common/uri'; -import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts index 825d9ef62e6..ff5534b4901 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts @@ -5,9 +5,9 @@ import { Event, EventMultiplexer } from 'vs/base/common/event'; import { - IExtensionManagementService, ILocalExtension, IGalleryExtension, InstallExtensionEvent, DidInstallExtensionEvent, IExtensionIdentifier, DidUninstallExtensionEvent, IReportedExtension, IGalleryMetadata, - IExtensionManagementServerService, IExtensionManagementServer, IExtensionGalleryService + IExtensionManagementService, ILocalExtension, IGalleryExtension, InstallExtensionEvent, DidInstallExtensionEvent, IExtensionIdentifier, DidUninstallExtensionEvent, IReportedExtension, IGalleryMetadata, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionType, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { URI } from 'vs/base/common/uri'; import { Disposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts index c5b08097ce4..c3921f17a54 100644 --- a/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService.ts @@ -6,7 +6,8 @@ import { localize } from 'vs/nls'; import { Schemas } from 'vs/base/common/network'; import { URI } from 'vs/base/common/uri'; -import { IExtensionManagementServer, IExtensionManagementServerService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; diff --git a/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts index 705ea4028c1..d4243701c05 100644 --- a/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts @@ -6,7 +6,8 @@ import { localize } from 'vs/nls'; import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionIdentifier, EnablementState, DidInstallExtensionEvent, InstallOperation, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionIdentifier, DidInstallExtensionEvent, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IStorageService, StorageScope, IWorkspaceStorageChangeEvent } from 'vs/platform/storage/common/storage'; diff --git a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts index ec939ce04b0..99b4fa29e22 100644 --- a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts +++ b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import * as sinon from 'sinon'; -import { IExtensionManagementService, IExtensionEnablementService, DidUninstallExtensionEvent, EnablementState, ILocalExtension, DidInstallExtensionEvent, InstallOperation, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, DidUninstallExtensionEvent, ILocalExtension, DidInstallExtensionEvent, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionEnablementService } from 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { Emitter } from 'vs/base/common/event'; diff --git a/src/vs/workbench/services/extensions/browser/extensionService.ts b/src/vs/workbench/services/extensions/browser/extensionService.ts index 23fa0b21c4a..14d0da31fad 100644 --- a/src/vs/workbench/services/extensions/browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/browser/extensionService.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts index f19abf44e9b..eed7a616357 100644 --- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts @@ -10,7 +10,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import * as perf from 'vs/base/common/performance'; import { isEqualOrParent } from 'vs/base/common/resources'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { BetterMergeId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts b/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts index 351bbe5ddc9..28503d4e7dc 100644 --- a/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts +++ b/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts @@ -8,7 +8,8 @@ import { Action } from 'vs/base/common/actions'; import { IDisposable, toDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { EnablementState, IExtensionEnablementService, IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { INotificationHandle, INotificationService, Severity } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts index f24f320674b..737395b0d42 100644 --- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts +++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts @@ -15,7 +15,7 @@ import { originalFSPath } from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; import * as pfs from 'vs/base/node/pfs'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { BUILTIN_MANIFEST_CACHE_FILE, MANIFEST_CACHE_FOLDER, USER_MANIFEST_CACHE_FILE, ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import pkg from 'vs/platform/product/node/package'; import product from 'vs/platform/product/node/product'; diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index 4d8357796eb..4c580ce9e6d 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -14,7 +14,8 @@ import * as path from 'vs/base/common/path'; import { runWhenIdle } from 'vs/base/common/async'; import { URI } from 'vs/base/common/uri'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionEnablementService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInitDataProvider, RemoteExtensionHostClient } from 'vs/workbench/services/extensions/common/remoteExtensionHostClient'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; From 6d09bf0f80f96ed07e0f1d74991b87c8de8e2e8e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 11:51:13 +0200 Subject: [PATCH 142/190] Move extensions tips service to workbench --- .../common/extensionManagement.ts | 44 ------------------- .../workbench/browser/web.simpleservices.ts | 4 +- .../extensions/browser/extensionEditor.ts | 2 +- .../extensions/browser/extensionsActions.ts | 4 +- .../extensions/browser/extensionsViews.ts | 4 +- .../extensions/browser/extensionsWidgets.ts | 3 +- .../extensions/common/extensionsUtils.ts | 4 +- .../electron-browser/extensionTipsService.ts | 6 +-- .../extensions.contribution.ts | 2 +- .../extensionsActions.test.ts | 4 +- .../electron-browser/extensionsViews.test.ts | 6 +-- .../extensionsWorkbenchService.test.ts | 4 +- .../welcome/page/browser/welcomePage.ts | 4 +- .../common/extensionManagement.ts | 44 +++++++++++++++++++ 14 files changed, 66 insertions(+), 69 deletions(-) diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 21b66fa717c..b075553498d 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -8,7 +8,6 @@ import { Event } from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { URI } from 'vs/base/common/uri'; -import { IWorkspaceFolder, IWorkspace } from 'vs/platform/workspace/common/workspace'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IExtensionManifest, IExtension, ExtensionType } from 'vs/platform/extensions/common/extensions'; @@ -206,49 +205,6 @@ export interface IExtensionManagementService { updateMetadata(local: ILocalExtension, metadata: IGalleryMetadata): Promise; } -export interface IExtensionsConfigContent { - recommendations: string[]; - unwantedRecommendations: string[]; -} - -export type RecommendationChangeNotification = { - extensionId: string, - isRecommended: boolean -}; - -export type DynamicRecommendation = 'dynamic'; -export type ExecutableRecommendation = 'executable'; -export type CachedRecommendation = 'cached'; -export type ApplicationRecommendation = 'application'; -export type ExtensionRecommendationSource = IWorkspace | IWorkspaceFolder | URI | DynamicRecommendation | ExecutableRecommendation | CachedRecommendation | ApplicationRecommendation; - -export interface IExtensionRecommendation { - extensionId: string; - sources: ExtensionRecommendationSource[]; -} - -export const IExtensionTipsService = createDecorator('extensionTipsService'); - -export interface IExtensionTipsService { - _serviceBrand: any; - getAllRecommendationsWithReason(): { [id: string]: { reasonId: ExtensionRecommendationReason, reasonText: string }; }; - getFileBasedRecommendations(): IExtensionRecommendation[]; - getOtherRecommendations(): Promise; - getWorkspaceRecommendations(): Promise; - getKeymapRecommendations(): IExtensionRecommendation[]; - toggleIgnoredRecommendation(extensionId: string, shouldIgnore: boolean): void; - getAllIgnoredRecommendations(): { global: string[], workspace: string[] }; - onRecommendationChange: Event; -} - -export const enum ExtensionRecommendationReason { - Workspace, - File, - Executable, - DynamicWorkspace, - Experimental -} - export const ExtensionsLabel = localize('extensions', "Extensions"); export const ExtensionsChannelId = 'extensions'; export const PreferencesLabel = localize('preferences', "Preferences"); diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index e92ca34d171..099f2db171d 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -11,8 +11,8 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' // tslint:disable-next-line: import-patterns no-standalone-editor import { IDownloadService } from 'vs/platform/download/common/download'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ExtensionType, ExtensionIdentifier, IExtension } from 'vs/platform/extensions/common/extensions'; import { IURLHandler, IURLService } from 'vs/platform/url/common/url'; import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 714ee465961..5456cb5f4a7 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -20,7 +20,7 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IExtensionManifest, IKeyBinding, IView, IViewContainer, ExtensionType } from 'vs/platform/extensions/common/extensions'; import { ResolvedKeybinding, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index b4e68f57be4..4a68163faa6 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -15,8 +15,8 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; -import { IExtensionTipsService, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { ExtensionsLabel, IGalleryExtension, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionTipsService, IExtensionRecommendation, IExtensionsConfigContent } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts index 8aad9e22872..2e889a62b7f 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts @@ -9,8 +9,8 @@ import { assign } from 'vs/base/common/objects'; import { Event, Emitter } from 'vs/base/common/event'; import { isPromiseCanceledError, getErrorMessage } from 'vs/base/common/errors'; import { PagedModel, IPagedModel, IPager, DelayedPagedModel } from 'vs/base/common/paging'; -import { SortBy, SortOrder, IQueryOptions, IExtensionTipsService, IExtensionRecommendation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionManagementServer, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { SortBy, SortOrder, IQueryOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementServer, IExtensionManagementServerService, IExtensionTipsService, IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts index 9b27879aa2e..fd3ec77d79d 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts @@ -9,8 +9,7 @@ import { IExtension, IExtensionsWorkbenchService, IExtensionContainer, Extension import { append, $, addClass } from 'vs/base/browser/dom'; import * as platform from 'vs/base/common/platform'; import { localize } from 'vs/nls'; -import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ILabelService } from 'vs/platform/label/common/label'; import { extensionButtonProminentBackground, extensionButtonProminentForeground, DisabledLabelAction, ReloadAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts index 87af1da1d88..282978991f9 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts @@ -9,8 +9,8 @@ import { Event } from 'vs/base/common/event'; import { onUnexpectedError } from 'vs/base/common/errors'; import { Disposable } from 'vs/base/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtensionManagementService, ILocalExtension, IExtensionTipsService, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, ILocalExtension, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts index 816a5521610..f4af7a1c9b6 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts @@ -9,10 +9,8 @@ import { forEach } from 'vs/base/common/collections'; import { Disposable } from 'vs/base/common/lifecycle'; import { match } from 'vs/base/common/glob'; import * as json from 'vs/base/common/json'; -import { - IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ExtensionRecommendationReason, EXTENSION_IDENTIFIER_PATTERN, - IExtensionsConfigContent, RecommendationChangeNotification, IExtensionRecommendation, ExtensionRecommendationSource, InstallOperation, ILocalExtension -} from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, IExtensionGalleryService, EXTENSION_IDENTIFIER_PATTERN, InstallOperation, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService, ExtensionRecommendationReason, IExtensionsConfigContent, RecommendationChangeNotification, IExtensionRecommendation, ExtensionRecommendationSource } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ITextModel } from 'vs/editor/common/model'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts index b2982429480..643c6e1b456 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index e9b47535d20..ab4af28558b 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -10,10 +10,10 @@ import { IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/c import * as ExtensionsActions from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, + IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 84a2299389a..00b4e80ab1f 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -11,10 +11,10 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions, - DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, ExtensionRecommendationReason, SortBy + IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, IQueryOptions, + DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, SortBy } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IExtensionTipsService, ExtensionRecommendationReason } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index d2285753ef2..ff52c3d1cda 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -11,10 +11,10 @@ import { generateUuid } from 'vs/base/common/uuid'; import { IExtensionsWorkbenchService, ExtensionState, AutoCheckUpdatesConfigurationKey, AutoUpdateConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; import { - IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension, IGalleryExtension, + IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IGalleryExtensionAssets, IExtensionIdentifier, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts index b33fed82b15..8317f147dfa 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts @@ -22,8 +22,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Schemas } from 'vs/base/common/network'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/contrib/extensions/common/extensionsUtils'; -import { IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionManagementService, IExtensionGalleryService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { used } from 'vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page'; import { ILifecycleService, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { Disposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts index be68a990b34..5bab26ebce4 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts @@ -8,6 +8,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' import { URI } from 'vs/base/common/uri'; import { IExtension } from 'vs/platform/extensions/common/extensions'; import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IWorkspace, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; export const IExtensionManagementServerService = createDecorator('extensionManagementServerService'); @@ -69,3 +70,46 @@ export interface IExtensionEnablementService { */ setEnablement(extensions: IExtension[], state: EnablementState): Promise; } + +export interface IExtensionsConfigContent { + recommendations: string[]; + unwantedRecommendations: string[]; +} + +export type RecommendationChangeNotification = { + extensionId: string, + isRecommended: boolean +}; + +export type DynamicRecommendation = 'dynamic'; +export type ExecutableRecommendation = 'executable'; +export type CachedRecommendation = 'cached'; +export type ApplicationRecommendation = 'application'; +export type ExtensionRecommendationSource = IWorkspace | IWorkspaceFolder | URI | DynamicRecommendation | ExecutableRecommendation | CachedRecommendation | ApplicationRecommendation; + +export interface IExtensionRecommendation { + extensionId: string; + sources: ExtensionRecommendationSource[]; +} + +export const IExtensionTipsService = createDecorator('extensionTipsService'); + +export interface IExtensionTipsService { + _serviceBrand: any; + getAllRecommendationsWithReason(): { [id: string]: { reasonId: ExtensionRecommendationReason, reasonText: string }; }; + getFileBasedRecommendations(): IExtensionRecommendation[]; + getOtherRecommendations(): Promise; + getWorkspaceRecommendations(): Promise; + getKeymapRecommendations(): IExtensionRecommendation[]; + toggleIgnoredRecommendation(extensionId: string, shouldIgnore: boolean): void; + getAllIgnoredRecommendations(): { global: string[], workspace: string[] }; + onRecommendationChange: Event; +} + +export const enum ExtensionRecommendationReason { + Workspace, + File, + Executable, + DynamicWorkspace, + Experimental +} From 02b527084209e35d337596f2838cab961c5ca214 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 11:59:16 +0200 Subject: [PATCH 143/190] fix icon urls --- .../contrib/extensions/browser/extensionsWorkbenchService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index a3084a6de46..46d215b018a 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -36,6 +36,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { IExtensionManifest, ExtensionType, IExtension as IPlatformExtension, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IProductService } from 'vs/platform/product/common/product'; +import { asDomUri } from 'vs/base/browser/dom'; interface IExtensionStateProvider { (extension: Extension): T; @@ -130,7 +131,7 @@ class Extension implements IExtension { private get localIconUrl(): string | null { if (this.local && this.local.manifest.icon) { - return resources.joinPath(this.local.location, this.local.manifest.icon).toString(); + return asDomUri(resources.joinPath(this.local.location, this.local.manifest.icon)).toString(); } return null; } From 75ce377f744644792d010f30996128d0e9049f79 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 12:15:39 +0200 Subject: [PATCH 144/190] Support enablement in web --- .../{node => common}/extensionEnablementService.ts | 0 .../test/electron-browser/extensionEnablementService.test.ts | 2 +- src/vs/workbench/workbench.main.ts | 2 +- src/vs/workbench/workbench.web.main.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/vs/workbench/services/extensionManagement/{node => common}/extensionEnablementService.ts (100%) diff --git a/src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts similarity index 100% rename from src/vs/workbench/services/extensionManagement/node/extensionEnablementService.ts rename to src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts diff --git a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts index 99b4fa29e22..29f0ad1ef3f 100644 --- a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts +++ b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { IExtensionManagementService, DidUninstallExtensionEvent, ILocalExtension, DidInstallExtensionEvent, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { ExtensionEnablementService } from 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; +import { ExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionEnablementService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { Emitter } from 'vs/base/common/event'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 7ade525b350..633fac6915a 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -124,11 +124,11 @@ import 'vs/workbench/services/textfile/common/textResourcePropertiesService'; import 'vs/workbench/services/mode/common/workbenchModeService'; import 'vs/workbench/services/commands/common/commandService'; import 'vs/workbench/services/themes/browser/workbenchThemeService'; -import 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import 'vs/workbench/services/extensions/electron-browser/extensionService'; import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; import 'vs/workbench/services/label/common/labelService'; import 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; +import 'vs/workbench/services/extensionManagement/common/extensionEnablementService'; import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; import 'vs/workbench/services/window/electron-browser/windowService'; diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index da6555d131f..d7ed222d705 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -118,11 +118,11 @@ import 'vs/workbench/services/textfile/common/textResourcePropertiesService'; import 'vs/workbench/services/mode/common/workbenchModeService'; import 'vs/workbench/services/commands/common/commandService'; import 'vs/workbench/services/themes/browser/workbenchThemeService'; -// import 'vs/workbench/services/extensionManagement/node/extensionEnablementService'; import 'vs/workbench/services/extensions/browser/extensionService'; // import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService'; import 'vs/workbench/services/label/common/labelService'; import 'vs/workbench/services/extensionManagement/common/extensionManagementServerService'; +import 'vs/workbench/services/extensionManagement/common/extensionEnablementService'; // import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import 'vs/workbench/services/notification/common/notificationService'; // import 'vs/workbench/services/window/electron-browser/windowService'; From 79a71f5d23594a648265a5468551c80701bfc455 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 12:16:03 +0200 Subject: [PATCH 145/190] update distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 685e5fed361..39c463d3c05 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "fbc5990ccee25d91cab59677ff6624708306a412", + "distro": "21fb8f9bbe268518be5189b0f46b8077f24a14e4", "author": { "name": "Microsoft Corporation" }, @@ -159,4 +159,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.4" } -} +} \ No newline at end of file From 29801104f14132a2f5242b46d71ed469a459a231 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Thu, 18 Jul 2019 12:18:16 +0200 Subject: [PATCH 146/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39c463d3c05..2791d98df45 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "21fb8f9bbe268518be5189b0f46b8077f24a14e4", + "distro": "fb0e9f7d0337ade4dd5fbd8450123140aba880bc", "author": { "name": "Microsoft Corporation" }, From ac34471f1cefcdde7454018cd1f887d4d33834f7 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Thu, 18 Jul 2019 12:22:03 +0200 Subject: [PATCH 147/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2791d98df45..93340dfb1cb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "fb0e9f7d0337ade4dd5fbd8450123140aba880bc", + "distro": "8dcd7590deff4d860f0fda2554b4c7daa7950c03", "author": { "name": "Microsoft Corporation" }, From ccbd05eed34de1fb016f14a830ceeb19b96184b2 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 18 Jul 2019 12:22:27 +0200 Subject: [PATCH 148/190] bump windows-mutex --- package.json | 2 +- yarn.lock | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 685e5fed361..64fc6ee29de 100644 --- a/package.json +++ b/package.json @@ -156,7 +156,7 @@ "vscode-windows-ca-certs": "0.1.0", "vscode-windows-registry": "1.0.1", "windows-foreground-love": "0.2.0", - "windows-mutex": "0.2.1", + "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } } diff --git a/yarn.lock b/yarn.lock index e0d9deffb5f..01fcf201ba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5942,11 +5942,6 @@ nan@2.14.0, nan@^2.0.0, nan@^2.13.2, nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== -nan@^2.10.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" - integrity sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw== - nan@^2.12.1: version "2.12.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" @@ -9735,13 +9730,13 @@ windows-foreground-love@0.2.0: resolved "https://registry.yarnpkg.com/windows-foreground-love/-/windows-foreground-love-0.2.0.tgz#b291832d8a02a966bc046ba0e498cc789809076b" integrity sha512-72ZDshnt8Q3/ImLMt4wxsY8eVnUd1KDb5QfvZX09AxJJJa0hGdyzPfd/ms0pKSYYwKlEhB1ri+WDKNvdIpJknQ== -windows-mutex@0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/windows-mutex/-/windows-mutex-0.2.1.tgz#05a8da8018f22874d7fbbd775c0141876d1c28fc" - integrity sha512-TaLGQa+qBcPZ2EH94BD/3Hy8fycrZjzqxI/lOMdXPyvffNnIJOvKwEyvNRC25bVFQ2mliJBziKhCMEhk9Dhhhg== +windows-mutex@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/windows-mutex/-/windows-mutex-0.3.0.tgz#2f51a0c97b3979c98952b23c086035f1f3715fab" + integrity sha512-IDWzyHOEpQr7m590pT90jMbCYNe525d7BgP6F80TjispEu2gWMvTIoSuO6Sy4atIEhvs3ys7DVlKdLzIAyRviQ== dependencies: bindings "^1.2.1" - nan "^2.10.0" + nan "^2.14.0" windows-process-tree@0.2.4: version "0.2.4" From bd57ca7066c3c7a70a85cbb7893b1ec16b361c85 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 18 Jul 2019 13:57:45 +0200 Subject: [PATCH 149/190] Expand Selection not working as intended. Fixes #77194. Fixes #77087 --- .../client/src/cssMain.ts | 22 +------------------ .../server/src/cssServerMain.ts | 6 ++--- .../client/src/htmlMain.ts | 22 +------------------ .../server/src/htmlServerMain.ts | 6 ++--- .../client/src/jsonMain.ts | 22 +------------------ .../server/src/jsonServerMain.ts | 3 ++- 6 files changed, 11 insertions(+), 70 deletions(-) diff --git a/extensions/css-language-features/client/src/cssMain.ts b/extensions/css-language-features/client/src/cssMain.ts index 8d8542f5a1e..ee8c9973d3a 100644 --- a/extensions/css-language-features/client/src/cssMain.ts +++ b/extensions/css-language-features/client/src/cssMain.ts @@ -9,7 +9,7 @@ import * as fs from 'fs'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); -import { languages, window, commands, ExtensionContext, Range, Position, CompletionItem, CompletionItemKind, TextEdit, SnippetString, workspace, TextDocument, SelectionRange } from 'vscode'; +import { languages, window, commands, ExtensionContext, Range, Position, CompletionItem, CompletionItemKind, TextEdit, SnippetString, workspace } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, Disposable } from 'vscode-languageclient'; import { getCustomDataPathsInAllWorkspaces, getCustomDataPathsFromAllExtensions } from './customData'; @@ -78,26 +78,6 @@ export function activate(context: ExtensionContext) { client.onReady().then(() => { context.subscriptions.push(initCompletionProvider()); - - documentSelector.forEach(selector => { - context.subscriptions.push(languages.registerSelectionRangeProvider(selector, { - async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise { - const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); - const rawResult = await client.sendRequest('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) }); - if (Array.isArray(rawResult)) { - return rawResult.map(rawSelectionRanges => { - return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => { - return { - range: client.protocol2CodeConverter.asRange(selectionRange.range), - parent - }; - }, undefined)!; - }); - } - return []; - } - })); - }); }); function initCompletionProvider(): Disposable { diff --git a/extensions/css-language-features/server/src/cssServerMain.ts b/extensions/css-language-features/server/src/cssServerMain.ts index 76374165b7c..884306d299a 100644 --- a/extensions/css-language-features/server/src/cssServerMain.ts +++ b/extensions/css-language-features/server/src/cssServerMain.ts @@ -374,7 +374,7 @@ connection.onFoldingRanges((params, token) => { }, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token); }); -connection.onRequest('$/textDocument/selectionRanges', async (params, token) => { +connection.onSelectionRanges((params, token) => { return runSafe(() => { const document = documents.get(params.textDocument.uri); const positions: Position[] = params.positions; @@ -383,8 +383,8 @@ connection.onRequest('$/textDocument/selectionRanges', async (params, token) => const stylesheet = stylesheets.get(document); return getLanguageService(document).getSelectionRanges(document, positions, stylesheet); } - return Promise.resolve(null); - }, null, `Error while computing selection ranges for ${params.textDocument.uri}`, token); + return []; + }, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token); }); diff --git a/extensions/html-language-features/client/src/htmlMain.ts b/extensions/html-language-features/client/src/htmlMain.ts index 6fe90190729..5f98f732b52 100644 --- a/extensions/html-language-features/client/src/htmlMain.ts +++ b/extensions/html-language-features/client/src/htmlMain.ts @@ -8,7 +8,7 @@ import * as fs from 'fs'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); -import { languages, ExtensionContext, IndentAction, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace, SelectionRange } from 'vscode'; +import { languages, ExtensionContext, IndentAction, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, TextDocumentPositionParams } from 'vscode-languageclient'; import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared'; import { activateTagClosing } from './tagClosing'; @@ -87,26 +87,6 @@ export function activate(context: ExtensionContext) { } }); toDispose.push(disposable); - - documentSelector.forEach(selector => { - context.subscriptions.push(languages.registerSelectionRangeProvider(selector, { - async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise { - const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); - const rawResult = await client.sendRequest('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) }); - if (Array.isArray(rawResult)) { - return rawResult.map(rawSelectionRanges => { - return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => { - return { - range: client.protocol2CodeConverter.asRange(selectionRange.range), - parent - }; - }, undefined)!; - }); - } - return []; - } - })); - }); }); languages.setLanguageConfiguration('html', { diff --git a/extensions/html-language-features/server/src/htmlServerMain.ts b/extensions/html-language-features/server/src/htmlServerMain.ts index e3e62991aca..6eb8fc298fe 100644 --- a/extensions/html-language-features/server/src/htmlServerMain.ts +++ b/extensions/html-language-features/server/src/htmlServerMain.ts @@ -454,7 +454,7 @@ connection.onFoldingRanges((params, token) => { }, null, `Error while computing folding regions for ${params.textDocument.uri}`, token); }); -connection.onRequest('$/textDocument/selectionRanges', async (params, token) => { +connection.onSelectionRanges((params, token) => { return runSafe(() => { const document = documents.get(params.textDocument.uri); const positions: Position[] = params.positions; @@ -465,8 +465,8 @@ connection.onRequest('$/textDocument/selectionRanges', async (params, token) => return htmlMode.getSelectionRanges(document, positions); } } - return Promise.resolve(null); - }, null, `Error while computing selection ranges for ${params.textDocument.uri}`, token); + return []; + }, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token); }); diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 3515c4a8aa6..323e5f0ed94 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -10,7 +10,7 @@ import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light'; const localize = nls.loadMessageBundle(); -import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange } from 'vscode'; +import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor } from 'vscode'; import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature, ResponseError } from 'vscode-languageclient'; import TelemetryReporter from 'vscode-extension-telemetry'; @@ -216,26 +216,6 @@ export function activate(context: ExtensionContext) { extensions.onDidChange(_ => { client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); }); - - documentSelector.forEach(selector => { - toDispose.push(languages.registerSelectionRangeProvider(selector, { - async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise { - const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); - const rawResult = await client.sendRequest('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) }); - if (Array.isArray(rawResult)) { - return rawResult.map(rawSelectionRanges => { - return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => { - return { - range: client.protocol2CodeConverter.asRange(selectionRange.range), - parent, - }; - }, undefined)!; - }); - } - return []; - } - })); - }); }); diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index b3d5ab47b8f..699e73a9c91 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -433,7 +433,8 @@ connection.onFoldingRanges((params, token) => { }, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token); }); -connection.onRequest('$/textDocument/selectionRanges', async (params, token) => { + +connection.onSelectionRanges((params, token) => { return runSafe(() => { const document = documents.get(params.textDocument.uri); if (document) { From d685337db2e58c97c52387f080d698c5fa22753d Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 15:29:41 +0200 Subject: [PATCH 150/190] Use semver-umd everywhere --- package.json | 3 +- remote/package.json | 3 +- remote/web/package.json | 2 +- remote/web/yarn.lock | 8 +- remote/yarn.lock | 10 +- src/typings/semver-umd.d.ts | 206 ++++++++++++++++++ src/vs/code/browser/workbench/workbench.js | 2 +- src/vs/code/node/cliProcessMain.ts | 2 +- .../node/extensionManagementService.ts | 2 +- .../browser/extensionsWorkbenchService.ts | 2 +- .../tasks/electron-browser/taskService.ts | 2 +- .../contrib/update/electron-browser/update.ts | 2 +- .../extensions/node/extensionPoints.ts | 2 +- yarn.lock | 8 +- 14 files changed, 229 insertions(+), 25 deletions(-) create mode 100644 src/typings/semver-umd.d.ts diff --git a/package.json b/package.json index e067a40bcfe..10673638030 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,7 @@ "node-pty": "0.9.0-beta19", "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", - "semver": "^5.5.0", - "semver-umd": "^5.5.0", + "semver-umd": "^5.5.3", "spdlog": "^0.9.0", "sudo-prompt": "9.0.0", "v8-inspect-profiler": "^0.0.20", diff --git a/remote/package.json b/remote/package.json index 16edc649482..57b51c1b82d 100644 --- a/remote/package.json +++ b/remote/package.json @@ -14,8 +14,7 @@ "node-pty": "0.9.0-beta19", "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", - "semver": "^5.5.0", - "semver-umd": "^5.5.0", + "semver-umd": "^5.5.3", "spdlog": "^0.9.0", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", diff --git a/remote/web/package.json b/remote/web/package.json index 6c18cb53937..c7a487b6c2d 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -7,6 +7,6 @@ "xterm": "3.15.0-beta67", "xterm-addon-search": "0.2.0-beta2", "xterm-addon-web-links": "0.1.0-beta10", - "semver-umd": "^5.5.0" + "semver-umd": "^5.5.3" } } \ No newline at end of file diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 6839b2e5af6..b624eb37290 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -19,10 +19,10 @@ oniguruma@^7.2.0: dependencies: nan "^2.14.0" -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== vscode-textmate@^4.1.1: version "4.2.2" diff --git a/remote/yarn.lock b/remote/yarn.lock index 2e8118c8bc3..78b7393ad6d 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -876,17 +876,17 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== semver@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -semver@^5.5.0, semver@^5.6.0: +semver@^5.6.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== diff --git a/src/typings/semver-umd.d.ts b/src/typings/semver-umd.d.ts new file mode 100644 index 00000000000..f79d658a1fd --- /dev/null +++ b/src/typings/semver-umd.d.ts @@ -0,0 +1,206 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'semver-umd' { + + // Type definitions for semver 5.5 + // Project: https://github.com/npm/node-semver + // Definitions by: Bart van der Schoor + // BendingBender + // Lucian Buzzo + // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver + + export const SEMVER_SPEC_VERSION: "2.0.0"; + + export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease"; + + /** + * Return the parsed version as a SemVer object, or null if it's not valid. + */ + export function parse(v: string | SemVer, loose?: boolean): SemVer | null; + /** + * Return the parsed version, or null if it's not valid. + */ + export function valid(v: string | SemVer, loose?: boolean): string | null; + /** + * Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid. + */ + export function clean(version: string, loose?: boolean): string | null; + /** + * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + */ + export function inc(v: string | SemVer, release: ReleaseType, loose?: boolean, identifier?: string): string | null; + /** + * Return the major version number. + */ + export function major(v: string | SemVer, loose?: boolean): number; + /** + * Return the minor version number. + */ + export function minor(v: string | SemVer, loose?: boolean): number; + /** + * Return the patch version number. + */ + export function patch(v: string | SemVer, loose?: boolean): number; + /** + * Returns an array of prerelease components, or null if none exist. + */ + export function prerelease(v: string | SemVer, loose?: boolean): string[] | null; + + // Comparison + /** + * v1 > v2 + */ + export function gt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 >= v2 + */ + export function gte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 < v2 + */ + export function lt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 <= v2 + */ + export function lte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. + */ + export function eq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 != v2 The opposite of eq. + */ + export function neq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + + /** + * Pass in a comparison string, and it'll call the corresponding semver comparison function. + * "===" and "!==" do simple string comparison, but are included for completeness. + * Throws if an invalid comparison string is provided. + */ + export function cmp(v1: string | SemVer, operator: Operator, v2: string | SemVer, loose?: boolean): boolean; + export type Operator = '===' | '!==' | '' | '=' | '==' | '!=' | '>' | '>=' | '<' | '<='; + + /** + * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). + */ + export function compare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; + /** + * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). + */ + export function rcompare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; + + /** + * Compares two identifiers, must be numeric strings or truthy/falsy values. Sorts in ascending order if passed to Array.sort(). + */ + export function compareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; + /** + * The reverse of compareIdentifiers. Sorts in descending order when passed to Array.sort(). + */ + export function rcompareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; + + /** + * Sorts an array of semver entries in ascending order. + */ + export function sort(list: Array, loose?: boolean): Array; + /** + * Sorts an array of semver entries in descending order. + */ + export function rsort(list: Array, loose?: boolean): Array; + + /** + * Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same. + */ + export function diff(v1: string, v2: string, loose?: boolean): ReleaseType | null; + + // Ranges + /** + * Return the valid range or null if it's not valid + */ + export function validRange(range: string | Range, loose?: boolean): string; + /** + * Return true if the version satisfies the range. + */ + export function satisfies(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return the highest version in the list that satisfies the range, or null if none of them do. + */ + export function maxSatisfying(versions: Array, range: string | Range, loose?: boolean): string; + /** + * Return the lowest version in the list that satisfies the range, or null if none of them do. + */ + export function minSatisfying(versions: Array, range: string, loose?: boolean): string; + /** + * Return true if version is greater than all the versions possible in the range. + */ + export function gtr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return true if version is less than all the versions possible in the range. + */ + export function ltr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return true if the version is outside the bounds of the range in either the high or low direction. + * The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + */ + export function outside(version: string | SemVer, range: string | Range, hilo: '>' | '<', loose?: boolean): boolean; + /** + * Return true if any of the ranges comparators intersect + */ + export function intersects(range1: string | Range, range2: string | Range, loose?: boolean): boolean; + + // Coercion + /** + * Coerces a string to semver if possible + */ + export function coerce(version: string | SemVer): SemVer | null; + + export class SemVer { + constructor(version: string | SemVer, loose?: boolean); + + raw: string; + loose: boolean; + format(): string; + inspect(): string; + + major: number; + minor: number; + patch: number; + version: string; + build: string[]; + prerelease: string[]; + + compare(other: string | SemVer): 1 | 0 | -1; + compareMain(other: string | SemVer): 1 | 0 | -1; + comparePre(other: string | SemVer): 1 | 0 | -1; + inc(release: ReleaseType, identifier?: string): SemVer; + } + + export class Comparator { + constructor(comp: string | Comparator, loose?: boolean); + + semver: SemVer; + operator: string; + value: boolean; + parse(comp: string): void; + test(version: string | SemVer): boolean; + intersects(comp: Comparator, loose?: boolean): boolean; + } + + export class Range { + constructor(range: string | Range, loose?: boolean); + + range: string; + raw: string; + loose: boolean; + format(): string; + inspect(): string; + + set: Comparator[][]; + parseRange(range: string): Comparator[]; + test(version: string | SemVer): boolean; + intersects(range: Range, loose?: boolean): boolean; + } + +} \ No newline at end of file diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js index 2f62dceb9ed..65fae7c82df 100644 --- a/src/vs/code/browser/workbench/workbench.js +++ b/src/vs/code/browser/workbench/workbench.js @@ -15,7 +15,7 @@ 'xterm': `${window.location.origin}/node_modules/xterm/lib/xterm.js`, 'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`, 'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`, - 'semver': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`, + 'semver-umd': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`, } }); diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 68978614625..1f3aeb31063 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import product from 'vs/platform/product/node/product'; import pkg from 'vs/platform/product/node/package'; import * as path from 'vs/base/common/path'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 725e477449a..564b0981fba 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -26,7 +26,7 @@ import { localizeManifest } from '../common/extensionNls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { Limiter, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; import { Event, Emitter } from 'vs/base/common/event'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { URI } from 'vs/base/common/uri'; import pkg from 'vs/platform/product/node/package'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 46d215b018a..fbefd13d378 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { Event, Emitter } from 'vs/base/common/event'; import { index, distinct } from 'vs/base/common/arrays'; import { ThrottledDelayer } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts b/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts index 631275db0d0..decffe55e63 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as Objects from 'vs/base/common/objects'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { IStringDictionary } from 'vs/base/common/collections'; import { WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { ITaskSystem } from 'vs/workbench/contrib/tasks/common/taskSystem'; diff --git a/src/vs/workbench/contrib/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts index e56a8a3e64e..f21b80c1f21 100644 --- a/src/vs/workbench/contrib/update/electron-browser/update.ts +++ b/src/vs/workbench/contrib/update/electron-browser/update.ts @@ -17,7 +17,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IUpdateService, State as UpdateState, StateType, IUpdate } from 'vs/platform/update/common/update'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { INotificationService, INotificationHandle, Severity } from 'vs/platform/notification/common/notification'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; diff --git a/src/vs/workbench/services/extensions/node/extensionPoints.ts b/src/vs/workbench/services/extensions/node/extensionPoints.ts index f6e5afbc6aa..5a7efd1462b 100644 --- a/src/vs/workbench/services/extensions/node/extensionPoints.ts +++ b/src/vs/workbench/services/extensions/node/extensionPoints.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import * as path from 'vs/base/common/path'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import * as json from 'vs/base/common/json'; import * as arrays from 'vs/base/common/arrays'; import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; diff --git a/yarn.lock b/yarn.lock index 01fcf201ba0..57cbaeb0fac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7970,10 +7970,10 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0: version "5.4.1" From fd5985489982fe14381dd56e6f0b29c53d5f991b Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 15:33:42 +0200 Subject: [PATCH 151/190] re export from semver --- src/typings/semver-umd.d.ts | 198 +----------------------------------- 1 file changed, 1 insertion(+), 197 deletions(-) diff --git a/src/typings/semver-umd.d.ts b/src/typings/semver-umd.d.ts index f79d658a1fd..372f000c617 100644 --- a/src/typings/semver-umd.d.ts +++ b/src/typings/semver-umd.d.ts @@ -5,202 +5,6 @@ declare module 'semver-umd' { - // Type definitions for semver 5.5 - // Project: https://github.com/npm/node-semver - // Definitions by: Bart van der Schoor - // BendingBender - // Lucian Buzzo - // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver - - export const SEMVER_SPEC_VERSION: "2.0.0"; - - export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease"; - - /** - * Return the parsed version as a SemVer object, or null if it's not valid. - */ - export function parse(v: string | SemVer, loose?: boolean): SemVer | null; - /** - * Return the parsed version, or null if it's not valid. - */ - export function valid(v: string | SemVer, loose?: boolean): string | null; - /** - * Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid. - */ - export function clean(version: string, loose?: boolean): string | null; - /** - * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. - */ - export function inc(v: string | SemVer, release: ReleaseType, loose?: boolean, identifier?: string): string | null; - /** - * Return the major version number. - */ - export function major(v: string | SemVer, loose?: boolean): number; - /** - * Return the minor version number. - */ - export function minor(v: string | SemVer, loose?: boolean): number; - /** - * Return the patch version number. - */ - export function patch(v: string | SemVer, loose?: boolean): number; - /** - * Returns an array of prerelease components, or null if none exist. - */ - export function prerelease(v: string | SemVer, loose?: boolean): string[] | null; - - // Comparison - /** - * v1 > v2 - */ - export function gt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - /** - * v1 >= v2 - */ - export function gte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - /** - * v1 < v2 - */ - export function lt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - /** - * v1 <= v2 - */ - export function lte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - /** - * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. - */ - export function eq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - /** - * v1 != v2 The opposite of eq. - */ - export function neq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; - - /** - * Pass in a comparison string, and it'll call the corresponding semver comparison function. - * "===" and "!==" do simple string comparison, but are included for completeness. - * Throws if an invalid comparison string is provided. - */ - export function cmp(v1: string | SemVer, operator: Operator, v2: string | SemVer, loose?: boolean): boolean; - export type Operator = '===' | '!==' | '' | '=' | '==' | '!=' | '>' | '>=' | '<' | '<='; - - /** - * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). - */ - export function compare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; - /** - * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). - */ - export function rcompare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; - - /** - * Compares two identifiers, must be numeric strings or truthy/falsy values. Sorts in ascending order if passed to Array.sort(). - */ - export function compareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; - /** - * The reverse of compareIdentifiers. Sorts in descending order when passed to Array.sort(). - */ - export function rcompareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; - - /** - * Sorts an array of semver entries in ascending order. - */ - export function sort(list: Array, loose?: boolean): Array; - /** - * Sorts an array of semver entries in descending order. - */ - export function rsort(list: Array, loose?: boolean): Array; - - /** - * Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same. - */ - export function diff(v1: string, v2: string, loose?: boolean): ReleaseType | null; - - // Ranges - /** - * Return the valid range or null if it's not valid - */ - export function validRange(range: string | Range, loose?: boolean): string; - /** - * Return true if the version satisfies the range. - */ - export function satisfies(version: string | SemVer, range: string | Range, loose?: boolean): boolean; - /** - * Return the highest version in the list that satisfies the range, or null if none of them do. - */ - export function maxSatisfying(versions: Array, range: string | Range, loose?: boolean): string; - /** - * Return the lowest version in the list that satisfies the range, or null if none of them do. - */ - export function minSatisfying(versions: Array, range: string, loose?: boolean): string; - /** - * Return true if version is greater than all the versions possible in the range. - */ - export function gtr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; - /** - * Return true if version is less than all the versions possible in the range. - */ - export function ltr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; - /** - * Return true if the version is outside the bounds of the range in either the high or low direction. - * The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) - */ - export function outside(version: string | SemVer, range: string | Range, hilo: '>' | '<', loose?: boolean): boolean; - /** - * Return true if any of the ranges comparators intersect - */ - export function intersects(range1: string | Range, range2: string | Range, loose?: boolean): boolean; - - // Coercion - /** - * Coerces a string to semver if possible - */ - export function coerce(version: string | SemVer): SemVer | null; - - export class SemVer { - constructor(version: string | SemVer, loose?: boolean); - - raw: string; - loose: boolean; - format(): string; - inspect(): string; - - major: number; - minor: number; - patch: number; - version: string; - build: string[]; - prerelease: string[]; - - compare(other: string | SemVer): 1 | 0 | -1; - compareMain(other: string | SemVer): 1 | 0 | -1; - comparePre(other: string | SemVer): 1 | 0 | -1; - inc(release: ReleaseType, identifier?: string): SemVer; - } - - export class Comparator { - constructor(comp: string | Comparator, loose?: boolean); - - semver: SemVer; - operator: string; - value: boolean; - parse(comp: string): void; - test(version: string | SemVer): boolean; - intersects(comp: Comparator, loose?: boolean): boolean; - } - - export class Range { - constructor(range: string | Range, loose?: boolean); - - range: string; - raw: string; - loose: boolean; - format(): string; - inspect(): string; - - set: Comparator[][]; - parseRange(range: string): Comparator[]; - test(version: string | SemVer): boolean; - intersects(range: Range, loose?: boolean): boolean; - } + export * from "semver"; } \ No newline at end of file From e6067d99a57ab9845b2e872e6c7115542f1c5b92 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 16:15:00 +0200 Subject: [PATCH 152/190] remove enablement service from simple services --- .../workbench/browser/web.simpleservices.ts | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 099f2db171d..cf48dcdeba7 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -12,8 +12,8 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' import { IDownloadService } from 'vs/platform/download/common/download'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IGalleryExtension, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { ExtensionType, ExtensionIdentifier, IExtension } from 'vs/platform/extensions/common/extensions'; +import { IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { ExtensionType, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IURLHandler, IURLService } from 'vs/platform/url/common/url'; import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; @@ -57,40 +57,6 @@ registerSingleton(IDownloadService, SimpleDownloadService, true); //#endregion -//#region Extension Management - -//#region Extension Enablement - -export class SimpleExtensionEnablementService implements IExtensionEnablementService { - - _serviceBrand: any; - - readonly onEnablementChanged = Event.None; - - readonly allUserExtensionsDisabled = false; - - getEnablementState(extension: IExtension): EnablementState { - return EnablementState.Enabled; - } - - canChangeEnablement(extension: IExtension): boolean { - return false; - } - - setEnablement(extensions: IExtension[], newState: EnablementState): Promise { - throw new Error('not implemented'); - } - - isEnabled(extension: IExtension): boolean { - return true; - } - -} - -registerSingleton(IExtensionEnablementService, SimpleExtensionEnablementService, true); - -//#endregion - //#region Extension Tips export class SimpleExtensionTipsService implements IExtensionTipsService { From 034e0a9f995fc3518181ee8640a23b459170a62a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 16:36:52 +0200 Subject: [PATCH 153/190] Use Enablement service to check if an extension is enabled or not --- .../api/browser/mainThreadExtensionService.ts | 23 +++++++----- .../extensions/browser/extensionsActions.ts | 37 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts index 8a63fccb827..e4453a9d4fe 100644 --- a/src/vs/workbench/api/browser/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/browser/mainThreadExtensionService.ts @@ -12,11 +12,12 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio import { INotificationService } from 'vs/platform/notification/common/notification'; import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { CancellationToken } from 'vs/base/common/cancellation'; +import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; @extHostNamedCustomer(MainContext.MainThreadExtensionService) export class MainThreadExtensionService implements MainThreadExtensionServiceShape { @@ -25,18 +26,21 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha private readonly _notificationService: INotificationService; private readonly _extensionsWorkbenchService: IExtensionsWorkbenchService; private readonly _windowService: IWindowService; + private readonly _extensionEnablementService: IExtensionEnablementService; constructor( extHostContext: IExtHostContext, @IExtensionService extensionService: IExtensionService, @INotificationService notificationService: INotificationService, @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, - @IWindowService windowService: IWindowService + @IWindowService windowService: IWindowService, + @IExtensionEnablementService extensionEnablementService: IExtensionEnablementService ) { this._extensionService = extensionService; this._notificationService = notificationService; this._extensionsWorkbenchService = extensionsWorkbenchService; this._windowService = windowService; + this._extensionEnablementService = extensionEnablementService; } public dispose(): void { @@ -74,30 +78,31 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha const local = await this._extensionsWorkbenchService.queryLocal(); const installedDependency = local.filter(i => areSameExtensions(i.identifier, { id: missingDependency }))[0]; if (installedDependency) { - await this._handleMissingInstalledDependency(extension, installedDependency); + await this._handleMissingInstalledDependency(extension, installedDependency.local!); } else { await this._handleMissingNotInstalledDependency(extension, missingDependency); } } } - private async _handleMissingInstalledDependency(extension: IExtensionDescription, missingInstalledDependency: IExtension): Promise { + private async _handleMissingInstalledDependency(extension: IExtensionDescription, missingInstalledDependency: ILocalExtension): Promise { const extName = extension.displayName || extension.name; - if (missingInstalledDependency.enablementState === EnablementState.Enabled || missingInstalledDependency.enablementState === EnablementState.WorkspaceEnabled) { + if (this._extensionEnablementService.isEnabled(missingInstalledDependency)) { this._notificationService.notify({ severity: Severity.Error, - message: localize('reload window', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?", extName, missingInstalledDependency.displayName), + message: localize('reload window', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name), actions: { primary: [new Action('reload', localize('reload', "Reload Window"), '', true, () => this._windowService.reloadWindow())] } }); } else { + const enablementState = this._extensionEnablementService.getEnablementState(missingInstalledDependency); this._notificationService.notify({ severity: Severity.Error, - message: localize('disabledDep', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is disabled. Would you like to enable the extension and reload the window?", extName, missingInstalledDependency.displayName), + message: localize('disabledDep', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is disabled. Would you like to enable the extension and reload the window?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name), actions: { primary: [new Action('enable', localize('enable dep', "Enable and Reload"), '', true, - () => this._extensionsWorkbenchService.setEnablement([missingInstalledDependency], missingInstalledDependency.enablementState === EnablementState.Disabled ? EnablementState.Enabled : EnablementState.WorkspaceEnabled) + () => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.Disabled ? EnablementState.Enabled : EnablementState.WorkspaceEnabled) .then(() => this._windowService.reloadWindow(), e => this._notificationService.error(e)))] } }); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 4a68163faa6..069634a1c0e 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -893,8 +893,10 @@ export class EnableForWorkspaceAction extends ExtensionAction { update(): void { this.enabled = false; - if (this.extension) { - this.enabled = this.extension.state === ExtensionState.Installed && (this.extension.enablementState === EnablementState.Disabled || this.extension.enablementState === EnablementState.WorkspaceDisabled) && !!this.extension.local && this.extensionEnablementService.canChangeEnablement(this.extension.local); + if (this.extension && this.extension.local) { + this.enabled = this.extension.state === ExtensionState.Installed + && (this.extension.enablementState === EnablementState.Disabled || this.extension.enablementState === EnablementState.WorkspaceDisabled) + && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } @@ -919,7 +921,9 @@ export class EnableGloballyAction extends ExtensionAction { update(): void { this.enabled = false; if (this.extension && this.extension.local) { - this.enabled = this.extension.state === ExtensionState.Installed && this.extension.enablementState === EnablementState.Disabled && this.extensionEnablementService.canChangeEnablement(this.extension.local); + this.enabled = this.extension.state === ExtensionState.Installed + && this.extension.enablementState === EnablementState.Disabled + && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } @@ -944,8 +948,10 @@ export class DisableForWorkspaceAction extends ExtensionAction { update(): void { this.enabled = false; - if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) { - this.enabled = this.extension.state === ExtensionState.Installed && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) && !!this.extension.local && this.extensionEnablementService.canChangeEnablement(this.extension.local); + if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) { + this.enabled = this.extension.state === ExtensionState.Installed + && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) + && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } @@ -969,8 +975,10 @@ export class DisableGloballyAction extends ExtensionAction { update(): void { this.enabled = false; - if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))) { - this.enabled = this.extension.state === ExtensionState.Installed && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) && !!this.extension.local && this.extensionEnablementService.canChangeEnablement(this.extension.local); + if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))) { + this.enabled = this.extension.state === ExtensionState.Installed + && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) + && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } @@ -1057,6 +1065,7 @@ export class CheckForUpdatesAction extends Action { id = CheckForUpdatesAction.ID, label = CheckForUpdatesAction.LABEL, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, + @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService, @IViewletService private readonly viewletService: IViewletService, @INotificationService private readonly notificationService: INotificationService ) { @@ -1072,7 +1081,7 @@ export class CheckForUpdatesAction extends Action { let msgAvailableExtensions = outdated.length === 1 ? localize('singleUpdateAvailable', "An extension update is available.") : localize('updatesAvailable', "{0} extension updates are available.", outdated.length); - const disabledExtensionsCount = outdated.filter(ext => ext.enablementState === EnablementState.Disabled || ext.enablementState === EnablementState.WorkspaceDisabled).length; + const disabledExtensionsCount = outdated.filter(ext => ext.local && !this.extensionEnablementService.isEnabled(ext.local)).length; if (disabledExtensionsCount) { if (outdated.length === 1) { msgAvailableExtensions = localize('singleDisabledUpdateAvailable', "An update to an extension which is disabled is available."); @@ -2714,7 +2723,7 @@ export class DisableAllAction extends Action { } private update(): void { - this.enabled = this.extensionsWorkbenchService.local.some(e => e.type === ExtensionType.User && (e.enablementState === EnablementState.Enabled || e.enablementState === EnablementState.WorkspaceEnabled) && !!e.local && this.extensionEnablementService.canChangeEnablement(e.local)); + this.enabled = this.extensionsWorkbenchService.local.some(e => e.type === ExtensionType.User && !!e.local && this.extensionEnablementService.isEnabled(e.local) && this.extensionEnablementService.canChangeEnablement(e.local)); } run(): Promise { @@ -2731,7 +2740,8 @@ export class DisableAllWorkpsaceAction extends Action { constructor( id: string = DisableAllWorkpsaceAction.ID, label: string = DisableAllWorkpsaceAction.LABEL, @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, - @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService + @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, + @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService ) { super(id, label); this.update(); @@ -2740,7 +2750,7 @@ export class DisableAllWorkpsaceAction extends Action { } private update(): void { - this.enabled = this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.extensionsWorkbenchService.local.some(e => e.type === ExtensionType.User && (e.enablementState === EnablementState.Enabled || e.enablementState === EnablementState.WorkspaceEnabled)); + this.enabled = this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.extensionsWorkbenchService.local.some(e => e.type === ExtensionType.User && !!e.local && this.extensionEnablementService.isEnabled(e.local) && this.extensionEnablementService.canChangeEnablement(e.local)); } run(): Promise { @@ -2965,7 +2975,8 @@ export class InstallSpecificVersionOfExtensionAction extends Action { @INotificationService private readonly notificationService: INotificationService, @IWindowService private readonly windowService: IWindowService, @IInstantiationService private readonly instantiationService: IInstantiationService, - @IExtensionService private readonly extensionService: IExtensionService + @IExtensionService private readonly extensionService: IExtensionService, + @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService, ) { super(id, label); } @@ -2987,7 +2998,7 @@ export class InstallSpecificVersionOfExtensionAction extends Action { } private isEnabled(extension: IExtension): boolean { - return !!extension.gallery && (extension.enablementState === EnablementState.Enabled || extension.enablementState === EnablementState.WorkspaceEnabled); + return !!extension.gallery && !!extension.local && this.extensionEnablementService.isEnabled(extension.local); } private async getExtensionEntries(): Promise<(IQuickPickItem & { extension: IExtension, versions: IGalleryExtensionVersion[] })[]> { From 6163b862430055d32694964e8e0fda6a63b04117 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 18 Jul 2019 16:56:08 +0200 Subject: [PATCH 154/190] add gotoLineMode to IOpenSettings --- src/vs/code/electron-main/app.ts | 7 +++++-- src/vs/code/electron-main/windows.ts | 3 +-- src/vs/platform/launch/electron-main/launchService.ts | 3 ++- src/vs/platform/menubar/electron-main/menubar.ts | 3 ++- src/vs/platform/windows/common/windows.ts | 1 + src/vs/platform/windows/electron-main/windows.ts | 1 + src/vs/platform/windows/electron-main/windowsService.ts | 5 +++-- src/vs/workbench/api/node/extHostCLIServer.ts | 5 +++-- 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index f7e670c79b6..69d059b4e40 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -241,6 +241,7 @@ export class CodeApplication extends Disposable { context: OpenContext.DOCK /* can also be opening from finder while app is running */, cli: this.environmentService.args, urisToOpen: macOpenFileURIs, + gotoLineMode: false, preferNewWindow: true /* dropping on the dock or opening from finder prefers to open in a new window */ }); @@ -595,8 +596,8 @@ export class CodeApplication extends Disposable { urlService.registerHandler({ async handleURL(uri: URI): Promise { if (windowsMainService.getWindowCount() === 0) { - const cli = { ...environmentService.args, goto: true }; - const [window] = windowsMainService.open({ context: OpenContext.API, cli, forceEmpty: true }); + const cli = { ...environmentService.args }; + const [window] = windowsMainService.open({ context: OpenContext.API, cli, forceEmpty: true, gotoLineMode: true }); await window.ready(); @@ -647,6 +648,7 @@ export class CodeApplication extends Disposable { urisToOpen: macOpenFiles.map(file => this.getURIToOpenFromPathSync(file)), noRecentEntry, waitMarkerFileURI, + gotoLineMode: false, initialStartup: true }); } @@ -659,6 +661,7 @@ export class CodeApplication extends Disposable { diffMode: args.diff, noRecentEntry, waitMarkerFileURI, + gotoLineMode: args.goto, initialStartup: true }); } diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index be336e02113..5e50acec4dc 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -844,8 +844,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService { private doExtractPathsFromAPI(openConfig: IOpenConfiguration): IPathToOpen[] { const pathsToOpen: IPathToOpen[] = []; - const cli = openConfig.cli; - const parseOptions: IPathParseOptions = { gotoLineMode: cli && cli.goto }; + const parseOptions: IPathParseOptions = { gotoLineMode: openConfig.gotoLineMode }; for (const pathToOpen of openConfig.urisToOpen || []) { if (!pathToOpen) { continue; diff --git a/src/vs/platform/launch/electron-main/launchService.ts b/src/vs/platform/launch/electron-main/launchService.ts index c192151f915..626a376d04b 100644 --- a/src/vs/platform/launch/electron-main/launchService.ts +++ b/src/vs/platform/launch/electron-main/launchService.ts @@ -228,7 +228,8 @@ export class LaunchService implements ILaunchService { diffMode: args.diff, addMode: args.add, noRecentEntry: !!args['skip-add-to-recently-opened'], - waitMarkerFileURI + waitMarkerFileURI, + gotoLineMode: args.goto }); } diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index c8091409e3f..76185f93da8 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -478,7 +478,8 @@ export class Menubar { context: OpenContext.MENU, cli: this.environmentService.args, urisToOpen: [uriToOpen], - forceNewWindow: openInNewWindow + forceNewWindow: openInNewWindow, + gotoLineMode: false }).length > 0; if (!success) { diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index d9e25ebfa2c..9af1792f70c 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -183,6 +183,7 @@ export interface IOpenSettings { forceReuseWindow?: boolean; diffMode?: boolean; addMode?: boolean; + gotoLineMode?: boolean; noRecentEntry?: boolean; waitMarkerFileURI?: URI; args?: ParsedArgs; diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts index cb72892f40e..3e64f5f5d0b 100644 --- a/src/vs/platform/windows/electron-main/windows.ts +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -132,6 +132,7 @@ export interface IOpenConfiguration { readonly forceEmpty?: boolean; readonly diffMode?: boolean; addMode?: boolean; + readonly gotoLineMode?: boolean; readonly initialStartup?: boolean; readonly noRecentEntry?: boolean; } diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index f74d5c79849..910c4e8d594 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -295,6 +295,7 @@ export class WindowsService extends Disposable implements IWindowsService, IURLH forceReuseWindow: options.forceReuseWindow, diffMode: options.diffMode, addMode: options.addMode, + gotoLineMode: options.gotoLineMode, noRecentEntry: options.noRecentEntry, waitMarkerFileURI: options.waitMarkerFileURI }); @@ -459,10 +460,10 @@ export class WindowsService extends Disposable implements IWindowsService, IURLH } private openFileForURI(uri: IURIToOpen): void { - const cli = assign(Object.create(null), this.environmentService.args, { goto: true }); + const cli = assign(Object.create(null), this.environmentService.args); const urisToOpen = [uri]; - this.windowsMainService.open({ context: OpenContext.API, cli, urisToOpen }); + this.windowsMainService.open({ context: OpenContext.API, cli, urisToOpen, gotoLineMode: true }); } async resolveProxy(windowId: number, url: string): Promise { diff --git a/src/vs/workbench/api/node/extHostCLIServer.ts b/src/vs/workbench/api/node/extHostCLIServer.ts index 2c549734a17..3b06ea4c064 100644 --- a/src/vs/workbench/api/node/extHostCLIServer.ts +++ b/src/vs/workbench/api/node/extHostCLIServer.ts @@ -18,6 +18,7 @@ export interface OpenCommandPipeArgs { forceNewWindow?: boolean; diffMode?: boolean; addMode?: boolean; + gotoLineMode?: boolean; forceReuseWindow?: boolean; waitMarkerFilePath?: string; } @@ -93,7 +94,7 @@ export class CLIServer { } private open(data: OpenCommandPipeArgs, res: http.ServerResponse) { - let { fileURIs, folderURIs, forceNewWindow, diffMode, addMode, forceReuseWindow, waitMarkerFilePath } = data; + let { fileURIs, folderURIs, forceNewWindow, diffMode, addMode, forceReuseWindow, gotoLineMode, waitMarkerFilePath } = data; const urisToOpen: IURIToOpen[] = []; if (Array.isArray(folderURIs)) { for (const s of folderURIs) { @@ -125,7 +126,7 @@ export class CLIServer { } if (urisToOpen.length) { const waitMarkerFileURI = waitMarkerFilePath ? URI.file(waitMarkerFilePath) : undefined; - const windowOpenArgs: IOpenSettings = { forceNewWindow, diffMode, addMode, forceReuseWindow, waitMarkerFileURI }; + const windowOpenArgs: IOpenSettings = { forceNewWindow, diffMode, addMode, gotoLineMode, forceReuseWindow, waitMarkerFileURI }; this._commands.executeCommand('_files.windowOpen', urisToOpen, windowOpenArgs); } res.writeHead(200); From 44d410567333dfbd9da5eab6f56bb2c83c31412e Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 18 Jul 2019 08:20:01 -0700 Subject: [PATCH 155/190] Bump vscode-ripgrep --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 10673638030..4a0241ff117 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "v8-inspect-profiler": "^0.0.20", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", - "vscode-ripgrep": "^1.3.1", + "vscode-ripgrep": "^1.5.4", "vscode-sqlite3": "4.0.8", "vscode-textmate": "^4.2.2", "xterm": "3.15.0-beta71", @@ -158,4 +158,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 57cbaeb0fac..7876a802c5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9561,10 +9561,10 @@ vscode-proxy-agent@0.4.0: https-proxy-agent "2.2.1" socks-proxy-agent "4.0.1" -vscode-ripgrep@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.3.1.tgz#51fb93debcd0c18a8b90dbc37f84f94333d0c486" - integrity sha512-4WLB/n4ZeWNi5AEzPTkfYrqbKtXlv0SlgmxbRVdulwZzGx/lfWeWPu9Shy32orM27IofQAQDuirbRBOYNJVzBA== +vscode-ripgrep@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.4.tgz#dae1c3eef350513299341cdf96e622c00b548eff" + integrity sha512-Bs8SvFAkR0QHf09J46VgNo19yRikOtj/f0zHzK3AM3ICjCGNN/BNoG9of6zGVHUTO+6Mk1RbKglyOHLKr8D1lg== vscode-sqlite3@4.0.8: version "4.0.8" From 8d560cd153e9760787c8795a1b2cd0e21f57772c Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Thu, 18 Jul 2019 08:44:33 -0700 Subject: [PATCH 156/190] Using vscode-telemetry-extractor npm package. (#77305) * Revert commit change * Revert commit change * Revert commit change * Revert commit change * Revert commit change * Initial work to move to utilizing the NPM module * Fix some paths * Bump NPM module * Update move command * Remove wrong directory in config * More build testing * Remove some debugging stuff * Fix relative dirs * Move node module to build package.json * Bump vscode-telemetry-extractor to 1.4.1 * Bump telemetry extractor version --- .../common/extract-telemetry.sh | 25 ++----- .../common/telemetry-config.json | 72 +++++++++++++++++++ build/package.json | 1 + package.json | 2 +- 4 files changed, 81 insertions(+), 19 deletions(-) create mode 100644 build/azure-pipelines/common/telemetry-config.json diff --git a/build/azure-pipelines/common/extract-telemetry.sh b/build/azure-pipelines/common/extract-telemetry.sh index 916c87c82ce..84bbd9c537c 100755 --- a/build/azure-pipelines/common/extract-telemetry.sh +++ b/build/azure-pipelines/common/extract-telemetry.sh @@ -2,29 +2,18 @@ set -e cd $BUILD_STAGINGDIRECTORY -git clone https://github.com/microsoft/vscode-telemetry-extractor.git -cd vscode-telemetry-extractor -git checkout 4e64f3de30f8fccb58ebdc0d85c4861a135d46cf -npm i -npm run compile -cd src -mkdir telemetry-sources -cd telemetry-sources +mkdir extraction +cd extraction git clone --depth 1 https://github.com/Microsoft/vscode-extension-telemetry.git git clone --depth 1 https://github.com/Microsoft/vscode-chrome-debug-core.git -git clone --depth 1 https://github.com/Microsoft/vscode-chrome-debug.git git clone --depth 1 https://github.com/Microsoft/vscode-node-debug2.git git clone --depth 1 https://github.com/Microsoft/vscode-node-debug.git -git clone --depth 1 https://github.com/Microsoft/vscode-docker.git -git clone --depth 1 https://github.com/Microsoft/vscode-go.git -git clone --depth 1 https://github.com/Microsoft/vscode-azure-account.git git clone --depth 1 https://github.com/Microsoft/vscode-html-languageservice.git git clone --depth 1 https://github.com/Microsoft/vscode-json-languageservice.git -git clone --depth 1 https://github.com/Microsoft/vscode-mono-debug.git -git clone --depth 1 https://github.com/Microsoft/TypeScript.git -cd ../../ -node ./out/cli-extract.js --sourceDir $BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement -node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement +$BUILD_SOURCESDIRECTORY/build/node_modules/.bin/vscode-telemetry-extractor --sourceDir $BUILD_SOURCESDIRECTORY --excludedDir $BUILD_SOURCESDIRECTORY/extensions --outputDir . --applyEndpoints +$BUILD_SOURCESDIRECTORY/build/node_modules/.bin/vscode-telemetry-extractor --config $BUILD_SOURCESDIRECTORY/build/azure-pipelines/common/telemetry-config.json -o . mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry mv declarations-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-core.json -mv declarations-extensions-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json \ No newline at end of file +mv config-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json +cd .. +rm -rf extraction \ No newline at end of file diff --git a/build/azure-pipelines/common/telemetry-config.json b/build/azure-pipelines/common/telemetry-config.json new file mode 100644 index 00000000000..fcba1e042ba --- /dev/null +++ b/build/azure-pipelines/common/telemetry-config.json @@ -0,0 +1,72 @@ +[ + { + "eventPrefix": "typescript-language-features/", + "sourceDirs": [ + "../../s/extensions/typescript-language-features" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "git/", + "sourceDirs": [ + "../../s/extensions/git" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "extension-telemetry/", + "sourceDirs": [ + "vscode-extension-telemetry" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "vscode-markdown/", + "sourceDirs": [ + "../../s/extensions/markdown-language-features" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "html-language-features/", + "sourceDirs": [ + "../../s/extensions/html-language-features", + "vscode-html-languageservice" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "json-language-features/", + "sourceDirs": [ + "../../s/extensions/json-language-features", + "vscode-json-languageservice" + ], + "excludedDirs": [], + "applyEndpoints": true + }, + { + "eventPrefix": "ms-vscode.node2/", + "sourceDirs": [ + "vscode-chrome-debug-core", + "vscode-node-debug2" + ], + "excludedDirs": [], + "applyEndpoints": true, + "patchDebugEvents": true + }, + { + "eventPrefix": "ms-vscode.node/", + "sourceDirs": [ + "vscode-chrome-debug-core", + "vscode-node-debug" + ], + "excludedDirs": [], + "applyEndpoints": true, + "patchDebugEvents": true + } +] \ No newline at end of file diff --git a/build/package.json b/build/package.json index 622b7b59351..d217cae2443 100644 --- a/build/package.json +++ b/build/package.json @@ -42,6 +42,7 @@ "tslint": "^5.9.1", "typescript": "3.5.2", "vsce": "1.48.0", + "vscode-telemetry-extractor": "1.4.3", "xml2js": "^0.4.17" }, "scripts": { diff --git a/package.json b/package.json index 4a0241ff117..4f231bcd688 100644 --- a/package.json +++ b/package.json @@ -158,4 +158,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} +} \ No newline at end of file From 27c59a0b494104b1bacab208a2b68c555db0effe Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 18 Jul 2019 17:53:46 +0200 Subject: [PATCH 157/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f231bcd688..e5b3a5e80fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "8dcd7590deff4d860f0fda2554b4c7daa7950c03", + "distro": "02f64b63759f873b1fe125ef9e4f3d20e73d30e5", "author": { "name": "Microsoft Corporation" }, From 3ed735d3650f6fee9b0a41904ea58e6463bb5301 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Wed, 17 Jul 2019 23:58:44 +0200 Subject: [PATCH 158/190] support debug broadcast svc for web --- .../workbench/browser/web.simpleservices.ts | 6 +-- .../common/extensionHostDebugIpc.ts | 50 +++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index b6e17d60b4e..9cfaf411337 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -38,12 +38,10 @@ import { ParsedArgs } from 'vs/platform/environment/common/environment'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { toStoreData, restoreRecentlyOpened } from 'vs/platform/history/common/historyStorage'; -// tslint:disable-next-line: import-patterns -import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; -//import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -//import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; +// tslint:disable-next-line: import-patterns +import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; //#region Download diff --git a/src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts b/src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts new file mode 100644 index 00000000000..e9410a83c83 --- /dev/null +++ b/src/vs/workbench/services/extensions/common/extensionHostDebugIpc.ts @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; +import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; +import { IReloadSessionEvent, ICloseSessionEvent, IAttachSessionEvent, ILogToSessionEvent, ITerminateSessionEvent } from 'vs/workbench/services/extensions/common/extensionHostDebug'; +import { Event, Emitter } from 'vs/base/common/event'; + +export class EchoChannel implements IServerChannel { + + private _onCloseEmitter = new Emitter(); + private _onReloadEmitter = new Emitter(); + private _onTerminateEmitter = new Emitter(); + private _onLogToEmitter = new Emitter(); + private _onAttachEmitter = new Emitter(); + + call(ctx: RemoteAgentConnectionContext, command: string, arg?: any): Promise { + switch (command) { + case 'close': + return Promise.resolve(this._onCloseEmitter.fire({ sessionId: arg[0] })); + case 'reload': + return Promise.resolve(this._onReloadEmitter.fire({ sessionId: arg[0] })); + case 'terminate': + return Promise.resolve(this._onTerminateEmitter.fire({ sessionId: arg[0] })); + case 'log': + return Promise.resolve(this._onLogToEmitter.fire({ sessionId: arg[0], log: arg[1] })); + case 'attach': + return Promise.resolve(this._onAttachEmitter.fire({ sessionId: arg[0], port: arg[1], subId: arg[2] })); + } + throw new Error('Method not implemented.'); + } + + listen(ctx: RemoteAgentConnectionContext, event: string, arg?: any): Event { + switch (event) { + case 'close': + return this._onCloseEmitter.event; + case 'reload': + return this._onReloadEmitter.event; + case 'terminate': + return this._onTerminateEmitter.event; + case 'log': + return this._onLogToEmitter.event; + case 'attach': + return this._onAttachEmitter.event; + } + throw new Error('Method not implemented.'); + } +} From d44f9dae34f0f8ddc07ab7d8bf394225c8b02a75 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 17 Jul 2019 15:07:31 -0700 Subject: [PATCH 159/190] Use array of string for applicable builtin settings --- extensions/git/package.json | 6 ++++++ extensions/markdown-language-features/package.json | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index 814f53020aa..4a789aaa6ad 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1246,12 +1246,18 @@ }, "git.ignoredRepositories": { "type": "array", + "items": { + "type": "string" + }, "default": [], "scope": "window", "description": "%config.ignoredRepositories%" }, "git.scanRepositories": { "type": "array", + "items": { + "type": "string" + }, "default": [], "scope": "resource", "description": "%config.scanRepositories%" diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index 8e841a982aa..0d74e1ac674 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -4,8 +4,8 @@ "description": "%description%", "version": "1.0.0", "icon": "icon.png", - "publisher": "vscode", - "enableProposedApi": true, + "publisher": "vscode", + "enableProposedApi": true, "license": "MIT", "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "engines": { @@ -187,6 +187,9 @@ "properties": { "markdown.styles": { "type": "array", + "items": { + "type": "string" + }, "default": [], "description": "%markdown.styles.dec%", "scope": "resource" From 6da8b1c158ef50dbf3af0b379544384a9d21bfc7 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Thu, 18 Jul 2019 10:17:41 -0700 Subject: [PATCH 160/190] Fix #77277, make info colors in error peek view match --- src/vs/platform/theme/common/colorRegistry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 11cb7598f9c..1a5e6e79217 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -271,8 +271,8 @@ export const editorErrorBorder = registerColor('editorError.border', { dark: nul export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#E9A700', hc: null }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.')); export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#FFCC00').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning boxes in the editor.')); -export const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('editorInfo.foreground', 'Foreground color of info squigglies in the editor.')); -export const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info boxes in the editor.')); +export const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#75BEFF', light: '#75BEFF', hc: null }, nls.localize('editorInfo.foreground', 'Foreground color of info squigglies in the editor.')); +export const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#75BEFF').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info boxes in the editor.')); export const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, nls.localize('editorHint.foreground', 'Foreground color of hint squigglies in the editor.')); export const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hc: Color.fromHex('#eeeeee').transparent(0.8) }, nls.localize('hintBorder', 'Border color of hint boxes in the editor.')); From 0cfa49c43017fb4b197199cbf918a0ec4d71abe7 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Thu, 18 Jul 2019 10:28:50 -0700 Subject: [PATCH 161/190] Fix #77368, provide better contrast between cursor and bracket match --- src/vs/editor/common/view/editorColorRegistry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index 2ee2b7c8831..23d5e072b9d 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { Color, RGBA } from 'vs/base/common/color'; -import { activeContrastBorder, editorBackground, editorForeground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder } from 'vs/platform/theme/common/colorRegistry'; +import { activeContrastBorder, editorBackground, editorForeground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; /** @@ -31,7 +31,7 @@ export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5 export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#999999', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor code lenses')); export const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hc: '#0064001a' }, nls.localize('editorBracketMatchBackground', 'Background color behind matching brackets')); -export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: '#fff' }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes')); +export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: contrastBorder }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes')); export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hc: '#7f7f7f4d' }, nls.localize('editorOverviewRulerBorder', 'Color of the overview ruler border.')); From cd14ea9592119de0ee95886872ac12cdd2ed6723 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 18 Jul 2019 10:51:25 -0700 Subject: [PATCH 162/190] Properly dispose of comment thread when removing empty widget, fixes #77588 --- src/vs/editor/common/modes.ts | 2 +- .../contrib/comments/browser/commentThreadWidget.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index f9caed90bae..d6438d398c3 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1285,7 +1285,7 @@ export interface CommentThread { commentThreadHandle: number; controllerHandle: number; extensionId?: string; - threadId: string | null; + threadId: string; resource: string | null; range: IRange; label: string; diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts index 67f7d8f2042..fcd4e69ba33 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts @@ -247,9 +247,14 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget this._actionbarWidget.push([...groups, this._collapseAction], { label: false, icon: true }); } + private deleteCommentThread(): void { + this.dispose(); + this.commentService.disposeCommentThread(this.owner, this._commentThread.threadId); + } + public collapse(): Promise { if (this._commentThread.comments && this._commentThread.comments.length === 0) { - this.dispose(); + this.deleteCommentThread(); return Promise.resolve(); } @@ -268,7 +273,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget if (this._isExpanded) { this.hide(); if (!this._commentThread.comments || !this._commentThread.comments.length) { - this.dispose(); + this.deleteCommentThread(); } } else { this.show({ lineNumber: lineNumber, column: 1 }, 2); From a6c461b564ad5857a8bd1486d336a3678039030a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 18 Jul 2019 20:08:00 +0200 Subject: [PATCH 163/190] missing yarn.lock --- build/yarn.lock | 328 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) diff --git a/build/yarn.lock b/build/yarn.lock index 3bba51751e1..02f533c9ce5 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -2,6 +2,14 @@ # yarn lockfile v1 +"@dsherret/to-absolute-glob@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1f6475dc8bd974cea07a2daf3864b317b1dd332c" + integrity sha1-H2R13IvZdM6gei2vOGSzF7HdMyw= + dependencies: + is-absolute "^1.0.0" + is-negated-glob "^1.0.0" + "@gulp-sourcemaps/map-sources@1.X": version "1.0.0" resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz#890ae7c5d8c877f6d384860215ace9d7ec945bda" @@ -10,6 +18,27 @@ normalize-path "^2.0.1" through2 "^2.0.3" +"@nodelib/fs.scandir@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.1.tgz#7fa8fed654939e1a39753d286b48b4836d00e0eb" + integrity sha512-NT/skIZjgotDSiXs0WqYhgcuBKhUMgfekCmCGtkUAiLqZdOnrdjmZr9wRl3ll64J9NF79uZ4fk16Dx0yMc/Xbg== + dependencies: + "@nodelib/fs.stat" "2.0.1" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.1", "@nodelib/fs.stat@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.1.tgz#814f71b1167390cfcb6a6b3d9cdeb0951a192c14" + integrity sha512-+RqhBlLn6YRBGOIoVYthsG0J9dfpO79eJyN7BYBkZJtfqrBwf2KK+rD/M/yjZR6WBmIhAgOV7S60eCgaSWtbFw== + +"@nodelib/fs.walk@^1.2.1": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.2.tgz#6a6450c5e17012abd81450eb74949a4d970d2807" + integrity sha512-J/DR3+W12uCzAJkw7niXDcqcKBg6+5G5Q/ZpThpGNzAUz70eOR6RV4XnnSN01qHZiVl0eavoxJsBypQoKsV2QQ== + dependencies: + "@nodelib/fs.scandir" "2.1.1" + fastq "^1.6.0" + "@types/ansi-colors@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@types/ansi-colors/-/ansi-colors-3.2.0.tgz#3e4fe85d9131ce1c6994f3040bd0b25306c16a6e" @@ -344,16 +373,36 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +array-back@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + array-differ@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= +array-differ@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" + integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= +arrify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" + integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== + asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" @@ -481,6 +530,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + browserify-mime@~1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/browserify-mime/-/browserify-mime-1.2.9.tgz#aeb1af28de6c0d7a6a2ce40adb68ff18422af31f" @@ -548,6 +604,11 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= +code-block-writer@9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-9.4.1.tgz#1448fca79dfc7a3649000f4c85be6bc770604c4c" + integrity sha512-LHAB+DL4YZDcwK8y/kAxZ0Lf/ncwLh/Ux4cTVWbPwIdrf1gPxXiPcwpz8r8/KqXu1aD+Raz46EOxDjFlbyO6bA== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -584,6 +645,16 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" +command-line-args@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.1.1.tgz#88e793e5bb3ceb30754a86863f0401ac92fd369a" + integrity sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg== + dependencies: + array-back "^3.0.1" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + commander@^2.12.1, commander@^2.8.1: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" @@ -710,6 +781,13 @@ diff@^3.2.0: resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + documentdb@1.13.0: version "1.13.0" resolved "https://registry.yarnpkg.com/documentdb/-/documentdb-1.13.0.tgz#bba6f03150b2f42498cec4261bc439d834a33f8b" @@ -829,11 +907,30 @@ fast-deep-equal@^1.0.0: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= +fast-glob@^3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.0.4.tgz#d484a41005cb6faeb399b951fd1bd70ddaebb602" + integrity sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg== + dependencies: + "@nodelib/fs.stat" "^2.0.1" + "@nodelib/fs.walk" "^1.2.1" + glob-parent "^5.0.0" + is-glob "^4.0.1" + merge2 "^1.2.3" + micromatch "^4.0.2" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= +fastq@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" + integrity sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + dependencies: + reusify "^1.0.0" + fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" @@ -841,6 +938,20 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -864,6 +975,15 @@ form-data@~2.3.1: combined-stream "1.0.6" mime-types "^2.1.12" +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -886,6 +1006,13 @@ github-releases@^0.4.1: prettyjson "1.2.1" request "2.81.0" +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + glob@^7.0.6, glob@^7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" @@ -898,6 +1025,32 @@ glob@^7.0.6, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" + integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + glogg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.1.tgz#dcf758e44789cc3f3d32c1f3562a3676e6a34810" @@ -910,6 +1063,11 @@ graceful-fs@4.X: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== + gulp-bom@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gulp-bom/-/gulp-bom-1.0.0.tgz#38a183a07187bd57a7922d37977441f379df2abf" @@ -1086,6 +1244,11 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" +ignore@^5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.2.tgz#e28e584d43ad7e92f96995019cc43b9e1ac49558" + integrity sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1099,16 +1262,65 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +is-absolute@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== + dependencies: + is-relative "^1.0.0" + is-windows "^1.0.1" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-relative@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== + dependencies: + is-unc-path "^1.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-unc-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== + dependencies: + unc-path-regex "^0.1.2" + is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= +is-windows@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -1171,6 +1383,13 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -1248,6 +1467,11 @@ lodash._root@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + lodash.escape@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" @@ -1331,6 +1555,19 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + mime-db@~1.30.0: version "1.30.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" @@ -1382,6 +1619,17 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +multimatch@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-4.0.0.tgz#8c3c0f6e3e8449ada0af3dd29efb491a375191b3" + integrity sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ== + dependencies: + "@types/minimatch" "^3.0.3" + array-differ "^3.0.0" + array-union "^2.1.0" + arrify "^2.0.1" + minimatch "^3.0.4" + multipipe@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" @@ -1480,6 +1728,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -1495,6 +1748,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picomatch@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" + integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + prettyjson@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prettyjson/-/prettyjson-1.2.1.tgz#fcffab41d19cab4dfae5e575e64246619b12d289" @@ -1667,6 +1925,16 @@ resolve@^1.3.2: dependencies: path-parse "^1.0.5" +reusify@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + safe-buffer@^5.0.1, safe-buffer@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -1702,6 +1970,11 @@ semver@^5.1.0, semver@^5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -1825,6 +2098,13 @@ tmp@0.0.29: dependencies: os-tmpdir "~1.0.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + tough-cookie@~2.3.0: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" @@ -1839,6 +2119,20 @@ tough-cookie@~2.3.3: dependencies: punycode "^1.4.1" +ts-morph@^3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-3.1.3.tgz#bbfa1d14481ee23bdd1c030340ccf4a243cfc844" + integrity sha512-CwjgyJTtd3f8vBi7Vr0IOgdOY6Wi/Tq0MhieXOE2B5ns5WWRD7BwMNHtv+ZufKI/S2U/lMrh+Q3bOauE4tsv2g== + dependencies: + "@dsherret/to-absolute-glob" "^2.0.2" + code-block-writer "9.4.1" + fs-extra "^8.1.0" + glob-parent "^5.0.0" + globby "^10.0.1" + is-negated-glob "^1.0.0" + multimatch "^4.0.0" + typescript "^3.0.1" + tslib@^1.8.0, tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -1899,11 +2193,26 @@ typescript@3.5.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== +typescript@^3.0.1: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== + +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376" integrity sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg== +unc-path-regex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + underscore@1.8.3, underscore@~1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" @@ -1914,6 +2223,11 @@ underscore@^1.8.3: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -1994,6 +2308,20 @@ vsce@1.48.0: yauzl "^2.3.1" yazl "^2.2.2" +vscode-ripgrep@^1.4.0: + version "1.5.4" + resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.4.tgz#dae1c3eef350513299341cdf96e622c00b548eff" + integrity sha512-Bs8SvFAkR0QHf09J46VgNo19yRikOtj/f0zHzK3AM3ICjCGNN/BNoG9of6zGVHUTO+6Mk1RbKglyOHLKr8D1lg== + +vscode-telemetry-extractor@1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.4.3.tgz#e4af380beb4e2a63d6e4fa819b25ba7ef6dc4a10" + integrity sha512-OFklPErZnUBjrKte3hg+irQXue5rzgz4qnvE8kdaOnW1E/wynHUEXW9t5vF5q0hu2lodpGMkybwLkSjONZVzvg== + dependencies: + command-line-args "^5.1.1" + ts-morph "^3.1.2" + vscode-ripgrep "^1.4.0" + vso-node-api@6.1.2-preview: version "6.1.2-preview" resolved "https://registry.yarnpkg.com/vso-node-api/-/vso-node-api-6.1.2-preview.tgz#aab3546df2451ecd894e071bb99b5df19c5fa78f" From a407a73fd319c6777a8200040b4cb1d6bcbcfb52 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 18 Jul 2019 11:25:12 -0700 Subject: [PATCH 164/190] Bump vscode-ripgrep in remote/ too --- remote/package.json | 2 +- remote/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/remote/package.json b/remote/package.json index 57b51c1b82d..a4113e1e74c 100644 --- a/remote/package.json +++ b/remote/package.json @@ -18,7 +18,7 @@ "spdlog": "^0.9.0", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", - "vscode-ripgrep": "^1.3.1", + "vscode-ripgrep": "^1.5.4", "vscode-textmate": "^4.2.2", "xterm": "3.15.0-beta71", "xterm-addon-search": "0.2.0-beta2", diff --git a/remote/yarn.lock b/remote/yarn.lock index 78b7393ad6d..9aa7137893e 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -1123,10 +1123,10 @@ vscode-proxy-agent@0.4.0: https-proxy-agent "2.2.1" socks-proxy-agent "4.0.1" -vscode-ripgrep@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.3.1.tgz#51fb93debcd0c18a8b90dbc37f84f94333d0c486" - integrity sha512-4WLB/n4ZeWNi5AEzPTkfYrqbKtXlv0SlgmxbRVdulwZzGx/lfWeWPu9Shy32orM27IofQAQDuirbRBOYNJVzBA== +vscode-ripgrep@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.4.tgz#dae1c3eef350513299341cdf96e622c00b548eff" + integrity sha512-Bs8SvFAkR0QHf09J46VgNo19yRikOtj/f0zHzK3AM3ICjCGNN/BNoG9of6zGVHUTO+6Mk1RbKglyOHLKr8D1lg== vscode-textmate@^4.2.2: version "4.2.2" From d5dc23c7b900103b3a6123a6d228bd9f696c2fed Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 18 Jul 2019 11:40:24 -0700 Subject: [PATCH 165/190] Fix rendering of comment actions that have no icon, fixes #77116 --- .../contrib/comments/browser/media/review.css | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/comments/browser/media/review.css b/src/vs/workbench/contrib/comments/browser/media/review.css index 82ad6c76234..f7cb3fd20d1 100644 --- a/src/vs/workbench/contrib/comments/browser/media/review.css +++ b/src/vs/workbench/contrib/comments/browser/media/review.css @@ -29,10 +29,6 @@ height: 21px; } -.monaco-editor .review-widget .body .review-comment .comment-actions .action-item { - width: 22px; -} - .monaco-editor .review-widget .body .review-comment .comment-title { display: flex; width: 100%; @@ -148,10 +144,6 @@ margin-right: 4px; } -.monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { - display: inline-block; -} - .monaco-editor .review-widget .head .review-actions > .monaco-action-bar .icon.expand-review-action { background-image: url("./close-light.svg"); background-size: 16px; @@ -220,7 +212,6 @@ display: block; height: 16px; line-height: 16px; - min-width: 28px; background-size: 16px; background-position: center center; background-repeat: no-repeat; @@ -433,7 +424,8 @@ height: 100%; } -.monaco-editor .review-widget .head .review-actions > .monaco-action-bar .action-item { +.monaco-editor .review-widget .action-item { + min-width: 16px; margin-left: 4px; } From 4b46756a3fb76214b96ca753b76da6c6d9e52e95 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 18 Jul 2019 11:48:48 -0700 Subject: [PATCH 166/190] Remove unused comment icons --- .../comments/browser/media/delete-dark.svg | 3 --- .../comments/browser/media/delete-hc.svg | 3 --- .../comments/browser/media/delete-light.svg | 3 --- .../comments/browser/media/edit-dark.svg | 4 --- .../comments/browser/media/edit-hc.svg | 4 --- .../comments/browser/media/edit-light.svg | 4 --- .../contrib/comments/browser/media/review.css | 26 ------------------- 7 files changed, 47 deletions(-) delete mode 100644 src/vs/workbench/contrib/comments/browser/media/delete-dark.svg delete mode 100644 src/vs/workbench/contrib/comments/browser/media/delete-hc.svg delete mode 100644 src/vs/workbench/contrib/comments/browser/media/delete-light.svg delete mode 100644 src/vs/workbench/contrib/comments/browser/media/edit-dark.svg delete mode 100644 src/vs/workbench/contrib/comments/browser/media/edit-hc.svg delete mode 100644 src/vs/workbench/contrib/comments/browser/media/edit-light.svg diff --git a/src/vs/workbench/contrib/comments/browser/media/delete-dark.svg b/src/vs/workbench/contrib/comments/browser/media/delete-dark.svg deleted file mode 100644 index 75644595d19..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/delete-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/delete-hc.svg b/src/vs/workbench/contrib/comments/browser/media/delete-hc.svg deleted file mode 100644 index 75644595d19..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/delete-hc.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/delete-light.svg b/src/vs/workbench/contrib/comments/browser/media/delete-light.svg deleted file mode 100644 index cf5f28ca35c..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/delete-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/edit-dark.svg b/src/vs/workbench/contrib/comments/browser/media/edit-dark.svg deleted file mode 100644 index a72757482be..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/edit-dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/edit-hc.svg b/src/vs/workbench/contrib/comments/browser/media/edit-hc.svg deleted file mode 100644 index b507253e449..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/edit-hc.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/edit-light.svg b/src/vs/workbench/contrib/comments/browser/media/edit-light.svg deleted file mode 100644 index ae71150c0c8..00000000000 --- a/src/vs/workbench/contrib/comments/browser/media/edit-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/vs/workbench/contrib/comments/browser/media/review.css b/src/vs/workbench/contrib/comments/browser/media/review.css index f7cb3fd20d1..dd292251cd6 100644 --- a/src/vs/workbench/contrib/comments/browser/media/review.css +++ b/src/vs/workbench/contrib/comments/browser/media/review.css @@ -157,32 +157,6 @@ background-image: url("./close-hc.svg"); } -.monaco-editor .review-widget .body .review-comment .comment-title .icon.edit { - background-image: url("./edit-light.svg"); - background-size: 16px; -} - -.monaco-editor.vs-dark .review-widget .body .review-comment .comment-title .icon.edit { - background-image: url("./edit-dark.svg"); -} - -.monaco-editor.hc-black .review-widget .body .review-comment .comment-title .icon.edit { - background-image: url("./edit-hc.svg"); -} - -.monaco-editor .review-widget .body .review-comment .comment-title .icon.delete { - background-image: url("./delete-light.svg"); - background-size: 16px; -} - -.monaco-editor.vs-dark .review-widget .body .review-comment .comment-title .icon.delete { - background-image: url("./delete-dark.svg"); -} - -.monaco-editor.hc-black .review-widget .body .review-comment .comment-title .icon.delete { - background-image: url("./delete-hc.svg"); -} - .monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions { display: none; background-image: url("./reaction-light.svg"); From 78de125b5f04f7761eb3675cb0319404bd7c89d7 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 18 Jul 2019 22:33:37 +0200 Subject: [PATCH 167/190] Introduce new enablement states --- .../api/browser/mainThreadExtensionService.ts | 2 +- .../extensions/browser/extensionsActions.ts | 32 +- .../browser/extensionsWorkbenchService.ts | 16 +- .../extensions/common/extensionsUtils.ts | 2 +- .../runtimeExtensionsEditor.ts | 4 +- .../extensionsActions.test.ts | 54 +-- .../electron-browser/extensionsViews.test.ts | 4 +- .../extensionsWorkbenchService.test.ts | 244 ++++++------- .../welcome/page/browser/welcomePage.ts | 6 +- .../common/extensionEnablementService.ts | 44 ++- .../common/extensionManagement.ts | 10 +- .../extensionEnablementService.test.ts | 325 +++++++++++------- .../common/inactiveExtensionUrlHandler.ts | 2 +- 13 files changed, 424 insertions(+), 321 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts index e4453a9d4fe..41ab45643b9 100644 --- a/src/vs/workbench/api/browser/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/browser/mainThreadExtensionService.ts @@ -102,7 +102,7 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha message: localize('disabledDep', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is disabled. Would you like to enable the extension and reload the window?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name), actions: { primary: [new Action('enable', localize('enable dep', "Enable and Reload"), '', true, - () => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.Disabled ? EnablementState.Enabled : EnablementState.WorkspaceEnabled) + () => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.DisabledGlobally ? EnablementState.EnabledGlobally : EnablementState.EnabledWorkspace) .then(() => this._windowService.reloadWindow(), e => this._notificationService.error(e)))] } }); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 069634a1c0e..0670f0faa51 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -895,13 +895,13 @@ export class EnableForWorkspaceAction extends ExtensionAction { this.enabled = false; if (this.extension && this.extension.local) { this.enabled = this.extension.state === ExtensionState.Installed - && (this.extension.enablementState === EnablementState.Disabled || this.extension.enablementState === EnablementState.WorkspaceDisabled) + && !this.extensionEnablementService.isEnabled(this.extension.local) && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.WorkspaceEnabled); + return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.EnabledWorkspace); } } @@ -922,13 +922,13 @@ export class EnableGloballyAction extends ExtensionAction { this.enabled = false; if (this.extension && this.extension.local) { this.enabled = this.extension.state === ExtensionState.Installed - && this.extension.enablementState === EnablementState.Disabled + && this.extension.enablementState === EnablementState.DisabledGlobally && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.Enabled); + return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.EnabledGlobally); } } @@ -950,13 +950,13 @@ export class DisableForWorkspaceAction extends ExtensionAction { this.enabled = false; if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) { this.enabled = this.extension.state === ExtensionState.Installed - && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) + && (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace) && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.WorkspaceDisabled); + return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.DisabledWorkspace); } } @@ -977,13 +977,13 @@ export class DisableGloballyAction extends ExtensionAction { this.enabled = false; if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))) { this.enabled = this.extension.state === ExtensionState.Installed - && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) + && (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace) && this.extensionEnablementService.canChangeEnablement(this.extension.local); } } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.Disabled); + return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.DisabledGlobally); } } @@ -2528,8 +2528,8 @@ export class StatusLabelAction extends Action implements IExtensionContainer { } if (currentEnablementState !== null) { - const currentlyEnabled = currentEnablementState === EnablementState.Enabled || currentEnablementState === EnablementState.WorkspaceEnabled; - const enabled = this.enablementState === EnablementState.Enabled || this.enablementState === EnablementState.WorkspaceEnabled; + const currentlyEnabled = currentEnablementState === EnablementState.EnabledGlobally || currentEnablementState === EnablementState.EnabledWorkspace; + const enabled = this.enablementState === EnablementState.EnabledGlobally || this.enablementState === EnablementState.EnabledWorkspace; if (!currentlyEnabled && enabled) { return canAddExtension() ? localize('enabled', "Enabled") : null; } @@ -2727,7 +2727,7 @@ export class DisableAllAction extends Action { } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.Disabled); + return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.DisabledGlobally); } } @@ -2754,7 +2754,7 @@ export class DisableAllWorkpsaceAction extends Action { } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.WorkspaceDisabled); + return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.DisabledWorkspace); } } @@ -2775,11 +2775,11 @@ export class EnableAllAction extends Action { } private update(): void { - this.enabled = this.extensionsWorkbenchService.local.some(e => !!e.local && this.extensionEnablementService.canChangeEnablement(e.local) && (e.enablementState === EnablementState.Disabled || e.enablementState === EnablementState.WorkspaceDisabled)); + this.enabled = this.extensionsWorkbenchService.local.some(e => !!e.local && this.extensionEnablementService.canChangeEnablement(e.local) && !this.extensionEnablementService.isEnabled(e.local)); } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.Enabled); + return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.EnabledGlobally); } } @@ -2802,11 +2802,11 @@ export class EnableAllWorkpsaceAction extends Action { } private update(): void { - this.enabled = this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.extensionsWorkbenchService.local.some(e => !!e.local && this.extensionEnablementService.canChangeEnablement(e.local) && (e.enablementState === EnablementState.Disabled || e.enablementState === EnablementState.WorkspaceDisabled)); + this.enabled = this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.extensionsWorkbenchService.local.some(e => !!e.local && this.extensionEnablementService.canChangeEnablement(e.local) && !this.extensionEnablementService.isEnabled(e.local)); } run(): Promise { - return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.WorkspaceEnabled); + return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.EnabledWorkspace); } } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index fbefd13d378..b0c5726c6b9 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -44,7 +44,7 @@ interface IExtensionStateProvider { class Extension implements IExtension { - public enablementState: EnablementState = EnablementState.Enabled; + public enablementState: EnablementState = EnablementState.EnabledGlobally; constructor( private stateProvider: IExtensionStateProvider, @@ -887,16 +887,16 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension private checkAndEnableDisabledDependencies(extensionIdentifier: IExtensionIdentifier): Promise { const extension = this.local.filter(e => (e.local || e.gallery) && areSameExtensions(extensionIdentifier, e.identifier))[0]; if (extension) { - const disabledDepencies = this.getExtensionsRecursively([extension], this.local, EnablementState.Enabled, { dependencies: true, pack: false }); + const disabledDepencies = this.getExtensionsRecursively([extension], this.local, EnablementState.EnabledGlobally, { dependencies: true, pack: false }); if (disabledDepencies.length) { - return this.setEnablement(disabledDepencies, EnablementState.Enabled); + return this.setEnablement(disabledDepencies, EnablementState.EnabledGlobally); } } return Promise.resolve(); } private promptAndSetEnablement(extensions: IExtension[], enablementState: EnablementState): Promise { - const enable = enablementState === EnablementState.Enabled || enablementState === EnablementState.WorkspaceEnabled; + const enable = enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace; if (enable) { const allDependenciesAndPackedExtensions = this.getExtensionsRecursively(extensions, this.local, enablementState, { dependencies: true, pack: true }); return this.checkAndSetEnablement(extensions, allDependenciesAndPackedExtensions, enablementState); @@ -911,7 +911,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension private checkAndSetEnablement(extensions: IExtension[], otherExtensions: IExtension[], enablementState: EnablementState): Promise { const allExtensions = [...extensions, ...otherExtensions]; - const enable = enablementState === EnablementState.Enabled || enablementState === EnablementState.WorkspaceEnabled; + const enable = enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace; if (!enable) { for (const extension of extensions) { let dependents = this.getDependentsAfterDisablement(extension, allExtensions, this.local); @@ -936,7 +936,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension if (i.enablementState === enablementState) { return false; } - const enable = enablementState === EnablementState.Enabled || enablementState === EnablementState.WorkspaceEnabled; + const enable = enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace; return (enable || i.type === ExtensionType.User) // Include all Extensions for enablement and only user extensions for disablement && (options.dependencies || options.pack) && extensions.some(extension => @@ -960,7 +960,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension if (i === extension) { return false; } - if (i.enablementState === EnablementState.WorkspaceDisabled || i.enablementState === EnablementState.Disabled) { + if (!(i.enablementState === EnablementState.EnabledWorkspace || i.enablementState === EnablementState.EnabledGlobally)) { return false; } if (extensionsToDisable.indexOf(i) !== -1) { @@ -1010,7 +1010,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension ] } */ - this.telemetryService.publicLog(enablementState === EnablementState.Enabled || enablementState === EnablementState.WorkspaceEnabled ? 'extension:enable' : 'extension:disable', extensions[i].telemetryData); + this.telemetryService.publicLog(enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace ? 'extension:enable' : 'extension:disable', extensions[i].telemetryData); } } return changed; diff --git a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts index 282978991f9..ea48be50fa0 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionsUtils.ts @@ -71,7 +71,7 @@ export class KeymapExtensions extends Disposable implements IWorkbenchContributi */ this.telemetryService.publicLog('disableOtherKeymaps', telemetryData); if (confirmed) { - this.extensionEnablementService.setEnablement(oldKeymaps.map(keymap => keymap.local), EnablementState.Disabled); + this.extensionEnablementService.setEnablement(oldKeymaps.map(keymap => keymap.local), EnablementState.DisabledGlobally); } }; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts index 92c40276e84..1366ea7ebd8 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -420,8 +420,8 @@ export class RuntimeExtensionsEditor extends BaseEditor { actions.push(new Separator()); if (e.element.marketplaceInfo) { - actions.push(new Action('runtimeExtensionsEditor.action.disableWorkspace', nls.localize('disable workspace', "Disable (Workspace)"), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element!.marketplaceInfo, EnablementState.WorkspaceDisabled))); - actions.push(new Action('runtimeExtensionsEditor.action.disable', nls.localize('disable', "Disable"), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element!.marketplaceInfo, EnablementState.Disabled))); + actions.push(new Action('runtimeExtensionsEditor.action.disableWorkspace', nls.localize('disable workspace', "Disable (Workspace)"), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element!.marketplaceInfo, EnablementState.DisabledWorkspace))); + actions.push(new Action('runtimeExtensionsEditor.action.disable', nls.localize('disable', "Disable"), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element!.marketplaceInfo, EnablementState.DisabledGlobally))); actions.push(new Separator()); } const state = this._extensionHostProfileService.state; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index ab4af28558b..36d5027e8f4 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -602,7 +602,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableForWorkspaceAction when the extension is disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -617,7 +617,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableForWorkspaceAction when extension is disabled for workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -632,8 +632,8 @@ suite('ExtensionsActions Test', () => { test('Test EnableForWorkspaceAction when the extension is disabled globally and workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace)) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -666,7 +666,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableGloballyAction when the extension is disabled for workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -681,7 +681,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableGloballyAction when the extension is disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -696,8 +696,8 @@ suite('ExtensionsActions Test', () => { test('Test EnableGloballyAction when the extension is disabled in both', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace)) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -730,7 +730,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableDropDownAction when extension is installed and disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -745,7 +745,7 @@ suite('ExtensionsActions Test', () => { test('Test EnableDropDownAction when extension is installed and disabled for workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -806,7 +806,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableForWorkspaceAction when the extension is disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -821,7 +821,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableForWorkspaceAction when the extension is disabled workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -854,7 +854,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableGloballyAction when the extension is disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -869,7 +869,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableGloballyAction when the extension is disabled for workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -914,7 +914,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableDropDownAction when extension is installed and disabled globally', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -929,7 +929,7 @@ suite('ExtensionsActions Test', () => { test('Test DisableDropDownAction when extension is installed and disabled for workspace', () => { const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace) .then(() => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); @@ -1198,7 +1198,7 @@ suite('ExtensionsActions Test', () => { test('Test ReloadAction when extension is updated when not running', () => { instantiationService.stubPromise(IExtensionService, 'getExtensions', [{ identifier: new ExtensionIdentifier('pub.b'), extensionLocation: URI.file('pub.b') }]); const local = aLocalExtension('a', { version: '1.0.1' }); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { const testObject: ExtensionsActions.ReloadAction = instantiationService.createInstance(ExtensionsActions.ReloadAction); instantiationService.createInstance(ExtensionContainers, [testObject]); @@ -1226,7 +1226,7 @@ suite('ExtensionsActions Test', () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]); return workbenchService.queryLocal().then(extensions => { testObject.extension = extensions[0]; - return workbenchService.setEnablement(extensions[0], EnablementState.Disabled) + return workbenchService.setEnablement(extensions[0], EnablementState.DisabledGlobally) .then(() => testObject.update()) .then(() => { assert.ok(testObject.enabled); @@ -1245,8 +1245,8 @@ suite('ExtensionsActions Test', () => { return workbenchService.queryLocal(). then(extensions => { testObject.extension = extensions[0]; - return workbenchService.setEnablement(extensions[0], EnablementState.Disabled) - .then(() => workbenchService.setEnablement(extensions[0], EnablementState.Enabled)) + return workbenchService.setEnablement(extensions[0], EnablementState.DisabledGlobally) + .then(() => workbenchService.setEnablement(extensions[0], EnablementState.EnabledGlobally)) .then(() => assert.ok(!testObject.enabled)); }); }); @@ -1254,7 +1254,7 @@ suite('ExtensionsActions Test', () => { test('Test ReloadAction when extension is enabled when not running', () => { instantiationService.stubPromise(IExtensionService, 'getExtensions', [{ identifier: new ExtensionIdentifier('pub.b'), extensionLocation: URI.file('pub.b') }]); const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { const testObject: ExtensionsActions.ReloadAction = instantiationService.createInstance(ExtensionsActions.ReloadAction); instantiationService.createInstance(ExtensionContainers, [testObject]); @@ -1263,7 +1263,7 @@ suite('ExtensionsActions Test', () => { return workbenchService.queryLocal() .then(extensions => { testObject.extension = extensions[0]; - return workbenchService.setEnablement(extensions[0], EnablementState.Enabled) + return workbenchService.setEnablement(extensions[0], EnablementState.EnabledGlobally) .then(() => testObject.update()) .then(() => { assert.ok(testObject.enabled); @@ -1276,7 +1276,7 @@ suite('ExtensionsActions Test', () => { test('Test ReloadAction when extension enablement is toggled when not running', () => { instantiationService.stubPromise(IExtensionService, 'getExtensions', [{ identifier: new ExtensionIdentifier('pub.b'), extensionLocation: URI.file('pub.b') }]); const local = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { const testObject: ExtensionsActions.ReloadAction = instantiationService.createInstance(ExtensionsActions.ReloadAction); instantiationService.createInstance(ExtensionContainers, [testObject]); @@ -1285,8 +1285,8 @@ suite('ExtensionsActions Test', () => { return workbenchService.queryLocal() .then(extensions => { testObject.extension = extensions[0]; - return workbenchService.setEnablement(extensions[0], EnablementState.Enabled) - .then(() => workbenchService.setEnablement(extensions[0], EnablementState.Disabled)) + return workbenchService.setEnablement(extensions[0], EnablementState.EnabledGlobally) + .then(() => workbenchService.setEnablement(extensions[0], EnablementState.DisabledGlobally)) .then(() => assert.ok(!testObject.enabled)); }); }); @@ -1295,7 +1295,7 @@ suite('ExtensionsActions Test', () => { test('Test ReloadAction when extension is updated when not running and enabled', () => { instantiationService.stubPromise(IExtensionService, 'getExtensions', [{ identifier: new ExtensionIdentifier('pub.b'), extensionLocation: URI.file('pub.b') }]); const local = aLocalExtension('a', { version: '1.0.1' }); - return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally) .then(() => { const testObject: ExtensionsActions.ReloadAction = instantiationService.createInstance(ExtensionsActions.ReloadAction); instantiationService.createInstance(ExtensionContainers, [testObject]); @@ -1308,7 +1308,7 @@ suite('ExtensionsActions Test', () => { const gallery = aGalleryExtension('a', { identifier: local.identifier, version: '1.0.2' }); installEvent.fire({ identifier: gallery.identifier, gallery }); didInstallEvent.fire({ identifier: gallery.identifier, gallery, operation: InstallOperation.Install, local: aLocalExtension('a', gallery, gallery) }); - return workbenchService.setEnablement(extensions[0], EnablementState.Enabled) + return workbenchService.setEnablement(extensions[0], EnablementState.EnabledGlobally) .then(() => testObject.update()) .then(() => { assert.ok(testObject.enabled); diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 00b4e80ab1f..90db9e85e98 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -145,8 +145,8 @@ suite('ExtensionsListView Tests', () => { ]); } }); - await (instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledTheme], EnablementState.Disabled); - await (instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledLanguage], EnablementState.Disabled); + await (instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledTheme], EnablementState.DisabledGlobally); + await (instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledLanguage], EnablementState.DisabledGlobally); instantiationService.set(IExtensionsWorkbenchService, instantiationService.createInstance(ExtensionsWorkbenchService)); testableView = instantiationService.createInstance(ExtensionsListView, {}); diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index ff52c3d1cda..69b101504fa 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -482,86 +482,86 @@ suite('ExtensionsWorkbenchServiceTest', () => { }); test('test uninstalled extensions are always enabled', async () => { - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledWorkspace)) .then(async () => { testObject = await aWorkbenchService(); instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a'))); return testObject.queryGallery(CancellationToken.None).then(pagedResponse => { const actual = pagedResponse.firstPage[0]; - assert.equal(actual.enablementState, EnablementState.Enabled); + assert.equal(actual.enablementState, EnablementState.EnabledGlobally); }); }); }); test('test enablement state installed enabled extension', async () => { - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [aLocalExtension('a')]); testObject = await aWorkbenchService(); const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Enabled); + assert.equal(actual.enablementState, EnablementState.EnabledGlobally); }); }); test('test workspace disabled extension', async () => { const extensionA = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('d')], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.WorkspaceDisabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('e')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('d')], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledWorkspace)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('e')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA]); testObject = await aWorkbenchService(); const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.WorkspaceDisabled); + assert.equal(actual.enablementState, EnablementState.DisabledWorkspace); }); }); test('test globally disabled extension', async () => { const localExtension = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('d')], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('d')], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localExtension]); testObject = await aWorkbenchService(); const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Disabled); + assert.equal(actual.enablementState, EnablementState.DisabledGlobally); }); }); test('test enablement state is updated for user extensions', async () => { - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [aLocalExtension('a')]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.WorkspaceDisabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledWorkspace) .then(() => { const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.WorkspaceDisabled); + assert.equal(actual.enablementState, EnablementState.DisabledWorkspace); }); }); }); test('test enable extension globally when extension is disabled for workspace', async () => { const localExtension = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.WorkspaceDisabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.DisabledWorkspace) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localExtension]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Enabled) + return testObject.setEnablement(testObject.local[0], EnablementState.EnabledGlobally) .then(() => { const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Enabled); + assert.equal(actual.enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -570,10 +570,10 @@ suite('ExtensionsWorkbenchServiceTest', () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [aLocalExtension('a')]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Disabled); + assert.equal(actual.enablementState, EnablementState.DisabledGlobally); }); }); @@ -581,25 +581,25 @@ suite('ExtensionsWorkbenchServiceTest', () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [aLocalExtension('a', {}, { type: ExtensionType.System })]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Disabled); + assert.equal(actual.enablementState, EnablementState.DisabledGlobally); }); }); test('test enablement state is updated on change from outside', async () => { const localExtension = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localExtension]); testObject = await aWorkbenchService(); - return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.DisabledGlobally) .then(() => { const actual = testObject.local[0]; - assert.equal(actual.enablementState, EnablementState.Disabled); + assert.equal(actual.enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -609,17 +609,17 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -629,17 +629,17 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -649,17 +649,17 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -669,13 +669,13 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[1], EnablementState.Disabled).then(() => assert.fail('Should fail'), error => assert.ok(true)); + return testObject.setEnablement(testObject.local[1], EnablementState.DisabledGlobally).then(() => assert.fail('Should fail'), error => assert.ok(true)); }); }); @@ -684,15 +684,15 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[1], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[1], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[1].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[1].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -702,19 +702,19 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); const target = sinon.spy(); testObject = await aWorkbenchService(); - return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.Disabled) + return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.DisabledGlobally) .then(() => { assert.ok(!target.called); - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -724,19 +724,19 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); const target = sinon.spy(); testObject = await aWorkbenchService(); - return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.Enabled) + return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.EnabledGlobally) .then(() => { assert.ok(!target.called); - assert.equal(testObject.local[0].enablementState, EnablementState.Enabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.EnabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -746,16 +746,16 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c', { extensionDependencies: ['pub.b'] }); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -765,16 +765,16 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c', { extensionDependencies: ['pub.b'] }); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Disabled); + assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally); }); }); }); @@ -784,14 +784,14 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b', { extensionDependencies: ['pub.a'] }); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => assert.fail('An extension with dependent should not be disabled'), () => null); }); }); @@ -801,16 +801,16 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c', { extensionDependencies: ['pub.b'] }); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) - .then(() => assert.equal(testObject.local[0].enablementState, EnablementState.Disabled)); + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) + .then(() => assert.equal(testObject.local[0].enablementState, EnablementState.DisabledGlobally)); }); }); @@ -819,13 +819,13 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b', { extensionDependencies: ['pub.c'] }); const extensionC = aLocalExtension('c', { extensionDependencies: ['pub.a'] }); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Enabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Enabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.EnabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.EnabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => assert.fail('An extension with dependent should not be disabled'), () => null); }); }); @@ -835,17 +835,17 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Enabled) + return testObject.setEnablement(testObject.local[0], EnablementState.EnabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Enabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.EnabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -855,18 +855,18 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Enabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.EnabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); const target = sinon.spy(); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Enabled) + return testObject.setEnablement(testObject.local[0], EnablementState.EnabledGlobally) .then(() => { assert.ok(!target.called); - assert.equal(testObject.local[0].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -876,19 +876,19 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b'); const extensionC = aLocalExtension('c'); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); const target = sinon.spy(); testObject = await aWorkbenchService(); - return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.Enabled) + return testObject.setEnablement([testObject.local[1], testObject.local[0]], EnablementState.EnabledGlobally) .then(() => { assert.ok(!target.called); - assert.equal(testObject.local[0].enablementState, EnablementState.Enabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.EnabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.EnabledGlobally); }); }); }); @@ -898,48 +898,48 @@ suite('ExtensionsWorkbenchServiceTest', () => { const extensionB = aLocalExtension('b', { extensionDependencies: ['pub.c'] }); const extensionC = aLocalExtension('c', { extensionDependencies: ['pub.a'] }); - return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.Disabled)) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.Disabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([extensionA], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionB], EnablementState.DisabledGlobally)) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([extensionC], EnablementState.DisabledGlobally)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [extensionA, extensionB, extensionC]); testObject = await aWorkbenchService(); - return testObject.setEnablement(testObject.local[0], EnablementState.Enabled) + return testObject.setEnablement(testObject.local[0], EnablementState.EnabledGlobally) .then(() => { - assert.equal(testObject.local[0].enablementState, EnablementState.Enabled); - assert.equal(testObject.local[1].enablementState, EnablementState.Enabled); - assert.equal(testObject.local[2].enablementState, EnablementState.Enabled); + assert.equal(testObject.local[0].enablementState, EnablementState.EnabledGlobally); + assert.equal(testObject.local[1].enablementState, EnablementState.EnabledGlobally); + assert.equal(testObject.local[2].enablementState, EnablementState.EnabledGlobally); }); }); }); test('test change event is fired when disablement flags are changed', async () => { - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [aLocalExtension('a')]); testObject = await aWorkbenchService(); const target = sinon.spy(); testObject.onChange(target); - return testObject.setEnablement(testObject.local[0], EnablementState.Disabled) + return testObject.setEnablement(testObject.local[0], EnablementState.DisabledGlobally) .then(() => assert.ok(target.calledOnce)); }); }); test('test change event is fired when disablement flags are changed from outside', async () => { const localExtension = aLocalExtension('a'); - return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.Disabled) - .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.WorkspaceDisabled)) + return instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('c')], EnablementState.DisabledGlobally) + .then(() => instantiationService.get(IExtensionEnablementService).setEnablement([aLocalExtension('b')], EnablementState.DisabledWorkspace)) .then(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localExtension]); testObject = await aWorkbenchService(); const target = sinon.spy(); testObject.onChange(target); - return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.Disabled) + return instantiationService.get(IExtensionEnablementService).setEnablement([localExtension], EnablementState.DisabledGlobally) .then(() => assert.ok(target.calledOnce)); }); }); diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts index 8317f147dfa..ab0d4193c40 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts @@ -458,7 +458,7 @@ class WelcomePage extends Disposable { .then(installed => { const local = installed.filter(i => areSameExtensions(extension.identifier, i.identifier))[0]; // TODO: Do this as part of the install to avoid multiple events. - return this.extensionEnablementService.setEnablement([local], EnablementState.Disabled).then(() => local); + return this.extensionEnablementService.setEnablement([local], EnablementState.DisabledGlobally).then(() => local); }); }); @@ -473,12 +473,12 @@ class WelcomePage extends Disposable { this.notificationService.info(strings.installing.replace('{0}', extensionSuggestion.name)); }, 300); const extensionsToDisable = extensions.filter(extension => isKeymapExtension(this.tipsService, extension) && extension.globallyEnabled).map(extension => extension.local); - extensionsToDisable.length ? this.extensionEnablementService.setEnablement(extensionsToDisable, EnablementState.Disabled) : Promise.resolve() + extensionsToDisable.length ? this.extensionEnablementService.setEnablement(extensionsToDisable, EnablementState.DisabledGlobally) : Promise.resolve() .then(() => { return foundAndInstalled.then(foundExtension => { messageDelay.cancel(); if (foundExtension) { - return this.extensionEnablementService.setEnablement([foundExtension], EnablementState.Enabled) + return this.extensionEnablementService.setEnablement([foundExtension], EnablementState.EnabledGlobally) .then(() => { /* __GDPR__FRAGMENT__ "WelcomePageInstalled-2" : { diff --git a/src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts index d4243701c05..3ceb5b20856 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionEnablementService.ts @@ -56,30 +56,34 @@ export class ExtensionEnablementService extends Disposable implements IExtension } getEnablementState(extension: IExtension): EnablementState { - if (this._isSystemDisabled(extension)) { - return EnablementState.Disabled; + if (this._isDisabledInEnv(extension)) { + return EnablementState.DisabledByEnvironemt; + } + if (this._isDisabledByExtensionKind(extension)) { + return EnablementState.DisabledByExtensionKind; } const identifier = extension.identifier; if (this.hasWorkspace) { if (this._getEnabledExtensions(StorageScope.WORKSPACE).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.WorkspaceEnabled; + return EnablementState.EnabledWorkspace; } if (this._getDisabledExtensions(StorageScope.WORKSPACE).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.WorkspaceDisabled; + return EnablementState.DisabledWorkspace; } } if (this._getDisabledExtensions(StorageScope.GLOBAL).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.Disabled; + return EnablementState.DisabledGlobally; } - return EnablementState.Enabled; + return EnablementState.EnabledGlobally; } canChangeEnablement(extension: IExtension): boolean { if (extension.manifest && extension.manifest.contributes && extension.manifest.contributes.localizations && extension.manifest.contributes.localizations.length) { return false; } - if (this._isSystemDisabled(extension)) { + const enablementState = this.getEnablementState(extension); + if (enablementState === EnablementState.DisabledByEnvironemt || enablementState === EnablementState.DisabledByExtensionKind) { return false; } return true; @@ -87,7 +91,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension async setEnablement(extensions: IExtension[], newState: EnablementState): Promise { - const workspace = newState === EnablementState.WorkspaceDisabled || newState === EnablementState.WorkspaceEnabled; + const workspace = newState === EnablementState.DisabledWorkspace || newState === EnablementState.EnabledWorkspace; if (workspace && !this.hasWorkspace) { return Promise.reject(new Error(localize('noWorkspace', "No workspace."))); } @@ -109,16 +113,16 @@ export class ExtensionEnablementService extends Disposable implements IExtension } switch (newState) { - case EnablementState.Enabled: + case EnablementState.EnabledGlobally: this._enableExtension(extension.identifier); break; - case EnablementState.Disabled: + case EnablementState.DisabledGlobally: this._disableExtension(extension.identifier); break; - case EnablementState.WorkspaceEnabled: + case EnablementState.EnabledWorkspace: this._enableExtensionInWorkspace(extension.identifier); break; - case EnablementState.WorkspaceDisabled: + case EnablementState.DisabledWorkspace: this._disableExtensionInWorkspace(extension.identifier); break; } @@ -128,10 +132,10 @@ export class ExtensionEnablementService extends Disposable implements IExtension isEnabled(extension: IExtension): boolean { const enablementState = this.getEnablementState(extension); - return enablementState === EnablementState.WorkspaceEnabled || enablementState === EnablementState.Enabled; + return enablementState === EnablementState.EnabledWorkspace || enablementState === EnablementState.EnabledGlobally; } - private _isSystemDisabled(extension: IExtension): boolean { + private _isDisabledInEnv(extension: IExtension): boolean { if (this.allUserExtensionsDisabled) { return extension.type === ExtensionType.User; } @@ -139,6 +143,10 @@ export class ExtensionEnablementService extends Disposable implements IExtension if (Array.isArray(disabledExtensions)) { return disabledExtensions.some(id => areSameExtensions({ id }, extension.identifier)); } + return false; + } + + private _isDisabledByExtensionKind(extension: IExtension): boolean { if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) { const server = isUIExtension(extension.manifest, this.productService, this.configurationService) ? this.extensionManagementServerService.localExtensionManagementServer : this.extensionManagementServerService.remoteExtensionManagementServer; return this.extensionManagementServerService.getExtensionManagementServer(extension.location) !== server; @@ -149,17 +157,17 @@ export class ExtensionEnablementService extends Disposable implements IExtension private _getEnablementState(identifier: IExtensionIdentifier): EnablementState { if (this.hasWorkspace) { if (this._getEnabledExtensions(StorageScope.WORKSPACE).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.WorkspaceEnabled; + return EnablementState.EnabledWorkspace; } if (this._getDisabledExtensions(StorageScope.WORKSPACE).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.WorkspaceDisabled; + return EnablementState.DisabledWorkspace; } } if (this._getDisabledExtensions(StorageScope.GLOBAL).filter(e => areSameExtensions(e, identifier))[0]) { - return EnablementState.Disabled; + return EnablementState.DisabledGlobally; } - return EnablementState.Enabled; + return EnablementState.EnabledGlobally; } private _enableExtension(identifier: IExtensionIdentifier): void { diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts index 5bab26ebce4..bd16a2ca85b 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts @@ -26,10 +26,12 @@ export interface IExtensionManagementServerService { } export const enum EnablementState { - Disabled, - WorkspaceDisabled, - Enabled, - WorkspaceEnabled + DisabledByExtensionKind, + DisabledByEnvironemt, + DisabledGlobally, + DisabledWorkspace, + EnabledGlobally, + EnabledWorkspace } export const IExtensionEnablementService = createDecorator('extensionEnablementService'); diff --git a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts index 29f0ad1ef3f..5852ce2d53c 100644 --- a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts +++ b/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts @@ -17,6 +17,11 @@ import { isUndefinedOrNull } from 'vs/base/common/types'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ProductService } from 'vs/platform/product/node/productService'; +import { URI } from 'vs/base/common/uri'; +import { Schemas } from 'vs/base/common/network'; +import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; +import { assign } from 'vs/base/common/objects'; +import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; function storageService(instantiationService: TestInstantiationService): IStorageService { let service = instantiationService.get(IStorageService); @@ -56,7 +61,7 @@ export class TestExtensionEnablementService extends ExtensionEnablementService { if (workspaceEnabledExtensions.length) { extensions = extensions.filter(r => !workspaceEnabledExtensions.some(e => areSameExtensions(e, r))); } - extensions.forEach(d => this.setEnablement([aLocalExtension(d.id)], EnablementState.Enabled)); + extensions.forEach(d => this.setEnablement([aLocalExtension(d.id)], EnablementState.EnabledGlobally)); } } @@ -70,6 +75,7 @@ suite('ExtensionEnablementService Test', () => { setup(() => { instantiationService = new TestInstantiationService(); + instantiationService.stub(IConfigurationService, new TestConfigurationService()); instantiationService.stub(IExtensionManagementService, { onDidUninstallExtension: didUninstallEvent.event, onDidInstallExtension: didInstallEvent.event, getInstalled: () => Promise.resolve([] as ILocalExtension[]) } as IExtensionManagementService); instantiationService.stub(IExtensionManagementServerService, { localExtensionManagementServer: { @@ -85,20 +91,20 @@ suite('ExtensionEnablementService Test', () => { test('test disable an extension globally', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.Disabled); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); assert.ok(!testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.Disabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.DisabledGlobally); }); test('test disable an extension globally should return truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) .then(value => assert.ok(value)); }); test('test disable an extension globally triggers the change event', () => { const target = sinon.spy(); testObject.onEnablementChanged(target); - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) .then(() => { assert.ok(target.calledOnce); assert.deepEqual((target.args[0][0][0]).identifier, { id: 'pub.a' }); @@ -106,116 +112,116 @@ suite('ExtensionEnablementService Test', () => { }); test('test disable an extension globally again should return a falsy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) .then(value => assert.ok(!value[0])); }); test('test state of globally disabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Disabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledGlobally)); }); test('test state of globally enabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Enabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.EnabledGlobally)); }); test('test disable an extension for workspace', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); assert.ok(!testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceDisabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.DisabledWorkspace); }); test('test disable an extension for workspace returns a truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) .then(value => assert.ok(value)); }); test('test disable an extension for workspace again should return a falsy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) .then(value => assert.ok(!value[0])); }); test('test state of workspace disabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.WorkspaceDisabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledWorkspace)); }); test('test state of workspace and globally disabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.WorkspaceDisabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledWorkspace)); }); test('test state of workspace enabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.WorkspaceEnabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.EnabledWorkspace)); }); test('test state of globally disabled and workspace enabled extension', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.WorkspaceEnabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.EnabledWorkspace)); }); test('test state of an extension when disabled for workspace from workspace enabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.WorkspaceDisabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledWorkspace)); }); test('test state of an extension when disabled globally from workspace enabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Disabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledGlobally)); }); test('test state of an extension when disabled globally from workspace disabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Disabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.DisabledGlobally)); }); test('test state of an extension when enabled globally from workspace enabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Enabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.EnabledGlobally)); }); test('test state of an extension when enabled globally from workspace disabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled)) - .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Enabled)); + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) + .then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.EnabledGlobally)); }); test('test disable an extension for workspace and then globally', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); - await testObject.setEnablement([extension], EnablementState.Disabled); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); assert.ok(!testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.Disabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.DisabledGlobally); }); test('test disable an extension for workspace and then globally return a truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) .then(value => assert.ok(value)); }); test('test disable an extension for workspace and then globally trigger the change event', () => { const target = sinon.spy(); - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) .then(() => testObject.onEnablementChanged(target)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) .then(() => { assert.ok(target.calledOnce); assert.deepEqual((target.args[0][0][0]).identifier, { id: 'pub.a' }); @@ -224,23 +230,23 @@ suite('ExtensionEnablementService Test', () => { test('test disable an extension globally and then for workspace', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.Disabled); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); assert.ok(!testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceDisabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.DisabledWorkspace); }); test('test disable an extension globally and then for workspace return a truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) .then(value => assert.ok(value)); }); test('test disable an extension globally and then for workspace triggers the change event', () => { const target = sinon.spy(); - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) .then(() => testObject.onEnablementChanged(target)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) .then(() => { assert.ok(target.calledOnce); assert.deepEqual((target.args[0][0][0]).identifier, { id: 'pub.a' }); @@ -249,29 +255,29 @@ suite('ExtensionEnablementService Test', () => { test('test disable an extension for workspace when there is no workspace throws error', () => { instantiationService.stub(IWorkspaceContextService, 'getWorkbenchState', WorkbenchState.EMPTY); - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) .then(() => assert.fail('should throw an error'), error => assert.ok(error)); }); test('test enable an extension globally', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.Disabled); - await testObject.setEnablement([extension], EnablementState.Enabled); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); + await testObject.setEnablement([extension], EnablementState.EnabledGlobally); assert.ok(testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.EnabledGlobally); }); test('test enable an extension globally return truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) .then(value => assert.ok(value)); }); test('test enable an extension globally triggers change event', () => { const target = sinon.spy(); - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) .then(() => testObject.onEnablementChanged(target)) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled)) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) .then(() => { assert.ok(target.calledOnce); assert.deepEqual((target.args[0][0][0]).identifier, { id: 'pub.a' }); @@ -279,29 +285,29 @@ suite('ExtensionEnablementService Test', () => { }); test('test enable an extension globally when already enabled return falsy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally) .then(value => assert.ok(!value[0])); }); test('test enable an extension for workspace', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); - await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); + await testObject.setEnablement([extension], EnablementState.EnabledWorkspace); assert.ok(testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceEnabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.EnabledWorkspace); }); test('test enable an extension for workspace return truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace)) .then(value => assert.ok(value)); }); test('test enable an extension for workspace triggers change event', () => { const target = sinon.spy(); - return testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.WorkspaceDisabled) + return testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.DisabledWorkspace) .then(() => testObject.onEnablementChanged(target)) - .then(() => testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.WorkspaceEnabled)) + .then(() => testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.EnabledWorkspace)) .then(() => { assert.ok(target.calledOnce); assert.deepEqual((target.args[0][0][0]).identifier, { id: 'pub.b' }); @@ -309,48 +315,48 @@ suite('ExtensionEnablementService Test', () => { }); test('test enable an extension for workspace when already enabled return truthy promise', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledWorkspace) .then(value => assert.ok(value)); }); test('test enable an extension for workspace when disabled in workspace and gloablly', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); - await testObject.setEnablement([extension], EnablementState.Disabled); - await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); + await testObject.setEnablement([extension], EnablementState.EnabledWorkspace); assert.ok(testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceEnabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.EnabledWorkspace); }); test('test enable an extension globally when disabled in workspace and gloablly', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); - await testObject.setEnablement([extension], EnablementState.Disabled); - await testObject.setEnablement([extension], EnablementState.Enabled); + await testObject.setEnablement([extension], EnablementState.EnabledWorkspace); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); + await testObject.setEnablement([extension], EnablementState.EnabledGlobally); assert.ok(testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.EnabledGlobally); }); test('test installing an extension re-eanbles it when disabled globally', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.Disabled); + await testObject.setEnablement([local], EnablementState.DisabledGlobally); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install }); assert.ok(testObject.isEnabled(local)); - assert.equal(testObject.getEnablementState(local), EnablementState.Enabled); + assert.equal(testObject.getEnablementState(local), EnablementState.EnabledGlobally); }); test('test updating an extension does not re-eanbles it when disabled globally', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.Disabled); + await testObject.setEnablement([local], EnablementState.DisabledGlobally); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update }); assert.ok(!testObject.isEnabled(local)); - assert.equal(testObject.getEnablementState(local), EnablementState.Disabled); + assert.equal(testObject.getEnablementState(local), EnablementState.DisabledGlobally); }); test('test installing an extension fires enablement change event when disabled globally', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.Disabled); + await testObject.setEnablement([local], EnablementState.DisabledGlobally); return new Promise((c, e) => { testObject.onEnablementChanged(([e]) => { if (e.identifier.id === local.identifier.id) { @@ -364,7 +370,7 @@ suite('ExtensionEnablementService Test', () => { test('test updating an extension does not fires enablement change event when disabled globally', async () => { const target = sinon.spy(); const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.Disabled); + await testObject.setEnablement([local], EnablementState.DisabledGlobally); testObject.onEnablementChanged(target); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update }); assert.ok(!target.called); @@ -372,23 +378,23 @@ suite('ExtensionEnablementService Test', () => { test('test installing an extension re-eanbles it when workspace disabled', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([local], EnablementState.DisabledWorkspace); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install }); assert.ok(testObject.isEnabled(local)); - assert.equal(testObject.getEnablementState(local), EnablementState.Enabled); + assert.equal(testObject.getEnablementState(local), EnablementState.EnabledGlobally); }); test('test updating an extension does not re-eanbles it when workspace disabled', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([local], EnablementState.DisabledWorkspace); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update }); assert.ok(!testObject.isEnabled(local)); - assert.equal(testObject.getEnablementState(local), EnablementState.WorkspaceDisabled); + assert.equal(testObject.getEnablementState(local), EnablementState.DisabledWorkspace); }); test('test installing an extension fires enablement change event when workspace disabled', async () => { const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([local], EnablementState.DisabledWorkspace); return new Promise((c, e) => { testObject.onEnablementChanged(([e]) => { if (e.identifier.id === local.identifier.id) { @@ -402,7 +408,7 @@ suite('ExtensionEnablementService Test', () => { test('test updating an extension does not fires enablement change event when workspace disabled', async () => { const target = sinon.spy(); const local = aLocalExtension('pub.a'); - await testObject.setEnablement([local], EnablementState.WorkspaceDisabled); + await testObject.setEnablement([local], EnablementState.DisabledWorkspace); testObject.onEnablementChanged(target); didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update }); assert.ok(!target.called); @@ -418,26 +424,26 @@ suite('ExtensionEnablementService Test', () => { test('test remove an extension from disablement list when uninstalled', async () => { const extension = aLocalExtension('pub.a'); - await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled); - await testObject.setEnablement([extension], EnablementState.Disabled); + await testObject.setEnablement([extension], EnablementState.DisabledWorkspace); + await testObject.setEnablement([extension], EnablementState.DisabledGlobally); didUninstallEvent.fire({ identifier: { id: 'pub.a' } }); assert.ok(testObject.isEnabled(extension)); - assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled); + assert.equal(testObject.getEnablementState(extension), EnablementState.EnabledGlobally); }); test('test isEnabled return false extension is disabled globally', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) .then(() => assert.ok(!testObject.isEnabled(aLocalExtension('pub.a')))); }); test('test isEnabled return false extension is disabled in workspace', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) .then(() => assert.ok(!testObject.isEnabled(aLocalExtension('pub.a')))); }); test('test isEnabled return true extension is not disabled', () => { - return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled) - .then(() => testObject.setEnablement([aLocalExtension('pub.c')], EnablementState.Disabled)) + return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace) + .then(() => testObject.setEnablement([aLocalExtension('pub.c')], EnablementState.DisabledGlobally)) .then(() => assert.ok(testObject.isEnabled(aLocalExtension('pub.b')))); }); @@ -477,22 +483,109 @@ suite('ExtensionEnablementService Test', () => { instantiationService.stub(IExtensionManagementService, { onDidUninstallExtension: didUninstallEvent.event, onDidInstallExtension: didInstallEvent.event, getInstalled: () => Promise.resolve([extension, aLocalExtension('pub.b')]) } as IExtensionManagementService); testObject = new TestExtensionEnablementService(instantiationService); assert.ok(!testObject.isEnabled(extension)); - assert.deepEqual(testObject.getEnablementState(extension), EnablementState.Disabled); + assert.deepEqual(testObject.getEnablementState(extension), EnablementState.DisabledByEnvironemt); + }); + + test('test local workspace extension is disabled by kind', async () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.ok(!testObject.isEnabled(localWorkspaceExtension)); + assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); + }); + + test('test local ui extension is not disabled by kind', async () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.ok(testObject.isEnabled(localWorkspaceExtension)); + assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); + }); + + test('test canChangeEnablement return false when the local workspace extension is disabled by kind', () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.equal(testObject.canChangeEnablement(localWorkspaceExtension), false); + }); + + test('test canChangeEnablement return true for local ui extension', () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.equal(testObject.canChangeEnablement(localWorkspaceExtension), true); + }); + + test('test remote ui extension is disabled by kind', async () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.ok(!testObject.isEnabled(localWorkspaceExtension)); + assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); + }); + + test('test remote workspace extension is not disabled by kind', async () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.ok(testObject.isEnabled(localWorkspaceExtension)); + assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); + }); + + test('test canChangeEnablement return false when the remote ui extension is disabled by kind', () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.equal(testObject.canChangeEnablement(localWorkspaceExtension), false); + }); + + test('test canChangeEnablement return true for remote workspace extension', () => { + instantiationService.stub(IExtensionManagementServerService, aMultiExtensionManagementServerService(instantiationService)); + const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + testObject = new TestExtensionEnablementService(instantiationService); + assert.equal(testObject.canChangeEnablement(localWorkspaceExtension), true); }); }); +function aMultiExtensionManagementServerService(instantiationService: TestInstantiationService): IExtensionManagementServerService { + const localExtensionManagementServer = { + authority: 'vscode-local', + label: 'local', + extensionManagementService: instantiationService.get(IExtensionManagementService) + }; + const remoteExtensionManagementServer = { + authority: 'vscode-remote', + label: 'remote', + extensionManagementService: instantiationService.get(IExtensionManagementService) + }; + return { + _serviceBrand: {}, + localExtensionManagementServer, + remoteExtensionManagementServer, + getExtensionManagementServer: (location: URI) => { + if (location.scheme === Schemas.file) { + return localExtensionManagementServer; + } + if (location.scheme === REMOTE_HOST_SCHEME) { + return remoteExtensionManagementServer; + } + return null; + } + }; +} + function aLocalExtension(id: string, contributes?: IExtensionContributions, type?: ExtensionType): ILocalExtension { + return aLocalExtension2(id, contributes ? { contributes } : {}, isUndefinedOrNull(type) ? {} : { type }); +} + +function aLocalExtension2(id: string, manifest: any = {}, properties: any = {}): ILocalExtension { const [publisher, name] = id.split('.'); - type = isUndefinedOrNull(type) ? ExtensionType.User : type; - return Object.create({ + properties = assign({ identifier: { id }, galleryIdentifier: { id, uuid: undefined }, - manifest: { - name, - publisher, - contributes - }, - type - }); + type: ExtensionType.User + }, properties); + manifest = assign({ name, publisher }, manifest); + return Object.create({ manifest, ...properties }); } diff --git a/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts b/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts index 28503d4e7dc..b850b474c62 100644 --- a/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts +++ b/src/vs/workbench/services/extensions/common/inactiveExtensionUrlHandler.ts @@ -191,7 +191,7 @@ export class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler { return; } - await this.extensionEnablementService.setEnablement([extension], EnablementState.Enabled); + await this.extensionEnablementService.setEnablement([extension], EnablementState.EnabledGlobally); await this.reloadAndHandle(uri); } } From f1bad3701296d08d0ae04df0e45320e8a94bd1ac Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 18 Jul 2019 15:34:05 -0700 Subject: [PATCH 168/190] Remove Comment Id --- src/vs/editor/common/modes.ts | 3 +- src/vs/vscode.proposed.d.ts | 48 ---------------- .../api/browser/mainThreadComments.ts | 4 -- .../workbench/api/common/extHost.protocol.ts | 1 - .../workbench/api/common/extHostComments.ts | 55 ++----------------- .../contrib/comments/browser/commentNode.ts | 12 ++-- .../comments/browser/commentService.ts | 17 ------ .../comments/browser/commentThreadWidget.ts | 16 +++--- .../browser/commentsEditorContribution.ts | 8 +-- .../contrib/comments/browser/commentsPanel.ts | 4 +- .../comments/browser/commentsTreeViewer.ts | 2 +- 11 files changed, 27 insertions(+), 143 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index d6438d398c3..fa05b9b968c 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1333,8 +1333,7 @@ export enum CommentMode { * @internal */ export interface Comment { - readonly commentId: string; - readonly uniqueIdInThread?: number; + readonly uniqueIdInThread: number; readonly body: IMarkdownString; readonly userName: string; readonly userIconPath?: string; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 46b57f913c2..2acdd9eb0c9 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -713,54 +713,6 @@ declare module 'vscode' { //#endregion - /** - * Comment Reactions - * Stay in proposed. - */ - interface CommentReaction { - readonly hasReacted?: boolean; - } - - /** - * Stay in proposed - */ - export interface CommentReactionProvider { - availableReactions: CommentReaction[]; - toggleReaction?(document: TextDocument, comment: Comment, reaction: CommentReaction): Promise; - } - - - export interface CommentController { - /** - * Optional reaction provider - * Stay in proposed. - */ - reactionProvider?: CommentReactionProvider; - } - - - /** - * A comment is displayed within the editor or the Comments Panel, depending on how it is provided. - */ - export interface Comment { - /** - * The id of the comment - */ - commentId: string; - } - - /** - * A comment controller is able to provide [comments](#CommentThread) support to the editor and - * provide users various ways to interact with comments. - */ - export interface CommentController { - /** - * Optional reaction provider - */ - reactionProvider?: CommentReactionProvider; - } - - //#endregion //#region Terminal diff --git a/src/vs/workbench/api/browser/mainThreadComments.ts b/src/vs/workbench/api/browser/mainThreadComments.ts index 77c2e1052a7..2580f438473 100644 --- a/src/vs/workbench/api/browser/mainThreadComments.ts +++ b/src/vs/workbench/api/browser/mainThreadComments.ts @@ -308,10 +308,6 @@ export class MainThreadCommentController { return commentingRanges || []; } - getReactionGroup(): modes.CommentReaction[] | undefined { - return this._features.reactionGroup; - } - async toggleReaction(uri: URI, thread: modes.CommentThread, comment: modes.Comment, reaction: modes.CommentReaction, token: CancellationToken): Promise { return this._proxy.$toggleReaction(this._handle, thread.commentThreadHandle, uri, comment, reaction); } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index d64f50a9460..d1f9840554d 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1284,7 +1284,6 @@ export interface ExtHostCommentsShape { $updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange): Promise; $deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number): void; $provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise; - $provideReactionGroup(commentControllerHandle: number): Promise; $toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise; } diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index 10166047fb2..bc39e462d0a 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -187,47 +187,28 @@ export class ExtHostComments implements ExtHostCommentsShape, IDisposable { }).then(ranges => ranges ? ranges.map(x => extHostTypeConverter.Range.from(x)) : undefined); } - $provideReactionGroup(commentControllerHandle: number): Promise { - const commentController = this._commentControllers.get(commentControllerHandle); - - if (!commentController || !commentController.reactionProvider) { - return Promise.resolve(undefined); - } - - return asPromise(() => { - return commentController!.reactionProvider!.availableReactions; - }).then(reactions => reactions.map(reaction => convertToReaction(commentController.reactionProvider, reaction))); - } - $toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise { - const document = this._documents.getDocument(URI.revive(uri)); const commentController = this._commentControllers.get(commentControllerHandle); - if (!commentController || !((commentController.reactionProvider && commentController.reactionProvider.toggleReaction) || commentController.reactionHandler)) { + if (!commentController || commentController.reactionHandler) { return Promise.resolve(undefined); } return asPromise(() => { const commentThread = commentController.getCommentThread(threadHandle); if (commentThread) { - const vscodeComment = commentThread.getComment(comment.commentId); + const vscodeComment = commentThread.getCommentByUniqueId(comment.uniqueIdInThread); if (commentController !== undefined && vscodeComment) { if (commentController.reactionHandler) { return commentController.reactionHandler(vscodeComment, convertFromReaction(reaction)); } - - if (commentController.reactionProvider && commentController.reactionProvider.toggleReaction) { - return commentController.reactionProvider.toggleReaction(document, vscodeComment, convertFromReaction(reaction)); - } } - } return Promise.resolve(undefined); }); } - dispose() { } @@ -391,16 +372,6 @@ export class ExtHostCommentThread implements vscode.CommentThread { ); } - getComment(commentId: string): vscode.Comment | undefined { - const comments = this._comments.filter(comment => comment.commentId === commentId); - - if (comments && comments.length) { - return comments[0]; - } - - return undefined; - } - getCommentByUniqueId(uniqueId: number): vscode.Comment | undefined { for (let key of this._commentsMap) { let comment = key[0]; @@ -442,19 +413,6 @@ class ExtHostCommentController implements vscode.CommentController { private _threads: Map = new Map(); commentingRangeProvider?: vscode.CommentingRangeProvider; - private _commentReactionProvider?: vscode.CommentReactionProvider; - - get reactionProvider(): vscode.CommentReactionProvider | undefined { - return this._commentReactionProvider; - } - - set reactionProvider(provider: vscode.CommentReactionProvider | undefined) { - this._commentReactionProvider = provider; - if (provider) { - this._proxy.$updateCommentControllerFeatures(this.handle, { reactionGroup: provider.availableReactions.map(reaction => convertToReaction(provider, reaction)) }); - } - } - private _reactionHandler?: ReactionHandler; get reactionHandler(): ReactionHandler | undefined { @@ -537,7 +495,6 @@ function convertToModeComment(thread: ExtHostCommentThread, commentController: E const iconPath = vscodeComment.author && vscodeComment.author.iconPath ? vscodeComment.author.iconPath.toString() : undefined; return { - commentId: vscodeComment.commentId, mode: vscodeComment.mode, contextValue: vscodeComment.contextValue, uniqueIdInThread: commentUniqueId, @@ -545,17 +502,16 @@ function convertToModeComment(thread: ExtHostCommentThread, commentController: E userName: vscodeComment.author.name, userIconPath: iconPath, label: vscodeComment.label, - commentReactions: vscodeComment.reactions ? vscodeComment.reactions.map(reaction => convertToReaction(commentController.reactionProvider, reaction)) : undefined + commentReactions: vscodeComment.reactions ? vscodeComment.reactions.map(reaction => convertToReaction(reaction)) : undefined }; } -function convertToReaction(provider: vscode.CommentReactionProvider | undefined, reaction: vscode.CommentReaction): modes.CommentReaction { +function convertToReaction(reaction: vscode.CommentReaction): modes.CommentReaction { return { label: reaction.label, iconPath: reaction.iconPath ? extHostTypeConverter.pathOrURIToURI(reaction.iconPath) : undefined, count: reaction.count, - hasReacted: reaction.hasReacted, - canEdit: provider !== undefined ? !!provider.toggleReaction : false + hasReacted: reaction.authorHasReacted, }; } @@ -564,7 +520,6 @@ function convertFromReaction(reaction: modes.CommentReaction): vscode.CommentRea label: reaction.label || '', count: reaction.count || 0, iconPath: reaction.iconPath ? URI.revive(reaction.iconPath) : '', - hasReacted: reaction.hasReacted, authorHasReacted: reaction.hasReacted || false }; } diff --git a/src/vs/workbench/contrib/comments/browser/commentNode.ts b/src/vs/workbench/contrib/comments/browser/commentNode.ts index 0b6b347c978..edf37f0728a 100644 --- a/src/vs/workbench/contrib/comments/browser/commentNode.ts +++ b/src/vs/workbench/contrib/comments/browser/commentNode.ts @@ -318,18 +318,18 @@ export class CommentNode extends Disposable { let toggleReactionAction = this.createReactionPicker2(this.comment.commentReactions || []); this._reactionsActionBar.push(toggleReactionAction, { label: false, icon: true }); } else { - let reactionGroup = this.commentService.getReactionGroup(this.owner); - if (reactionGroup && reactionGroup.length) { - let toggleReactionAction = this.createReactionPicker2(reactionGroup || []); - this._reactionsActionBar.push(toggleReactionAction, { label: false, icon: true }); - } + // let reactionGroup = this.commentService.getReactionGroup(this.owner); + // if (reactionGroup && reactionGroup.length) { + // let toggleReactionAction = this.createReactionPicker2(reactionGroup || []); + // this._reactionsActionBar.push(toggleReactionAction, { label: false, icon: true }); + // } } } private createCommentEditor(): void { const container = dom.append(this._commentEditContainer, dom.$('.edit-textarea')); this._commentEditor = this.instantiationService.createInstance(SimpleCommentEditor, container, SimpleCommentEditor.getEditorOptions(), this.parentEditor, this.parentThread); - const resource = URI.parse(`comment:commentinput-${this.comment.commentId}-${Date.now()}.md`); + const resource = URI.parse(`comment:commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`); this._commentEditorModel = this.modelService.createModel('', this.modeService.createByFilepathOrFirstLine(resource), resource, false); this._commentEditor.setModel(this._commentEditorModel); diff --git a/src/vs/workbench/contrib/comments/browser/commentService.ts b/src/vs/workbench/contrib/comments/browser/commentService.ts index d3db753315b..e676d7caf1a 100644 --- a/src/vs/workbench/contrib/comments/browser/commentService.ts +++ b/src/vs/workbench/contrib/comments/browser/commentService.ts @@ -54,7 +54,6 @@ export interface ICommentService { disposeCommentThread(ownerId: string, threadId: string): void; getComments(resource: URI): Promise<(ICommentInfo | null)[]>; getCommentingRanges(resource: URI): Promise; - getReactionGroup(owner: string): CommentReaction[] | undefined; hasReactionHandler(owner: string): boolean; toggleReaction(owner: string, resource: URI, thread: CommentThread, comment: Comment, reaction: CommentReaction): Promise; setActiveCommentThread(commentThread: CommentThread | null): void; @@ -183,22 +182,6 @@ export class CommentService extends Disposable implements ICommentService { } } - getReactionGroup(owner: string): CommentReaction[] | undefined { - const commentProvider = this._commentControls.get(owner); - - if (commentProvider) { - return commentProvider.getReactionGroup(); - } - - const commentController = this._commentControls.get(owner); - - if (commentController) { - return commentController.getReactionGroup(); - } - - return undefined; - } - hasReactionHandler(owner: string): boolean { const commentProvider = this._commentControls.get(owner); diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts index fcd4e69ba33..26c32a87835 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts @@ -161,14 +161,14 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget // we don't do anything here as we always do the reveal ourselves. } - public reveal(commentId?: string) { + public reveal(commentUniqueId?: number) { if (!this._isExpanded) { this.show({ lineNumber: this._commentThread.range.startLineNumber, column: 1 }, 2); } - if (commentId) { + if (commentUniqueId !== undefined) { let height = this.editor.getLayoutInfo().height; - let matchedNode = this._commentElements.filter(commentNode => commentNode.comment.commentId === commentId); + let matchedNode = this._commentElements.filter(commentNode => commentNode.comment.uniqueIdInThread === commentUniqueId); if (matchedNode && matchedNode.length) { const commentThreadCoords = dom.getDomNodePagePosition(this._commentElements[0].domNode); const commentCoords = dom.getDomNodePagePosition(matchedNode[0].domNode); @@ -289,7 +289,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget let commentElementsToDelIndex: number[] = []; for (let i = 0; i < oldCommentsLen; i++) { let comment = this._commentElements[i].comment; - let newComment = commentThread.comments ? commentThread.comments.filter(c => c.commentId === comment.commentId) : []; + let newComment = commentThread.comments ? commentThread.comments.filter(c => c.uniqueIdInThread === comment.uniqueIdInThread) : []; if (newComment.length) { this._commentElements[i].update(newComment[0]); @@ -309,7 +309,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget let newCommentNodeList: CommentNode[] = []; for (let i = newCommentsLen - 1; i >= 0; i--) { let currentComment = commentThread.comments![i]; - let oldCommentNode = this._commentElements.filter(commentNode => commentNode.comment.commentId === currentComment.commentId); + let oldCommentNode = this._commentElements.filter(commentNode => commentNode.comment.uniqueIdInThread === currentComment.uniqueIdInThread); if (oldCommentNode.length) { oldCommentNode[0].update(currentComment); lastCommentElement = oldCommentNode[0].domNode; @@ -606,13 +606,13 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget this._disposables.add(newCommentNode); this._disposables.add(newCommentNode.onDidDelete(deletedNode => { - const deletedNodeId = deletedNode.comment.commentId; - const deletedElementIndex = arrays.firstIndex(this._commentElements, commentNode => commentNode.comment.commentId === deletedNodeId); + const deletedNodeId = deletedNode.comment.uniqueIdInThread; + const deletedElementIndex = arrays.firstIndex(this._commentElements, commentNode => commentNode.comment.uniqueIdInThread === deletedNodeId); if (deletedElementIndex > -1) { this._commentElements.splice(deletedElementIndex, 1); } - const deletedCommentIndex = arrays.firstIndex(this._commentThread.comments!, comment => comment.commentId === deletedNodeId); + const deletedCommentIndex = arrays.firstIndex(this._commentThread.comments!, comment => comment.uniqueIdInThread === deletedNodeId); if (deletedCommentIndex > -1) { this._commentThread.comments!.splice(deletedCommentIndex, 1); } diff --git a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts index 35d61c27f4b..89dd182ebe2 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts @@ -247,18 +247,18 @@ export class ReviewController implements IEditorContribution { return editor.getContribution(ID); } - public revealCommentThread(threadId: string, commentId: string, fetchOnceIfNotExist: boolean): void { + public revealCommentThread(threadId: string, commentUniqueId: number, fetchOnceIfNotExist: boolean): void { const commentThreadWidget = this._commentWidgets.filter(widget => widget.commentThread.threadId === threadId); if (commentThreadWidget.length === 1) { - commentThreadWidget[0].reveal(commentId); + commentThreadWidget[0].reveal(commentUniqueId); } else if (fetchOnceIfNotExist) { if (this._computePromise) { this._computePromise.then(_ => { - this.revealCommentThread(threadId, commentId, false); + this.revealCommentThread(threadId, commentUniqueId, false); }); } else { this.beginCompute().then(_ => { - this.revealCommentThread(threadId, commentId, false); + this.revealCommentThread(threadId, commentUniqueId, false); }); } } diff --git a/src/vs/workbench/contrib/comments/browser/commentsPanel.ts b/src/vs/workbench/contrib/comments/browser/commentsPanel.ts index dd9a18a0ff7..27440e3e996 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsPanel.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsPanel.ts @@ -175,7 +175,7 @@ export class CommentsPanel extends Panel { let currentActiveResource = activeEditor ? activeEditor.getResource() : undefined; if (currentActiveResource && currentActiveResource.toString() === element.resource.toString()) { const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId; - const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.commentId : element.comment.commentId; + const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.uniqueIdInThread : element.comment.uniqueIdInThread; const control = this.editorService.activeTextEditorWidget; if (threadToReveal && isCodeEditor(control)) { const controller = ReviewController.get(control); @@ -200,7 +200,7 @@ export class CommentsPanel extends Panel { const control = editor.getControl(); if (threadToReveal && isCodeEditor(control)) { const controller = ReviewController.get(control); - controller.revealCommentThread(threadToReveal, commentToReveal.commentId, true); + controller.revealCommentThread(threadToReveal, commentToReveal.uniqueIdInThread, true); } } }); diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts index fb60a911d6d..91370417b61 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts @@ -23,7 +23,7 @@ export class CommentsDataSource implements IDataSource { return element.id; } if (element instanceof CommentNode) { - return `${element.resource.toString()}-${element.comment.commentId}`; + return `${element.resource.toString()}-${element.comment.uniqueIdInThread}`; } return ''; } From 97ce6669fa995bafb202a55af856b38fad79f272 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 18 Jul 2019 15:38:44 -0700 Subject: [PATCH 169/190] toggle reaction should work. --- src/vs/workbench/api/common/extHostComments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index bc39e462d0a..b71643ba369 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -190,7 +190,7 @@ export class ExtHostComments implements ExtHostCommentsShape, IDisposable { $toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise { const commentController = this._commentControllers.get(commentControllerHandle); - if (!commentController || commentController.reactionHandler) { + if (!commentController || !commentController.reactionHandler) { return Promise.resolve(undefined); } From aba87f135229c17c4624341b7a2499dcedafcb87 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 18 Jul 2019 16:38:14 -0700 Subject: [PATCH 170/190] Fix #75647 --- src/vs/workbench/contrib/comments/browser/commentNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentNode.ts b/src/vs/workbench/contrib/comments/browser/commentNode.ts index edf37f0728a..d3ac220871e 100644 --- a/src/vs/workbench/contrib/comments/browser/commentNode.ts +++ b/src/vs/workbench/contrib/comments/browser/commentNode.ts @@ -166,7 +166,7 @@ export class CommentNode extends Disposable { secondaryActions.push(...secondary); } - if (actions.length) { + if (actions.length || secondaryActions.length) { this.toolbar = new ToolBar(this._actionsToolbarContainer, this.contextMenuService, { actionViewItemProvider: action => { if (action.id === ToggleReactionsAction.ID) { From fb46db1e4edb4247199f2f0e8159a1b76cb39f77 Mon Sep 17 00:00:00 2001 From: kieferrm Date: Fri, 19 Jul 2019 00:57:34 +0000 Subject: [PATCH 171/190] fix GDPR annotation --- rudi/declarations-resolved.json | 2754 +++++++++++++++++ .../diagnostics/node/diagnosticsService.ts | 10 +- 2 files changed, 2761 insertions(+), 3 deletions(-) create mode 100644 rudi/declarations-resolved.json diff --git a/rudi/declarations-resolved.json b/rudi/declarations-resolved.json new file mode 100644 index 00000000000..48266798069 --- /dev/null +++ b/rudi/declarations-resolved.json @@ -0,0 +1,2754 @@ +{ + "events": { + "monacoworkbench/packagemetrics": { + "commit": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "size": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "count": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "editorActionInvoked": { + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "suggestWidget": { + "wasautomaticallytriggered": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "suggestioncount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "snippetcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "textcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "suggestWidget:toggleDetailsFocus": { + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "suggestWidget:collapseDetails": { + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "suggestWidget:expandDetails": { + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "update:win32SetupTarget": { + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "update:winSetupTarget": { + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "update:notAvailable": { + "explicit": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "extensionActivationTimes": { + "outcome": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "id": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "extensionversion": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "activationevents": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "isbuiltin": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "reason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "startup": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "codeloadingtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "activatecalltime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "activateresolvedtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + } + }, + "webviews:createWebviewPanel": { + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "machineIdFallback": { + "usingfallbackguid": { + "classification": "SystemMetaData", + "purpose": "BusinessInsight", + "isMeasurement": true + } + }, + "machineIdDisambiguation": { + "correctedmachineid": { + "classification": "EndUserPseudonymizedInformation", + "purpose": "FeatureInsight" + } + }, + "galleryService:downloadVSIX": { + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionGallery:install": { + "success": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "errorcode": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "recommendationreason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionGallery:uninstall": { + "success": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "errorcode": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionGallery:update": { + "success": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "errorcode": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "startupTimeVaried": { + "version": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "ellapsed": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "islatestversion": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "didusecacheddata": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "windowkind": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "windowcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "viewletid": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "panelid": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "editorids": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "timers.ellapsedappready": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedwindowload": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedwindowloadtorequire": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedextensions": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedextensionsready": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedrequire": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedworkspacestorageinit": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedworkspaceserviceinit": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedviewletrestore": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedpanelrestore": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsededitorrestore": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedworkbench": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsedtimerstotimerscomputed": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "timers.ellapsednlsgeneration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "platform": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "release": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "arch": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "totalmem": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "freemem": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "cpus.count": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "cpus.speed": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "cpus.model": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "initialstartup": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "hasaccessibilitysupport": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "isvmlikelyhood": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "emptyworkbench": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "loadavg": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "meminfo.workingsetsize": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "meminfo.privatebytes": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "meminfo.sharedbytes": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + } + }, + "startupRawTimers": { + "entries": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "replaceAll.started": { + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + } + }, + "searchResultsFirstRender": { + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + } + }, + "searchResultsFinished": { + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + } + }, + "searchResultsShown": { + "count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "filecount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "scheme": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "options.pattern": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "options.isregexp": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "options.iswordmatch": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "options.wordseparators": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "options.ismultiline": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "options.iscasesensitive": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "options.issmartcase": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "workspce.tags": { + "workbench.filestoopenorcreate": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workbench.filestodiff": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "workspace.roots": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.empty": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.grunt": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.gulp": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.jake": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.tsconfig": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.jsconfig": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.config.xml": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.vsc.extension": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.asp": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.sln": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.unity": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.express": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.sails": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.koa": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.hapi": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.socket.io": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.restify": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.rnpm-plugin-windows": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.react": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.@angular/core": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.vue": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.aws-sdk": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.aws-amplify-sdk": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.azure": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.azure-storage": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.@google-cloud/common": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.firebase": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.npm.heroku-cli": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.bower": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.yeoman.code.ext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.cordova.high": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.cordova.low": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.xamarin.android": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.xamarin.ios": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.android.cpp": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.reactnative": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.ionic": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": "true" + }, + "workspace.nativescript": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": "true" + }, + "workspace.java.pom": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.requirements": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.requirements.star": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.pipfile": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.conda": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.any-azure": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-storage-common": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-storage-blob": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-storage-file": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-storage-queue": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-mgmt": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-shell": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.pulumi-azure": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-cosmos": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-devtools": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-elasticluster": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-eventgrid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-functions": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-graphrbac": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-keyvault": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-loganalytics": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-monitor": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-servicebus": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-servicefabric": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-storage": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-translator": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-iothub-device-client": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-ml": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.azure-cognitiveservices": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.adal": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.pydocumentdb": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.botbuilder-core": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.botbuilder-schema": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "workspace.py.botframework-connector": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "workspace.remotes": { + "domains": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "workspace.hashedRemotes": { + "remotes": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "workspace.azure": { + "node": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "java": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "resolveProxy.stats": { + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "keyboardLayout": { + "currentkeyboardlayout.name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.text": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.model": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.layout": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.variant": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.options": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.rules": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.lang": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "currentkeyboardlayout.localizedname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "disableOtherKeymaps": { + "oldkeymaps": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "confirmed": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "newkeymap.id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "newkeymap.uuid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionGallery:install:recommendations": { + "recommendationreason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionsRecommendations:ignoreRecommendation": { + "recommendationreason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "extensionid": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "extensionWorkspaceRecommendations:popup": { + "userreaction": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionRecommendations:popup": { + "userreaction": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "fileExtensionSuggestion:popup": { + "userreaction": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "fileextension": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "dynamicWorkspaceRecommendations": { + "count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "cache": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "exthostunresponsive": { + "id": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "isMeasurement": true + }, + "data": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "extensionGallery:openExtension": { + "recommendationreason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionEditor:navbarChange": { + "navitem": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionAllRecommendations:open": { + "count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "recommendations": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionRecommendations:open": { + "count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "recommendations": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extensionWorkspaceRecommendations:open": { + "count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "extension:enable": { + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "extension:disable": { + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "galleryid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publishername": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "dependencies": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "index": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "searchtext": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "querysource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "debug/addLaunchConfiguration": {}, + "debugSessionStart": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "breakpointcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "exceptionbreakpoints": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "watchexpressionscount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "extensionname": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "isbuiltin": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "launchjsonexists": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "debugSessionStop": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "success": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "sessionlengthinseconds": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "breakpointcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "watchexpressionscount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "debugMisconfiguration": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "error": { + "classification": "CallstackOrException", + "purpose": "FeatureInsight" + } + }, + "debugAddBreakpoint": { + "context": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "hascondition": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "hashitcondition": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "haslogmessage": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "debugProtocolErrorResponse": { + "error": { + "classification": "CallstackOrException", + "purpose": "FeatureInsight" + } + }, + "taskService": { + "trigger": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "runner": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "taskkind": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "command": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "success": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "exitcode": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "taskService.customize": { + "properties": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "problems.filter": { + "errors": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "warnings": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "infos": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "problems.selectDiagnostic": { + "source": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "code": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "problems.selectRelatedInformation": { + "source": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "code": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "problems.expandRelatedInformation": { + "source": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "code": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + } + }, + "experimentalPrompts": { + "experimentid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "commandtext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "cancelled": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "keybindings.filter": { + "filter": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "emptyfilters": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "defaultSettings.filter": { + "filter": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "durations.nlpresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "counts.nlpresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "durations.filterresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "counts.filterresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "requestcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "defaultSettings.searchError": { + "message": { + "classification": "CallstackOrException", + "purpose": "FeatureInsight" + }, + "filter": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "defaultSettingsActions.copySetting": { + "userconfigurationkeys": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "query": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "nlpindex": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "groupid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "displayidx": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "editableside": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "settingsEditor.settingModified": { + "key": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "query": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "groupid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "nlpindex": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "displayindex": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "showconfiguredonly": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "isreset": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "settingsEditor.filter": { + "query": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + }, + "durations.nlpresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "counts.nlpresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "counts.filterresult": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "requestcount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + } + }, + "settingsEditor.searchError": { + "message": { + "classification": "CallstackOrException", + "purpose": "FeatureInsight" + }, + "filter": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "breadcrumbs/select": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "breadcrumbs/open": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "editorOpened": { + "typeid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.mimetype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.scheme": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.ext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.path": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "editorClosed": { + "typeid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "target": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.mimetype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.scheme": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.ext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "resource.path": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "views.toggleVisibility": { + "viewid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "visible": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "activityBarAction": { + "viewletid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "action": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "languagePackSuggestion:popup": { + "userreaction": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "language": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "installExtension": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "installedExtension": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "outcome": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "error": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + } + }, + "detailsExtension": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "installKeymap": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "installedKeymap": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "outcome": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "error": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + } + }, + "detailsKeymap": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "workbenchActionExecuted": { + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "walkThroughSnippetInteraction": { + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "snippet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "experiments:optout": { + "optout": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "experiments": { + "experiments": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "taskService.template": { + "templateid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "autodetect": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "workspaceLoad": { + "useragent": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "emptyworkbench": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "windowsize.innerheight": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "windowsize.innerwidth": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "windowsize.outerheight": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "windowsize.outerwidth": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "workbench.filestoopenorcreate": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "workbench.filestodiff": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "customkeybindingscount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "theme": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "language": { + "classification": "SystemMetaData", + "purpose": "BusinessInsight" + }, + "pinnedviewlets": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "restoredviewlet": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "restorededitors": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "startupkind": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "openKeybindings": { + "textual": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "extensionsMessage": { + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "extensionid": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "extensionpointid": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "message": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "resolveProxy": { + "count": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "duration": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "errorcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cachecount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cachesize": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cacherolls": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "envcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "settingscount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "localhostcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "envnoproxycount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "results": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "output.channel.creation.error": {}, + "customKeybindingsChanged": { + "keycount": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "settingsRead": { + "settingstype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "fileGet": { + "mimetype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "ext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "path": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "reason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "whitelistedjson": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "settingsWritten": { + "settingstype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "filePUT": { + "mimetype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "ext": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "path": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "reason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "whitelistedjson": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "cachedSearchComplete": { + "reason": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "resultcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "workspacefoldercount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "endtoendtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "sortingtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cachewasresolved": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "cachelookuptime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cachefiltertime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cacheentrycount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "scheme": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "searchComplete": { + "reason": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "resultcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "workspacefoldercount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "endtoendtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "sortingtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "filewalktime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "directorieswalked": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "fileswalked": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cmdtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "cmdresultcount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "scheme": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "textSearchComplete": { + "reason": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "workspacefoldercount": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "endtoendtime": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "scheme": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "error": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "usepcre2": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + }, + "activatePlugin": { + "id": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "name": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "isbuiltin": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "publisherdisplayname": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "themeid": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "extensionversion": { + "classification": "PublicNonPersonalData", + "purpose": "FeatureInsight" + }, + "activationevents": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "reason": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "issueReporterSearchError": { + "message": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + } + }, + "issueReporterSubmit": { + "issuetype": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "numsimilarissuesdisplayed": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "issueReporterViewSimilarIssue": {}, + "issueReporterGetElementError": { + "message": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + } + }, + "shimming.open": { + "extension": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "shimming.open.call.noForward": { + "extension": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "galleryService:query": { + "type": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "text": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + } + }, + "galleryService:requestError": { + "url": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "cdn": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "message": { + "classification": "CallstackOrException", + "purpose": "FeatureInsight" + } + }, + "galleryService:cdnFallback": { + "url": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "message": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "updateConfiguration": { + "configurationsource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "configurationkeys": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "updateConfigurationValues": { + "configurationsource": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "configurationvalues": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + } + }, + "updateKeybindings": { + "bindings": { + "classification": "CustomerContent", + "purpose": "FeatureInsight" + } + }, + "optInStatus": { + "optin": { + "classification": "SystemMetaData", + "purpose": "BusinessInsight", + "ismeasurement": true + } + }, + "UnhandledError": { + "callstack": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "msg": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "file": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "line": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "column": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + }, + "uncaught_error_name": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "uncaught_error_msg": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth" + }, + "count": { + "classification": "CallstackOrException", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + } + }, + "workspace.stats": { + "filetypes.name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "filetypes.count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "configtypes.name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "configtypes.count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "launchconfigs.name": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + }, + "launchconfigs.count": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "ismeasurement": true + } + }, + "update:downloaded": { + "version": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + }, + "windowerror": { + "type": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth", + "ismeasurement": true + } + }, + "commandExecuted": { + "id": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "from": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + } + } + }, + "commonProperties": { + "pluginhosttelemetry": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "common.firstsessiondate": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.lastsessiondate": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.isnewsession": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.instanceid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.remoteauthority": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "common.machineid": { + "classification": "EndUserPseudonymizedInformation", + "purpose": "FeatureInsight" + }, + "sessionid": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "commithash": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "version": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.platform": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.product": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "common.useragent": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "timestamp": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.timesincesessionstart": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "common.sequence": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight", + "isMeasurement": true + }, + "common.platformversion": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.nodeplatform": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "common.nodearch": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "common.snap": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.source": { + "classification": "SystemMetaData", + "purpose": "FeatureInsight" + }, + "common.version.shell": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + }, + "common.version.renderer": { + "classification": "SystemMetaData", + "purpose": "PerformanceAndHealth" + } + } +} \ No newline at end of file diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts index f1e6a82fb1a..9e74621348c 100644 --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts @@ -520,10 +520,14 @@ export class DiagnosticsService implements IDiagnosticsService { if (folderUri.scheme === 'file') { const folder = folderUri.fsPath; collectWorkspaceStats(folder, ['node_modules', '.git']).then(stats => { + type WorkspaceStatItemClassification = { + name: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + count: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + }; type WorkspaceStatsClassification = { - fileTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; - configTypes: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; - launchConfigs: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true }; + fileTypes: WorkspaceStatItemClassification; + configTypes: WorkspaceStatItemClassification; + launchConfigs: WorkspaceStatItemClassification; }; type WorkspaceStatsEvent = { fileTypes: WorkspaceStatItem[]; From ba22178f752f1b22d7df3294c682a9527017cd0c Mon Sep 17 00:00:00 2001 From: kieferrm Date: Fri, 19 Jul 2019 00:58:28 +0000 Subject: [PATCH 172/190] delete bogus directory --- rudi/declarations-resolved.json | 2754 ------------------------------- 1 file changed, 2754 deletions(-) delete mode 100644 rudi/declarations-resolved.json diff --git a/rudi/declarations-resolved.json b/rudi/declarations-resolved.json deleted file mode 100644 index 48266798069..00000000000 --- a/rudi/declarations-resolved.json +++ /dev/null @@ -1,2754 +0,0 @@ -{ - "events": { - "monacoworkbench/packagemetrics": { - "commit": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "size": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "count": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "editorActionInvoked": { - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "suggestWidget": { - "wasautomaticallytriggered": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "suggestioncount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "snippetcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "textcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "suggestWidget:toggleDetailsFocus": { - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "suggestWidget:collapseDetails": { - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "suggestWidget:expandDetails": { - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "update:win32SetupTarget": { - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "update:winSetupTarget": { - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "update:notAvailable": { - "explicit": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "extensionActivationTimes": { - "outcome": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "id": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "extensionversion": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "activationevents": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "isbuiltin": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "reason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "startup": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "codeloadingtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "activatecalltime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "activateresolvedtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - } - }, - "webviews:createWebviewPanel": { - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "machineIdFallback": { - "usingfallbackguid": { - "classification": "SystemMetaData", - "purpose": "BusinessInsight", - "isMeasurement": true - } - }, - "machineIdDisambiguation": { - "correctedmachineid": { - "classification": "EndUserPseudonymizedInformation", - "purpose": "FeatureInsight" - } - }, - "galleryService:downloadVSIX": { - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionGallery:install": { - "success": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "errorcode": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "recommendationreason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionGallery:uninstall": { - "success": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "errorcode": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionGallery:update": { - "success": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "errorcode": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "startupTimeVaried": { - "version": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "ellapsed": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "islatestversion": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "didusecacheddata": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "windowkind": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "windowcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "viewletid": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "panelid": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "editorids": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "timers.ellapsedappready": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedwindowload": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedwindowloadtorequire": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedextensions": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedextensionsready": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedrequire": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedworkspacestorageinit": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedworkspaceserviceinit": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedviewletrestore": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedpanelrestore": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsededitorrestore": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedworkbench": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsedtimerstotimerscomputed": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "timers.ellapsednlsgeneration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "platform": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "release": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "arch": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "totalmem": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "freemem": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "cpus.count": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "cpus.speed": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "cpus.model": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "initialstartup": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "hasaccessibilitysupport": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "isvmlikelyhood": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "emptyworkbench": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "loadavg": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "meminfo.workingsetsize": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "meminfo.privatebytes": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "meminfo.sharedbytes": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - } - }, - "startupRawTimers": { - "entries": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "replaceAll.started": { - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - } - }, - "searchResultsFirstRender": { - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - } - }, - "searchResultsFinished": { - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - } - }, - "searchResultsShown": { - "count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "filecount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "scheme": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "options.pattern": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "options.isregexp": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "options.iswordmatch": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "options.wordseparators": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "options.ismultiline": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "options.iscasesensitive": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "options.issmartcase": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "workspce.tags": { - "workbench.filestoopenorcreate": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workbench.filestodiff": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "workspace.roots": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.empty": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.grunt": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.gulp": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.jake": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.tsconfig": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.jsconfig": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.config.xml": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.vsc.extension": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.asp": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.sln": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.unity": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.express": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.sails": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.koa": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.hapi": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.socket.io": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.restify": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.rnpm-plugin-windows": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.react": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.@angular/core": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.vue": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.aws-sdk": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.aws-amplify-sdk": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.azure": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.azure-storage": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.@google-cloud/common": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.firebase": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.npm.heroku-cli": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.bower": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.yeoman.code.ext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.cordova.high": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.cordova.low": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.xamarin.android": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.xamarin.ios": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.android.cpp": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.reactnative": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.ionic": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": "true" - }, - "workspace.nativescript": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": "true" - }, - "workspace.java.pom": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.requirements": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.requirements.star": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.pipfile": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.conda": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.any-azure": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-storage-common": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-storage-blob": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-storage-file": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-storage-queue": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-mgmt": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-shell": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.pulumi-azure": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-cosmos": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-devtools": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-elasticluster": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-eventgrid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-functions": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-graphrbac": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-keyvault": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-loganalytics": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-monitor": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-servicebus": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-servicefabric": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-storage": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-translator": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-iothub-device-client": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-ml": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.azure-cognitiveservices": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.adal": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.pydocumentdb": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.botbuilder-core": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.botbuilder-schema": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "workspace.py.botframework-connector": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "workspace.remotes": { - "domains": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "workspace.hashedRemotes": { - "remotes": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "workspace.azure": { - "node": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "java": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "resolveProxy.stats": { - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "keyboardLayout": { - "currentkeyboardlayout.name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.text": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.model": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.layout": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.variant": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.options": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.rules": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.lang": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "currentkeyboardlayout.localizedname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "disableOtherKeymaps": { - "oldkeymaps": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "confirmed": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "newkeymap.id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "newkeymap.uuid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionGallery:install:recommendations": { - "recommendationreason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionsRecommendations:ignoreRecommendation": { - "recommendationreason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "extensionid": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "extensionWorkspaceRecommendations:popup": { - "userreaction": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionRecommendations:popup": { - "userreaction": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "fileExtensionSuggestion:popup": { - "userreaction": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "fileextension": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "dynamicWorkspaceRecommendations": { - "count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "cache": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "exthostunresponsive": { - "id": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "isMeasurement": true - }, - "data": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "extensionGallery:openExtension": { - "recommendationreason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionEditor:navbarChange": { - "navitem": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionAllRecommendations:open": { - "count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "recommendations": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionRecommendations:open": { - "count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "recommendations": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extensionWorkspaceRecommendations:open": { - "count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "extension:enable": { - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "extension:disable": { - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "galleryid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publishername": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "dependencies": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "index": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "searchtext": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "querysource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "debug/addLaunchConfiguration": {}, - "debugSessionStart": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "breakpointcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "exceptionbreakpoints": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "watchexpressionscount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "extensionname": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "isbuiltin": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "launchjsonexists": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "debugSessionStop": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "success": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "sessionlengthinseconds": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "breakpointcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "watchexpressionscount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "debugMisconfiguration": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "error": { - "classification": "CallstackOrException", - "purpose": "FeatureInsight" - } - }, - "debugAddBreakpoint": { - "context": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "hascondition": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "hashitcondition": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "haslogmessage": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "debugProtocolErrorResponse": { - "error": { - "classification": "CallstackOrException", - "purpose": "FeatureInsight" - } - }, - "taskService": { - "trigger": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "runner": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "taskkind": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "command": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "success": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "exitcode": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "taskService.customize": { - "properties": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "problems.filter": { - "errors": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "warnings": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "infos": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "problems.selectDiagnostic": { - "source": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "code": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "problems.selectRelatedInformation": { - "source": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "code": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "problems.expandRelatedInformation": { - "source": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "code": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - } - }, - "experimentalPrompts": { - "experimentid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "commandtext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "cancelled": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "keybindings.filter": { - "filter": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "emptyfilters": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "defaultSettings.filter": { - "filter": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "durations.nlpresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "counts.nlpresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "durations.filterresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "counts.filterresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "requestcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "defaultSettings.searchError": { - "message": { - "classification": "CallstackOrException", - "purpose": "FeatureInsight" - }, - "filter": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "defaultSettingsActions.copySetting": { - "userconfigurationkeys": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "query": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "nlpindex": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "groupid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "displayidx": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "editableside": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "settingsEditor.settingModified": { - "key": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "query": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "groupid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "nlpindex": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "displayindex": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "showconfiguredonly": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "isreset": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "settingsEditor.filter": { - "query": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - }, - "durations.nlpresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "counts.nlpresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "counts.filterresult": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "requestcount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - } - }, - "settingsEditor.searchError": { - "message": { - "classification": "CallstackOrException", - "purpose": "FeatureInsight" - }, - "filter": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "breadcrumbs/select": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "breadcrumbs/open": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "editorOpened": { - "typeid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.mimetype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.scheme": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.ext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.path": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "editorClosed": { - "typeid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "target": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.mimetype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.scheme": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.ext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "resource.path": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "views.toggleVisibility": { - "viewid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "visible": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "activityBarAction": { - "viewletid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "action": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "languagePackSuggestion:popup": { - "userreaction": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "language": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "installExtension": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "installedExtension": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "outcome": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "error": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - } - }, - "detailsExtension": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "installKeymap": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "installedKeymap": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "outcome": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "error": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - } - }, - "detailsKeymap": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "workbenchActionExecuted": { - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "walkThroughSnippetInteraction": { - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "snippet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "experiments:optout": { - "optout": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "experiments": { - "experiments": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "taskService.template": { - "templateid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "autodetect": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "workspaceLoad": { - "useragent": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "emptyworkbench": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "windowsize.innerheight": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "windowsize.innerwidth": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "windowsize.outerheight": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "windowsize.outerwidth": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "workbench.filestoopenorcreate": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "workbench.filestodiff": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "customkeybindingscount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "theme": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "language": { - "classification": "SystemMetaData", - "purpose": "BusinessInsight" - }, - "pinnedviewlets": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "restoredviewlet": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "restorededitors": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "startupkind": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "openKeybindings": { - "textual": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "extensionsMessage": { - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "extensionid": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "extensionpointid": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "message": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "resolveProxy": { - "count": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "duration": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "errorcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cachecount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cachesize": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cacherolls": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "envcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "settingscount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "localhostcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "envnoproxycount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "results": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "output.channel.creation.error": {}, - "customKeybindingsChanged": { - "keycount": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "settingsRead": { - "settingstype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "fileGet": { - "mimetype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "ext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "path": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "reason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "whitelistedjson": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "settingsWritten": { - "settingstype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "filePUT": { - "mimetype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "ext": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "path": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "reason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "whitelistedjson": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "cachedSearchComplete": { - "reason": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "resultcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "workspacefoldercount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "endtoendtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "sortingtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cachewasresolved": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "cachelookuptime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cachefiltertime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cacheentrycount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "scheme": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "searchComplete": { - "reason": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "resultcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "workspacefoldercount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "endtoendtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "sortingtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "filewalktime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "directorieswalked": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "fileswalked": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cmdtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "cmdresultcount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "scheme": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "textSearchComplete": { - "reason": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "workspacefoldercount": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "endtoendtime": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "scheme": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "error": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "usepcre2": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - }, - "activatePlugin": { - "id": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "name": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "isbuiltin": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "publisherdisplayname": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "themeid": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "extensionversion": { - "classification": "PublicNonPersonalData", - "purpose": "FeatureInsight" - }, - "activationevents": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "reason": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "issueReporterSearchError": { - "message": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - } - }, - "issueReporterSubmit": { - "issuetype": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "numsimilarissuesdisplayed": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "issueReporterViewSimilarIssue": {}, - "issueReporterGetElementError": { - "message": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - } - }, - "shimming.open": { - "extension": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "shimming.open.call.noForward": { - "extension": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "galleryService:query": { - "type": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "text": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - } - }, - "galleryService:requestError": { - "url": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "cdn": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "message": { - "classification": "CallstackOrException", - "purpose": "FeatureInsight" - } - }, - "galleryService:cdnFallback": { - "url": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "message": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "updateConfiguration": { - "configurationsource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "configurationkeys": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "updateConfigurationValues": { - "configurationsource": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "configurationvalues": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - } - }, - "updateKeybindings": { - "bindings": { - "classification": "CustomerContent", - "purpose": "FeatureInsight" - } - }, - "optInStatus": { - "optin": { - "classification": "SystemMetaData", - "purpose": "BusinessInsight", - "ismeasurement": true - } - }, - "UnhandledError": { - "callstack": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "msg": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "file": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "line": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "column": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - }, - "uncaught_error_name": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "uncaught_error_msg": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth" - }, - "count": { - "classification": "CallstackOrException", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - } - }, - "workspace.stats": { - "filetypes.name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "filetypes.count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "configtypes.name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "configtypes.count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "launchconfigs.name": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - }, - "launchconfigs.count": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "ismeasurement": true - } - }, - "update:downloaded": { - "version": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - }, - "windowerror": { - "type": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth", - "ismeasurement": true - } - }, - "commandExecuted": { - "id": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "from": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - } - } - }, - "commonProperties": { - "pluginhosttelemetry": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "common.firstsessiondate": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.lastsessiondate": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.isnewsession": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.instanceid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.remoteauthority": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "common.machineid": { - "classification": "EndUserPseudonymizedInformation", - "purpose": "FeatureInsight" - }, - "sessionid": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "commithash": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "version": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.platform": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.product": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "common.useragent": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "timestamp": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.timesincesessionstart": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "common.sequence": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight", - "isMeasurement": true - }, - "common.platformversion": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.nodeplatform": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "common.nodearch": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "common.snap": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.source": { - "classification": "SystemMetaData", - "purpose": "FeatureInsight" - }, - "common.version.shell": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - }, - "common.version.renderer": { - "classification": "SystemMetaData", - "purpose": "PerformanceAndHealth" - } - } -} \ No newline at end of file From 8802050f6d06d6ba9ee0af392060c1235c29e9de Mon Sep 17 00:00:00 2001 From: chrisdias Date: Thu, 18 Jul 2019 18:34:06 -0700 Subject: [PATCH 173/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5b3a5e80fe..3e9df748b00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "02f64b63759f873b1fe125ef9e4f3d20e73d30e5", + "distro": "0890008b4907e5a7490a4ccc45cc880ce5b37e49", "author": { "name": "Microsoft Corporation" }, From 662279722217358fa56de864ca22e2c875b7251c Mon Sep 17 00:00:00 2001 From: Daniel Schildt Date: Fri, 19 Jul 2019 06:21:42 +0300 Subject: [PATCH 174/190] fix: spelling mistake correction - Correct spelling mistake in `commonEditorConfig.ts` file - Change word from `mulitiplier` to `multiplier` Note: - Potentially affects "Get Started - User and Workspace Settings" https://code.visualstudio.com/docs/getstarted/settings page's listing of the default editor config parameters, as those still include the (probably) generated mispelling. --- src/vs/editor/common/config/commonEditorConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 5866654f0ca..f7b61db2b35 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -460,7 +460,7 @@ const editorConfiguration: IConfigurationNode = { 'editor.fastScrollSensitivity': { 'type': 'number', 'default': EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity, - 'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed mulitiplier when pressing `Alt`.") + 'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.") }, 'editor.multiCursorModifier': { 'type': 'string', From 38e5a64bc35850a55cb34063bb8700d95b777f50 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 09:33:52 +0200 Subject: [PATCH 175/190] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e9df748b00..8d546203d04 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "0890008b4907e5a7490a4ccc45cc880ce5b37e49", + "distro": "53215ea1e983c935e01e95875b9ee9ef65777c7d", "author": { "name": "Microsoft Corporation" }, From 628bdedf671d3230fc76982fae845875a6f6c0da Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 09:35:20 +0200 Subject: [PATCH 176/190] add tests --- .../extensions/browser/extensionsActions.ts | 138 ++++++------------ .../extensionsActions.test.ts | 62 +++++++- 2 files changed, 104 insertions(+), 96 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 0670f0faa51..b9c9c18e8bd 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -16,7 +16,7 @@ import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { ExtensionsLabel, IGalleryExtension, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionTipsService, IExtensionRecommendation, IExtensionsConfigContent } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionTipsService, IExtensionRecommendation, IExtensionsConfigContent, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; @@ -270,60 +270,55 @@ export class InstallAction extends ExtensionAction { } } -export class RemoteInstallAction extends ExtensionAction { +export class InstallInOtherServerAction extends ExtensionAction { - private static INSTALL_LABEL = localize('install', "Install"); - private static INSTALLING_LABEL = localize('installing', "Installing"); + protected static INSTALL_LABEL = localize('install', "Install"); + protected static INSTALLING_LABEL = localize('installing', "Installing"); private static readonly Class = 'extension-action prominent install'; private static readonly InstallingClass = 'extension-action install installing'; updateWhenCounterExtensionChanges: boolean = true; - private installing: boolean = false; + protected installing: boolean = false; constructor( + id: string, + private readonly server: IExtensionManagementServer | null, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, - @ILabelService private readonly labelService: ILabelService, - @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @IProductService private readonly productService: IProductService, ) { - super(`extensions.remoteinstall`, RemoteInstallAction.INSTALL_LABEL, RemoteInstallAction.Class, false); - this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); + super(id, InstallInOtherServerAction.INSTALL_LABEL, InstallInOtherServerAction.Class, false); this.updateLabel(); this.update(); } private updateLabel(): void { - if (this.installing) { - this.label = RemoteInstallAction.INSTALLING_LABEL; - this.tooltip = this.label; - return; - } - const remoteServer = this.extensionManagementServerService.remoteExtensionManagementServer; - if (remoteServer) { - this.label = `${RemoteInstallAction.INSTALL_LABEL} on ${remoteServer.label}`; - this.tooltip = this.label; - return; - } + this.label = this.getLabel(); + this.tooltip = this.label; + } + + protected getLabel(): string { + return this.installing ? InstallInOtherServerAction.INSTALLING_LABEL : + this.server ? `${InstallInOtherServerAction.INSTALL_LABEL} on ${this.server.label}` + : InstallInOtherServerAction.INSTALL_LABEL; + } update(): void { this.enabled = false; - this.class = RemoteInstallAction.Class; + this.class = InstallInOtherServerAction.Class; if (this.installing) { this.enabled = true; - this.class = RemoteInstallAction.InstallingClass; + this.class = InstallInOtherServerAction.InstallingClass; this.updateLabel(); return; } - if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer - // Installed User Extension - && this.extension && this.extension.local && this.extension.type === ExtensionType.User && this.extension.state === ExtensionState.Installed - // Local Workspace Extension - && this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && (isLanguagePackExtension(this.extension.local.manifest) || !isUIExtension(this.extension.local.manifest, this.productService, this.configurationService)) - // Extension does not exist in remote - && !this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.extensionManagementServerService.remoteExtensionManagementServer) + + if ( + this.extension && this.extension.local && this.server + // disabled by extension kind or it is a language pack extension + && (this.extension.enablementState === EnablementState.DisabledByExtensionKind || isLanguagePackExtension(this.extension.local.manifest)) + // Not installed in other server and can install in other server + && !this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.server) && this.extensionsWorkbenchService.canInstall(this.extension) ) { this.enabled = true; @@ -333,13 +328,13 @@ export class RemoteInstallAction extends ExtensionAction { } async run(): Promise { - if (this.extensionManagementServerService.remoteExtensionManagementServer && !this.installing) { + if (this.server && !this.installing) { this.installing = true; this.update(); this.extensionsWorkbenchService.open(this.extension); alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName)); if (this.extension.gallery) { - await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(this.extension.gallery); + await this.server.extensionManagementService.installFromGallery(this.extension.gallery); this.installing = false; this.update(); } @@ -347,77 +342,30 @@ export class RemoteInstallAction extends ExtensionAction { } } -export class LocalInstallAction extends ExtensionAction { - - private static INSTALL_LABEL = localize('install locally', "Install Locally"); - private static INSTALLING_LABEL = localize('installing', "Installing"); - - private static readonly Class = 'extension-action prominent install'; - private static readonly InstallingClass = 'extension-action install installing'; - - updateWhenCounterExtensionChanges: boolean = true; - private installing: boolean = false; +export class RemoteInstallAction extends InstallInOtherServerAction { constructor( - @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, - @ILabelService private readonly labelService: ILabelService, - @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @IProductService private readonly productService: IProductService, + @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, + @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService ) { - super(`extensions.localinstall`, LocalInstallAction.INSTALL_LABEL, LocalInstallAction.Class, false); - this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); - this.updateLabel(); - this.update(); + super(`extensions.remoteinstall`, extensionManagementServerService.remoteExtensionManagementServer, extensionsWorkbenchService); } - private updateLabel(): void { - if (this.installing) { - this.label = LocalInstallAction.INSTALLING_LABEL; - this.tooltip = this.label; - return; - } - this.label = `${LocalInstallAction.INSTALL_LABEL}`; - this.tooltip = this.label; +} + +export class LocalInstallAction extends InstallInOtherServerAction { + + constructor( + @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, + @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService + ) { + super(`extensions.localinstall`, extensionManagementServerService.localExtensionManagementServer, extensionsWorkbenchService); } - update(): void { - this.enabled = false; - this.class = LocalInstallAction.Class; - if (this.installing) { - this.enabled = true; - this.class = LocalInstallAction.InstallingClass; - this.updateLabel(); - return; - } - if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer - // Installed User Extension - && this.extension && this.extension.local && this.extension.type === ExtensionType.User && this.extension.state === ExtensionState.Installed - // Remote UI or Language pack Extension - && this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && (isLanguagePackExtension(this.extension.local.manifest) || isUIExtension(this.extension.local.manifest, this.productService, this.configurationService)) - // Extension does not exist in local - && !this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.extensionManagementServerService.localExtensionManagementServer) - && this.extensionsWorkbenchService.canInstall(this.extension) - ) { - this.enabled = true; - this.updateLabel(); - return; - } + protected getLabel(): string { + return this.installing ? InstallInOtherServerAction.INSTALLING_LABEL : localize('install locally', "Install Locally"); } - async run(): Promise { - if (this.extensionManagementServerService.localExtensionManagementServer && !this.installing) { - this.installing = true; - this.update(); - this.extensionsWorkbenchService.open(this.extension); - alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName)); - if (this.extension.gallery) { - await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(this.extension.gallery); - this.installing = false; - this.update(); - } - } - } } export class UninstallAction extends ExtensionAction { diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 36d5027e8f4..b60cebb0eed 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -21,7 +21,7 @@ import { TestExtensionEnablementService } from 'vs/workbench/services/extensionM import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; import { IURLService } from 'vs/platform/url/common/url'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { Emitter } from 'vs/base/common/event'; +import { Emitter, Event } from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; @@ -42,6 +42,8 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { ILabelService } from 'vs/platform/label/common/label'; import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/electron-browser/extensionManagementServerService'; import { IProductService } from 'vs/platform/product/common/product'; +import { Schemas } from 'vs/base/common/network'; +import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; suite('ExtensionsActions Test', () => { @@ -1351,6 +1353,27 @@ suite('ExtensionsActions Test', () => { assert.ok(!testObject.enabled); }); + test('Test remote install action is enabled for local workspace extension', async () => { + // multi server setup + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, instantiationService.get(IExtensionManagementService)); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); test(`RecommendToFolderAction`, () => { // TODO: Implement test @@ -1380,4 +1403,41 @@ suite('ExtensionsActions Test', () => { return { firstPage: objects, total: objects.length, pageSize: objects.length, getPage: () => null! }; } + function aMultiExtensionManagementServerService(instantiationService: TestInstantiationService, localExtensionManagementService?: IExtensionManagementService, remoteExtensionManagementService?: IExtensionManagementService): IExtensionManagementServerService { + const localExtensionManagementServer: IExtensionManagementServer = { + authority: 'vscode-local', + label: 'local', + extensionManagementService: localExtensionManagementService || createExtensionManagementService() + }; + const remoteExtensionManagementServer: IExtensionManagementServer = { + authority: 'vscode-remote', + label: 'remote', + extensionManagementService: remoteExtensionManagementService || createExtensionManagementService() + }; + return { + _serviceBrand: {}, + localExtensionManagementServer, + remoteExtensionManagementServer, + getExtensionManagementServer: (location: URI) => { + if (location.scheme === Schemas.file) { + return localExtensionManagementServer; + } + if (location.scheme === REMOTE_HOST_SCHEME) { + return remoteExtensionManagementServer; + } + return null; + } + }; + } + + function createExtensionManagementService(): IExtensionManagementService { + return { + onInstallExtension: Event.None, + onDidInstallExtension: Event.None, + onUninstallExtension: Event.None, + onDidUninstallExtension: Event.None, + getInstalled: () => Promise.resolve([]) + }; + } + }); From 13d8325aaa02fa80ff0bf8a3c94ea5490830b5d7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 19 Jul 2019 10:33:50 +0200 Subject: [PATCH 177/190] [json] update server readme --- .../json-language-features/server/README.md | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/extensions/json-language-features/server/README.md b/extensions/json-language-features/server/README.md index 9b02dc24ef6..5ca997d9e12 100644 --- a/extensions/json-language-features/server/README.md +++ b/extensions/json-language-features/server/README.md @@ -21,6 +21,8 @@ The server implements the following capabilities of the language server protocol - [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to properties in the document. - [Document Colors](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor) for showing color decorators on values representing colors and [Color Presentation](https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation) for color presentation information to support color pickers. The location of colors is defined by the document's [JSON schema](http://json-schema.org/). All values marked with `"format": "color-hex"` (VSCode specific, non-standard JSON Schema extension) are considered color values. The supported color formats are `#rgb[a]` and `#rrggbb[aa]`. - [Code Formatting](https://microsoft.github.io/language-server-protocol/specification#textDocument_rangeFormatting) supporting ranges and formatting the whole document. +- [Folding Ranges](https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange) for all folding ranges in the document. +- Semantic Selection for semantic selection for one or multiple cursor positions. - [Diagnostics (Validation)](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics) are pushed for all open documents - syntax errors - structural validation based on the document's [JSON schema](http://json-schema.org/). @@ -90,10 +92,39 @@ To find the schema for a given JSON document, the server uses the following mech - The settings define a schema association based on the documents URL. Settings can either associate a schema URL to a file or path pattern, and they can directly provide a schema. - Additionally, schema associations can also be provided by a custom 'schemaAssociations' configuration call. -Schemas are identified by URLs. To load the content of a schema, the JSON language server tries to load from that URL or path. The following URL schemas are supported: +Schemas are identified by URLs. To load the content of a schema, the JSON language server either tries to load from that URI or path itself, or delegates to the client. + +The `initializationOptions.handledSchemaProtocols` initialization option defines which URLs are handled by the server. Requests for all other URIs are send to the client. + +`handledSchemaProtocols` is part of the initialization options and can't be changed while the server is running. + +```ts +let clientOptions: LanguageClientOptions = { + initializationOptions: { + handledSchemaProtocols: ['file'] // language server should only try to load file URLs + } + ... +} +``` + +If `handledSchemaProtocols` is not set, the JSON language server will load the following URLs itself: + - `http`, `https`: Loaded using NodeJS's HTTP support. Proxies can be configured through the settings. - `file`: Loaded using NodeJS's `fs` support. -- `vscode`: Loaded by an LSP call to the client. + +#### Schema content request + +Requests for schemas with URLs not handled by the server are forwarded to the client through an LSP request. This request is a JSON language server specific, non-standardized, extension to the LSP. + +Request: +- method: 'vscode/content' +- params: `string` - The schema URL to request. +- response: `string` - The content of the schema with the given URL + +#### Schema content change notification + +When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server specific, non-standardized, extension to the LSP. +The server will, as a response, clear the schema content from the cache and reload the schema content when required again. #### Schema associations notification @@ -111,20 +142,6 @@ interface ISchemaAssociations { - keys: a file names or file path (separated by `/`). `*` can be used as a wildcard. - values: An array of schema URLs -#### Schema content request - -The schema content for schema URLs that start with `vscode://` will be requested from the client through an LSP request. This request is a JSON language server specific, non-standardized, extension to the LSP. - -Request: -- method: 'vscode/content' -- params: `string` - The schema URL to request. The server will only ask for URLs that start with `vscode://` -- response: `string` - The content of the schema with the given URL - -#### Schema content change notification - -When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server specific, non-standardized, extension to the LSP. -The server will, as a response, clear the schema content from the cache and reload the schema content when required again. - Notification: - method: 'json/schemaContent' - params: `string` the URL of the schema that has changed. From caad996fbaddb7705f40d71690671c83c8fc4f31 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 19 Jul 2019 10:34:31 +0200 Subject: [PATCH 178/190] JSON Language Server 1.2.0 --- extensions/json-language-features/server/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index 68b639c2aae..c07dca1e441 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -1,7 +1,7 @@ { "name": "vscode-json-languageserver", "description": "JSON language server", - "version": "1.0.1", + "version": "1.2.0", "author": "Microsoft Corporation", "license": "MIT", "engines": { From eeaffa91a3ba140ca7d6622abc901aa70d131150 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Fri, 19 Jul 2019 11:29:39 +0200 Subject: [PATCH 179/190] add new variable ${relativeFileDirname}; fixes #77616 --- .../configuration-editing/src/extension.ts | 19 ++++++++++++++----- .../common/variableResolver.ts | 7 +++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/extensions/configuration-editing/src/extension.ts b/extensions/configuration-editing/src/extension.ts index 913c5288809..aff533d86d9 100644 --- a/extensions/configuration-editing/src/extension.ts +++ b/extensions/configuration-editing/src/extension.ts @@ -63,11 +63,20 @@ function registerVariableCompletions(pattern: string): vscode.Disposable { const indexOf$ = document.lineAt(position.line).text.indexOf('$'); const startPosition = indexOf$ >= 0 ? new vscode.Position(position.line, indexOf$) : position; - return [{ label: 'workspaceFolder', detail: localize('workspaceFolder', "The path of the folder opened in VS Code") }, { label: 'workspaceFolderBasename', detail: localize('workspaceFolderBasename', "The name of the folder opened in VS Code without any slashes (/)") }, - { label: 'relativeFile', detail: localize('relativeFile', "The current opened file relative to ${workspaceFolder}") }, { label: 'file', detail: localize('file', "The current opened file") }, { label: 'cwd', detail: localize('cwd', "The task runner's current working directory on startup") }, - { label: 'lineNumber', detail: localize('lineNumber', "The current selected line number in the active file") }, { label: 'selectedText', detail: localize('selectedText', "The current selected text in the active file") }, - { label: 'fileDirname', detail: localize('fileDirname', "The current opened file's dirname") }, { label: 'fileExtname', detail: localize('fileExtname', "The current opened file's extension") }, { label: 'fileBasename', detail: localize('fileBasename', "The current opened file's basename") }, - { label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") }].map(variable => ({ + return [ + { label: 'workspaceFolder', detail: localize('workspaceFolder', "The path of the folder opened in VS Code") }, + { label: 'workspaceFolderBasename', detail: localize('workspaceFolderBasename', "The name of the folder opened in VS Code without any slashes (/)") }, + { label: 'relativeFile', detail: localize('relativeFile', "The current opened file relative to ${workspaceFolder}") }, + { label: 'relativeFileDirname', detail: localize('relativeFileDirname', "The current opened file's dirname relative to ${workspaceFolder}") }, + { label: 'file', detail: localize('file', "The current opened file") }, + { label: 'cwd', detail: localize('cwd', "The task runner's current working directory on startup") }, + { label: 'lineNumber', detail: localize('lineNumber', "The current selected line number in the active file") }, + { label: 'selectedText', detail: localize('selectedText', "The current selected text in the active file") }, + { label: 'fileDirname', detail: localize('fileDirname', "The current opened file's dirname") }, + { label: 'fileExtname', detail: localize('fileExtname', "The current opened file's extension") }, + { label: 'fileBasename', detail: localize('fileBasename', "The current opened file's basename") }, + { label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") } + ].map(variable => ({ label: '${' + variable.label + '}', range: new vscode.Range(startPosition, position), detail: variable.detail diff --git a/src/vs/workbench/services/configurationResolver/common/variableResolver.ts b/src/vs/workbench/services/configurationResolver/common/variableResolver.ts index 43d8013dc31..a07fb3a264d 100644 --- a/src/vs/workbench/services/configurationResolver/common/variableResolver.ts +++ b/src/vs/workbench/services/configurationResolver/common/variableResolver.ts @@ -237,6 +237,13 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe } return getFilePath(); + case 'relativeFileDirname': + let dirname = paths.dirname(getFilePath()); + if (folderUri) { + return paths.normalize(paths.relative(getFolderUri().fsPath, dirname)); + } + return dirname; + case 'fileDirname': return paths.dirname(getFilePath()); From e4d9905d35b93dcdc5f216125da2cbf1aae483ec Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 12:26:11 +0200 Subject: [PATCH 180/190] add tests for remote and local install action --- .../extensionsActions.test.ts | 407 +++++++++++++++++- 1 file changed, 398 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index b60cebb0eed..fccc14da4cc 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -44,6 +44,7 @@ import { ExtensionManagementServerService } from 'vs/workbench/services/extensio import { IProductService } from 'vs/platform/product/common/product'; import { Schemas } from 'vs/base/common/network'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; suite('ExtensionsActions Test', () => { @@ -55,7 +56,7 @@ suite('ExtensionsActions Test', () => { didUninstallEvent: Emitter; - suiteSetup(() => { + setup(async () => { installEvent = new Emitter(); didInstallEvent = new Emitter(); uninstallEvent = new Emitter(); @@ -93,9 +94,7 @@ suite('ExtensionsActions Test', () => { instantiationService.set(IExtensionTipsService, instantiationService.createInstance(ExtensionTipsService)); instantiationService.stub(IURLService, URLService); - }); - setup(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', []); instantiationService.stubPromise(IExtensionManagementService, 'getExtensionsReport', []); instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage()); @@ -1355,15 +1354,14 @@ suite('ExtensionsActions Test', () => { test('Test remote install action is enabled for local workspace extension', async () => { // multi server setup - const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, instantiationService.get(IExtensionManagementService)); + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension])); instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); - const workbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); instantiationService.set(IExtensionsWorkbenchService, workbenchService); - const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); - instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]); const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); instantiationService.createInstance(ExtensionContainers, [testObject]); @@ -1375,6 +1373,378 @@ suite('ExtensionsActions Test', () => { assert.equal('extension-action prominent install', testObject.class); }); + test('Test remote install action is enabled for disabled local workspace extension', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + await instantiationService.get(IExtensionEnablementService).setEnablement([localWorkspaceExtension], EnablementState.DisabledGlobally); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); + + test('Test remote install action is disabled when extension is not set', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension])); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for extension which is not installed', async () => { + // multi server setup + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a'))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const pager = await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = pager.firstPage[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for local workspace extension which is disabled in env', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension])); + instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled when remote server is not available', async () => { + // single server setup + const workbenchService = instantiationService.get(IExtensionsWorkbenchService); + const extensionManagementServerService = instantiationService.get(IExtensionManagementServerService); + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for local workspace extension if it is installed in remote', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), createExtensionManagementService([remoteWorkspaceExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for local workspace extension if it cannot be installed', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for local ui extension if it is not installed in remote', async () => { + // multi server setup + const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test remote install action is disabled for local ui extension if it is also installed in remote', async () => { + // multi server setup + const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension]), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is enabled for remote ui extension', async () => { + // multi server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); + + test('Test local install action is enabled for disabled remote ui extension', async () => { + // multi server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + await instantiationService.get(IExtensionEnablementService).setEnablement([remoteUIExtension], EnablementState.DisabledGlobally); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); + + test('Test local install action is disabled when extension is not set', async () => { + // multi server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for extension which is not installed', async () => { + // multi server setup + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a'))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const pager = await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = pager.firstPage[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for remote ui extension which is disabled in env', async () => { + // multi server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled when local server is not available', async () => { + // single server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aSingleRemoteExtensionManagementServerService(instantiationService, createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for remote ui extension if it is installed in local', async () => { + // multi server setup + const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension]), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for remote UI extension if it cannot be installed', async () => { + // multi server setup + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for remote workspace extension if it is not installed in local', async () => { + // multi server setup + const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteWorkspaceExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + + test('Test local install action is disabled for remote workspace extension if it is also installed in local', async () => { + // multi server setup + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspae' }, { location: URI.file(`pub.a`) }); + const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), createExtensionManagementService([remoteWorkspaceExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + testObject.extension = extensions[0]; + assert.ok(testObject.extension); + assert.ok(!testObject.enabled); + }); + test(`RecommendToFolderAction`, () => { // TODO: Implement test }); @@ -1403,6 +1773,25 @@ suite('ExtensionsActions Test', () => { return { firstPage: objects, total: objects.length, pageSize: objects.length, getPage: () => null! }; } + function aSingleRemoteExtensionManagementServerService(instantiationService: TestInstantiationService, remoteExtensionManagementService?: IExtensionManagementService): IExtensionManagementServerService { + const remoteExtensionManagementServer: IExtensionManagementServer = { + authority: 'vscode-remote', + label: 'remote', + extensionManagementService: remoteExtensionManagementService || createExtensionManagementService() + }; + return { + _serviceBrand: {}, + localExtensionManagementServer: null, + remoteExtensionManagementServer, + getExtensionManagementServer: (location: URI) => { + if (location.scheme === REMOTE_HOST_SCHEME) { + return remoteExtensionManagementServer; + } + return null; + } + }; + } + function aMultiExtensionManagementServerService(instantiationService: TestInstantiationService, localExtensionManagementService?: IExtensionManagementService, remoteExtensionManagementService?: IExtensionManagementService): IExtensionManagementServerService { const localExtensionManagementServer: IExtensionManagementServer = { authority: 'vscode-local', @@ -1430,13 +1819,13 @@ suite('ExtensionsActions Test', () => { }; } - function createExtensionManagementService(): IExtensionManagementService { + function createExtensionManagementService(installed: ILocalExtension[] = []): IExtensionManagementService { return { onInstallExtension: Event.None, onDidInstallExtension: Event.None, onUninstallExtension: Event.None, onDidUninstallExtension: Event.None, - getInstalled: () => Promise.resolve([]) + getInstalled: () => Promise.resolve(installed) }; } From ac3680d6498e4fa5d8f6792fe029983a30c6632a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 13:23:30 +0200 Subject: [PATCH 181/190] more tests --- .../extensionsActions.test.ts | 145 +++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index fccc14da4cc..93388fdad2b 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -1373,6 +1373,77 @@ suite('ExtensionsActions Test', () => { assert.equal('extension-action prominent install', testObject.class); }); + test('Test remote install action when installing local workspace extension', async (done) => { + // multi server setup + const remoteExtensionManagementService: IExtensionManagementService = createExtensionManagementService(); + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), remoteExtensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.stub(IExtensionsWorkbenchService, workbenchService, 'open', undefined); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + + remoteExtensionManagementService.installFromGallery = () => new Promise(c => c(aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }))); + const disposable = testObject.onDidChange(() => { + if (testObject.label === 'Installing' && testObject.enabled) { + disposable.dispose(); + done(); + } + }); + testObject.run(); + }); + + test('Test remote install action when installing local workspace extension is finished', async (done) => { + // multi server setup + const remoteExtensionManagementService: IExtensionManagementService = createExtensionManagementService(); + const onDidInstallEvent = new Emitter(); + remoteExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event; + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), remoteExtensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.stub(IExtensionsWorkbenchService, workbenchService, 'open', undefined); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + + const installedExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + remoteExtensionManagementService.installFromGallery = () => new Promise(c => c(installedExtension)); + await testObject.run(); + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + + const disposable = testObject.onDidChange(() => { + if (testObject.label === 'Install on remote' && !testObject.enabled) { + disposable.dispose(); + done(); + } + }); + onDidInstallEvent.fire({ identifier: installedExtension.identifier, local: installedExtension, operation: InstallOperation.Install }); + }); + test('Test remote install action is enabled for disabled local workspace extension', async () => { // multi server setup const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); @@ -1568,6 +1639,77 @@ suite('ExtensionsActions Test', () => { assert.equal('extension-action prominent install', testObject.class); }); + test('Test local install action when installing remote ui extension', async (done) => { + // multi server setup + const localExtensionManagementService: IExtensionManagementService = createExtensionManagementService(); + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.stub(IExtensionsWorkbenchService, workbenchService, 'open', undefined); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + + localExtensionManagementService.installFromGallery = () => new Promise(c => c(aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }))); + const disposable = testObject.onDidChange(() => { + if (testObject.label === 'Installing' && testObject.enabled) { + disposable.dispose(); + done(); + } + }); + testObject.run(); + }); + + test('Test local install action when installing remote ui extension is finished', async (done) => { + // multi server setup + const localExtensionManagementService: IExtensionManagementService = createExtensionManagementService(); + const onDidInstallEvent = new Emitter(); + localExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event; + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteUIExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.stub(IExtensionsWorkbenchService, workbenchService, 'open', undefined); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + + const installedExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) }); + localExtensionManagementService.installFromGallery = () => new Promise(c => c(installedExtension)); + await testObject.run(); + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + + const disposable = testObject.onDidChange(() => { + if (testObject.label === 'Install Locally' && !testObject.enabled) { + disposable.dispose(); + done(); + } + }); + onDidInstallEvent.fire({ identifier: installedExtension.identifier, local: installedExtension, operation: InstallOperation.Install }); + }); + test('Test local install action is enabled for disabled remote ui extension', async () => { // multi server setup const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); @@ -1825,7 +1967,8 @@ suite('ExtensionsActions Test', () => { onDidInstallExtension: Event.None, onUninstallExtension: Event.None, onDidUninstallExtension: Event.None, - getInstalled: () => Promise.resolve(installed) + getInstalled: () => Promise.resolve(installed), + installFromGallery: (extension: IGalleryExtension) => Promise.reject(new Error('not supported')) }; } From 961d04f3c241400d09b5222a881307bc9ae47525 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 16:20:14 +0200 Subject: [PATCH 182/190] Check for installed status Add tests for language pack extensions --- .../extensions/browser/extensionsActions.ts | 2 +- .../extensionsActions.test.ts | 142 ++++++++++++++++++ 2 files changed, 143 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index b9c9c18e8bd..999c4539c03 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -314,7 +314,7 @@ export class InstallInOtherServerAction extends ExtensionAction { } if ( - this.extension && this.extension.local && this.server + this.extension && this.extension.local && this.server && this.extension.state === ExtensionState.Installed // disabled by extension kind or it is a language pack extension && (this.extension.enablementState === EnablementState.DisabledByExtensionKind || isLanguagePackExtension(this.extension.local.manifest)) // Not installed in other server and can install in other server diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 93388fdad2b..5c4b51aa788 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -1539,6 +1539,31 @@ suite('ExtensionsActions Test', () => { assert.ok(!testObject.enabled); }); + test('Test remote install action is disabled for local workspace extension if it is uninstalled locally', async () => { + // multi server setup + const extensionManagementService = instantiationService.get(IExtensionManagementService); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, extensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + + uninstallEvent.fire(localWorkspaceExtension.identifier); + assert.ok(!testObject.enabled); + }); + test('Test remote install action is disabled for local workspace extension if it is installed in remote', async () => { // multi server setup const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) }); @@ -1618,6 +1643,52 @@ suite('ExtensionsActions Test', () => { assert.ok(!testObject.enabled); }); + test('Test remote install action is enabled for locally installed language pack extension', async () => { + // multi server setup + const languagePackExtension = aLocalExtension('a', { contributes: { localizations: [{ languageId: 'de', translations: [] }] } }, { location: URI.file(`pub.a`) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([languagePackExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: languagePackExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); + + test('Test remote install action is disabled if local language pack extension is uninstalled', async () => { + // multi server setup + const extensionManagementService = instantiationService.get(IExtensionManagementService); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, extensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const languagePackExtension = aLocalExtension('a', { contributes: { localizations: [{ languageId: 'de', translations: [] }] } }, { location: URI.file(`pub.a`) }); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [languagePackExtension]); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: languagePackExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install on remote', testObject.label); + + uninstallEvent.fire(languagePackExtension.identifier); + assert.ok(!testObject.enabled); + }); + test('Test local install action is enabled for remote ui extension', async () => { // multi server setup const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); @@ -1829,6 +1900,31 @@ suite('ExtensionsActions Test', () => { assert.ok(!testObject.enabled); }); + test('Test local install action is disabled for remoteUI extension if it is uninstalled locally', async () => { + // multi server setup + const extensionManagementService = instantiationService.get(IExtensionManagementService); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), extensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [remoteUIExtension]); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: remoteUIExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + + uninstallEvent.fire(remoteUIExtension.identifier); + assert.ok(!testObject.enabled); + }); + test('Test local install action is disabled for remote UI extension if it cannot be installed', async () => { // multi server setup const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); @@ -1887,6 +1983,52 @@ suite('ExtensionsActions Test', () => { assert.ok(!testObject.enabled); }); + test('Test local install action is enabled for remotely installed language pack extension', async () => { + // multi server setup + const languagePackExtension = aLocalExtension('a', { contributes: { localizations: [{ languageId: 'de', translations: [] }] } }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([languagePackExtension])); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: languagePackExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + assert.equal('extension-action prominent install', testObject.class); + }); + + test('Test local install action is disabled if remote language pack extension is uninstalled', async () => { + // multi server setup + const extensionManagementService = instantiationService.get(IExtensionManagementService); + const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), extensionManagementService); + instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService); + instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService)); + const languagePackExtension = aLocalExtension('a', { contributes: { localizations: [{ languageId: 'de', translations: [] }] } }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [languagePackExtension]); + const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService); + instantiationService.set(IExtensionsWorkbenchService, workbenchService); + + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: languagePackExtension.identifier }))); + const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction); + instantiationService.createInstance(ExtensionContainers, [testObject]); + + const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!); + await workbenchService.queryGallery(CancellationToken.None); + testObject.extension = extensions[0]; + assert.ok(testObject.enabled); + assert.equal('Install Locally', testObject.label); + + uninstallEvent.fire(languagePackExtension.identifier); + assert.ok(!testObject.enabled); + }); + test(`RecommendToFolderAction`, () => { // TODO: Implement test }); From a0d681dab8e8d1956ee8746bccf2ba27f73ab8b9 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 16:58:11 +0200 Subject: [PATCH 183/190] clean up install action --- .../extensions/browser/extensionsActions.ts | 25 +++++++++++-------- .../browser/extensionsWorkbenchService.ts | 4 +-- .../contrib/extensions/common/extensions.ts | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 999c4539c03..f68a840c9ad 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -172,19 +172,22 @@ export class InstallAction extends ExtensionAction { } update(): void { - if (!this.extension || this.extension.type === ExtensionType.System || this.extension.state === ExtensionState.Installed) { - this.enabled = false; - this.class = InstallAction.Class; - this.label = InstallAction.INSTALL_LABEL; - return; - } this.enabled = false; - if (this.extensionsWorkbenchService.canInstall(this.extension)) { - const local = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier))[0]; - this.enabled = !local || (!!local.local && isLanguagePackExtension(local.local.manifest)); + this.class = InstallAction.Class; + this.label = InstallAction.INSTALL_LABEL; + if (this.extension && this.extension.type === ExtensionType.User) { + if (this.extension.state === ExtensionState.Uninstalled && this.extensionsWorkbenchService.canInstall(this.extension)) { + this.enabled = true; + this.updateLabel(); + return; + } + if (this.extension.state === ExtensionState.Installing) { + this.enabled = false; + this.updateLabel(); + this.class = this.extension.state === ExtensionState.Installing ? InstallAction.InstallingClass : InstallAction.Class; + return; + } } - this.class = this.extension.state === ExtensionState.Installing ? InstallAction.InstallingClass : InstallAction.Class; - this.updateLabel(); } private updateLabel(): void { diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index b0c5726c6b9..c0e396c38b4 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -58,8 +58,8 @@ class Extension implements IExtension { @IProductService private readonly productService: IProductService ) { } - get type(): ExtensionType | undefined { - return this.local ? this.local.type : undefined; + get type(): ExtensionType { + return this.local ? this.local.type : ExtensionType.User; } get name(): string { diff --git a/src/vs/workbench/contrib/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts index 5e6d7cf3993..33e46eecf82 100644 --- a/src/vs/workbench/contrib/extensions/common/extensions.ts +++ b/src/vs/workbench/contrib/extensions/common/extensions.ts @@ -34,7 +34,7 @@ export const enum ExtensionState { } export interface IExtension { - readonly type?: ExtensionType; + readonly type: ExtensionType; readonly state: ExtensionState; readonly name: string; readonly displayName: string; From a93ef520f82b8ba164ec317e2b534a119dd67ce8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 Jul 2019 17:12:40 +0200 Subject: [PATCH 184/190] fix tests --- .../electron-browser/extensionsWorkbenchService.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 69b101504fa..04ed61d0d8a 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -112,7 +112,7 @@ suite('ExtensionsWorkbenchServiceTest', () => { test('test gallery extension', async () => { const expected = aGalleryExtension('expectedName', { displayName: 'expectedDisplayName', - version: '1.5', + version: '1.5.0', publisherId: 'expectedPublisherId', publisher: 'expectedPublisher', publisherDisplayName: 'expectedPublisherDisplayName', @@ -140,14 +140,14 @@ suite('ExtensionsWorkbenchServiceTest', () => { assert.equal(1, pagedResponse.firstPage.length); const actual = pagedResponse.firstPage[0]; - assert.equal(null, actual.type); + assert.equal(ExtensionType.User, actual.type); assert.equal('expectedName', actual.name); assert.equal('expectedDisplayName', actual.displayName); assert.equal('expectedpublisher.expectedname', actual.identifier.id); assert.equal('expectedPublisher', actual.publisher); assert.equal('expectedPublisherDisplayName', actual.publisherDisplayName); - assert.equal('1.5', actual.version); - assert.equal('1.5', actual.latestVersion); + assert.equal('1.5.0', actual.version); + assert.equal('1.5.0', actual.latestVersion); assert.equal('expectedDescription', actual.description); assert.equal('uri:icon', actual.iconUrl); assert.equal('fallback:icon', actual.iconUrlFallback); From f0e66ee83bdd0de83bcb601702ba26a1b6d28dff Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 19 Jul 2019 09:32:33 -0700 Subject: [PATCH 185/190] Bump vscode-ripgrep --- package.json | 4 ++-- remote/package.json | 2 +- remote/yarn.lock | 8 ++++---- yarn.lock | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 8d546203d04..6c72aa10cfc 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "v8-inspect-profiler": "^0.0.20", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", - "vscode-ripgrep": "^1.5.4", + "vscode-ripgrep": "^1.5.5", "vscode-sqlite3": "4.0.8", "vscode-textmate": "^4.2.2", "xterm": "3.15.0-beta71", @@ -158,4 +158,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} \ No newline at end of file +} diff --git a/remote/package.json b/remote/package.json index a4113e1e74c..081eb5c6076 100644 --- a/remote/package.json +++ b/remote/package.json @@ -18,7 +18,7 @@ "spdlog": "^0.9.0", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", - "vscode-ripgrep": "^1.5.4", + "vscode-ripgrep": "^1.5.5", "vscode-textmate": "^4.2.2", "xterm": "3.15.0-beta71", "xterm-addon-search": "0.2.0-beta2", diff --git a/remote/yarn.lock b/remote/yarn.lock index 9aa7137893e..3ed8f02de3c 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -1123,10 +1123,10 @@ vscode-proxy-agent@0.4.0: https-proxy-agent "2.2.1" socks-proxy-agent "4.0.1" -vscode-ripgrep@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.4.tgz#dae1c3eef350513299341cdf96e622c00b548eff" - integrity sha512-Bs8SvFAkR0QHf09J46VgNo19yRikOtj/f0zHzK3AM3ICjCGNN/BNoG9of6zGVHUTO+6Mk1RbKglyOHLKr8D1lg== +vscode-ripgrep@^1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.5.tgz#24c0e9cb356cf889c98e15ecb58f9cf654a1d961" + integrity sha512-OrPrAmcun4+uZAuNcQvE6CCPskh+5AsjANod/Q3zRcJcGNxgoOSGlQN9RPtatkUNmkN8Nn8mZBnS1jMylu/dKg== vscode-textmate@^4.2.2: version "4.2.2" diff --git a/yarn.lock b/yarn.lock index 7876a802c5c..3fa82a92145 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9561,10 +9561,10 @@ vscode-proxy-agent@0.4.0: https-proxy-agent "2.2.1" socks-proxy-agent "4.0.1" -vscode-ripgrep@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.4.tgz#dae1c3eef350513299341cdf96e622c00b548eff" - integrity sha512-Bs8SvFAkR0QHf09J46VgNo19yRikOtj/f0zHzK3AM3ICjCGNN/BNoG9of6zGVHUTO+6Mk1RbKglyOHLKr8D1lg== +vscode-ripgrep@^1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.5.tgz#24c0e9cb356cf889c98e15ecb58f9cf654a1d961" + integrity sha512-OrPrAmcun4+uZAuNcQvE6CCPskh+5AsjANod/Q3zRcJcGNxgoOSGlQN9RPtatkUNmkN8Nn8mZBnS1jMylu/dKg== vscode-sqlite3@4.0.8: version "4.0.8" From 04ce5599675e3bb367d93e4e68827961439fe58c Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 19 Jul 2019 10:14:23 -0700 Subject: [PATCH 186/190] Support file scheme for save and open dialog --- .../workbench/services/dialogs/browser/fileDialogService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts index 8c04023b954..f7d1e60691e 100644 --- a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts +++ b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts @@ -221,7 +221,7 @@ export class FileDialogService implements IFileDialogService { const schema = this.getFileSystemSchema(options); if (this.shouldUseSimplified(schema)) { if (!options.availableFileSystems) { - options.availableFileSystems = [schema]; // by default only allow saving in the own file system + options.availableFileSystems = this.ensureFileSchema(schema); // always allow file as well } return this.saveRemoteResource(options); @@ -239,7 +239,7 @@ export class FileDialogService implements IFileDialogService { const schema = this.getFileSystemSchema(options); if (this.shouldUseSimplified(schema)) { if (!options.availableFileSystems) { - options.availableFileSystems = [schema]; // by default only allow loading in the own file system + options.availableFileSystems = this.ensureFileSchema(schema); // always allow file as well } const uri = await this.pickRemoteResource(options); From c3e13bca4fd87f88a77c7aff414cdf804cb99cff Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 19 Jul 2019 11:27:54 -0700 Subject: [PATCH 187/190] thread id in commentNode ID --- src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts index 91370417b61..65f2ce20738 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts @@ -23,7 +23,7 @@ export class CommentsDataSource implements IDataSource { return element.id; } if (element instanceof CommentNode) { - return `${element.resource.toString()}-${element.comment.uniqueIdInThread}`; + return `${element.resource.toString()}-${element.threadId}-${element.comment.uniqueIdInThread}`; } return ''; } From e4ea68f5b66c97d79ad2a7f433a3183ab26e0bdb Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Fri, 19 Jul 2019 11:34:38 -0700 Subject: [PATCH 188/190] Update icons for npm script explorer --- extensions/npm/resources/dark/continue.svg | 4 +++- extensions/npm/resources/dark/debug.svg | 10 ++++------ extensions/npm/resources/dark/prepostscript.svg | 4 +++- extensions/npm/resources/dark/refresh.svg | 5 ++++- extensions/npm/resources/dark/script.svg | 4 +++- extensions/npm/resources/light/continue.svg | 4 +++- extensions/npm/resources/light/debug.svg | 10 ++++------ extensions/npm/resources/light/prepostscript.svg | 4 +++- extensions/npm/resources/light/refresh.svg | 5 ++++- extensions/npm/resources/light/script.svg | 4 +++- 10 files changed, 34 insertions(+), 20 deletions(-) diff --git a/extensions/npm/resources/dark/continue.svg b/extensions/npm/resources/dark/continue.svg index e6eb6041129..8b0a58eca9b 100644 --- a/extensions/npm/resources/dark/continue.svg +++ b/extensions/npm/resources/dark/continue.svg @@ -1 +1,3 @@ -continue \ No newline at end of file + + + diff --git a/extensions/npm/resources/dark/debug.svg b/extensions/npm/resources/dark/debug.svg index e211df43ef6..e4c1b7a927b 100644 --- a/extensions/npm/resources/dark/debug.svg +++ b/extensions/npm/resources/dark/debug.svg @@ -1,7 +1,5 @@ - - - - - - + + + + diff --git a/extensions/npm/resources/dark/prepostscript.svg b/extensions/npm/resources/dark/prepostscript.svg index cc9bcee715a..7137a9d7bb5 100644 --- a/extensions/npm/resources/dark/prepostscript.svg +++ b/extensions/npm/resources/dark/prepostscript.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/extensions/npm/resources/dark/refresh.svg b/extensions/npm/resources/dark/refresh.svg index d79fdaa4e8e..ec0c43f0bc3 100644 --- a/extensions/npm/resources/dark/refresh.svg +++ b/extensions/npm/resources/dark/refresh.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/extensions/npm/resources/dark/script.svg b/extensions/npm/resources/dark/script.svg index f90781897a7..7137a9d7bb5 100644 --- a/extensions/npm/resources/dark/script.svg +++ b/extensions/npm/resources/dark/script.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/extensions/npm/resources/light/continue.svg b/extensions/npm/resources/light/continue.svg index a4dd1cd3ca8..2563bfa114b 100644 --- a/extensions/npm/resources/light/continue.svg +++ b/extensions/npm/resources/light/continue.svg @@ -1 +1,3 @@ -continue \ No newline at end of file + + + diff --git a/extensions/npm/resources/light/debug.svg b/extensions/npm/resources/light/debug.svg index b8efb1c8f77..81a5ffb6b11 100644 --- a/extensions/npm/resources/light/debug.svg +++ b/extensions/npm/resources/light/debug.svg @@ -1,7 +1,5 @@ - - - - - - + + + + diff --git a/extensions/npm/resources/light/prepostscript.svg b/extensions/npm/resources/light/prepostscript.svg index e59d80cd323..60f77501db7 100644 --- a/extensions/npm/resources/light/prepostscript.svg +++ b/extensions/npm/resources/light/prepostscript.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/extensions/npm/resources/light/refresh.svg b/extensions/npm/resources/light/refresh.svg index e0345748192..a5b88123a0e 100644 --- a/extensions/npm/resources/light/refresh.svg +++ b/extensions/npm/resources/light/refresh.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/extensions/npm/resources/light/script.svg b/extensions/npm/resources/light/script.svg index fb1c74cf773..60f77501db7 100644 --- a/extensions/npm/resources/light/script.svg +++ b/extensions/npm/resources/light/script.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + From 496158d60fdd3d0b1bda3d8525b4535180ee4052 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 19 Jul 2019 11:43:09 -0700 Subject: [PATCH 189/190] comment node should also be prefixed with ownerid. --- .../comments/browser/commentsTreeViewer.ts | 4 +-- .../contrib/comments/common/commentModel.ts | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts index 65f2ce20738..86ade2f8f53 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts @@ -20,10 +20,10 @@ export class CommentsDataSource implements IDataSource { return 'root'; } if (element instanceof ResourceWithCommentThreads) { - return element.id; + return `${element.owner}-${element.id}`; } if (element instanceof CommentNode) { - return `${element.resource.toString()}-${element.threadId}-${element.comment.uniqueIdInThread}`; + return `${element.owner}-${element.resource.toString()}-${element.threadId}-${element.comment.uniqueIdInThread}`; } return ''; } diff --git a/src/vs/workbench/contrib/comments/common/commentModel.ts b/src/vs/workbench/contrib/comments/common/commentModel.ts index d2a03f5ccd5..b4e40ddca1b 100644 --- a/src/vs/workbench/contrib/comments/common/commentModel.ts +++ b/src/vs/workbench/contrib/comments/common/commentModel.ts @@ -15,13 +15,15 @@ export interface ICommentThreadChangedEvent extends CommentThreadChangedEvent { } export class CommentNode { + owner: string; threadId: string; range: IRange; comment: Comment; replies: CommentNode[] = []; resource: URI; - constructor(threadId: string, resource: URI, comment: Comment, range: IRange) { + constructor(owner: string, threadId: string, resource: URI, comment: Comment, range: IRange) { + this.owner = owner; this.threadId = threadId; this.comment = comment; this.resource = resource; @@ -35,18 +37,20 @@ export class CommentNode { export class ResourceWithCommentThreads { id: string; + owner: string; commentThreads: CommentNode[]; // The top level comments on the file. Replys are nested under each node. resource: URI; - constructor(resource: URI, commentThreads: CommentThread[]) { + constructor(owner: string, resource: URI, commentThreads: CommentThread[]) { + this.owner = owner; this.id = resource.toString(); this.resource = resource; - this.commentThreads = commentThreads.filter(thread => thread.comments && thread.comments.length).map(thread => ResourceWithCommentThreads.createCommentNode(resource, thread)); + this.commentThreads = commentThreads.filter(thread => thread.comments && thread.comments.length).map(thread => ResourceWithCommentThreads.createCommentNode(owner, resource, thread)); } - public static createCommentNode(resource: URI, commentThread: CommentThread): CommentNode { + public static createCommentNode(owner: string, resource: URI, commentThread: CommentThread): CommentNode { const { threadId, comments, range } = commentThread; - const commentNodes: CommentNode[] = comments!.map(comment => new CommentNode(threadId!, resource, comment, range)); + const commentNodes: CommentNode[] = comments!.map(comment => new CommentNode(owner, threadId!, resource, comment, range)); if (commentNodes.length > 1) { commentNodes[0].replies = commentNodes.slice(1, commentNodes.length); } @@ -65,7 +69,7 @@ export class CommentsModel { } public setCommentThreads(owner: string, commentThreads: CommentThread[]): void { - this.commentThreadsMap.set(owner, this.groupByResource(commentThreads)); + this.commentThreadsMap.set(owner, this.groupByResource(owner, commentThreads)); this.resourceCommentThreads = flatten(values(this.commentThreadsMap)); } @@ -97,9 +101,9 @@ export class CommentsModel { // Find comment node on resource that is that thread and replace it const index = firstIndex(matchingResourceData.commentThreads, (commentThread) => commentThread.threadId === thread.threadId); if (index >= 0) { - matchingResourceData.commentThreads[index] = ResourceWithCommentThreads.createCommentNode(URI.parse(matchingResourceData.id), thread); + matchingResourceData.commentThreads[index] = ResourceWithCommentThreads.createCommentNode(owner, URI.parse(matchingResourceData.id), thread); } else if (thread.comments && thread.comments.length) { - matchingResourceData.commentThreads.push(ResourceWithCommentThreads.createCommentNode(URI.parse(matchingResourceData.id), thread)); + matchingResourceData.commentThreads.push(ResourceWithCommentThreads.createCommentNode(owner, URI.parse(matchingResourceData.id), thread)); } }); @@ -108,10 +112,10 @@ export class CommentsModel { if (existingResource.length) { const resource = existingResource[0]; if (thread.comments && thread.comments.length) { - resource.commentThreads.push(ResourceWithCommentThreads.createCommentNode(resource.resource, thread)); + resource.commentThreads.push(ResourceWithCommentThreads.createCommentNode(owner, resource.resource, thread)); } } else { - threadsForOwner.push(new ResourceWithCommentThreads(URI.parse(thread.resource!), [thread])); + threadsForOwner.push(new ResourceWithCommentThreads(owner, URI.parse(thread.resource!), [thread])); } }); @@ -133,11 +137,11 @@ export class CommentsModel { } } - private groupByResource(commentThreads: CommentThread[]): ResourceWithCommentThreads[] { + private groupByResource(owner: string, commentThreads: CommentThread[]): ResourceWithCommentThreads[] { const resourceCommentThreads: ResourceWithCommentThreads[] = []; const commentThreadsByResource = new Map(); for (const group of groupBy(commentThreads, CommentsModel._compareURIs)) { - commentThreadsByResource.set(group[0].resource!, new ResourceWithCommentThreads(URI.parse(group[0].resource!), group)); + commentThreadsByResource.set(group[0].resource!, new ResourceWithCommentThreads(owner, URI.parse(group[0].resource!), group)); } commentThreadsByResource.forEach((v, i, m) => { From ccc4fbf13ad1084356c72b5414308e2ad6ba21a9 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 19 Jul 2019 12:04:20 -0700 Subject: [PATCH 190/190] Fix search validation not applied immediately when toggling regex mode Fix #77435 --- src/vs/workbench/contrib/search/browser/searchView.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 16ebfb4ed95..51979d3ff21 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1151,6 +1151,10 @@ export class SearchView extends ViewletPanel { } onQueryChanged(preserveFocus?: boolean): void { + if (!this.searchWidget.searchInput.inputBox.isInputValid()) { + return; + } + const isRegex = this.searchWidget.searchInput.getRegex(); const isWholeWords = this.searchWidget.searchInput.getWholeWords(); const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive();