From 5a4391b3b17089e2654c6726448e6c60c1e6248f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Geis?= Date: Tue, 10 Jul 2018 15:53:56 +0200 Subject: [PATCH 001/624] Added contrib extension to have focus follow mouse (fixes #25685). --- .../common/config/commonEditorConfig.ts | 5 ++ src/vs/editor/common/config/editorOptions.ts | 17 +++-- .../contrib/focusOnHover/focusOnHover.ts | 65 +++++++++++++++++++ src/vs/editor/editor.all.ts | 1 + src/vs/monaco.d.ts | 5 ++ 5 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 src/vs/editor/contrib/focusOnHover/focusOnHover.ts diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 9774ab0405b..c771bb7aeba 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -784,6 +784,11 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations, 'description': nls.localize('largeFileOptimizations', "Special handling for large files to disable certain memory intensive features.") }, + 'editor.focusOnHover': { + 'type': 'boolean', + 'default': false, + 'description': nls.localize('focusOnHover', 'Controls if editors should be focused when hovered.') + }, 'diffEditor.renderIndicators': { 'type': 'boolean', 'default': true, diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 14365ee9925..26bafcc31a4 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -625,6 +625,10 @@ export interface IEditorOptions { * Controls fading out of unused variables. */ showUnused?: boolean; + /** + * Controls whether editors should be focused on hover. + */ + focusOnHover?: boolean; } /** @@ -936,6 +940,7 @@ export interface EditorContribOptions { readonly lightbulbEnabled: boolean; readonly codeActionsOnSave: ICodeActionsOnSaveOptions; readonly codeActionsOnSaveTimeout: number; + readonly focusOnHover: boolean; } /** @@ -1315,6 +1320,7 @@ export class InternalEditorOptions { && objects.equals(a.codeActionsOnSave, b.codeActionsOnSave) && a.codeActionsOnSaveTimeout === b.codeActionsOnSaveTimeout && a.lightbulbEnabled === b.lightbulbEnabled + && a.focusOnHover === b.focusOnHover ); } @@ -1676,7 +1682,7 @@ export class EditorOptionsValidator { accessibilitySupport: _stringSet<'auto' | 'on' | 'off'>(opts.accessibilitySupport, defaults.accessibilitySupport, ['auto', 'on', 'off']), showUnused: _boolean(opts.showUnused, defaults.showUnused), viewInfo: viewInfo, - contribInfo: contribInfo, + contribInfo: contribInfo }; } @@ -1909,7 +1915,8 @@ export class EditorOptionsValidator { colorDecorators: _boolean(opts.colorDecorators, defaults.colorDecorators), lightbulbEnabled: _boolean(opts.lightbulb ? opts.lightbulb.enabled : false, defaults.lightbulbEnabled), codeActionsOnSave: _booleanMap(opts.codeActionsOnSave, {}), - codeActionsOnSaveTimeout: _clampedInt(opts.codeActionsOnSaveTimeout, defaults.codeActionsOnSaveTimeout, 1, 10000) + codeActionsOnSaveTimeout: _clampedInt(opts.codeActionsOnSaveTimeout, defaults.codeActionsOnSaveTimeout, 1, 10000), + focusOnHover: _boolean(opts.focusOnHover, defaults.focusOnHover) }; } } @@ -2017,7 +2024,8 @@ export class InternalEditorOptionsFactory { colorDecorators: opts.contribInfo.colorDecorators, lightbulbEnabled: opts.contribInfo.lightbulbEnabled, codeActionsOnSave: opts.contribInfo.codeActionsOnSave, - codeActionsOnSaveTimeout: opts.contribInfo.codeActionsOnSaveTimeout + codeActionsOnSaveTimeout: opts.contribInfo.codeActionsOnSaveTimeout, + focusOnHover: opts.contribInfo.focusOnHover } }; } @@ -2496,6 +2504,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { colorDecorators: true, lightbulbEnabled: true, codeActionsOnSave: {}, - codeActionsOnSaveTimeout: 750 + codeActionsOnSaveTimeout: 750, + focusOnHover: false }, }; diff --git a/src/vs/editor/contrib/focusOnHover/focusOnHover.ts b/src/vs/editor/contrib/focusOnHover/focusOnHover.ts new file mode 100644 index 00000000000..239360c49d0 --- /dev/null +++ b/src/vs/editor/contrib/focusOnHover/focusOnHover.ts @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { IEditorContribution } from 'vs/editor/common/editorCommon'; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; +import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; +import { IDisposable } from 'vs/base/common/lifecycle'; + +export class FocusOnHoverController implements IEditorContribution { + + private static readonly ID = 'editor.contrib.focusOnHover'; + + private _editorMouseMoveHandler?: IDisposable; + private _didChangeConfigurationHandler: IDisposable; + + static get(editor: ICodeEditor): FocusOnHoverController { + return editor.getContribution(FocusOnHoverController.ID); + } + + constructor(private readonly _editor: ICodeEditor) { + this._hookEvents(); + + this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { + if (e.contribInfo) { + this._unhookEvents(); + this._hookEvents(); + } + }); + } + + private _hookEvents(): void { + if (this._editor.getConfiguration().contribInfo.focusOnHover) { + this._editorMouseMoveHandler = this._editor.onMouseMove(_ => this._onEditorMouseMove()); + } + } + + private _unhookEvents(): void { + if (this._editorMouseMoveHandler) { + this._editorMouseMoveHandler.dispose(); + this._editorMouseMoveHandler = null; + } + } + + private _onEditorMouseMove(): void { + if (!this._editor.hasTextFocus()) { + this._editor.focus(); + } + } + + public getId(): string { + return FocusOnHoverController.ID; + } + + public dispose(): void { + this._unhookEvents(); + this._didChangeConfigurationHandler.dispose(); + } +} + +registerEditorContribution(FocusOnHoverController); diff --git a/src/vs/editor/editor.all.ts b/src/vs/editor/editor.all.ts index cc32769c6a6..85667363e86 100644 --- a/src/vs/editor/editor.all.ts +++ b/src/vs/editor/editor.all.ts @@ -21,6 +21,7 @@ import 'vs/editor/contrib/contextmenu/contextmenu'; import 'vs/editor/contrib/cursorUndo/cursorUndo'; import 'vs/editor/contrib/dnd/dnd'; import 'vs/editor/contrib/find/findController'; +import 'vs/editor/contrib/focusOnHover/focusOnHover'; import 'vs/editor/contrib/folding/folding'; import 'vs/editor/contrib/fontZoom/fontZoom'; import 'vs/editor/contrib/format/formatActions'; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index d176c102959..6e3f3758bf1 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2967,6 +2967,10 @@ declare namespace monaco.editor { * Controls fading out of unused variables. */ showUnused?: boolean; + /** + * Controls whether editors should be focused on hover. + */ + focusOnHover?: boolean; } /** @@ -3218,6 +3222,7 @@ declare namespace monaco.editor { readonly lightbulbEnabled: boolean; readonly codeActionsOnSave: ICodeActionsOnSaveOptions; readonly codeActionsOnSaveTimeout: number; + readonly focusOnHover: boolean; } /** From 6c5ecf0a8c5837e90b79fe16ea8047da23c24e4f Mon Sep 17 00:00:00 2001 From: lipgloss Date: Sun, 9 Sep 2018 18:07:49 -0600 Subject: [PATCH 002/624] add workbench configuration option for minimap opacity --- src/vs/editor/browser/viewParts/minimap/minimap.ts | 6 +++++- src/vs/platform/theme/common/colorRegistry.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 5f8337eb5a9..faccccf7fd0 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -26,7 +26,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor'; import * as platform from 'vs/base/common/platform'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; +import { minimapOpacity, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; const enum RenderMinimap { None = 0, @@ -926,6 +926,10 @@ export class Minimap extends ViewPart { } registerThemingParticipant((theme, collector) => { + const minimapOpacityValue = theme.getColor(minimapOpacity); + if (minimapOpacityValue) { + collector.addRule(`.monaco-editor .minimap { opacity: ${minimapOpacityValue.rgba.a}; will-change: opacity; }`); + } const sliderBackground = theme.getColor(scrollbarSliderBackground); if (sliderBackground) { const halfSliderBackground = sliderBackground.transparent(0.5); diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 9af7371f18a..975b802fa58 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -219,6 +219,8 @@ export const buttonHoverBackground = registerColor('button.hoverBackground', { d export const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hc: Color.black }, nls.localize('badgeBackground', "Badge background color. Badges are small information labels, e.g. for search results count.")); export const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: '#333', hc: Color.white }, nls.localize('badgeForeground', "Badge foreground color. Badges are small information labels, e.g. for search results count.")); +export const minimapOpacity = registerColor('minimapOpacity', { dark: null, light: null, hc: null }, nls.localize('minimapOpacity', "Opacity of minimap in hex. Color data is ignored.")); + export const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hc: null }, nls.localize('scrollbarShadow', "Scrollbar shadow to indicate that the view is scrolled.")); export const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hc: transparent(contrastBorder, 0.6) }, nls.localize('scrollbarSliderBackground', "Scrollbar slider background color.")); export const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hc: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', "Scrollbar slider background color when hovering.")); From b7ce554fa929979ae8c6121bd2b872ee1e32f6fb Mon Sep 17 00:00:00 2001 From: Przemyslaw Adamczewski Date: Tue, 19 Feb 2019 17:25:09 +0100 Subject: [PATCH 003/624] Fixes #40646: multi cursor copy line n times --- .../contrib/linesOperations/linesOperations.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/linesOperations/linesOperations.ts b/src/vs/editor/contrib/linesOperations/linesOperations.ts index d1559b13f0c..4080deab4c3 100644 --- a/src/vs/editor/contrib/linesOperations/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/linesOperations.ts @@ -37,8 +37,20 @@ abstract class AbstractCopyLinesAction extends EditorAction { public run(_accessor: ServicesAccessor, editor: ICodeEditor): void { - const commands: ICommand[] = []; - const selections = editor.getSelections() || []; + let commands: ICommand[] = []; + let selections = editor.getSelections() || []; + selections = selections.reduce((accumulator, selection) => { + const isCurrentSelectionDuplicated = accumulator.some(value => ( + value.startLineNumber === selection.startLineNumber && + value.endLineNumber === selection.endLineNumber + )); + + if (isCurrentSelectionDuplicated) { + return accumulator; + } + + return [...accumulator, selection]; + }, []); for (const selection of selections) { commands.push(new CopyLinesCommand(selection, this.down)); From 4f083a077ef2b5a2f80eae0341ec0e9e3d927ac6 Mon Sep 17 00:00:00 2001 From: Michael Gubik Date: Fri, 8 Mar 2019 19:46:21 +0800 Subject: [PATCH 004/624] Fix #62003, add option for predominant axis scrolling --- .../base/browser/ui/scrollbar/scrollableElement.ts | 10 ++++++++++ .../ui/scrollbar/scrollableElementOptions.ts | 9 +++++++++ .../viewParts/editorScrollbar/editorScrollbar.ts | 4 +++- src/vs/editor/common/config/commonEditorConfig.ts | 5 +++++ src/vs/editor/common/config/editorOptions.ts | 14 ++++++++++++-- src/vs/monaco.d.ts | 6 ++++++ 6 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts index 9b31c847f70..f82e490baa5 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts @@ -282,6 +282,7 @@ export abstract class AbstractScrollableElement extends Widget { this._options.handleMouseWheel = massagedOptions.handleMouseWheel; this._options.mouseWheelScrollSensitivity = massagedOptions.mouseWheelScrollSensitivity; this._options.fastScrollSensitivity = massagedOptions.fastScrollSensitivity; + this._options.scrollPredominantAxisOnly = massagedOptions.scrollPredominantAxisOnly; this._setListeningToMouseWheel(this._options.handleMouseWheel); if (!this._options.lazyRender) { @@ -329,6 +330,14 @@ export abstract class AbstractScrollableElement extends Widget { let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity; let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity; + if (this._options.scrollPredominantAxisOnly) { + if (Math.abs(deltaY) >= Math.abs(deltaX)) { + deltaX = 0; + } else { + deltaY = 0; + } + } + if (this._options.flipAxes) { [deltaY, deltaX] = [deltaX, deltaY]; } @@ -548,6 +557,7 @@ function resolveOptions(opts: ScrollableElementCreationOptions): ScrollableEleme scrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false), mouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1), fastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5), + scrollPredominantAxisOnly: (typeof opts.scrollPredominantAxisOnly !== 'undefined' ? opts.scrollPredominantAxisOnly : true), mouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true), arrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11), diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts b/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts index 7073bee8cb5..10e13f6273e 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts @@ -55,6 +55,13 @@ export interface ScrollableElementCreationOptions { * Defaults to 5. */ fastScrollSensitivity?: number; + /** + * Whether the editor will only scroll along the predominant axis when scrolling both + * vertically and horizontally at the same time. + * Prevents horizontal drift when scrolling vertically on a trackpad. + * Defaults to true. + */ + scrollPredominantAxisOnly?: boolean; /** * Height for vertical arrows (top/bottom) and width for horizontal arrows (left/right). * Defaults to 11. @@ -113,6 +120,7 @@ export interface ScrollableElementChangeOptions { handleMouseWheel?: boolean; mouseWheelScrollSensitivity?: number; fastScrollSensitivity: number; + scrollPredominantAxisOnly: boolean; } export interface ScrollableElementResolvedOptions { @@ -125,6 +133,7 @@ export interface ScrollableElementResolvedOptions { alwaysConsumeMouseWheel: boolean; mouseWheelScrollSensitivity: number; fastScrollSensitivity: number; + scrollPredominantAxisOnly: boolean; mouseWheelSmoothScroll: boolean; arrowSize: number; listenOnDomNode: HTMLElement | null; diff --git a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts index d9b8c4dfd8f..1f852dda2df 100644 --- a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts +++ b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts @@ -49,6 +49,7 @@ export class EditorScrollbar extends ViewPart { arrowSize: configScrollbarOpts.arrowSize, mouseWheelScrollSensitivity: configScrollbarOpts.mouseWheelScrollSensitivity, fastScrollSensitivity: configScrollbarOpts.fastScrollSensitivity, + scrollPredominantAxisOnly: configScrollbarOpts.scrollPredominantAxisOnly, }; this.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.scrollable)); @@ -129,7 +130,8 @@ export class EditorScrollbar extends ViewPart { const newOpts: ScrollableElementChangeOptions = { handleMouseWheel: editor.viewInfo.scrollbar.handleMouseWheel, mouseWheelScrollSensitivity: editor.viewInfo.scrollbar.mouseWheelScrollSensitivity, - fastScrollSensitivity: editor.viewInfo.scrollbar.fastScrollSensitivity + fastScrollSensitivity: editor.viewInfo.scrollbar.fastScrollSensitivity, + scrollPredominantAxisOnly: editor.viewInfo.scrollbar.scrollPredominantAxisOnly }; this.scrollbar.updateOptions(newOpts); } diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 2fcc4babff2..782e53ff8a4 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -459,6 +459,11 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity, 'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed mulitiplier when pressing `Alt`.") }, + 'editor.scrollPredominantAxisOnly': { + 'type': 'boolean', + 'default': EDITOR_DEFAULTS.viewInfo.scrollbar.scrollPredominantAxisOnly, + 'description': nls.localize('scrollPredominantAxisOnly', "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") + }, 'editor.multiCursorModifier': { 'type': 'string', 'enum': ['ctrlCmd', 'alt'], diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index f9df5b7912d..6b1c37d4303 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -485,6 +485,11 @@ export interface IEditorOptions { * Defaults to 5. */ fastScrollSensitivity?: number; + /** + * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. + * Defaults to true. + */ + scrollPredominantAxisOnly?: boolean; /** * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' @@ -898,6 +903,7 @@ export interface InternalEditorScrollbarOptions { readonly verticalSliderSize: number; readonly mouseWheelScrollSensitivity: number; readonly fastScrollSensitivity: number; + readonly scrollPredominantAxisOnly: boolean; } export interface InternalEditorMinimapOptions { @@ -1321,6 +1327,7 @@ export class InternalEditorOptions { && a.verticalSliderSize === b.verticalSliderSize && a.mouseWheelScrollSensitivity === b.mouseWheelScrollSensitivity && a.fastScrollSensitivity === b.fastScrollSensitivity + && a.scrollPredominantAxisOnly === b.scrollPredominantAxisOnly ); } @@ -1826,7 +1833,7 @@ export class EditorOptionsValidator { }; } - private static _sanitizeScrollbarOpts(opts: IEditorScrollbarOptions | undefined, defaults: InternalEditorScrollbarOptions, mouseWheelScrollSensitivity: number, fastScrollSensitivity: number): InternalEditorScrollbarOptions { + private static _sanitizeScrollbarOpts(opts: IEditorScrollbarOptions | undefined, defaults: InternalEditorScrollbarOptions, mouseWheelScrollSensitivity: number, fastScrollSensitivity: number, scrollPredominantAxisOnly: boolean): InternalEditorScrollbarOptions { if (typeof opts !== 'object') { return defaults; } @@ -1851,6 +1858,7 @@ export class EditorOptionsValidator { handleMouseWheel: _boolean(opts.handleMouseWheel, defaults.handleMouseWheel), mouseWheelScrollSensitivity: mouseWheelScrollSensitivity, fastScrollSensitivity: fastScrollSensitivity, + scrollPredominantAxisOnly: scrollPredominantAxisOnly, }; } @@ -2006,7 +2014,8 @@ export class EditorOptionsValidator { if (fastScrollSensitivity <= 0) { fastScrollSensitivity = defaults.scrollbar.fastScrollSensitivity; } - const scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity, fastScrollSensitivity); + let scrollPredominantAxisOnly = _boolean(opts.scrollPredominantAxisOnly, defaults.scrollbar.scrollPredominantAxisOnly); + const scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity, fastScrollSensitivity, scrollPredominantAxisOnly); const minimap = this._sanitizeMinimapOpts(opts.minimap, defaults.minimap); return { @@ -2636,6 +2645,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { handleMouseWheel: true, mouseWheelScrollSensitivity: 1, fastScrollSensitivity: 5, + scrollPredominantAxisOnly: true, }, minimap: { enabled: true, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 2f457a8d6a0..a26e2e69e5a 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2816,6 +2816,11 @@ declare namespace monaco.editor { * Defaults to 5. */ fastScrollSensitivity?: number; + /** + * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. + * Defaults to true. + */ + scrollPredominantAxisOnly?: boolean; /** * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' @@ -3174,6 +3179,7 @@ declare namespace monaco.editor { readonly verticalSliderSize: number; readonly mouseWheelScrollSensitivity: number; readonly fastScrollSensitivity: number; + readonly scrollPredominantAxisOnly: boolean; } export interface InternalEditorMinimapOptions { From 78236850f3fd6370758df24a1075ba1cbd6ed8c6 Mon Sep 17 00:00:00 2001 From: Cailin Smith Date: Mon, 22 Jul 2019 17:16:56 +0200 Subject: [PATCH 005/624] Move indent right one when the highlighted line is a scope start/end Previously, the indent was always to the left of the current line. While this logic was easier to implement, it is inconsistent with the behavior expected. This commit changes it to select the scope, rather than the line's indent. This is not a complete fix for #49342, as this does not add support to semantic detection, however, this will work in probably 90% of the cases, and is a relatively straightforward fix. --- src/vs/editor/common/model/textModel.ts | 25 +++++ .../common/model/textModelWithTokens.test.ts | 98 +++++++++++++------ 2 files changed, 92 insertions(+), 31 deletions(-) diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 3b7bb2d1365..aa7b8da805b 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -2408,6 +2408,31 @@ export class TextModel extends Disposable implements model.ITextModel { if (distance === 0) { // This is the initial line number + if (currentIndent >= 0 && this._computeIndentLevel(upLineNumber) > currentIndent) { + // This is a new scope, we have special handling here, since we want the + // child scope's indent to be active, not the parent scope's + startLineNumber = upLineNumber + 1; + endLineNumber = maxLineNumber; + for (let offsetDown = startLineNumber; offsetDown < maxLineNumber; offsetDown++) { + if (this._computeIndentLevel(offsetDown) === currentIndent) { + endLineNumber = offsetDown; + break; + } + } + return { startLineNumber, endLineNumber, indent: upLineIndentLevel + 1 }; + } + if (currentIndent >= 0 && this._computeIndentLevel(upLineNumber - 2) > currentIndent) { + // This is the end of a scope. Like above, but we walk backwards to find the parent scope start + endLineNumber = upLineNumber - 1; + startLineNumber = minLineNumber; + for (let offsetUp = endLineNumber; offsetUp >= minLineNumber; offsetUp--) { + if (this._computeIndentLevel(offsetUp - 1) === this._computeIndentLevel(upLineNumber - 1)) { + startLineNumber = offsetUp + 1; + break; + } + } + return { startLineNumber, endLineNumber, indent: upLineIndentLevel + 1 }; + } startLineNumber = upLineNumber; endLineNumber = downLineNumber; indent = upLineIndentLevel; diff --git a/src/vs/editor/test/common/model/textModelWithTokens.test.ts b/src/vs/editor/test/common/model/textModelWithTokens.test.ts index 74d93190439..fe47c6f9f57 100644 --- a/src/vs/editor/test/common/model/textModelWithTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelWithTokens.test.ts @@ -433,37 +433,6 @@ suite('TextModel.getLineIndentGuide', () => { assert.deepEqual(actual, lines); - // Also test getActiveIndentGuide - for (let lineNumber = 1; lineNumber <= model.getLineCount(); lineNumber++) { - let startLineNumber = lineNumber; - let endLineNumber = lineNumber; - let indent = actualIndents[lineNumber - 1]; - - if (indent !== 0) { - for (let i = lineNumber - 1; i >= 1; i--) { - const currIndent = actualIndents[i - 1]; - if (currIndent >= indent) { - startLineNumber = i; - } else { - break; - } - } - for (let i = lineNumber + 1; i <= model.getLineCount(); i++) { - const currIndent = actualIndents[i - 1]; - if (currIndent >= indent) { - endLineNumber = i; - } else { - break; - } - } - } - - const expected = { startLineNumber, endLineNumber, indent }; - const actual = model.getActiveIndentGuide(lineNumber, 1, model.getLineCount()); - - assert.deepEqual(actual, expected, `line number ${lineNumber}`); - } - model.dispose(); } @@ -644,3 +613,70 @@ suite('TextModel.getLineIndentGuide', () => { model.dispose(); }); }); + +suite('TextModel.getActiveIndentGuide', () => { + function assertActiveIndent(lines: [Boolean, string][], selectedLine: number) { + let text = lines.map(l => l[1]).join('\n'); + let model = TextModel.createFromString(text); + + let actualActive = model.getActiveIndentGuide(selectedLine, 1, model.getLineCount()); + + let actual: [Boolean, string][] = []; + for (let line = 1; line <= model.getLineCount(); line++) { + actual[line - 1] = [actualActive.indent > 0 && line >= actualActive.startLineNumber && line <= actualActive.endLineNumber, model.getLineContent(line)]; + } + + assert.deepEqual(actual, lines); + + model.dispose(); + + } + + test('no active', () => { + assertActiveIndent([ + [false, 'A'], + [false, 'A'] + ], 1); + }); + + test('inside scope', () => { + assertActiveIndent([ + [false, 'A'], + [true, ' A'] + ], 2); + }); + + test('scope start', () => { + assertActiveIndent([ + [false, 'A'], + [true, ' A'], + [false, 'A'] + ], 1); + }); + + test('inside scope start and end', () => { + assertActiveIndent([ + [false, 'A'], + [true, ' A'], + [false, 'A'] + ], 2); + }); + + test('scope end', () => { + assertActiveIndent([ + [false, 'A'], + [true, ' A'], + [false, 'A'] + ], 3); + }); + + test('empty line', () => { + assertActiveIndent([ + [false, 'A'], + [true, ' A'], + [true, ''], + [true, ' A'], + [false, 'A'] + ], 3); + }); +}); \ No newline at end of file From 208b205337f8e82fcc004e9cce8b4d45dd84922d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 6 Sep 2019 22:56:58 +0200 Subject: [PATCH 006/624] Remove unnecessary JSON schema --- src/vs/editor/common/config/commonEditorConfig.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index d2ee45b542a..af4f2074ea8 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -473,11 +473,6 @@ const editorConfiguration: IConfigurationNode = { default: true, description: nls.localize('ignoreTrimWhitespace', "Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.") }, - 'editor.focusOnHover': { - 'type': 'boolean', - 'default': false, - 'description': nls.localize('focusOnHover', 'Controls if editors should be focused when hovered.') - }, 'diffEditor.renderIndicators': { type: 'boolean', default: true, From 6eeebddf880ccfa99d28d91647b37e9f12833782 Mon Sep 17 00:00:00 2001 From: Waldemar Kornewald Date: Mon, 16 Sep 2019 16:31:06 +0200 Subject: [PATCH 007/624] Support for revealing at definition This scrolls the target closer to the top, but leaves sufficient room for e.g. class/function comments, while showing more of the source below the target (i.e.. more of the class/function body). --- .../editor/browser/controller/coreCommands.ts | 6 ++- .../browser/viewParts/lines/viewLines.ts | 13 +++++- .../editor/browser/widget/codeEditorWidget.ts | 40 +++++++++++++++++++ .../editor/browser/widget/diffEditorWidget.ts | 20 ++++++++++ src/vs/editor/common/editorCommon.ts | 24 +++++++++++ src/vs/editor/common/view/viewEvents.ts | 3 +- src/vs/monaco.d.ts | 20 ++++++++++ src/vs/platform/editor/common/editor.ts | 7 ++++ src/vs/vscode.d.ts | 7 +++- .../workbench/api/browser/mainThreadEditor.ts | 3 ++ .../workbench/api/common/extHost.protocol.ts | 3 +- src/vs/workbench/api/common/extHostTypes.ts | 3 +- src/vs/workbench/common/editor.ts | 16 +++++++- 13 files changed, 156 insertions(+), 9 deletions(-) diff --git a/src/vs/editor/browser/controller/coreCommands.ts b/src/vs/editor/browser/controller/coreCommands.ts index 94ed9e159cb..918053db202 100644 --- a/src/vs/editor/browser/controller/coreCommands.ts +++ b/src/vs/editor/browser/controller/coreCommands.ts @@ -270,7 +270,8 @@ export namespace RevealLine_ { export const RawAtArgument = { Top: 'top', Center: 'center', - Bottom: 'bottom' + Bottom: 'bottom', + Definition: 'definition', }; } @@ -1477,6 +1478,9 @@ export namespace CoreNavigationCommands { case RevealLine_.RawAtArgument.Bottom: revealAt = VerticalRevealType.Bottom; break; + case RevealLine_.RawAtArgument.Definition: + revealAt = VerticalRevealType.Definition; + break; default: break; } diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index eb524a41b69..d9bd8cb692c 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -616,14 +616,23 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, let newScrollTop: number; - if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) { + if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport + || verticalType === viewEvents.VerticalRevealType.Definition + ) { if (verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { // Box is already in the viewport... do nothing newScrollTop = viewportStartY; } else { // Box is outside the viewport... center it const boxMiddleY = (boxStartY + boxEndY) / 2; - newScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2); + let delta = viewportHeight * 0.5; + if (verticalType === viewEvents.VerticalRevealType.Definition) { + // Definition scrolls to 20% from the top of the viewport, but ensures a minimum amount of space from the top + // and never scrolls beyond the center. + const minSpace = 100; + delta = Math.min(delta, Math.max(minSpace, viewportHeight * 0.2)); + } + newScrollTop = Math.max(0, boxMiddleY - delta); } } else { newScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === viewEvents.VerticalRevealType.Top, verticalType === viewEvents.VerticalRevealType.Bottom); diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 6185ac85e12..3da1ddb4aa2 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -547,6 +547,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE this._revealLine(lineNumber, VerticalRevealType.CenterIfOutsideViewport, scrollType); } + public revealLineAtDefinition(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealLine(lineNumber, VerticalRevealType.Definition, scrollType); + } + private _revealLine(lineNumber: number, revealType: VerticalRevealType, scrollType: editorCommon.ScrollType): void { if (typeof lineNumber !== 'number') { throw new Error('Invalid arguments'); @@ -587,6 +591,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } + public revealPositionAtDefinition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealPosition( + position, + VerticalRevealType.Definition, + true, + scrollType + ); + } + private _revealPosition(position: IPosition, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void { if (!Position.isIPosition(position)) { throw new Error('Invalid arguments'); @@ -675,6 +688,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } + public revealLinesAtDefinition(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealLines( + startLineNumber, + endLineNumber, + VerticalRevealType.Definition, + scrollType + ); + } + private _revealLines(startLineNumber: number, endLineNumber: number, verticalType: VerticalRevealType, scrollType: editorCommon.ScrollType): void { if (typeof startLineNumber !== 'number' || typeof endLineNumber !== 'number') { throw new Error('Invalid arguments'); @@ -715,6 +737,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } + public revealRangeAtDefinition(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealRange( + range, + VerticalRevealType.Definition, + true, + scrollType + ); + } + public revealRangeAtTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this._revealRange( range, @@ -724,6 +755,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } + public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealRange( + range, + VerticalRevealType.Definition, + true, + scrollType + ); + } + private _revealRange(range: IRange, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void { if (!Range.isIRange(range)) { throw new Error('Invalid arguments'); diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 3762f7e0b13..fa18e527848 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -695,6 +695,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealLineInCenterIfOutsideViewport(lineNumber, scrollType); } + public revealLineAtDefinition(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealLineAtDefinition(lineNumber, scrollType); + } + public revealPosition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this.modifiedEditor.revealPosition(position, scrollType); } @@ -707,6 +711,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealPositionInCenterIfOutsideViewport(position, scrollType); } + public revealPositionAtDefinition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealPositionAtDefinition(position, scrollType); + } + public getSelection(): Selection | null { return this.modifiedEditor.getSelection(); } @@ -739,6 +747,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType); } + public revealLinesAtDefinition(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealLinesAtDefinition(startLineNumber, endLineNumber, scrollType); + } + public revealRange(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth, revealVerticalInCenter: boolean = false, revealHorizontal: boolean = true): void { this.modifiedEditor.revealRange(range, scrollType, revealVerticalInCenter, revealHorizontal); } @@ -751,10 +763,18 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealRangeInCenterIfOutsideViewport(range, scrollType); } + public revealRangeAtDefinition(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealRangeAtDefinition(range, scrollType); + } + public revealRangeAtTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this.modifiedEditor.revealRangeAtTop(range, scrollType); } + public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealRangeNearTop(range, scrollType); + } + public getSupportedActions(): editorCommon.IEditorAction[] { return this.modifiedEditor.getSupportedActions(); } diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index e11482fa25b..91f5d061c29 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -339,6 +339,12 @@ export interface IEditor { */ revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal a line close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLineAtDefinition(lineNumber: number, scrollType?: ScrollType): void; + /** * Scroll vertically or horizontally as necessary and reveal a position. */ @@ -354,6 +360,12 @@ export interface IEditor { */ revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealPositionAtDefinition(position: IPosition, scrollType?: ScrollType): void; + /** * Returns the primary selection of the editor. */ @@ -406,6 +418,12 @@ export interface IEditor { */ revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal lines close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLinesAtDefinition(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + /** * Scroll vertically or horizontally as necessary and reveal a range. */ @@ -426,6 +444,12 @@ export interface IEditor { */ revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealRangeAtDefinition(range: IRange, scrollType?: ScrollType): void; + /** * Directly trigger a handler or an editor action. * @param source The source of the call. diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts index 55c455808ad..8d832f5b596 100644 --- a/src/vs/editor/common/view/viewEvents.ts +++ b/src/vs/editor/common/view/viewEvents.ts @@ -159,7 +159,8 @@ export const enum VerticalRevealType { Center = 1, CenterIfOutsideViewport = 2, Top = 3, - Bottom = 4 + Bottom = 4, + Definition = 5, } export class ViewRevealRangeRequestEvent { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 52c82fe6d55..3297808e5cd 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2108,6 +2108,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport. */ revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal a line close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLineAtDefinition(lineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a position. */ @@ -2120,6 +2125,11 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport. */ revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealPositionAtDefinition(position: IPosition, scrollType?: ScrollType): void; /** * Returns the primary selection of the editor. */ @@ -2165,6 +2175,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport. */ revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal lines close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLinesAtDefinition(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a range. */ @@ -2181,6 +2196,11 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. */ revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealRangeAtDefinition(range: IRange, scrollType?: ScrollType): void; /** * Directly trigger a handler or an editor action. * @param source The source of the call. diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index 09d22bda225..6b9889ee5b8 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -202,6 +202,13 @@ export interface ITextEditorOptions extends IEditorOptions { /** * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. + * This can't be used in combination with revealAtDefinition. */ revealInCenterIfOutsideViewport?: boolean; + + /** + * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealAtDefinition?: boolean; } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2fe649dab60..ba960d5db4d 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -710,7 +710,12 @@ declare module 'vscode' { /** * The range will always be revealed at the top of the viewport. */ - AtTop = 3 + AtTop = 3, + /** + * The range will always be revealed close to the top of the viewport, + * optimized for viewing a code definition. + */ + AtDefinition = 4, } /** diff --git a/src/vs/workbench/api/browser/mainThreadEditor.ts b/src/vs/workbench/api/browser/mainThreadEditor.ts index 520801babe6..877d76b1a4b 100644 --- a/src/vs/workbench/api/browser/mainThreadEditor.ts +++ b/src/vs/workbench/api/browser/mainThreadEditor.ts @@ -415,6 +415,9 @@ export class MainThreadTextEditor { case TextEditorRevealType.AtTop: this._codeEditor.revealRangeAtTop(range, editorCommon.ScrollType.Smooth); break; + case TextEditorRevealType.AtDefinition: + this._codeEditor.revealRangeAtDefinition(range, editorCommon.ScrollType.Smooth); + break; default: console.warn(`Unknown revealType: ${revealType}`); break; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index f8cd4bab411..0cbe408fbac 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -203,7 +203,8 @@ export enum TextEditorRevealType { Default = 0, InCenter = 1, InCenterIfOutsideViewport = 2, - AtTop = 3 + AtTop = 3, + AtDefinition = 4, } export interface IUndoStopOptions { diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 57e377721b8..7a89a770faa 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1420,7 +1420,8 @@ export enum TextEditorRevealType { Default = 0, InCenter = 1, InCenterIfOutsideViewport = 2, - AtTop = 3 + AtTop = 3, + AtDefinition = 4, } export enum TextEditorSelectionChangeKind { diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index cffa415f9c8..c31285e8c28 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -837,6 +837,7 @@ export class TextEditorOptions extends EditorOptions { private endColumn: number; private revealInCenterIfOutsideViewport: boolean; + private revealAtDefinition: boolean; private editorViewState: IEditorViewState | null; static from(input?: IBaseResourceInput): TextEditorOptions | undefined { @@ -872,6 +873,13 @@ export class TextEditorOptions extends EditorOptions { this.editorViewState = options.viewState as IEditorViewState; } + if (typeof options.revealAtDefinition === 'boolean') { + this.revealAtDefinition = options.revealAtDefinition; + if (options.revealInCenterIfOutsideViewport) { + throw new Error('revealInCenterIfOutsideViewport and revealAtDefinition cannot both be true'); + } + } + if (typeof options.revealInCenterIfOutsideViewport === 'boolean') { this.revealInCenterIfOutsideViewport = options.revealInCenterIfOutsideViewport; } @@ -942,7 +950,9 @@ export class TextEditorOptions extends EditorOptions { endColumn: this.endColumn }; editor.setSelection(range); - if (this.revealInCenterIfOutsideViewport) { + if (this.revealAtDefinition) { + editor.revealRangeAtDefinition(range, scrollType); + } else if (this.revealInCenterIfOutsideViewport) { editor.revealRangeInCenterIfOutsideViewport(range, scrollType); } else { editor.revealRangeInCenter(range, scrollType); @@ -956,7 +966,9 @@ export class TextEditorOptions extends EditorOptions { column: this.startColumn }; editor.setPosition(pos); - if (this.revealInCenterIfOutsideViewport) { + if (this.revealAtDefinition) { + editor.revealPositionAtDefinition(pos, scrollType); + } else if (this.revealInCenterIfOutsideViewport) { editor.revealPositionInCenterIfOutsideViewport(pos, scrollType); } else { editor.revealPositionInCenter(pos, scrollType); From 00ef6f11906f51e92d53f6645989fb1853f0681a Mon Sep 17 00:00:00 2001 From: Waldemar Kornewald Date: Mon, 16 Sep 2019 16:36:13 +0200 Subject: [PATCH 008/624] Outline: reveal at definition instead of center --- src/vs/workbench/contrib/outline/browser/outlinePanel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/outline/browser/outlinePanel.ts b/src/vs/workbench/contrib/outline/browser/outlinePanel.ts index 55ec4cb5e4b..898cd59e462 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePanel.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePanel.ts @@ -614,7 +614,7 @@ export class OutlinePanel extends ViewletPanel { options: { preserveFocus: !focus, selection: Range.collapseToStart(element.symbol.selectionRange), - revealInCenterIfOutsideViewport: true + revealAtDefinition: true, } } as IResourceInput, aside ? SIDE_GROUP : ACTIVE_GROUP); } From 7096c1fbebd4c10860c957ac20c4b209cf805bbb Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 29 Nov 2019 08:56:01 +0100 Subject: [PATCH 009/624] notarize app --- .../darwin/product-build-darwin.yml | 27 +++++++++++++++++-- build/azure-pipelines/product-build.yml | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 273a728927f..b59933f5afb 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -141,13 +141,36 @@ steps: { "keyCode": "CP-401337-Apple", "operationSetCode": "MacAppDeveloperSign", - "parameters": [ ], + "parameters": { + "Hardening": "--options=runtime" + }, + "toolName": "sign", + "toolVersion": "1.0" + } + ] + SessionTimeout: 60 + displayName: Codesign + +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + inputs: + ConnectedServiceName: 'ESRP CodeSign' + FolderPath: '$(agent.builddirectory)' + Pattern: 'VSCode-darwin.zip' + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keyCode": "CP-401337-Apple", + "operationSetCode": " MacAppNotarize", + "parameters": { + "BundleId": "com.microsoft.VSCodeInsiders" + }, "toolName": "sign", "toolVersion": "1.0" } ] SessionTimeout: 120 - displayName: Codesign + displayName: Notarization - script: | set -e diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index ecf47fa1cdd..aefcd66f2e8 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -101,6 +101,7 @@ jobs: - job: macOS condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_MACOS'], 'true')) + timeoutInMinutes: 180 pool: vmImage: macOS 10.13 dependsOn: From f47b5aaaf2d6af887c41b63462159576b3ceb7c3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 29 Nov 2019 09:27:54 +0100 Subject: [PATCH 010/624] build: hardcode cache --- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- build/azure-pipelines/product-compile.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index b59933f5afb..d2a536e7f19 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -1,7 +1,7 @@ steps: - script: | mkdir -p .build - echo -n $BUILD_SOURCEVERSION > .build/commit + echo -n 7096c1fbebd4c10860c957ac20c4b209cf805bbb > .build/commit echo -n $VSCODE_QUALITY > .build/quality displayName: Prepare cache flag diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index 8029f8a5661..080cf48e207 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -1,7 +1,7 @@ steps: - script: | mkdir -p .build - echo -n $BUILD_SOURCEVERSION > .build/commit + echo -n 7096c1fbebd4c10860c957ac20c4b209cf805bbb > .build/commit echo -n $VSCODE_QUALITY > .build/quality displayName: Prepare cache flag From 14be98cb2be98ada6027429d6e46e1fdb5b74f25 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 29 Nov 2019 09:43:01 +0100 Subject: [PATCH 011/624] fix build parameters --- .../darwin/product-build-darwin.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index d2a536e7f19..8f1288459d0 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -141,9 +141,12 @@ steps: { "keyCode": "CP-401337-Apple", "operationSetCode": "MacAppDeveloperSign", - "parameters": { - "Hardening": "--options=runtime" - }, + "parameters": [ + { + "parameterName": "Hardening", + "parameterValue": "--options=runtime" + } + ], "toolName": "sign", "toolVersion": "1.0" } @@ -162,9 +165,12 @@ steps: { "keyCode": "CP-401337-Apple", "operationSetCode": " MacAppNotarize", - "parameters": { - "BundleId": "com.microsoft.VSCodeInsiders" - }, + "parameters": [ + { + "parameterName": "BundleId", + "parameterValue": "com.microsoft.VSCodeInsiders" + } + ], "toolName": "sign", "toolVersion": "1.0" } From 5c253064560cfbc9e44a87a22b7d9e6d1057fac8 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 29 Nov 2019 10:00:26 +0100 Subject: [PATCH 012/624] bad spacing --- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 8f1288459d0..33bf4c3ec99 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -164,7 +164,7 @@ steps: [ { "keyCode": "CP-401337-Apple", - "operationSetCode": " MacAppNotarize", + "operationSetCode": "MacAppNotarize", "parameters": [ { "parameterName": "BundleId", From 7cadd81deecbba7c6c1b885b8c69710a708b5182 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 29 Nov 2019 11:46:57 +0100 Subject: [PATCH 013/624] Revert "build: hardcode cache" This reverts commit f47b5aaaf2d6af887c41b63462159576b3ceb7c3. --- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- build/azure-pipelines/product-compile.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 33bf4c3ec99..c78b5d624c9 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -1,7 +1,7 @@ steps: - script: | mkdir -p .build - echo -n 7096c1fbebd4c10860c957ac20c4b209cf805bbb > .build/commit + echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality displayName: Prepare cache flag diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index 080cf48e207..8029f8a5661 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -1,7 +1,7 @@ steps: - script: | mkdir -p .build - echo -n 7096c1fbebd4c10860c957ac20c4b209cf805bbb > .build/commit + echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality displayName: Prepare cache flag From 1b21dc39bcb6b728400fc3a9a8d01339eb68f3d7 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 2 Dec 2019 10:19:16 +0100 Subject: [PATCH 014/624] comment out notarization --- .../darwin/product-build-darwin.yml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index c78b5d624c9..08554ec9412 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -154,29 +154,29 @@ steps: SessionTimeout: 60 displayName: Codesign -- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - inputs: - ConnectedServiceName: 'ESRP CodeSign' - FolderPath: '$(agent.builddirectory)' - Pattern: 'VSCode-darwin.zip' - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-401337-Apple", - "operationSetCode": "MacAppNotarize", - "parameters": [ - { - "parameterName": "BundleId", - "parameterValue": "com.microsoft.VSCodeInsiders" - } - ], - "toolName": "sign", - "toolVersion": "1.0" - } - ] - SessionTimeout: 120 - displayName: Notarization +# - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 +# inputs: +# ConnectedServiceName: 'ESRP CodeSign' +# FolderPath: '$(agent.builddirectory)' +# Pattern: 'VSCode-darwin.zip' +# signConfigType: inlineSignParams +# inlineOperation: | +# [ +# { +# "keyCode": "CP-401337-Apple", +# "operationSetCode": "MacAppNotarize", +# "parameters": [ +# { +# "parameterName": "BundleId", +# "parameterValue": "com.microsoft.VSCodeInsiders" +# } +# ], +# "toolName": "sign", +# "toolVersion": "1.0" +# } +# ] +# SessionTimeout: 120 +# displayName: Notarization - script: | set -e From 618dc0d93831648186a87df1fee75569df85490b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 2 Dec 2019 10:55:32 +0100 Subject: [PATCH 015/624] Revert "comment out notarization" This reverts commit 1b21dc39bcb6b728400fc3a9a8d01339eb68f3d7. --- .../darwin/product-build-darwin.yml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 08554ec9412..c78b5d624c9 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -154,29 +154,29 @@ steps: SessionTimeout: 60 displayName: Codesign -# - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 -# inputs: -# ConnectedServiceName: 'ESRP CodeSign' -# FolderPath: '$(agent.builddirectory)' -# Pattern: 'VSCode-darwin.zip' -# signConfigType: inlineSignParams -# inlineOperation: | -# [ -# { -# "keyCode": "CP-401337-Apple", -# "operationSetCode": "MacAppNotarize", -# "parameters": [ -# { -# "parameterName": "BundleId", -# "parameterValue": "com.microsoft.VSCodeInsiders" -# } -# ], -# "toolName": "sign", -# "toolVersion": "1.0" -# } -# ] -# SessionTimeout: 120 -# displayName: Notarization +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + inputs: + ConnectedServiceName: 'ESRP CodeSign' + FolderPath: '$(agent.builddirectory)' + Pattern: 'VSCode-darwin.zip' + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keyCode": "CP-401337-Apple", + "operationSetCode": "MacAppNotarize", + "parameters": [ + { + "parameterName": "BundleId", + "parameterValue": "com.microsoft.VSCodeInsiders" + } + ], + "toolName": "sign", + "toolVersion": "1.0" + } + ] + SessionTimeout: 120 + displayName: Notarization - script: | set -e From 6033b3bc105bafbf4b489e95226797228970e31e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 2 Dec 2019 19:30:34 +0100 Subject: [PATCH 016/624] publish middle step build artifacts --- .../darwin/product-build-darwin.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index c78b5d624c9..89022cef03a 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -130,6 +130,12 @@ steps: pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd displayName: Archive build +- task: PublishPipelineArtifact@0 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: darwin-unsigned + targetPath: ../VSCode-darwin.zip + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: ConnectedServiceName: 'ESRP CodeSign' @@ -154,6 +160,12 @@ steps: SessionTimeout: 60 displayName: Codesign +- task: PublishPipelineArtifact@0 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: darwin-signed + targetPath: ../VSCode-darwin.zip + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: ConnectedServiceName: 'ESRP CodeSign' @@ -178,6 +190,12 @@ steps: SessionTimeout: 120 displayName: Notarization +- task: PublishPipelineArtifact@0 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: darwin-notarized + targetPath: ../VSCode-darwin.zip + - script: | set -e VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ From a4f3af066f5754f63e1d1be6f6a5f7da007b8196 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 2 Dec 2019 22:18:31 +0100 Subject: [PATCH 017/624] move cleanup code --- build/azure-pipelines/darwin/product-build-darwin.yml | 4 ++++ build/azure-pipelines/darwin/publish.sh | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 89022cef03a..17b9a05317b 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -160,6 +160,10 @@ steps: SessionTimeout: 60 displayName: Codesign +- script: | + zip -d ../VSCode-darwin.zip "*.pkg" + displayName: Clean Archive + - task: PublishPipelineArtifact@0 displayName: 'Publish Pipeline Artifact' inputs: diff --git a/build/azure-pipelines/darwin/publish.sh b/build/azure-pipelines/darwin/publish.sh index a8067a5eefb..58f110c5df5 100755 --- a/build/azure-pipelines/darwin/publish.sh +++ b/build/azure-pipelines/darwin/publish.sh @@ -1,9 +1,6 @@ #!/usr/bin/env bash set -e -# remove pkg from archive -zip -d ../VSCode-darwin.zip "*.pkg" - # publish the build node build/azure-pipelines/common/createAsset.js \ darwin \ From e642cad1a8b1ddd5ee8a7db91fd4b37f7fb92708 Mon Sep 17 00:00:00 2001 From: zhengjiaqi01 Date: Wed, 25 Dec 2019 11:02:11 +0800 Subject: [PATCH 018/624] editor action run support params --- src/vs/editor/standalone/browser/standaloneCodeEditor.ts | 8 ++++---- src/vs/monaco.d.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 86ce9f07ace..ecd84dda8b8 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; -import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, optional, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -74,7 +74,7 @@ export interface IActionDescriptor { * Method that will be executed when the action is triggered. * @param editor The editor instance is passed in as a convenience */ - run(editor: ICodeEditor): void | Promise; + run(editor: ICodeEditor, param?: any): void | Promise; } /** @@ -226,8 +226,8 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon ); const contextMenuGroupId = _descriptor.contextMenuGroupId || null; const contextMenuOrder = _descriptor.contextMenuOrder || 0; - const run = (): Promise => { - return Promise.resolve(_descriptor.run(this)); + const run = (accessor?: ServicesAccessor, ...args: any[]): Promise => { + return Promise.resolve(_descriptor.run(this, ...args)); }; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 27cece82f20..02b818633f0 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1045,7 +1045,7 @@ declare namespace monaco.editor { * Method that will be executed when the action is triggered. * @param editor The editor instance is passed in as a convenience */ - run(editor: ICodeEditor): void | Promise; + run(editor: ICodeEditor, param?: any): void | Promise; } /** From 5e1d23320d0cd269631561c372e3ca815e42a815 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Fri, 10 Jan 2020 17:23:05 -0500 Subject: [PATCH 019/624] Allow for rulers to be individually colored This change set: adds an interface for Ruler Color Options, adds a union type of that interface and number, adjust the rulers type hint to use said union type, adds a mechanism to apply boxshadow to fastDomNode, and updates the way rulers are rendered to support individual colors. I've also ensured that descriptions are provided for settings.json. So now, all nodes will provide explanations. --- src/vs/base/browser/fastDomNode.ts | 10 ++++ .../editor/browser/viewParts/rulers/rulers.ts | 16 ++++-- src/vs/editor/common/config/editorOptions.ts | 51 +++++++++++++++---- src/vs/monaco.d.ts | 9 +++- 4 files changed, 72 insertions(+), 14 deletions(-) diff --git a/src/vs/base/browser/fastDomNode.ts b/src/vs/base/browser/fastDomNode.ts index 5c688bd3496..7d4711792d3 100644 --- a/src/vs/base/browser/fastDomNode.ts +++ b/src/vs/base/browser/fastDomNode.ts @@ -27,6 +27,7 @@ export class FastDomNode { private _visibility: string; private _layerHint: boolean; private _contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint'; + private _boxShadow: string; constructor(domNode: T) { this.domNode = domNode; @@ -49,6 +50,7 @@ export class FastDomNode { this._visibility = ''; this._layerHint = false; this._contain = 'none'; + this._boxShadow = ''; } public setMaxWidth(maxWidth: number): void { @@ -208,6 +210,14 @@ export class FastDomNode { this.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : ''; } + public setBoxShadow(boxShadow: string): void { + if (this._boxShadow === boxShadow) { + return; + } + this._boxShadow = boxShadow; + this.domNode.style.boxShadow = boxShadow; + } + public setContain(contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint'): void { if (this._contain === contain) { return; diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 0f22de06a73..9f0490762d7 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -11,13 +11,13 @@ import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/v import { ViewContext } from 'vs/editor/common/view/viewContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { EditorOption, IRulerOption } from 'vs/editor/common/config/editorOptions'; export class Rulers extends ViewPart { public domNode: FastDomNode; private readonly _renderedRulers: FastDomNode[]; - private _rulers: number[]; + private _rulers: IRulerOption[]; private _typicalHalfwidthCharacterWidth: number; constructor(context: ViewContext) { @@ -92,9 +92,19 @@ export class Rulers extends ViewPart { for (let i = 0, len = this._rulers.length; i < len; i++) { const node = this._renderedRulers[i]; + const srcNode = this._rulers[i]; + let rulerSize, rulerColor = ''; + if (typeof srcNode === 'number') { + rulerSize = srcNode; + } else { + rulerSize = srcNode.size; + rulerColor = `1px 0 0 0 ${srcNode.color} inset`; + } + + node.setBoxShadow(rulerColor); node.setHeight(Math.min(ctx.scrollHeight, 1000000)); - node.setLeft(this._rulers[i] * this._typicalHalfwidthCharacterWidth); + node.setLeft(rulerSize * this._typicalHalfwidthCharacterWidth); } } } diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 3adac8cf46b..b4222fb2804 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -59,7 +59,7 @@ export interface IEditorOptions { * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: number[]; + rulers?: IRulerOption[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -2212,6 +2212,15 @@ class EditorQuickSuggestions extends BaseEditorOption string); @@ -2285,30 +2294,52 @@ class EditorRenderLineNumbersOption extends BaseEditorOption { +class EditorRulers extends SimpleEditorOption { constructor() { - const defaults: number[] = []; + const defaults: IRulerOption[] = []; + const sizeSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', "Number of monospace characters at which this editor ruler will render.") }; + super( EditorOption.rulers, 'rulers', defaults, { type: 'array', - items: { - type: 'number' - }, + items: [ + sizeSchema, + { + type: [ + 'object' + ], + properties: { + size: sizeSchema, + color: { + type: 'string', + description: nls.localize('rulers.color', "Color of this editor ruler."), + format: 'color-hex' + } + } + } + ], default: defaults, description: nls.localize('rulers', "Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.") } ); } - public validate(input: any): number[] { + public validate(input: any): IRulerOption[] { if (Array.isArray(input)) { - let rulers: number[] = []; + let rulers: IRulerOption[] = []; for (let value of input) { - rulers.push(EditorIntOption.clampedInt(value, 0, 0, 10000)); + let clamped; + if (typeof value === 'number') { + clamped = EditorIntOption.clampedInt(value, 0, 0, 10000); + } else { + clamped = value; + clamped.size = EditorIntOption.clampedInt(value.size, 0, 0, 10000); + } + rulers.push(clamped); } - rulers.sort((a, b) => a - b); + rulers.sort((a, b) => ((typeof a === 'number') ? a : a.size) - ((typeof b === 'number') ? b : b.size)); return rulers; } return this.defaultValue; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 38597bc5d3b..ec5911ecd43 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2504,7 +2504,7 @@ declare namespace monaco.editor { * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: number[]; + rulers?: IRulerOption[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -3282,6 +3282,13 @@ declare namespace monaco.editor { strings: boolean; } + export interface IRulerColorOption { + readonly size: number; + readonly color: string; + } + + export type IRulerOption = number | IRulerColorOption; + export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); /** From fbec956fc43afee912a5222bca35714a7c787953 Mon Sep 17 00:00:00 2001 From: Konstantin Solomatov Date: Fri, 10 Jan 2020 15:15:34 -0800 Subject: [PATCH 020/624] Fix link handing in extension pseudoterminals --- src/vs/workbench/api/common/extHostTerminalService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index f5635b83d23..8834b1e585e 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -277,6 +277,7 @@ export class ExtHostPseudoterminal implements ITerminalChildProcess { } this._pty.open(initialDimensions ? initialDimensions : undefined); + this._onProcessReady.fire({ pid: -1, cwd: '' }); } } From 2248fa1cbdf8e311fcea92d2fa786cd9326074c6 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Fri, 10 Jan 2020 20:47:54 -0500 Subject: [PATCH 021/624] Move that to a spot that makes more sense --- src/vs/editor/common/config/editorOptions.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index b4222fb2804..e5dfc53e56e 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2212,15 +2212,6 @@ class EditorQuickSuggestions extends BaseEditorOption string); @@ -2294,6 +2285,13 @@ class EditorRenderLineNumbersOption extends BaseEditorOption { constructor() { From 0b1798d2cc99c4ccf872594dab43563e4157501c Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Fri, 10 Jan 2020 20:50:08 -0500 Subject: [PATCH 022/624] run yarn --- src/vs/monaco.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ec5911ecd43..fa6e244f57a 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3282,6 +3282,8 @@ declare namespace monaco.editor { strings: boolean; } + export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); + export interface IRulerColorOption { readonly size: number; readonly color: string; @@ -3289,8 +3291,6 @@ declare namespace monaco.editor { export type IRulerOption = number | IRulerColorOption; - export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); - /** * Configuration options for editor scrollbars */ From 558664f8918e3cee10fb882ec842538e4546fb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20Ero=C4=9Flu?= Date: Wed, 15 Jan 2020 12:17:25 +0300 Subject: [PATCH 023/624] Added remembering end key state behaviour --- package.json | 1 + src/vs/editor/common/controller/cursorCommon.ts | 11 ++++++++--- .../common/controller/cursorMoveOperations.ts | 14 +++++++++++--- src/vs/editor/common/controller/oneCursor.ts | 6 +++--- yarn.lock | 15 +++++++++++++++ 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index cee5e193327..4adc271a857 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "applicationinsights": "1.0.8", "chokidar": "3.2.3", "graceful-fs": "4.1.11", + "gulp-bom": "^3.0.0", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.3", "iconv-lite": "0.5.0", diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts index ac269997918..d981f26a0a0 100644 --- a/src/vs/editor/common/controller/cursorCommon.ts +++ b/src/vs/editor/common/controller/cursorCommon.ts @@ -277,18 +277,21 @@ export class SingleCursorState { public readonly position: Position; public readonly leftoverVisibleColumns: number; public readonly selection: Selection; + public readonly isEnd: boolean; constructor( selectionStart: Range, selectionStartLeftoverVisibleColumns: number, position: Position, leftoverVisibleColumns: number, + isEnd: boolean = false ) { this.selectionStart = selectionStart; this.selectionStartLeftoverVisibleColumns = selectionStartLeftoverVisibleColumns; this.position = position; this.leftoverVisibleColumns = leftoverVisibleColumns; this.selection = SingleCursorState._computeSelection(this.selectionStart, this.position); + this.isEnd = isEnd; } public equals(other: SingleCursorState) { @@ -304,14 +307,15 @@ export class SingleCursorState { return (!this.selection.isEmpty() || !this.selectionStart.isEmpty()); } - public move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState { + public move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number, isEnd: boolean = false): SingleCursorState { if (inSelectionMode) { // move just position return new SingleCursorState( this.selectionStart, this.selectionStartLeftoverVisibleColumns, new Position(lineNumber, column), - leftoverVisibleColumns + leftoverVisibleColumns, + isEnd ); } else { // move everything @@ -319,7 +323,8 @@ export class SingleCursorState { new Range(lineNumber, column, lineNumber, column), leftoverVisibleColumns, new Position(lineNumber, column), - leftoverVisibleColumns + leftoverVisibleColumns, + isEnd ); } } diff --git a/src/vs/editor/common/controller/cursorMoveOperations.ts b/src/vs/editor/common/controller/cursorMoveOperations.ts index 1d414dd1f32..8be77b1031c 100644 --- a/src/vs/editor/common/controller/cursorMoveOperations.ts +++ b/src/vs/editor/common/controller/cursorMoveOperations.ts @@ -122,9 +122,13 @@ export class MoveOperations { column = cursor.position.column; } + if (cursor.isEnd) { + column = model.getLineMaxColumn(lineNumber + 1); + } + let r = MoveOperations.down(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); + return cursor.move(inSelectionMode, r.lineNumber, cursor.isEnd ? column : r.column, r.leftoverVisibleColumns, cursor.isEnd); } public static translateDown(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState { @@ -174,9 +178,13 @@ export class MoveOperations { column = cursor.position.column; } + if (cursor.isEnd) { + column = model.getLineMaxColumn(lineNumber - 1); + } + let r = MoveOperations.up(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); + return cursor.move(inSelectionMode, r.lineNumber, cursor.isEnd ? column : r.column, r.leftoverVisibleColumns, cursor.isEnd); } public static translateUp(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState { @@ -214,7 +222,7 @@ export class MoveOperations { public static moveToEndOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState { let lineNumber = cursor.position.lineNumber; let maxColumn = model.getLineMaxColumn(lineNumber); - return cursor.move(inSelectionMode, lineNumber, maxColumn, 0); + return cursor.move(inSelectionMode, lineNumber, maxColumn, 0, true); } public static moveToBeginningOfBuffer(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState { diff --git a/src/vs/editor/common/controller/oneCursor.ts b/src/vs/editor/common/controller/oneCursor.ts index 2bb09583133..07716dbb5de 100644 --- a/src/vs/editor/common/controller/oneCursor.ts +++ b/src/vs/editor/common/controller/oneCursor.ts @@ -99,7 +99,7 @@ export class OneCursor { ); const leftoverVisibleColumns = modelState.position.equals(position) ? modelState.leftoverVisibleColumns : 0; - modelState = new SingleCursorState(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns); + modelState = new SingleCursorState(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns, modelState.isEnd); } if (!viewState) { @@ -108,12 +108,12 @@ export class OneCursor { const viewSelectionStart2 = context.convertModelPositionToViewPosition(new Position(modelState.selectionStart.endLineNumber, modelState.selectionStart.endColumn)); const viewSelectionStart = new Range(viewSelectionStart1.lineNumber, viewSelectionStart1.column, viewSelectionStart2.lineNumber, viewSelectionStart2.column); const viewPosition = context.convertModelPositionToViewPosition(modelState.position); - viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); + viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns, modelState.isEnd); } else { // Validate new view state const viewSelectionStart = context.validateViewRange(viewState.selectionStart, modelState.selectionStart); const viewPosition = context.validateViewPosition(viewState.position, modelState.position); - viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); + viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns, viewState.isEnd); } this.modelState = modelState; diff --git a/yarn.lock b/yarn.lock index 6ef2a9f7c77..1e16ef4ba3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3996,6 +3996,14 @@ gulp-azure-storage@^0.10.0: vinyl "^2.2.0" vinyl-fs "^3.0.3" +gulp-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/gulp-bom/-/gulp-bom-3.0.0.tgz#b2f1ab0ef304ff5e593665b776ba517ef7ffb4ad" + integrity sha512-iw/J94F+MVlxG64Q17BSkHsyjpY17qHl3N3A/jDdrL77zQBkhKtTiKLqM4di9CUX/qFToyyeDsOWwH+rESBgmA== + dependencies: + plugin-error "^1.0.1" + through2 "^3.0.1" + gulp-buffer@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/gulp-buffer/-/gulp-buffer-0.0.2.tgz#af81b4346101736b49942ec6c9fa867ffe737036" @@ -8924,6 +8932,13 @@ through2@^3.0.0: readable-stream "2 || 3" xtend "~4.0.1" +through2@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a" + integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== + dependencies: + readable-stream "2 || 3" + through2@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/through2/-/through2-0.2.3.tgz#eb3284da4ea311b6cc8ace3653748a52abf25a3f" From b89cd2ff843363e7b6346f21637b5cf108a778c1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 23 Jan 2020 13:56:24 +0100 Subject: [PATCH 024/624] IViewsRegistry.registerEmptyViewContent --- src/vs/workbench/common/views.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index fa839f073ad..531eab4d038 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -10,7 +10,7 @@ import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/con import { localize } from 'vs/nls'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { values, keys, getOrSet } from 'vs/base/common/map'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -20,6 +20,7 @@ import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { flatten } from 'vs/base/common/arrays'; import { IViewPaneContainer } from 'vs/workbench/common/viewPaneContainer'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import { SetMap } from 'vs/base/common/collections'; export const TEST_VIEW_CONTAINER_ID = 'workbench.view.extension.test'; export const FocusedViewContext = new RawContextKey('focusedView', ''); @@ -208,6 +209,10 @@ export interface IViewDescriptorCollection extends IDisposable { readonly allViewDescriptors: IViewDescriptor[]; } +export interface IViewContentDescriptor { + readonly content: string; +} + export interface IViewsRegistry { readonly onViewsRegistered: Event<{ views: IViewDescriptor[], viewContainer: ViewContainer }>; @@ -227,6 +232,8 @@ export interface IViewsRegistry { getView(id: string): IViewDescriptor | null; getViewContainer(id: string): ViewContainer | null; + + registerEmptyViewContent(id: string, viewContent: IViewContentDescriptor): IDisposable; } class ViewsRegistry extends Disposable implements IViewsRegistry { @@ -242,6 +249,7 @@ class ViewsRegistry extends Disposable implements IViewsRegistry { private _viewContainers: ViewContainer[] = []; private _views: Map = new Map(); + private _emptyViewContents = new SetMap(); registerViews(views: IViewDescriptor[], viewContainer: ViewContainer): void { this.addViews(views, viewContainer); @@ -291,6 +299,11 @@ class ViewsRegistry extends Disposable implements IViewsRegistry { return null; } + registerEmptyViewContent(id: string, viewContent: IViewContentDescriptor): IDisposable { + this._emptyViewContents.add(id, viewContent); + return toDisposable(() => this._emptyViewContents.delete(id, viewContent)); + } + private addViews(viewDescriptors: IViewDescriptor[], viewContainer: ViewContainer): void { let views = this._views.get(viewContainer); if (!views) { From 7c30a1b05e5dc42ea486121ae67e5c15761b8c86 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 23 Jan 2020 20:10:29 +0100 Subject: [PATCH 025/624] wip: empty view content --- src/vs/workbench/browser/parts/views/customView.ts | 2 ++ .../workbench/browser/parts/views/media/views.css | 10 ++++++++++ .../browser/parts/views/viewPaneContainer.ts | 13 +++++++++++++ .../contrib/bulkEdit/browser/bulkEditPane.ts | 1 + .../contrib/debug/browser/breakpointsView.ts | 2 ++ .../contrib/debug/browser/callStackView.ts | 2 ++ .../contrib/debug/browser/loadedScriptsView.ts | 2 ++ src/vs/workbench/contrib/debug/browser/repl.ts | 2 ++ src/vs/workbench/contrib/debug/browser/startView.ts | 2 ++ .../contrib/debug/browser/variablesView.ts | 2 ++ .../contrib/debug/browser/watchExpressionsView.ts | 2 ++ .../contrib/extensions/browser/extensionsViews.ts | 2 ++ .../contrib/files/browser/views/emptyView.ts | 2 ++ .../contrib/files/browser/views/explorerView.ts | 2 ++ .../contrib/files/browser/views/openEditorsView.ts | 2 ++ .../contrib/markers/browser/markersView.ts | 7 ++++--- .../contrib/outline/browser/outlinePane.ts | 2 ++ src/vs/workbench/contrib/remote/browser/remote.ts | 2 ++ .../workbench/contrib/remote/browser/tunnelView.ts | 2 ++ src/vs/workbench/contrib/scm/browser/mainPane.ts | 2 ++ .../workbench/contrib/scm/browser/repositoryPane.ts | 2 ++ .../workbench/contrib/search/browser/searchView.ts | 1 + 22 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 5aec72c4959..9866973e660 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -72,6 +72,8 @@ export class CustomTreeViewPane extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + if (this.treeView instanceof CustomTreeView) { this.treeView.show(container); } diff --git a/src/vs/workbench/browser/parts/views/media/views.css b/src/vs/workbench/browser/parts/views/media/views.css index fd2fa438e9d..1ff7d80c06f 100644 --- a/src/vs/workbench/browser/parts/views/media/views.css +++ b/src/vs/workbench/browser/parts/views/media/views.css @@ -71,6 +71,16 @@ display: none; } +.monaco-workbench .pane > .pane-body > .empty-view { + width: 100%; + height: 100%; +} + +.monaco-workbench .pane > .pane-body > .empty-view, +.monaco-workbench .pane > .pane-body.empty > :not(.empty-view) { + display: none; +} + .customview-tree .monaco-list-row .monaco-tl-contents.align-icon-with-twisty::before { display: none; } diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts index 7730d4b4b7c..43f1fe0b1af 100644 --- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts +++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts @@ -70,6 +70,9 @@ export abstract class ViewPane extends Pane implements IView { protected _onDidChangeTitleArea = this._register(new Emitter()); readonly onDidChangeTitleArea: Event = this._onDidChangeTitleArea.event; + protected _onDidChangeEmptyState = this._register(new Emitter()); + readonly onDidChangeEmptyState: Event = this._onDidChangeEmptyState.event; + private focusedViewContextKey: IContextKey; private _isVisible: boolean = false; @@ -84,6 +87,7 @@ export abstract class ViewPane extends Pane implements IView { private headerContainer?: HTMLElement; private titleContainer?: HTMLElement; protected twistiesContainer?: HTMLElement; + private emptyViewContainer?: HTMLElement; constructor( options: IViewPaneOptions, @@ -190,6 +194,11 @@ export abstract class ViewPane extends Pane implements IView { this._onDidChangeTitleArea.fire(); } + protected renderBody(container: HTMLElement): void { + this.emptyViewContainer = append(container, $('.empty-view', { tabIndex: 0 })); + this.emptyViewContainer.textContent = 'this view is empty'; + } + focus(): void { if (this.element) { this.element.focus(); @@ -243,6 +252,10 @@ export abstract class ViewPane extends Pane implements IView { saveState(): void { // Subclasses to implement for saving state } + + isEmpty(): boolean { + return false; + } } export interface IViewPaneContainerOptions extends IPaneViewOptions { diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditPane.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditPane.ts index f6475702aff..fb150c41cb7 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditPane.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditPane.ts @@ -96,6 +96,7 @@ export class BulkEditPane extends ViewPane { } protected renderBody(parent: HTMLElement): void { + super.renderBody(parent); const resourceLabels = this._instaService.createInstance( ResourceLabels, diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 1c2711791de..6ad592d9a06 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -75,6 +75,8 @@ export class BreakpointsView extends ViewPane { } public renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'debug-breakpoints'); const delegate = new BreakpointsDelegate(this.debugService); diff --git a/src/vs/workbench/contrib/debug/browser/callStackView.ts b/src/vs/workbench/contrib/debug/browser/callStackView.ts index a8048eab4e7..f06adb209f3 100644 --- a/src/vs/workbench/contrib/debug/browser/callStackView.ts +++ b/src/vs/workbench/contrib/debug/browser/callStackView.ts @@ -149,6 +149,8 @@ export class CallStackView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'debug-call-stack'); const treeContainer = renderViewTree(container); diff --git a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts index bbb86f09dbd..a0ff9d57cfd 100644 --- a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts @@ -428,6 +428,8 @@ export class LoadedScriptsView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'debug-loaded-scripts'); dom.addClass(container, 'show-file-icons'); diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index d9381e21706..34f8f321578 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -439,6 +439,8 @@ export class Repl extends ViewPane implements IPrivateReplService, IHistoryNavig // --- Creation protected renderBody(parent: HTMLElement): void { + super.renderBody(parent); + this.container = dom.append(parent, $('.repl')); const treeContainer = dom.append(this.container, $('.repl-tree')); this.createReplInput(this.container); diff --git a/src/vs/workbench/contrib/debug/browser/startView.ts b/src/vs/workbench/contrib/debug/browser/startView.ts index cd6218472de..bca28aef4ff 100644 --- a/src/vs/workbench/contrib/debug/browser/startView.ts +++ b/src/vs/workbench/contrib/debug/browser/startView.ts @@ -154,6 +154,8 @@ export class StartView extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + this.firstMessageContainer = $('.top-section'); container.appendChild(this.firstMessageContainer); diff --git a/src/vs/workbench/contrib/debug/browser/variablesView.ts b/src/vs/workbench/contrib/debug/browser/variablesView.ts index 71b9e9f8d32..53f2478e0a2 100644 --- a/src/vs/workbench/contrib/debug/browser/variablesView.ts +++ b/src/vs/workbench/contrib/debug/browser/variablesView.ts @@ -83,6 +83,8 @@ export class VariablesView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'debug-variables'); const treeContainer = renderViewTree(container); diff --git a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts index e21d0c884a7..24c6fb35f15 100644 --- a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts +++ b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts @@ -60,6 +60,8 @@ export class WatchExpressionsView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'debug-watch'); const treeContainer = renderViewTree(container); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts index 477532889fd..4f85c58c07c 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts @@ -123,6 +123,8 @@ export class ExtensionsListView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + const extensionsList = append(container, $('.extensions-list')); const messageContainer = append(container, $('.message-container')); const messageSeverityIcon = append(messageContainer, $('')); diff --git a/src/vs/workbench/contrib/files/browser/views/emptyView.ts b/src/vs/workbench/contrib/files/browser/views/emptyView.ts index 350b41d643c..2de786dbfee 100644 --- a/src/vs/workbench/contrib/files/browser/views/emptyView.ts +++ b/src/vs/workbench/contrib/files/browser/views/emptyView.ts @@ -52,6 +52,8 @@ export class EmptyView extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + DOM.addClass(container, 'explorer-empty-view'); container.tabIndex = 0; diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index c95939c1f74..1c190a34e5a 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -240,6 +240,8 @@ export class ExplorerView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + const treeContainer = DOM.append(container, DOM.$('.explorer-folders-view')); this.styleElement = DOM.createStyleSheet(treeContainer); diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index a5c809c541b..dcc8e237b65 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -200,6 +200,8 @@ export class OpenEditorsView extends ViewPane { } renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'explorer-open-editors'); dom.addClass(container, 'show-file-icons'); diff --git a/src/vs/workbench/contrib/markers/browser/markersView.ts b/src/vs/workbench/contrib/markers/browser/markersView.ts index c3c6d6ab777..c2f9cd852cb 100644 --- a/src/vs/workbench/contrib/markers/browser/markersView.ts +++ b/src/vs/workbench/contrib/markers/browser/markersView.ts @@ -137,6 +137,7 @@ export class MarkersView extends ViewPane implements IMarkerFilterController { } public renderBody(parent: HTMLElement): void { + super.renderBody(parent); dom.addClass(parent, 'markers-panel'); @@ -193,7 +194,7 @@ export class MarkersView extends ViewPane implements IMarkerFilterController { return; } - if (this.isEmpty() && this.messageBoxContainer) { + if (this.hasNoProblems() && this.messageBoxContainer) { this.messageBoxContainer.focus(); } else if (this.tree) { this.tree.getHTMLElement().focus(); @@ -533,7 +534,7 @@ export class MarkersView extends ViewPane implements IMarkerFilterController { } } - private isEmpty(): boolean { + private hasNoProblems(): boolean { const { total, filtered } = this.getFilterStats(); return total === 0 || filtered === 0; } @@ -542,7 +543,7 @@ export class MarkersView extends ViewPane implements IMarkerFilterController { this.cachedFilterStats = undefined; this.resetTree(); if (this.tree) { - this.tree.toggleVisibility(this.isEmpty()); + this.tree.toggleVisibility(this.hasNoProblems()); } this.renderMessage(); } diff --git a/src/vs/workbench/contrib/outline/browser/outlinePane.ts b/src/vs/workbench/contrib/outline/browser/outlinePane.ts index 598b4cab644..e83eeb05d96 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePane.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePane.ts @@ -294,6 +294,8 @@ export class OutlinePane extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + this._domNode = container; this._domNode.tabIndex = 0; dom.addClass(container, 'outline-pane'); diff --git a/src/vs/workbench/contrib/remote/browser/remote.ts b/src/vs/workbench/contrib/remote/browser/remote.ts index a55a0e2684c..484f7e6cb22 100644 --- a/src/vs/workbench/contrib/remote/browser/remote.ts +++ b/src/vs/workbench/contrib/remote/browser/remote.ts @@ -377,6 +377,8 @@ class HelpPanel extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + dom.addClass(container, 'remote-help'); const treeContainer = document.createElement('div'); dom.addClass(treeContainer, 'remote-help-content'); diff --git a/src/vs/workbench/contrib/remote/browser/tunnelView.ts b/src/vs/workbench/contrib/remote/browser/tunnelView.ts index ce7da57ef73..192649fee50 100644 --- a/src/vs/workbench/contrib/remote/browser/tunnelView.ts +++ b/src/vs/workbench/contrib/remote/browser/tunnelView.ts @@ -459,6 +459,8 @@ export class TunnelPanel extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + const panelContainer = dom.append(container, dom.$('.tree-explorer-viewlet-tree-view')); const treeContainer = dom.append(panelContainer, dom.$('.customview-tree')); dom.addClass(treeContainer, 'file-icon-themable-tree'); diff --git a/src/vs/workbench/contrib/scm/browser/mainPane.ts b/src/vs/workbench/contrib/scm/browser/mainPane.ts index 695e9325011..3e30e0821be 100644 --- a/src/vs/workbench/contrib/scm/browser/mainPane.ts +++ b/src/vs/workbench/contrib/scm/browser/mainPane.ts @@ -192,6 +192,8 @@ export class MainPane extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + const delegate = new ProvidersListDelegate(); const renderer = this.instantiationService.createInstance(ProviderRenderer); const identityProvider = { getId: (r: ISCMRepository) => r.provider.id }; diff --git a/src/vs/workbench/contrib/scm/browser/repositoryPane.ts b/src/vs/workbench/contrib/scm/browser/repositoryPane.ts index b443b239d66..71e49f322ca 100644 --- a/src/vs/workbench/contrib/scm/browser/repositoryPane.ts +++ b/src/vs/workbench/contrib/scm/browser/repositoryPane.ts @@ -658,6 +658,8 @@ export class RepositoryPane extends ViewPane { } protected renderBody(container: HTMLElement): void { + super.renderBody(container); + const focusTracker = trackFocus(container); this._register(focusTracker.onDidFocus(() => this.repository.focus())); this._register(focusTracker); diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 0cf4ab44d70..c2738543190 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -256,6 +256,7 @@ export class SearchView extends ViewPane { } renderBody(parent: HTMLElement): void { + super.renderBody(parent); this.container = dom.append(parent, dom.$('.search-view')); this.searchWidgetsContainerElement = dom.append(this.container, $('.search-widgets-container')); From ff4b55dfa0b0b7aaa72c93ee84e1c5d9c940f3a4 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 24 Jan 2020 11:31:20 +0100 Subject: [PATCH 026/624] views: link up empty view registry to panes --- .../browser/parts/views/media/views.css | 2 +- .../browser/parts/views/viewPaneContainer.ts | 42 +++++++++++++++++-- src/vs/workbench/common/views.ts | 18 +++++++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/media/views.css b/src/vs/workbench/browser/parts/views/media/views.css index 1ff7d80c06f..62c158a311f 100644 --- a/src/vs/workbench/browser/parts/views/media/views.css +++ b/src/vs/workbench/browser/parts/views/media/views.css @@ -76,7 +76,7 @@ height: 100%; } -.monaco-workbench .pane > .pane-body > .empty-view, +.monaco-workbench .pane > .pane-body:not(.empty) > .empty-view, .monaco-workbench .pane > .pane-body.empty > :not(.empty-view) { display: none; } diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts index 43f1fe0b1af..e3bb63d15ea 100644 --- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts +++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts @@ -9,7 +9,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { attachStyler, IColorMapping } from 'vs/platform/theme/common/styler'; import { SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_BORDER } from 'vs/workbench/common/theme'; -import { append, $, trackFocus, toggleClass, EventType, isAncestor, Dimension, addDisposableListener } from 'vs/base/browser/dom'; +import { append, $, trackFocus, toggleClass, EventType, isAncestor, Dimension, addDisposableListener, addClass, removeClass } from 'vs/base/browser/dom'; import { IDisposable, combinedDisposable, dispose, toDisposable, Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; import { firstIndex } from 'vs/base/common/arrays'; import { IAction, IActionRunner, ActionRunner } from 'vs/base/common/actions'; @@ -25,7 +25,7 @@ import { PaneView, IPaneViewOptions, IPaneOptions, Pane, DefaultPaneDndControlle import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { Extensions as ViewContainerExtensions, IView, FocusedViewContext, IViewContainersRegistry, IViewDescriptor, ViewContainer } from 'vs/workbench/common/views'; +import { Extensions as ViewContainerExtensions, IView, FocusedViewContext, IViewContainersRegistry, IViewDescriptor, ViewContainer, IViewsRegistry } from 'vs/workbench/common/views'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { assertIsDefined } from 'vs/base/common/types'; @@ -54,6 +54,8 @@ export interface IViewPaneOptions extends IPaneOptions { titleMenuId?: MenuId; } +const viewsRegistry = Registry.as(ViewContainerExtensions.ViewsRegistry); + export abstract class ViewPane extends Pane implements IView { private static readonly AlwaysShowActionsConfig = 'workbench.view.alwaysShowHeaderActions'; @@ -87,7 +89,9 @@ export abstract class ViewPane extends Pane implements IView { private headerContainer?: HTMLElement; private titleContainer?: HTMLElement; protected twistiesContainer?: HTMLElement; - private emptyViewContainer?: HTMLElement; + + private bodyContainer!: HTMLElement; + private emptyViewContainer!: HTMLElement; constructor( options: IViewPaneOptions, @@ -195,8 +199,19 @@ export abstract class ViewPane extends Pane implements IView { } protected renderBody(container: HTMLElement): void { + this.bodyContainer = container; this.emptyViewContainer = append(container, $('.empty-view', { tabIndex: 0 })); - this.emptyViewContainer.textContent = 'this view is empty'; + + // we should update our empty state whenever + const onEmptyViewContentChange = Event.any( + // the registry changes + Event.map(Event.filter(viewsRegistry.onDidChangeEmptyViewContent, id => id === this.id), () => this.isEmpty()), + // or the view's empty state changes + Event.latch(Event.map(this.onDidChangeEmptyState, () => this.isEmpty())) + ); + + this._register(onEmptyViewContentChange(this.updateEmptyState, this)); + this.updateEmptyState(this.isEmpty()); } focus(): void { @@ -253,6 +268,25 @@ export abstract class ViewPane extends Pane implements IView { // Subclasses to implement for saving state } + private updateEmptyState(isEmpty: boolean): void { + if (!isEmpty) { + removeClass(this.bodyContainer, 'empty'); + this.emptyViewContainer.innerHTML = ''; + return; + } + + const contents = viewsRegistry.getEmptyViewContent(this.id); + + if (contents.length === 0) { + removeClass(this.bodyContainer, 'empty'); + this.emptyViewContainer.innerHTML = ''; + return; + } + + addClass(this.bodyContainer, 'empty'); + this.emptyViewContainer.textContent = contents.map(c => c.content).join(''); + } + isEmpty(): boolean { return false; } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 531eab4d038..fdc8b34735a 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -233,7 +233,9 @@ export interface IViewsRegistry { getViewContainer(id: string): ViewContainer | null; + readonly onDidChangeEmptyViewContent: Event; registerEmptyViewContent(id: string, viewContent: IViewContentDescriptor): IDisposable; + getEmptyViewContent(id: string): IViewContentDescriptor[]; } class ViewsRegistry extends Disposable implements IViewsRegistry { @@ -247,6 +249,9 @@ class ViewsRegistry extends Disposable implements IViewsRegistry { private readonly _onDidChangeContainer: Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }> = this._register(new Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }>()); readonly onDidChangeContainer: Event<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }> = this._onDidChangeContainer.event; + private readonly _onDidChangeEmptyViewContent: Emitter = this._register(new Emitter()); + readonly onDidChangeEmptyViewContent: Event = this._onDidChangeEmptyViewContent.event; + private _viewContainers: ViewContainer[] = []; private _views: Map = new Map(); private _emptyViewContents = new SetMap(); @@ -301,7 +306,18 @@ class ViewsRegistry extends Disposable implements IViewsRegistry { registerEmptyViewContent(id: string, viewContent: IViewContentDescriptor): IDisposable { this._emptyViewContents.add(id, viewContent); - return toDisposable(() => this._emptyViewContents.delete(id, viewContent)); + this._onDidChangeEmptyViewContent.fire(id); + + return toDisposable(() => { + this._emptyViewContents.delete(id, viewContent); + this._onDidChangeEmptyViewContent.fire(id); + }); + } + + getEmptyViewContent(id: string): IViewContentDescriptor[] { + const result: IViewContentDescriptor[] = []; + this._emptyViewContents.forEach(id, descriptor => result.push(descriptor)); + return result; } private addViews(viewDescriptors: IViewDescriptor[], viewContainer: ViewContainer): void { From 6415faa71d5920426435c28a526b86b8f8071f37 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 24 Jan 2020 15:44:09 +0100 Subject: [PATCH 027/624] introduce LinkedText --- src/vs/base/browser/linkedText.ts | 44 ++++++++++++++ src/vs/base/test/browser/linkedTest.test.ts | 63 +++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 src/vs/base/browser/linkedText.ts create mode 100644 src/vs/base/test/browser/linkedTest.test.ts diff --git a/src/vs/base/browser/linkedText.ts b/src/vs/base/browser/linkedText.ts new file mode 100644 index 00000000000..3d69948aa42 --- /dev/null +++ b/src/vs/base/browser/linkedText.ts @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export interface ILink { + readonly label: string; + readonly href: string; + readonly title?: string; +} + +export type LinkedTextNode = string | ILink; +export type LinkedText = LinkedTextNode[]; + +const LINK_REGEX = /\[([^\]]+)\]\(((?:https?:\/\/|command:)[^\)\s]+)(?: "([^"]+)")?\)/gi; + +export function parseLinkedText(text: string): LinkedText { + const result: LinkedTextNode[] = []; + + let index = 0; + let match: RegExpExecArray | null; + + while (match = LINK_REGEX.exec(text)) { + if (match.index - index > 0) { + result.push(text.substring(index, match.index)); + } + + const [, label, href, title] = match; + + if (title) { + result.push({ label, href, title }); + } else { + result.push({ label, href }); + } + + index = match.index + match[0].length; + } + + if (index < text.length) { + result.push(text.substring(index)); + } + + return result; +} diff --git a/src/vs/base/test/browser/linkedTest.test.ts b/src/vs/base/test/browser/linkedTest.test.ts new file mode 100644 index 00000000000..8bfcad6f875 --- /dev/null +++ b/src/vs/base/test/browser/linkedTest.test.ts @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; +import { parseLinkedText } from 'vs/base/browser/linkedText'; + +suite('LinkedText', () => { + test('parses correctly', () => { + assert.deepEqual(parseLinkedText(''), []); + assert.deepEqual(parseLinkedText('hello'), ['hello']); + assert.deepEqual(parseLinkedText('hello there'), ['hello there']); + assert.deepEqual(parseLinkedText('Some message with [link text](http://link.href).'), [ + 'Some message with ', + { label: 'link text', href: 'http://link.href' }, + '.' + ]); + assert.deepEqual(parseLinkedText('Some message with [link text](http://link.href "and a title").'), [ + 'Some message with ', + { label: 'link text', href: 'http://link.href', title: 'and a title' }, + '.' + ]); + assert.deepEqual(parseLinkedText('Some message with [link text](random stuff).'), [ + 'Some message with [link text](random stuff).' + ]); + assert.deepEqual(parseLinkedText('Some message with [https link](https://link.href).'), [ + 'Some message with ', + { label: 'https link', href: 'https://link.href' }, + '.' + ]); + assert.deepEqual(parseLinkedText('Some message with [https link](https:).'), [ + 'Some message with [https link](https:).' + ]); + assert.deepEqual(parseLinkedText('Some message with [a command](command:foobar).'), [ + 'Some message with ', + { label: 'a command', href: 'command:foobar' }, + '.' + ]); + assert.deepEqual(parseLinkedText('Some message with [a command](command:).'), [ + 'Some message with [a command](command:).' + ]); + assert.deepEqual(parseLinkedText('link [one](command:foo "nice") and link [two](http://foo)...'), [ + 'link ', + { label: 'one', href: 'command:foo', title: 'nice' }, + ' and link ', + { label: 'two', href: 'http://foo' }, + '...' + ]); + }); +}); + +/* +[I'm an inline-style link](https://www.google.com) + +[I'm an inline-style link with title](https://www.google.com "Google's Homepage") + +[I'm a reference-style link][Arbitrary case-insensitive reference text] + +[I'm a relative reference to a repository file](../blob/master/LICENSE) + +[You can use numbers for reference-style link definitions][1] +*/ From 7c8489c8600491a755012c63b5ed3ef693f904ef Mon Sep 17 00:00:00 2001 From: Robert Rossmann Date: Wed, 29 Jan 2020 20:38:37 +0100 Subject: [PATCH 028/624] Style diff editor's scrollable viewport just like any other scrollbar --- src/vs/editor/browser/widget/media/diffEditor.css | 13 ++++--------- src/vs/workbench/browser/style.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index 317916a1078..eda4e7755fb 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -8,19 +8,14 @@ z-index: 9; } +.monaco-diff-editor .diffOverview .diffViewport { + z-index: 10; +} + /* colors not externalized: using transparancy on background */ .monaco-diff-editor.vs .diffOverview { background: rgba(0, 0, 0, 0.03); } .monaco-diff-editor.vs-dark .diffOverview { background: rgba(255, 255, 255, 0.01); } -.monaco-diff-editor .diffViewport { - box-shadow: inset 0px 0px 1px 0px #B9B9B9; - background: rgba(0, 0, 0, 0.10); -} - -.monaco-diff-editor.vs-dark .diffViewport, -.monaco-diff-editor.hc-black .diffViewport { - background: rgba(255, 255, 255, 0.10); -} .monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar { background: rgba(0,0,0,0); } .monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar { background: rgba(0,0,0,0); } .monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar { background: none; } diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts index ea118c2511a..5280cfea434 100644 --- a/src/vs/workbench/browser/style.ts +++ b/src/vs/workbench/browser/style.ts @@ -86,6 +86,10 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider { background: ${scrollbarSliderBackgroundColor}; } + + .monaco-workbench .monaco-diff-editor .diffViewport { + background: ${scrollbarSliderBackgroundColor}; + } `); } @@ -95,6 +99,10 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${scrollbarSliderHoverBackgroundColor}; } + + .monaco-workbench .monaco-diff-editor .diffViewport:hover { + background: ${scrollbarSliderHoverBackgroundColor}; + } `); } @@ -104,6 +112,10 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider.active { background: ${scrollbarSliderActiveBackgroundColor}; } + + .monaco-workbench .monaco-diff-editor .diffViewport:active { + background: ${scrollbarSliderActiveBackgroundColor}; + } `); } From 8342b3ada9df04140adc6f5bc4a142c8486543bf Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 31 Jan 2020 12:10:58 +0100 Subject: [PATCH 029/624] add some lint rules that enforce our api-guidelines --- .eslintrc.json | 56 +++++++++++- build/lib/eslint/vscode-dts-create-func.js | 35 +++++++ build/lib/eslint/vscode-dts-create-func.ts | 40 ++++++++ build/lib/eslint/vscode-dts-event-naming.js | 81 +++++++++++++++++ build/lib/eslint/vscode-dts-event-naming.ts | 91 +++++++++++++++++++ .../lib/eslint/vscode-dts-interface-naming.js | 30 ++++++ .../lib/eslint/vscode-dts-interface-naming.ts | 35 +++++++ .../lib/eslint/vscode-dts-literal-or-types.js | 23 +++++ .../lib/eslint/vscode-dts-literal-or-types.ts | 25 +++++ 9 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 build/lib/eslint/vscode-dts-create-func.js create mode 100644 build/lib/eslint/vscode-dts-create-func.ts create mode 100644 build/lib/eslint/vscode-dts-event-naming.js create mode 100644 build/lib/eslint/vscode-dts-event-naming.ts create mode 100644 build/lib/eslint/vscode-dts-interface-naming.js create mode 100644 build/lib/eslint/vscode-dts-interface-naming.ts create mode 100644 build/lib/eslint/vscode-dts-literal-or-types.js create mode 100644 build/lib/eslint/vscode-dts-literal-or-types.ts diff --git a/.eslintrc.json b/.eslintrc.json index ef22512e284..2a086870704 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,7 +26,17 @@ "no-throw-literal": "warn", "no-unsafe-finally": "warn", "no-unused-labels": "warn", - "no-restricted-globals": ["warn", "name", "length", "event", "closed", "external", "status", "origin", "orientation"], // non-complete list of globals that are easy to access unintentionally + "no-restricted-globals": [ + "warn", + "name", + "length", + "event", + "closed", + "external", + "status", + "origin", + "orientation" + ], // non-complete list of globals that are easy to access unintentionally "no-var": "warn", "jsdoc/no-types": "warn", "semi": "off", @@ -622,6 +632,50 @@ "rules": { "jsdoc/no-types": "off" } + }, + { + "files": [ + "**/vscode.d.ts", + "**/vscode.proposed.d.ts" + ], + "rules": { + "vscode-dts-create-func": "warn", + "vscode-dts-literal-or-types": "warn", + "vscode-dts-interface-naming": "warn", + "vscode-dts-event-naming": [ + "warn", + { + "allowed": [ + "onCancellationRequested", + "event" + ], + "verbs": [ + "accept", + "change", + "close", + "collapse", + "create", + "delete", + "dispose", + "end", + "expand", + "hide", + "open", + "override", + "receive", + "register", + "rename", + "save", + "send", + "start", + "terminate", + "trigger", + "unregister", + "write" + ] + } + ] + } } ] } diff --git a/build/lib/eslint/vscode-dts-create-func.js b/build/lib/eslint/vscode-dts-create-func.js new file mode 100644 index 00000000000..5a27bf51c80 --- /dev/null +++ b/build/lib/eslint/vscode-dts-create-func.js @@ -0,0 +1,35 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +module.exports = new class ApiLiteralOrTypes { + constructor() { + this.meta = { + docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' }, + messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', } + }; + } + create(context) { + return { + ['TSDeclareFunction Identifier[name=/create.*/]']: (node) => { + var _a; + const decl = node.parent; + if (((_a = decl.returnType) === null || _a === void 0 ? void 0 : _a.typeAnnotation.type) !== experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + return; + } + if (decl.returnType.typeAnnotation.typeName.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const ident = decl.returnType.typeAnnotation.typeName.name; + if (ident === 'Promise' || ident === 'Thenable') { + context.report({ + node, + messageId: 'sync' + }); + } + } + }; + } +}; diff --git a/build/lib/eslint/vscode-dts-create-func.ts b/build/lib/eslint/vscode-dts-create-func.ts new file mode 100644 index 00000000000..295d099da7c --- /dev/null +++ b/build/lib/eslint/vscode-dts-create-func.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 * as eslint from 'eslint'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; + +export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' }, + messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + return { + ['TSDeclareFunction Identifier[name=/create.*/]']: (node: any) => { + + const decl = (node).parent; + + if (decl.returnType?.typeAnnotation.type !== AST_NODE_TYPES.TSTypeReference) { + return; + } + if (decl.returnType.typeAnnotation.typeName.type !== AST_NODE_TYPES.Identifier) { + return; + } + + const ident = decl.returnType.typeAnnotation.typeName.name; + if (ident === 'Promise' || ident === 'Thenable') { + context.report({ + node, + messageId: 'sync' + }); + } + } + }; + } +}; diff --git a/build/lib/eslint/vscode-dts-event-naming.js b/build/lib/eslint/vscode-dts-event-naming.js new file mode 100644 index 00000000000..c93c1818305 --- /dev/null +++ b/build/lib/eslint/vscode-dts-event-naming.js @@ -0,0 +1,81 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _a; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +module.exports = new (_a = class ApiEventNaming { + constructor() { + this.meta = { + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming' + }, + messages: { + naming: 'Event names must follow this patten: `on[Did|Will]`', + verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration', + subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API', + unknown: 'UNKNOWN event declaration, lint-rule needs tweaking' + } + }; + } + create(context) { + const config = context.options[0]; + const allowed = new Set(config.allowed); + const verbs = new Set(config.verbs); + return { + ['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node) => { + var _a, _b; + const def = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent; + let ident; + if ((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { + ident = def; + } + else if (((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || (def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + ident = def.key; + } + if (!ident) { + // event on unknown structure... + return context.report({ + node, + message: 'unknown' + }); + } + if (allowed.has(ident.name)) { + // configured exception + return; + } + const match = ApiEventNaming._nameRegExp.exec(ident.name); + if (!match) { + context.report({ + node: ident, + messageId: 'naming' + }); + return; + } + // check that is spelled out (configured) as verb + if (!verbs.has(match[2].toLowerCase())) { + context.report({ + node: ident, + messageId: 'verb', + data: { verb: match[2] } + }); + } + // check that a subject (if present) has occurred + if (match[3]) { + const regex = new RegExp(match[3], 'ig'); + const parts = context.getSourceCode().getText().split(regex); + if (parts.length < 3) { + context.report({ + node: ident, + messageId: 'subject', + data: { subject: match[3] } + }); + } + } + } + }; + } + }, + _a._nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/, + _a); diff --git a/build/lib/eslint/vscode-dts-event-naming.ts b/build/lib/eslint/vscode-dts-event-naming.ts new file mode 100644 index 00000000000..6543c4586bc --- /dev/null +++ b/build/lib/eslint/vscode-dts-event-naming.ts @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; + +export = new class ApiEventNaming implements eslint.Rule.RuleModule { + + private static _nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/; + + readonly meta: eslint.Rule.RuleMetaData = { + docs: { + url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming' + }, + messages: { + naming: 'Event names must follow this patten: `on[Did|Will]`', + verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration', + subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API', + unknown: 'UNKNOWN event declaration, lint-rule needs tweaking' + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + const config = <{ allowed: string[], verbs: string[] }>context.options[0]; + const allowed = new Set(config.allowed); + const verbs = new Set(config.verbs); + + return { + ['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node: any) => { + + const def = (node).parent?.parent?.parent; + let ident: TSESTree.Identifier | undefined; + + if (def?.type === AST_NODE_TYPES.Identifier) { + ident = def; + + } else if ((def?.type === AST_NODE_TYPES.TSPropertySignature || def?.type === AST_NODE_TYPES.ClassProperty) && def.key.type === AST_NODE_TYPES.Identifier) { + ident = def.key; + } + + if (!ident) { + // event on unknown structure... + return context.report({ + node, + message: 'unknown' + }); + } + + if (allowed.has(ident.name)) { + // configured exception + return; + } + + const match = ApiEventNaming._nameRegExp.exec(ident.name); + if (!match) { + context.report({ + node: ident, + messageId: 'naming' + }); + return; + } + + // check that is spelled out (configured) as verb + if (!verbs.has(match[2].toLowerCase())) { + context.report({ + node: ident, + messageId: 'verb', + data: { verb: match[2] } + }); + } + + // check that a subject (if present) has occurred + if (match[3]) { + const regex = new RegExp(match[3], 'ig'); + const parts = context.getSourceCode().getText().split(regex); + if (parts.length < 3) { + context.report({ + node: ident, + messageId: 'subject', + data: { subject: match[3] } + }); + } + } + } + }; + } +}; + diff --git a/build/lib/eslint/vscode-dts-interface-naming.js b/build/lib/eslint/vscode-dts-interface-naming.js new file mode 100644 index 00000000000..70ca810825b --- /dev/null +++ b/build/lib/eslint/vscode-dts-interface-naming.js @@ -0,0 +1,30 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _a; +module.exports = new (_a = class ApiInterfaceNaming { + constructor() { + this.meta = { + messages: { + naming: 'Interfaces must not be prefixed with uppercase `I`', + } + }; + } + create(context) { + return { + ['TSInterfaceDeclaration Identifier']: (node) => { + const name = node.name; + if (ApiInterfaceNaming._nameRegExp.test(name)) { + context.report({ + node, + messageId: 'naming' + }); + } + } + }; + } + }, + _a._nameRegExp = /I[A-Z]/, + _a); diff --git a/build/lib/eslint/vscode-dts-interface-naming.ts b/build/lib/eslint/vscode-dts-interface-naming.ts new file mode 100644 index 00000000000..d9ec4e8c34c --- /dev/null +++ b/build/lib/eslint/vscode-dts-interface-naming.ts @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree } from '@typescript-eslint/experimental-utils'; + +export = new class ApiInterfaceNaming implements eslint.Rule.RuleModule { + + private static _nameRegExp = /I[A-Z]/; + + readonly meta: eslint.Rule.RuleMetaData = { + messages: { + naming: 'Interfaces must not be prefixed with uppercase `I`', + } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + return { + ['TSInterfaceDeclaration Identifier']: (node: any) => { + + const name = (node).name; + if (ApiInterfaceNaming._nameRegExp.test(name)) { + context.report({ + node, + messageId: 'naming' + }); + } + } + }; + } +}; + diff --git a/build/lib/eslint/vscode-dts-literal-or-types.js b/build/lib/eslint/vscode-dts-literal-or-types.js new file mode 100644 index 00000000000..02e6de876ba --- /dev/null +++ b/build/lib/eslint/vscode-dts-literal-or-types.js @@ -0,0 +1,23 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +module.exports = new class ApiLiteralOrTypes { + constructor() { + this.meta = { + docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' }, + messages: { useEnum: 'Use enums, not literal-or-types', } + }; + } + create(context) { + return { + ['TSTypeAnnotation TSUnionType TSLiteralType']: (node) => { + context.report({ + node: node, + messageId: 'useEnum' + }); + } + }; + } +}; diff --git a/build/lib/eslint/vscode-dts-literal-or-types.ts b/build/lib/eslint/vscode-dts-literal-or-types.ts new file mode 100644 index 00000000000..01a3eb21523 --- /dev/null +++ b/build/lib/eslint/vscode-dts-literal-or-types.ts @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; + +export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule { + + readonly meta: eslint.Rule.RuleMetaData = { + docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' }, + messages: { useEnum: 'Use enums, not literal-or-types', } + }; + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + return { + ['TSTypeAnnotation TSUnionType TSLiteralType']: (node: any) => { + context.report({ + node: node, + messageId: 'useEnum' + }); + } + }; + } +}; From c11a5feafed4951edd9138e9ba40a9ce6017a313 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 31 Jan 2020 16:14:16 +0100 Subject: [PATCH 030/624] IPC: getBroadcastChannel fixes #89614 --- src/vs/base/parts/ipc/common/ipc.ts | 64 ++++++++++++++--- src/vs/base/parts/ipc/test/node/ipc.test.ts | 76 +++++++++++++++++++++ 2 files changed, 131 insertions(+), 9 deletions(-) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 662a29a9d86..6fa8a0d0fae 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, Emitter, Relay } from 'vs/base/common/event'; +import { Event, Emitter, Relay, EventMultiplexer } from 'vs/base/common/event'; import { IDisposable, toDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; @@ -95,7 +95,8 @@ export interface Client { export interface IConnectionHub { readonly connections: Connection[]; - readonly onDidChangeConnections: Event>; + readonly onDidAddConnection: Event>; + readonly onDidRemoveConnection: Event>; } /** @@ -117,6 +118,7 @@ export interface IClientRouter { */ export interface IRoutingChannelClient { getChannel(channelName: string, router: IClientRouter): T; + getBroadcastChannel(channelName: string): T; } interface IReader { @@ -659,8 +661,11 @@ export class IPCServer implements IChannelServer, I private channels = new Map>(); private _connections = new Set>(); - private readonly _onDidChangeConnections = new Emitter>(); - readonly onDidChangeConnections: Event> = this._onDidChangeConnections.event; + private readonly _onDidAddConnection = new Emitter>(); + readonly onDidAddConnection: Event> = this._onDidAddConnection.event; + + private readonly _onDidRemoveConnection = new Emitter>(); + readonly onDidRemoveConnection: Event> = this._onDidRemoveConnection.event; get connections(): Connection[] { const result: Connection[] = []; @@ -683,12 +688,13 @@ export class IPCServer implements IChannelServer, I const connection: Connection = { channelServer, channelClient, ctx }; this._connections.add(connection); - this._onDidChangeConnections.fire(connection); + this._onDidAddConnection.fire(connection); onDidClientDisconnect(() => { channelServer.dispose(); channelClient.dispose(); this._connections.delete(connection); + this._onDidRemoveConnection.fire(connection); }); }); }); @@ -698,14 +704,14 @@ export class IPCServer implements IChannelServer, I const that = this; return { - call(command: string, arg?: any, cancellationToken?: CancellationToken) { + call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { const channelPromise = router.routeCall(that, command, arg) .then(connection => (connection as Connection).channelClient.getChannel(channelName)); return getDelayedChannel(channelPromise) .call(command, arg, cancellationToken); }, - listen(event: string, arg: any) { + listen(event: string, arg: any): Event { const channelPromise = router.routeEvent(that, event, arg) .then(connection => (connection as Connection).channelClient.getChannel(channelName)); @@ -715,6 +721,45 @@ export class IPCServer implements IChannelServer, I } as T; } + getBroadcastChannel(channelName: string): T { + const that = this; + + return { + call(_): Promise { + throw new Error('IPC broadcast channels are not supported for calls'); + }, + listen(eventName: string, arg: any): Event { + const eventMultiplexer = new EventMultiplexer(); + const map = new Map, IDisposable>(); + + const onDidAddConnection = (connection: Connection) => { + const channel = connection.channelClient.getChannel(channelName); + const event = channel.listen(eventName, arg); + const disposable = eventMultiplexer.add(event); + + map.set(connection, disposable); + }; + + const onDidRemoveConnection = (connection: Connection) => { + const disposable = map.get(connection); + + if (!disposable) { + return; + } + + disposable.dispose(); + map.delete(connection); + }; + + that.connections.forEach(onDidAddConnection); + that.onDidAddConnection(onDidAddConnection); + that.onDidRemoveConnection(onDidRemoveConnection); + + return eventMultiplexer.event; + } + } as T; + } + registerChannel(channelName: string, channel: IServerChannel): void { this.channels.set(channelName, channel); @@ -726,7 +771,8 @@ export class IPCServer implements IChannelServer, I dispose(): void { this.channels.clear(); this._connections.clear(); - this._onDidChangeConnections.dispose(); + this._onDidAddConnection.dispose(); + this._onDidRemoveConnection.dispose(); } } @@ -827,7 +873,7 @@ export class StaticRouter implements IClientRouter } } - await Event.toPromise(hub.onDidChangeConnections); + await Event.toPromise(hub.onDidAddConnection); return await this.route(hub); } } diff --git a/src/vs/base/parts/ipc/test/node/ipc.test.ts b/src/vs/base/parts/ipc/test/node/ipc.test.ts index 589acae53d4..d0aeee23d47 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.test.ts @@ -415,4 +415,80 @@ suite('Base IPC', function () { return assert.equal(r, 'Super Context'); }); }); + + suite('one to many', function () { + test('all clients get pinged', async function () { + const service = new TestService(); + const channel = new TestChannel(service); + const server = new TestIPCServer(); + server.registerChannel('channel', channel); + + let client1GotPinged = false; + const client1 = server.createConnection('client1'); + const ipcService1 = new TestChannelClient(client1.getChannel('channel')); + ipcService1.onPong(() => client1GotPinged = true); + + let client2GotPinged = false; + const client2 = server.createConnection('client2'); + const ipcService2 = new TestChannelClient(client2.getChannel('channel')); + ipcService2.onPong(() => client2GotPinged = true); + + await timeout(1); + service.ping('hello'); + + await timeout(1); + assert(client1GotPinged, 'client 1 got pinged'); + assert(client2GotPinged, 'client 2 got pinged'); + + client1.dispose(); + client2.dispose(); + server.dispose(); + }); + + test('server gets pings from all clients (broadcast channel)', async function () { + const server = new TestIPCServer(); + + const client1 = server.createConnection('client1'); + const clientService1 = new TestService(); + const clientChannel1 = new TestChannel(clientService1); + client1.registerChannel('channel', clientChannel1); + + const pings: string[] = []; + const broadcastChannel = server.getBroadcastChannel('channel'); + const broadcastService = new TestChannelClient(broadcastChannel); + broadcastService.onPong(msg => pings.push(msg)); + + await timeout(1); + clientService1.ping('hello 1'); + + await timeout(1); + assert.deepEqual(pings, ['hello 1']); + + const client2 = server.createConnection('client2'); + const clientService2 = new TestService(); + const clientChannel2 = new TestChannel(clientService2); + client2.registerChannel('channel', clientChannel2); + + await timeout(1); + clientService2.ping('hello 2'); + + await timeout(1); + assert.deepEqual(pings, ['hello 1', 'hello 2']); + + client1.dispose(); + clientService1.ping('hello 1'); + + await timeout(1); + assert.deepEqual(pings, ['hello 1', 'hello 2']); + + await timeout(1); + clientService2.ping('hello again 2'); + + await timeout(1); + assert.deepEqual(pings, ['hello 1', 'hello 2', 'hello again 2']); + + client2.dispose(); + server.dispose(); + }); + }); }); From d1fca9d427f60af79df16b452904d30803eff879 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Fri, 31 Jan 2020 08:01:12 -0800 Subject: [PATCH 031/624] debug: update js-debug-nightly to "2020.1.41823" @ 2020-01-31T01:06:32.567Z --- build/builtInExtensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 65cf6e5376e..464af9c3511 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -46,7 +46,7 @@ }, { "name": "ms-vscode.js-debug-nightly", - "version": "2020.1.41823", + "version": "2020.1.43263", "forQualities": [ "insider" ], From f550dcc7baf78374304dc4331309d00c3964f6e6 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 31 Jan 2020 09:32:52 -0800 Subject: [PATCH 032/624] Fix search smoketest - use span for all searchview messages and fix selector Fix #89795 --- src/vs/workbench/contrib/search/browser/searchView.ts | 4 ++-- test/automation/src/search.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index baa12121c5d..61e407deeaa 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1543,7 +1543,7 @@ export class SearchView extends ViewPane { if (this.searchConfig.enableSearchEditorPreview) { dom.append(messageEl, $('span', undefined, resultMsg + ' - ')); - const span = dom.append(messageEl, $('span', undefined)); + const span = dom.append(messageEl, $('span')); const openInEditorLink = dom.append(span, $('a.pointer.prominent', undefined, nls.localize('openInEditor.message', "Open in editor"))); openInEditorLink.title = appendKeyBindingLabel( @@ -1556,7 +1556,7 @@ export class SearchView extends ViewPane { })); } else { - dom.append(messageEl, $('p', undefined, resultMsg)); + dom.append(messageEl, $('span', undefined, resultMsg)); } this.reLayout(); } else if (!msgWasHidden) { diff --git a/test/automation/src/search.ts b/test/automation/src/search.ts index 8f7767802f5..91b986038d5 100644 --- a/test/automation/src/search.ts +++ b/test/automation/src/search.ts @@ -109,11 +109,12 @@ export class Search extends Viewlet { } async waitForResultText(text: string): Promise { - await this.code.waitForTextContent(`${VIEWLET} .messages .message>p`, text); + // The label can end with " - " depending on whether the search editor is enabled + await this.code.waitForTextContent(`${VIEWLET} .messages .message>span`, undefined, result => result.startsWith(text)); } async waitForNoResultText(): Promise { - await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>p`); + await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>span`); } private async waitForInputFocus(selector: string): Promise { From 843a3e647a45b751f5b469224bcc3a87b30d772e Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Fri, 31 Jan 2020 13:37:01 -0800 Subject: [PATCH 033/624] bump version to 1.43.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fde05321d20..e67b14e4b37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-oss-dev", - "version": "1.42.0", + "version": "1.43.0", "distro": "37cc2dc2461194a03cadbd9de5030ac3b6eb1109", "author": { "name": "Microsoft Corporation" From 45a1ac998264ffa275ab565415c6487fdfb0e091 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 31 Jan 2020 23:59:54 +0100 Subject: [PATCH 034/624] Fix #89823 --- .../userDataSync/common/extensionsSync.ts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/userDataSync/common/extensionsSync.ts b/src/vs/platform/userDataSync/common/extensionsSync.ts index 5a380b38fde..4ed1d2bf012 100644 --- a/src/vs/platform/userDataSync/common/extensionsSync.ts +++ b/src/vs/platform/userDataSync/common/extensionsSync.ts @@ -240,8 +240,23 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse } if (added.length || updated.length) { - const installedExtensions = await this.extensionManagementService.getInstalled(ExtensionType.User); await Promise.all([...added, ...updated].map(async e => { + const installedExtensions = await this.extensionManagementService.getInstalled(); + const installedExtension = installedExtensions.filter(installed => areSameExtensions(installed.identifier, e.identifier))[0]; + + // Builtin Extension: Sync only enablement state + if (installedExtension && installedExtension.type === ExtensionType.System) { + if (e.enabled) { + this.logService.info('Extensions: Enabling extension.', e.identifier.id); + await this.extensionEnablementService.enableExtension(e.identifier); + } else { + this.logService.info('Extensions: Disabling extension.', e.identifier.id); + await this.extensionEnablementService.disableExtension(e.identifier); + } + removeFromSkipped.push(e.identifier); + return; + } + const extension = await this.extensionGalleryService.getCompatibleExtension(e.identifier, e.version); if (extension) { try { @@ -253,7 +268,7 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse await this.extensionEnablementService.disableExtension(extension.identifier); } // Install only if the extension does not exist - if (!installedExtensions.some(installed => areSameExtensions(installed.identifier, extension.identifier) && installed.manifest.version === extension.version)) { + if (!installedExtension || installedExtension.manifest.version !== extension.version) { this.logService.info('Extensions: Installing extension.', e.identifier.id, extension.version); await this.extensionManagementService.installFromGallery(extension); removeFromSkipped.push(extension.identifier); @@ -284,7 +299,7 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse } private async getLocalExtensions(): Promise { - const installedExtensions = await this.extensionManagementService.getInstalled(ExtensionType.User); + const installedExtensions = await this.extensionManagementService.getInstalled(); const disabledExtensions = await this.extensionEnablementService.getDisabledExtensionsAsync(); return installedExtensions .map(({ identifier }) => ({ identifier, enabled: !disabledExtensions.some(disabledExtension => areSameExtensions(disabledExtension, identifier)) })); From 19b7657634de563a1c6cd181b7dd9a2404548731 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Sat, 1 Feb 2020 00:33:08 +0100 Subject: [PATCH 035/624] Fix #89817 --- .../common/abstractSynchronizer.ts | 10 ++--- .../userDataSync/common/extensionsSync.ts | 3 +- .../userDataSync/common/globalStateSync.ts | 2 +- .../userDataSync/common/keybindingsSync.ts | 42 ++++++++++++------- .../userDataSync/common/settingsSync.ts | 24 +++++++---- .../userDataSync/common/userDataAutoSync.ts | 18 ++++---- 6 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts index f92bb11f724..386ccb45299 100644 --- a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts +++ b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts @@ -54,7 +54,8 @@ export abstract class AbstractSynchroniser extends Disposable { } async hasRemoteData(): Promise { - const remoteUserData = await this.getRemoteUserData(); + const lastSyncData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncData); return remoteUserData.content !== null; } @@ -77,11 +78,8 @@ export abstract class AbstractSynchroniser extends Disposable { await this.fileService.writeFile(this.lastSyncResource, VSBuffer.fromString(JSON.stringify(lastSyncUserData))); } - protected async getRemoteUserData(lastSyncData?: IUserData | null): Promise { - if (lastSyncData === undefined) { - lastSyncData = await this.getLastSyncUserData(); - } - return this.userDataSyncStoreService.read(this.getRemoteDataResourceKey(), lastSyncData || null, this.source); + protected async getRemoteUserData(lastSyncData: IUserData | null): Promise { + return this.userDataSyncStoreService.read(this.getRemoteDataResourceKey(), lastSyncData, this.source); } protected async updateRemoteUserData(content: string, ref: string | null): Promise { diff --git a/src/vs/platform/userDataSync/common/extensionsSync.ts b/src/vs/platform/userDataSync/common/extensionsSync.ts index 4ed1d2bf012..cfd1668c471 100644 --- a/src/vs/platform/userDataSync/common/extensionsSync.ts +++ b/src/vs/platform/userDataSync/common/extensionsSync.ts @@ -206,7 +206,6 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse } if (added.length || removed.length || updated.length) { - this.logService.info('Extensions: Updating local extensions...'); skippedExtensions = await this.updateLocalExtensions(added, removed, updated, skippedExtensions); } @@ -218,7 +217,7 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse remoteUserData = { ref, content }; } - if (hasChanges || !lastSyncUserData) { + if (lastSyncUserData?.ref !== remoteUserData.ref) { // update last sync this.logService.info('Extensions: Updating last synchronised extensions...'); await this.updateLastSyncUserData({ ...remoteUserData, skippedExtensions }); diff --git a/src/vs/platform/userDataSync/common/globalStateSync.ts b/src/vs/platform/userDataSync/common/globalStateSync.ts index badbce13d4f..6556d7539c3 100644 --- a/src/vs/platform/userDataSync/common/globalStateSync.ts +++ b/src/vs/platform/userDataSync/common/globalStateSync.ts @@ -195,7 +195,7 @@ export class GlobalStateSynchroniser extends AbstractSynchroniser implements IUs remoteUserData = { ref, content }; } - if (hasChanges || !lastSyncUserData) { + if (lastSyncUserData?.ref !== remoteUserData.ref) { // update last sync this.logService.info('UI State: Updating last synchronised ui state...'); await this.updateLastSyncUserData(remoteUserData); diff --git a/src/vs/platform/userDataSync/common/keybindingsSync.ts b/src/vs/platform/userDataSync/common/keybindingsSync.ts index 0f1dce42072..b1df87e1c73 100644 --- a/src/vs/platform/userDataSync/common/keybindingsSync.ts +++ b/src/vs/platform/userDataSync/common/keybindingsSync.ts @@ -29,6 +29,7 @@ interface ISyncContent { interface ISyncPreviewResult { readonly fileContent: IFileContent | null; readonly remoteUserData: IUserData; + readonly lastSyncUserData: IUserData | null; readonly hasLocalChanged: boolean; readonly hasRemoteChanged: boolean; readonly hasConflicts: boolean; @@ -63,7 +64,8 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements this.logService.info('Keybindings: Started pulling keybindings...'); this.setStatus(SyncStatus.Syncing); - const remoteUserData = await this.getRemoteUserData(); + const lastSyncUserData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); const remoteContent = remoteUserData.content !== null ? this.getKeybindingsContentFromSyncContent(remoteUserData.content) : null; if (remoteContent !== null) { @@ -74,7 +76,8 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements hasConflicts: false, hasLocalChanged: true, hasRemoteChanged: false, - remoteUserData + remoteUserData, + lastSyncUserData })); await this.apply(); } @@ -106,14 +109,16 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements const fileContent = await this.getLocalFileContent(); if (fileContent !== null) { - const remoteUserData = await this.getRemoteUserData(); + const lastSyncUserData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, fileContent.value); this.syncPreviewResultPromise = createCancelablePromise(() => Promise.resolve({ fileContent, hasConflicts: false, hasLocalChanged: false, hasRemoteChanged: true, - remoteUserData + remoteUserData, + lastSyncUserData })); await this.apply(undefined, true); } @@ -204,7 +209,8 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements const preview = await this.syncPreviewResultPromise; content = preview.remoteUserData?.content; } else { - const remoteUserData = await this.getRemoteUserData(); + const lastSyncData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncData); content = remoteUserData.content; } return content ? this.getKeybindingsContentFromSyncContent(content) : null; @@ -247,6 +253,8 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements return; } + let { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; + if (content === undefined) { if (await this.fileService.exists(this.environmentService.keybindingsSyncPreviewResource)) { const keybindingsPreivew = await this.fileService.readFile(this.environmentService.keybindingsSyncPreviewResource); @@ -261,25 +269,21 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements throw error; } - let { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; if (!hasLocalChanged && !hasRemoteChanged) { this.logService.trace('Keybindings: No changes found during synchronizing keybindings.'); } + if (hasLocalChanged) { this.logService.info('Keybindings: Updating local keybindings'); await this.updateLocalFileContent(content, fileContent); } + if (hasRemoteChanged) { this.logService.info('Keybindings: Updating remote keybindings'); const remoteContents = this.updateSyncContent(content, remoteUserData.content); const ref = await this.updateRemoteUserData(remoteContents, forcePush ? null : remoteUserData.ref); remoteUserData = { ref, content: remoteContents }; } - if (remoteUserData?.content) { - this.logService.info('Keybindings: Updating last synchronised keybindings'); - const lastSyncContent = this.updateSyncContent(content, null); - await this.updateLastSyncUserData({ ref: remoteUserData.ref, content: lastSyncContent }); - } // Delete the preview await this.fileService.del(this.environmentService.keybindingsSyncPreviewResource); @@ -287,6 +291,12 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements this.logService.trace('Keybindings: No changes found during synchronizing keybindings.'); } + if (lastSyncUserData?.ref !== remoteUserData.ref && (content !== undefined || fileContent !== null)) { + this.logService.info('Keybindings: Updating last synchronised keybindings'); + const lastSyncContent = this.updateSyncContent(content !== undefined ? content : fileContent!.value.toString(), null); + await this.updateLastSyncUserData({ ref: remoteUserData.ref, content: lastSyncContent }); + } + this.syncPreviewResultPromise = null; } @@ -304,9 +314,9 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements } private async generatePreview(token: CancellationToken): Promise { - const lastSyncData = await this.getLastSyncUserData(); - const lastSyncContent = lastSyncData && lastSyncData.content ? this.getKeybindingsContentFromSyncContent(lastSyncData.content) : null; - const remoteUserData = await this.getRemoteUserData(lastSyncData); + const lastSyncUserData = await this.getLastSyncUserData(); + const lastSyncContent = lastSyncUserData && lastSyncUserData.content ? this.getKeybindingsContentFromSyncContent(lastSyncUserData.content) : null; + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); const remoteContent = remoteUserData.content ? this.getKeybindingsContentFromSyncContent(remoteUserData.content) : null; // Get file content last to get the latest const fileContent = await this.getLocalFileContent(); @@ -319,7 +329,7 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements const localContent: string = fileContent ? fileContent.value.toString() : '[]'; if (this.hasErrors(localContent)) { this.logService.error('Keybindings: Unable to sync keybindings as there are errors/warning in keybindings file.'); - return { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged, hasConflicts }; + return { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged, hasConflicts }; } if (!lastSyncContent // First time sync @@ -350,7 +360,7 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements await this.fileService.writeFile(this.environmentService.keybindingsSyncPreviewResource, VSBuffer.fromString(previewContent)); } - return { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged, hasConflicts }; + return { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged, hasConflicts }; } private _formattingOptions: Promise | undefined = undefined; diff --git a/src/vs/platform/userDataSync/common/settingsSync.ts b/src/vs/platform/userDataSync/common/settingsSync.ts index b68d344d6bc..5a7c071d5c0 100644 --- a/src/vs/platform/userDataSync/common/settingsSync.ts +++ b/src/vs/platform/userDataSync/common/settingsSync.ts @@ -25,6 +25,7 @@ import { AbstractFileSynchroniser } from 'vs/platform/userDataSync/common/abstra interface ISyncPreviewResult { readonly fileContent: IFileContent | null; readonly remoteUserData: IUserData; + readonly lastSyncUserData: IUserData | null; readonly hasLocalChanged: boolean; readonly hasRemoteChanged: boolean; readonly remoteContent: string | null; @@ -84,7 +85,8 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS this.logService.info('Settings: Started pulling settings...'); this.setStatus(SyncStatus.Syncing); - const remoteUserData = await this.getRemoteUserData(); + const lastSyncUserData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); if (remoteUserData.content !== null) { const fileContent = await this.getLocalFileContent(); @@ -101,6 +103,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS hasRemoteChanged: false, remoteContent: content, remoteUserData, + lastSyncUserData, })); await this.apply(); @@ -136,7 +139,8 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS // Remove ignored settings const content = updateIgnoredSettings(fileContent.value.toString(), '{}', getIgnoredSettings(this.configurationService), formatUtils); await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(content)); - const remoteUserData = await this.getRemoteUserData(); + const lastSyncUserData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); this.syncPreviewResultPromise = createCancelablePromise(() => Promise.resolve({ conflictSettings: [], @@ -146,6 +150,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS hasRemoteChanged: true, remoteContent: content, remoteUserData, + lastSyncUserData, })); await this.apply(undefined, true); @@ -213,7 +218,8 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const preview = await this.syncPreviewResultPromise; content = preview.remoteUserData?.content; } else { - const remoteUserData = await this.getRemoteUserData(); + const lastSyncData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncData); content = remoteUserData.content; } return content !== undefined ? content : null; @@ -294,7 +300,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS return; } - let { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; + let { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; if (content === undefined) { if (await this.fileService.exists(this.environmentService.settingsSyncPreviewResource)) { @@ -332,7 +338,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS this.logService.trace('Settings: No changes found during synchronizing settings.'); } - if (remoteUserData.content) { + if (lastSyncUserData?.ref !== remoteUserData.ref) { this.logService.info('Settings: Updating last synchronised settings'); await this.updateLastSyncUserData(remoteUserData); } @@ -354,8 +360,8 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } private async generatePreview(resolvedConflicts: { key: string, value: any }[], token: CancellationToken): Promise { - const lastSyncData = await this.getLastSyncUserData(); - const remoteUserData = await this.getRemoteUserData(lastSyncData); + const lastSyncUserData = await this.getLastSyncUserData(); + const remoteUserData = await this.getRemoteUserData(lastSyncUserData); // Get file content last to get the latest const fileContent = await this.getLocalFileContent(); let hasLocalChanged: boolean = false; @@ -376,7 +382,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS else { this.logService.trace('Settings: Merging remote settings with local settings...'); const formatUtils = await this.getFormattingOptions(); - const result = merge(localContent, remoteUserData.content, lastSyncData ? lastSyncData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); + const result = merge(localContent, remoteUserData.content, lastSyncUserData ? lastSyncUserData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); hasConflicts = result.hasConflicts; hasLocalChanged = result.localContent !== null; hasRemoteChanged = result.remoteContent !== null; @@ -399,7 +405,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } this.setConflicts(conflictSettings); - return { fileContent, remoteUserData, hasLocalChanged, hasRemoteChanged, remoteContent, conflictSettings, hasConflicts }; + return { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged, remoteContent, conflictSettings, hasConflicts }; } private _formattingOptions: Promise | undefined = undefined; diff --git a/src/vs/platform/userDataSync/common/userDataAutoSync.ts b/src/vs/platform/userDataSync/common/userDataAutoSync.ts index 001ed04d906..636aab43f50 100644 --- a/src/vs/platform/userDataSync/common/userDataAutoSync.ts +++ b/src/vs/platform/userDataSync/common/userDataAutoSync.ts @@ -125,13 +125,17 @@ export class UserDataAutoSync extends Disposable implements IUserDataAutoSyncSer this.successiveFailures = 0; } - triggerAutoSync(): Promise { - return this.syncDelayer.trigger(() => { - this.logService.info('Sync: Triggerred.'); - return this.sync(false, true); - }, this.successiveFailures - ? 1000 * 1 * Math.min(this.successiveFailures, 60) /* Delay by number of seconds as number of failures up to 1 minute */ - : 1000); + async triggerAutoSync(): Promise { + if (this.enabled) { + return this.syncDelayer.trigger(() => { + this.logService.info('Sync: Triggerred.'); + return this.sync(false, true); + }, this.successiveFailures + ? 1000 * 1 * Math.min(this.successiveFailures, 60) /* Delay by number of seconds as number of failures up to 1 minute */ + : 1000); + } else { + this.syncDelayer.cancel(); + } } } From d837ddc72e7d9a8f35b5bd2ea976339926dcb1b0 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 31 Jan 2020 15:35:49 -0800 Subject: [PATCH 036/624] Fix off-by-one typo to improve display of file names in TS call hierarchy (#89822) --- .../typescript-language-features/src/features/callHierarchy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/callHierarchy.ts b/extensions/typescript-language-features/src/features/callHierarchy.ts index 63ecc4801af..a76d8a6bea8 100644 --- a/extensions/typescript-language-features/src/features/callHierarchy.ts +++ b/extensions/typescript-language-features/src/features/callHierarchy.ts @@ -72,7 +72,7 @@ class TypeScriptCallHierarchySupport implements vscode.CallHierarchyProvider { } function isSourceFileItem(item: Proto.CallHierarchyItem) { - return item.kind === PConst.Kind.script || item.kind === PConst.Kind.module && item.selectionSpan.start.line === 0 && item.selectionSpan.start.offset === 0; + return item.kind === PConst.Kind.script || item.kind === PConst.Kind.module && item.selectionSpan.start.line === 1 && item.selectionSpan.start.offset === 1; } function fromProtocolCallHierarchyItem(item: Proto.CallHierarchyItem): vscode.CallHierarchyItem { From 4ee7ff133e111d373e710160c81b95e2a8e3303d Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Sat, 1 Feb 2020 00:40:10 +0100 Subject: [PATCH 037/624] :lipstick: --- .../code/electron-browser/sharedProcess/sharedProcessMain.ts | 4 ++-- .../{userDataAutoSync.ts => userDataAutoSyncService.ts} | 2 +- .../{userDataAutoSync.ts => userDataAutoSyncService.ts} | 4 ++-- .../{userDataAutoSync.ts => userDataAutoSyncService.ts} | 4 ++-- src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts | 4 ++-- src/vs/workbench/workbench.web.main.ts | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename src/vs/platform/userDataSync/common/{userDataAutoSync.ts => userDataAutoSyncService.ts} (98%) rename src/vs/platform/userDataSync/electron-browser/{userDataAutoSync.ts => userDataAutoSyncService.ts} (88%) rename src/vs/workbench/contrib/userDataSync/browser/{userDataAutoSync.ts => userDataAutoSyncService.ts} (89%) diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index a28a1ea8d6c..710fdb817c1 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -59,7 +59,7 @@ import { LoggerService } from 'vs/platform/log/node/loggerService'; import { UserDataSyncLogService } from 'vs/platform/userDataSync/common/userDataSyncLog'; import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; import { KeytarCredentialsService } from 'vs/platform/credentials/node/credentialsService'; -import { UserDataAutoSync } from 'vs/platform/userDataSync/electron-browser/userDataAutoSync'; +import { UserDataAutoSyncService } from 'vs/platform/userDataSync/electron-browser/userDataAutoSyncService'; import { SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync'; import { UserDataAuthTokenService } from 'vs/platform/userDataSync/common/userDataAuthTokenService'; @@ -219,7 +219,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat const userDataSyncChannel = new UserDataSyncChannel(userDataSyncService); server.registerChannel('userDataSync', userDataSyncChannel); - const userDataAutoSync = instantiationService2.createInstance(UserDataAutoSync); + const userDataAutoSync = instantiationService2.createInstance(UserDataAutoSyncService); const userDataAutoSyncChannel = new UserDataAutoSyncChannel(userDataAutoSync); server.registerChannel('userDataAutoSync', userDataAutoSyncChannel); diff --git a/src/vs/platform/userDataSync/common/userDataAutoSync.ts b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts similarity index 98% rename from src/vs/platform/userDataSync/common/userDataAutoSync.ts rename to src/vs/platform/userDataSync/common/userDataAutoSyncService.ts index 636aab43f50..bbe40077d65 100644 --- a/src/vs/platform/userDataSync/common/userDataAutoSync.ts +++ b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts @@ -9,7 +9,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IUserDataSyncLogService, IUserDataSyncService, SyncStatus, IUserDataAuthTokenService, IUserDataAutoSyncService, IUserDataSyncUtilService, UserDataSyncError, UserDataSyncErrorCode, SyncSource } from 'vs/platform/userDataSync/common/userDataSync'; -export class UserDataAutoSync extends Disposable implements IUserDataAutoSyncService { +export class UserDataAutoSyncService extends Disposable implements IUserDataAutoSyncService { _serviceBrand: any; diff --git a/src/vs/platform/userDataSync/electron-browser/userDataAutoSync.ts b/src/vs/platform/userDataSync/electron-browser/userDataAutoSyncService.ts similarity index 88% rename from src/vs/platform/userDataSync/electron-browser/userDataAutoSync.ts rename to src/vs/platform/userDataSync/electron-browser/userDataAutoSyncService.ts index 6ca2e9085e3..2b5fdcaba9e 100644 --- a/src/vs/platform/userDataSync/electron-browser/userDataAutoSync.ts +++ b/src/vs/platform/userDataSync/electron-browser/userDataAutoSyncService.ts @@ -6,10 +6,10 @@ import { IUserDataSyncService, IUserDataSyncLogService, IUserDataAuthTokenService, IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync'; import { Event } from 'vs/base/common/event'; import { IElectronService } from 'vs/platform/electron/node/electron'; -import { UserDataAutoSync as BaseUserDataAutoSync } from 'vs/platform/userDataSync/common/userDataAutoSync'; +import { UserDataAutoSyncService as BaseUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -export class UserDataAutoSync extends BaseUserDataAutoSync { +export class UserDataAutoSyncService extends BaseUserDataAutoSyncService { constructor( @IUserDataSyncService userDataSyncService: IUserDataSyncService, diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataAutoSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataAutoSyncService.ts similarity index 89% rename from src/vs/workbench/contrib/userDataSync/browser/userDataAutoSync.ts rename to src/vs/workbench/contrib/userDataSync/browser/userDataAutoSyncService.ts index 2fd6b1ea03b..5e5b10448cd 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataAutoSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataAutoSyncService.ts @@ -6,12 +6,12 @@ import { IUserDataSyncService, IUserDataSyncLogService, IUserDataAuthTokenService, IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Event } from 'vs/base/common/event'; -import { UserDataAutoSync as BaseUserDataAutoSync } from 'vs/platform/userDataSync/common/userDataAutoSync'; +import { UserDataAutoSyncService as BaseUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { UserDataSyncTrigger } from 'vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger'; import { IHostService } from 'vs/workbench/services/host/browser/host'; -export class UserDataAutoSync extends BaseUserDataAutoSync { +export class UserDataAutoSyncService extends BaseUserDataAutoSyncService { constructor( @IUserDataSyncService userDataSyncService: IUserDataSyncService, diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 287f31dee48..20246b2d1ac 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -23,7 +23,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { isWeb } from 'vs/base/common/platform'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { UserDataAutoSync } from 'vs/workbench/contrib/userDataSync/browser/userDataAutoSync'; +import { UserDataAutoSyncService } from 'vs/workbench/contrib/userDataSync/browser/userDataAutoSyncService'; import { UserDataSyncTrigger } from 'vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger'; import { timeout } from 'vs/base/common/async'; import { IOutputService } from 'vs/workbench/contrib/output/common/output'; @@ -119,7 +119,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo this.registerActions(); this.initializeActiveAccount().then(_ => { if (isWeb) { - this._register(instantiationService.createInstance(UserDataAutoSync)); + this._register(instantiationService.createInstance(UserDataAutoSyncService)); } else { this._register(instantiationService.createInstance(UserDataSyncTrigger).onDidTriggerSync(() => userDataAutoSyncService.triggerAutoSync())); } diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 0719b361e00..28e0750d950 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -69,7 +69,7 @@ import { UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDa import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService'; import { SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync'; import { UserDataAuthTokenService } from 'vs/platform/userDataSync/common/userDataAuthTokenService'; -import { UserDataAutoSync } from 'vs/platform/userDataSync/common/userDataAutoSync'; +import { UserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService'; import { AccessibilityService } from 'vs/platform/accessibility/common/accessibilityService'; registerSingleton(IExtensionManagementService, ExtensionManagementService); @@ -82,7 +82,7 @@ registerSingleton(IAuthenticationService, AuthenticationService); registerSingleton(IUserDataSyncLogService, UserDataSyncLogService); registerSingleton(IUserDataSyncStoreService, UserDataSyncStoreService); registerSingleton(IUserDataAuthTokenService, UserDataAuthTokenService); -registerSingleton(IUserDataAutoSyncService, UserDataAutoSync); +registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService); registerSingleton(ISettingsSyncService, SettingsSynchroniser); registerSingleton(IUserDataSyncService, UserDataSyncService); From f11a0b9a2918a23bc8b74e95356ab9de2c39adcb Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Fri, 31 Jan 2020 15:09:52 -0800 Subject: [PATCH 038/624] Rename session displayName to accountName, closes #89807 --- src/vs/editor/common/modes.ts | 2 +- src/vs/vscode.proposed.d.ts | 2 +- .../userDataSync/browser/userDataSync.ts | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 44ced7e13a7..8438a570562 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1341,7 +1341,7 @@ export interface RenameProvider { export interface Session { id: string; accessToken: string; - displayName: string; + accountName: string; } export interface Command { diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 0d08385e27d..209ae8df9d0 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -21,7 +21,7 @@ declare module 'vscode' { export interface Session { id: string; accessToken: string; - displayName: string; + accountName: string; scopes: string[] } diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 20246b2d1ac..72115c36e8f 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -131,31 +131,31 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo } private async initializeActiveAccount(): Promise { - const accounts = await this.authenticationService.getSessions(this.userDataSyncStore!.authenticationProviderId); + const sessions = await this.authenticationService.getSessions(this.userDataSyncStore!.authenticationProviderId); // Auth provider has not yet been registered - if (!accounts) { + if (!sessions) { return; } - if (accounts.length === 0) { + if (sessions.length === 0) { this.activeAccount = undefined; return; } - if (accounts.length === 1) { - this.activeAccount = accounts[0]; + if (sessions.length === 1) { + this.activeAccount = sessions[0]; return; } - const selectedAccount = await this.quickInputService.pick(accounts.map(account => { + const selectedAccount = await this.quickInputService.pick(sessions.map(session => { return { - id: account.id, - label: account.displayName + id: session.id, + label: session.accountName }; }), { canPickMany: false }); if (selectedAccount) { - this.activeAccount = accounts.filter(account => selectedAccount.id === account.id)[0]; + this.activeAccount = sessions.filter(account => selectedAccount.id === account.id)[0]; } } From f4786e227cd73bd4af3e3b5d7957d203ace59b44 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Fri, 31 Jan 2020 15:52:57 -0800 Subject: [PATCH 039/624] Expose authentication provider registartion/unregistration as single event, fixes #89806 --- src/vs/vscode.proposed.d.ts | 23 +++++++++++++++++-- .../workbench/api/common/extHost.api.impl.ts | 7 ++---- .../api/common/extHostAuthentication.ts | 11 ++++----- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 209ae8df9d0..73f79fd819e 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -25,6 +25,21 @@ declare module 'vscode' { scopes: string[] } + /** + * An [event](#Event) which fires when an [AuthenticationProvider](#AuthenticationProvider) is added or removed. + */ + export interface AuthenticationProvidersChangeEvent { + /** + * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added. + */ + readonly added: string[]; + + /** + * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.. + */ + readonly removed: string[]; + } + export interface AuthenticationProvider { /** * Used as an identifier for extensions trying to work with a particular @@ -33,6 +48,11 @@ declare module 'vscode' { */ readonly id: string; readonly displayName: string; + + /** + * A [enent](#Event) which fires when the array of sessions has changed, or data + * within a session has changed. + */ readonly onDidChangeSessions: Event; /** @@ -53,8 +73,7 @@ declare module 'vscode' { /** * Fires with the provider id that was registered or unregistered. */ - export const onDidRegisterAuthenticationProvider: Event; - export const onDidUnregisterAuthenticationProvider: Event; + export const onDidChangeAuthenticationProviders: Event; export const providers: ReadonlyArray; } diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 91045fcda6c..897af14d451 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -188,11 +188,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I get providers() { return extHostAuthentication.providers(extension); }, - get onDidRegisterAuthenticationProvider() { - return extHostAuthentication.onDidRegisterAuthenticationProvider; - }, - get onDidUnregisterAuthenticationProvider() { - return extHostAuthentication.onDidUnregisterAuthenticationProvider; + get onDidChangeAuthenticationProviders(): Event { + return extHostAuthentication.onDidChangeAuthenticationProviders; } }; diff --git a/src/vs/workbench/api/common/extHostAuthentication.ts b/src/vs/workbench/api/common/extHostAuthentication.ts index c4518b0a407..326610264f7 100644 --- a/src/vs/workbench/api/common/extHostAuthentication.ts +++ b/src/vs/workbench/api/common/extHostAuthentication.ts @@ -55,11 +55,8 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { private _proxy: MainThreadAuthenticationShape; private _authenticationProviders: Map = new Map(); - private _onDidRegisterAuthenticationProvider = new Emitter(); - readonly onDidRegisterAuthenticationProvider: Event = this._onDidRegisterAuthenticationProvider.event; - - private _onDidUnregisterAuthenticationProvider = new Emitter(); - readonly onDidUnregisterAuthenticationProvider: Event = this._onDidUnregisterAuthenticationProvider.event; + private _onDidChangeAuthenticationProviders = new Emitter(); + readonly onDidChangeAuthenticationProviders: Event = this._onDidChangeAuthenticationProviders.event; constructor(mainContext: IMainContext) { this._proxy = mainContext.getProxy(MainContext.MainThreadAuthentication); @@ -83,13 +80,13 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { }); this._proxy.$registerAuthenticationProvider(provider.id, provider.displayName); - this._onDidRegisterAuthenticationProvider.fire(provider.id); + this._onDidChangeAuthenticationProviders.fire({ added: [provider.id], removed: [] }); return new Disposable(() => { listener.dispose(); this._authenticationProviders.delete(provider.id); this._proxy.$unregisterAuthenticationProvider(provider.id); - this._onDidUnregisterAuthenticationProvider.fire(provider.id); + this._onDidChangeAuthenticationProviders.fire({ added: [], removed: [provider.id] }); }); } From da4aafa73f2f9ecde2d063c748c2bd0a1e383c2c Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 31 Jan 2020 15:55:09 -0800 Subject: [PATCH 040/624] Fix microsoft/monaco-editor#1797. --- src/vs/editor/common/config/editorOptions.ts | 6 +++--- src/vs/monaco.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index e9df917949b..b10bc840c76 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -74,7 +74,7 @@ export interface IEditorOptions { * If it is a function, it will be invoked when rendering a line number and the return value will be rendered. * Otherwise, if it is a truey, line numbers will be rendered normally (equivalent of using an identity function). * Otherwise, line numbers will not be rendered. - * Defaults to true. + * Defaults to `on`. */ lineNumbers?: LineNumbersType; /** @@ -385,8 +385,8 @@ export interface IEditorOptions { */ autoSurround?: EditorAutoSurroundStrategy; /** - * Enable auto indentation adjustment. - * Defaults to false. + * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines. + * Defaults to advanced. */ autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; /** diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 24b9c882113..cbe0e969cc4 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2865,8 +2865,8 @@ declare namespace monaco.editor { */ autoSurround?: EditorAutoSurroundStrategy; /** - * Enable auto indentation adjustment. - * Defaults to false. + * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines. + * Defaults to advanced. */ autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; /** From 6054af390c2f9f0e68e317df6185f8a1d35ea3d8 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 31 Jan 2020 16:40:06 -0800 Subject: [PATCH 041/624] Update comment. --- src/vs/monaco.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index cbe0e969cc4..35f5ded808f 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2554,7 +2554,7 @@ declare namespace monaco.editor { * If it is a function, it will be invoked when rendering a line number and the return value will be rendered. * Otherwise, if it is a truey, line numbers will be rendered normally (equivalent of using an identity function). * Otherwise, line numbers will not be rendered. - * Defaults to true. + * Defaults to `on`. */ lineNumbers?: LineNumbersType; /** From 9e69751c92376e5cef1623923c5ab626d0cd4a49 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 31 Jan 2020 16:40:31 -0800 Subject: [PATCH 042/624] Fix microsoft/monaco-editor#1782. --- src/vs/editor/browser/controller/textAreaInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts index 1c2e190f66c..2bb542b4deb 100644 --- a/src/vs/editor/browser/controller/textAreaInput.ts +++ b/src/vs/editor/browser/controller/textAreaInput.ts @@ -331,7 +331,7 @@ export class TextAreaInput extends Disposable { this._onType.fire(typeInput); } } else { - if (typeInput.text !== '') { + if (typeInput.text !== '' || typeInput.replaceCharCnt !== 0) { this._firePaste(typeInput.text, null); } this._nextCommand = ReadFromTextArea.Type; From c4309702c525d61b34bb6403a121a0595a473974 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 31 Jan 2020 16:52:47 -0800 Subject: [PATCH 043/624] Don't take the global find clipboard text when focusing during search Fix #88452 --- src/vs/workbench/contrib/search/browser/searchView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 61e407deeaa..08ec6023f3e 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1297,7 +1297,7 @@ export class SearchView extends ViewPane { this.onQueryTriggered(query, options, excludePatternText, includePatternText, triggeredOnType); if (!preserveFocus) { - this.searchWidget.focus(false); // focus back to input field + this.searchWidget.focus(false, undefined, true); // focus back to input field } }, onQueryValidationError); } From 88de8131ee57693b9e01a689c204a8be1247f3b6 Mon Sep 17 00:00:00 2001 From: Paul Oppenheimer Date: Sat, 1 Feb 2020 12:19:54 -0500 Subject: [PATCH 044/624] Rename "Contributions" to "Feature Contributions" Fix #89753 --- .../workbench/contrib/extensions/browser/extensionEditor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index c3dd4df0b90..71a3b1a6d66 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -126,7 +126,7 @@ class NavBar extends Disposable { const NavbarSection = { Readme: 'readme', - Contributions: 'contributions', + FeatureContributions: 'contributions', Changelog: 'changelog', Dependencies: 'dependencies', ExtensionPack: 'extensionPack' @@ -438,7 +438,7 @@ export class ExtensionEditor extends BaseEditor { template.navbar.push(NavbarSection.ExtensionPack, localize('extensionPack', "Extension Pack"), localize('extensionsPack', "Set of extensions that can be installed together")); } if (manifest && manifest.contributes) { - template.navbar.push(NavbarSection.Contributions, localize('contributions', "Contributions"), localize('contributionstooltip', "Lists contributions to VS Code by this extension")); + template.navbar.push(NavbarSection.FeatureContributions, localize('contributions', "Feature Contributions"), localize('contributionstooltip', "Lists contributions to VS Code by this extension")); } if (extension.hasChangelog()) { template.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"), localize('changelogtooltip', "Extension update history, rendered from the extension's 'CHANGELOG.md' file")); @@ -565,7 +565,7 @@ export class ExtensionEditor extends BaseEditor { private open(id: string, extension: IExtension, template: IExtensionEditorTemplate): Promise { switch (id) { case NavbarSection.Readme: return this.openReadme(template); - case NavbarSection.Contributions: return this.openContributions(template); + case NavbarSection.FeatureContributions: return this.openContributions(template); case NavbarSection.Changelog: return this.openChangelog(template); case NavbarSection.Dependencies: return this.openDependencies(extension, template); case NavbarSection.ExtensionPack: return this.openExtensionPack(extension, template); From 50a7443ae8889e64a5f3b46b39e2ff52af3c79ab Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Sun, 2 Feb 2020 09:47:11 -0800 Subject: [PATCH 045/624] Doc consistency --- src/vs/editor/common/config/editorOptions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index b10bc840c76..07200e8eb33 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2751,7 +2751,7 @@ class EditorSuggest extends BaseEditorOption Date: Sun, 2 Feb 2020 14:38:39 -0500 Subject: [PATCH 046/624] Fixes #89857 --- src/vs/workbench/contrib/scm/browser/repositoryPane.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/scm/browser/repositoryPane.ts b/src/vs/workbench/contrib/scm/browser/repositoryPane.ts index 41e20df5115..3e01e03f569 100644 --- a/src/vs/workbench/contrib/scm/browser/repositoryPane.ts +++ b/src/vs/workbench/contrib/scm/browser/repositoryPane.ts @@ -769,7 +769,12 @@ export class RepositoryPane extends ViewPane { // Keep model in sync with API this.inputModel.setValue(this.repository.input.value); - this._register(this.repository.input.onDidChange(value => this.inputModel.setValue(value))); + this._register(this.repository.input.onDidChange(value => { + if (value === this.inputModel.getValue()) { + return; + } + this.inputModel.setValue(value); + })); // Keep API in sync with model and update placeholder and validation toggleClass(placeholderTextContainer, 'hidden', this.inputModel.getValueLength() > 0); From 082266298c6cc8c9c4283b6d3dd761edefffa489 Mon Sep 17 00:00:00 2001 From: Gustavo Cassel Date: Sun, 2 Feb 2020 19:32:27 -0300 Subject: [PATCH 047/624] Developed setting 'mouseOpensDefinitionInPeek' which controls whether the mouse click opens element definition in the peek widget. --- src/vs/editor/common/config/editorOptions.ts | 10 ++ .../common/standalone/standaloneEnums.ts | 89 ++++++++--------- .../link/goToDefinitionAtPosition.ts | 4 +- src/vs/monaco.d.ts | 95 ++++++++++--------- 4 files changed, 109 insertions(+), 89 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index e9df917949b..a436c18203d 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -555,6 +555,11 @@ export interface IEditorOptions { * Defaults to false. */ peekWidgetDefaultFocus?: 'tree' | 'editor'; + /** + * Controls whether the mouse click opens element definition in the peek widget. + * Defaults to false. + */ + mouseOpensDefinitionInPeek?: boolean; } export interface IEditorConstructionOptions extends IEditorOptions { @@ -3192,6 +3197,7 @@ export const enum EditorOption { overviewRulerLanes, parameterHints, peekWidgetDefaultFocus, + mouseOpensDefinitionInPeek, quickSuggestions, quickSuggestionsDelay, readOnly, @@ -3583,6 +3589,10 @@ export const EditorOptions = { description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.") } )), + mouseOpensDefinitionInPeek: register(new EditorBooleanOption( + EditorOption.mouseOpensDefinitionInPeek, 'mouseOpensDefinitionInPeek', false, + { description: nls.localize('mouseOpensDefinitionInPeek', "Controls whether the mouse click opens element definition in the peek widget.") } + )), quickSuggestions: register(new EditorQuickSuggestions()), quickSuggestionsDelay: register(new EditorIntOption( EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay', diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index a828c6bd946..919c871a8c1 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -231,50 +231,51 @@ export enum EditorOption { overviewRulerLanes = 63, parameterHints = 64, peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - semanticHighlighting = 84, - showFoldingControls = 85, - showUnused = 86, - snippetSuggestions = 87, - smoothScrolling = 88, - stopRenderingLineAfter = 89, - suggest = 90, - suggestFontSize = 91, - suggestLineHeight = 92, - suggestOnTriggerCharacters = 93, - suggestSelection = 94, - tabCompletion = 95, - useTabStops = 96, - wordSeparators = 97, - wordWrap = 98, - wordWrapBreakAfterCharacters = 99, - wordWrapBreakBeforeCharacters = 100, - wordWrapColumn = 101, - wordWrapMinified = 102, - wrappingIndent = 103, - wrappingStrategy = 104, - editorClassName = 105, - pixelRatio = 106, - tabFocusMode = 107, - layoutInfo = 108, - wrappingInfo = 109 + mouseOpensDefinitionInPeek = 66, + quickSuggestions = 67, + quickSuggestionsDelay = 68, + readOnly = 69, + renderControlCharacters = 70, + renderIndentGuides = 71, + renderFinalNewline = 72, + renderLineHighlight = 73, + renderValidationDecorations = 74, + renderWhitespace = 75, + revealHorizontalRightPadding = 76, + roundedSelection = 77, + rulers = 78, + scrollbar = 79, + scrollBeyondLastColumn = 80, + scrollBeyondLastLine = 81, + selectionClipboard = 82, + selectionHighlight = 83, + selectOnLineNumbers = 84, + semanticHighlighting = 85, + showFoldingControls = 86, + showUnused = 87, + snippetSuggestions = 88, + smoothScrolling = 89, + stopRenderingLineAfter = 90, + suggest = 91, + suggestFontSize = 92, + suggestLineHeight = 93, + suggestOnTriggerCharacters = 94, + suggestSelection = 95, + tabCompletion = 96, + useTabStops = 97, + wordSeparators = 98, + wordWrap = 99, + wordWrapBreakAfterCharacters = 100, + wordWrapBreakBeforeCharacters = 101, + wordWrapColumn = 102, + wordWrapMinified = 103, + wrappingIndent = 104, + wrappingStrategy = 105, + editorClassName = 106, + pixelRatio = 107, + tabFocusMode = 108, + layoutInfo = 109, + wrappingInfo = 110 } /** diff --git a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts index d3678e527d9..b609be4291e 100644 --- a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts +++ b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts @@ -27,6 +27,7 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro import { Position } from 'vs/editor/common/core/position'; import { withNullAsUndefined } from 'vs/base/common/types'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { EditorOption } from 'vs/editor/common/config/editorOptions'; export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution { @@ -334,7 +335,8 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri private gotoDefinition(position: Position, openToSide: boolean): Promise { this.editor.setPosition(position); - const action = new DefinitionAction({ openToSide, openInPeek: false, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined }); + const openInPeek = this.editor.getOption(EditorOption.mouseOpensDefinitionInPeek); + const action = new DefinitionAction({ openToSide, openInPeek: openInPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined }); return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor)); } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 24b9c882113..84522b4c21d 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3035,6 +3035,11 @@ declare namespace monaco.editor { * Defaults to false. */ peekWidgetDefaultFocus?: 'tree' | 'editor'; + /** + * Controls whether the mouse click opens element definition in the peek widget. + * Defaults to false. + */ + mouseOpensDefinitionInPeek?: boolean; } export interface IEditorConstructionOptions extends IEditorOptions { @@ -3761,50 +3766,51 @@ declare namespace monaco.editor { overviewRulerLanes = 63, parameterHints = 64, peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - semanticHighlighting = 84, - showFoldingControls = 85, - showUnused = 86, - snippetSuggestions = 87, - smoothScrolling = 88, - stopRenderingLineAfter = 89, - suggest = 90, - suggestFontSize = 91, - suggestLineHeight = 92, - suggestOnTriggerCharacters = 93, - suggestSelection = 94, - tabCompletion = 95, - useTabStops = 96, - wordSeparators = 97, - wordWrap = 98, - wordWrapBreakAfterCharacters = 99, - wordWrapBreakBeforeCharacters = 100, - wordWrapColumn = 101, - wordWrapMinified = 102, - wrappingIndent = 103, - wrappingStrategy = 104, - editorClassName = 105, - pixelRatio = 106, - tabFocusMode = 107, - layoutInfo = 108, - wrappingInfo = 109 + mouseOpensDefinitionInPeek = 66, + quickSuggestions = 67, + quickSuggestionsDelay = 68, + readOnly = 69, + renderControlCharacters = 70, + renderIndentGuides = 71, + renderFinalNewline = 72, + renderLineHighlight = 73, + renderValidationDecorations = 74, + renderWhitespace = 75, + revealHorizontalRightPadding = 76, + roundedSelection = 77, + rulers = 78, + scrollbar = 79, + scrollBeyondLastColumn = 80, + scrollBeyondLastLine = 81, + selectionClipboard = 82, + selectionHighlight = 83, + selectOnLineNumbers = 84, + semanticHighlighting = 85, + showFoldingControls = 86, + showUnused = 87, + snippetSuggestions = 88, + smoothScrolling = 89, + stopRenderingLineAfter = 90, + suggest = 91, + suggestFontSize = 92, + suggestLineHeight = 93, + suggestOnTriggerCharacters = 94, + suggestSelection = 95, + tabCompletion = 96, + useTabStops = 97, + wordSeparators = 98, + wordWrap = 99, + wordWrapBreakAfterCharacters = 100, + wordWrapBreakBeforeCharacters = 101, + wordWrapColumn = 102, + wordWrapMinified = 103, + wrappingIndent = 104, + wrappingStrategy = 105, + editorClassName = 106, + pixelRatio = 107, + tabFocusMode = 108, + layoutInfo = 109, + wrappingInfo = 110 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3873,6 +3879,7 @@ declare namespace monaco.editor { overviewRulerLanes: IEditorOption; parameterHints: IEditorOption; peekWidgetDefaultFocus: IEditorOption; + mouseOpensDefinitionInPeek: IEditorOption; quickSuggestions: IEditorOption; quickSuggestionsDelay: IEditorOption; readOnly: IEditorOption; From 39e290dbbc25a5b6214913172c9d7f10fb8a7880 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 3 Feb 2020 09:36:08 +0100 Subject: [PATCH 048/624] Fix #89796 --- test/automation/src/problems.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/automation/src/problems.ts b/test/automation/src/problems.ts index 8cabe8e320b..2e20731f76b 100644 --- a/test/automation/src/problems.ts +++ b/test/automation/src/problems.ts @@ -12,7 +12,7 @@ export const enum ProblemSeverity { export class Problems { - static PROBLEMS_VIEW_SELECTOR = '.panel.markers-panel'; + static PROBLEMS_VIEW_SELECTOR = '.panel .markers-panel'; constructor(private code: Code) { } From d6eb50caa4963df0e1ac0f6c87214ec4d1a1c491 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 3 Feb 2020 09:38:03 +0100 Subject: [PATCH 049/624] Smoke-Test: Hot-exit / dataloss tests broken (#89905) * smoke test - carefuly select untitled content based on file name to find it properly * Fileservice: mkdirp() logic is prone to errors from race conditions (fixes #89834) --- src/vs/platform/files/common/fileService.ts | 17 +++++++- .../files/test/node/diskFileService.test.ts | 43 ++++++++++++++++++- .../src/areas/workbench/data-loss.test.ts | 2 +- .../areas/workbench/data-migration.test.ts | 2 +- 4 files changed, 60 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts index 9e95c4a9020..f20db0fdc87 100644 --- a/src/vs/platform/files/common/fileService.ts +++ b/src/vs/platform/files/common/fileService.ts @@ -752,7 +752,22 @@ export class FileService extends Disposable implements IFileService { // Create directories as needed for (let i = directoriesToCreate.length - 1; i >= 0; i--) { directory = joinPath(directory, directoriesToCreate[i]); - await provider.mkdir(directory); + + try { + await provider.mkdir(directory); + } catch (error) { + if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileExists) { + // For mkdirp() we tolerate that the mkdir() call fails + // in case the folder already exists. This follows node.js + // own implementation of fs.mkdir({ recursive: true }) and + // reduces the chances of race conditions leading to errors + // if multiple calls try to create the same folders + // As such, we only throw an error here if it is other than + // the fact that the file already exists. + // (see also https://github.com/microsoft/vscode/issues/89834) + throw error; + } + } } } diff --git a/src/vs/platform/files/test/node/diskFileService.test.ts b/src/vs/platform/files/test/node/diskFileService.test.ts index 39ec15a577f..8c3ae0bef46 100644 --- a/src/vs/platform/files/test/node/diskFileService.test.ts +++ b/src/vs/platform/files/test/node/diskFileService.test.ts @@ -19,7 +19,7 @@ import { FileOperation, FileOperationEvent, IFileStat, FileOperationResult, File import { NullLogService } from 'vs/platform/log/common/log'; import { isLinux, isWindows } from 'vs/base/common/platform'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; +import { isEqual, joinPath } from 'vs/base/common/resources'; import { VSBuffer, VSBufferReadable, streamToBufferReadableStream, VSBufferReadableStream, bufferToReadable, bufferToStream, streamToBuffer } from 'vs/base/common/buffer'; import { find } from 'vs/base/common/arrays'; @@ -1867,6 +1867,47 @@ suite('Disk File Service', function () { assert.ok(!error); }); + test('writeFile - no error when writing to same non-existing folder multiple times different new files', async () => { + const newFolder = URI.file(join(testDir, 'some', 'new', 'folder')); + + const file1 = joinPath(newFolder, 'file-1'); + const file2 = joinPath(newFolder, 'file-2'); + const file3 = joinPath(newFolder, 'file-3'); + + // this essentially verifies that the mkdirp logic implemented + // in the file service is able to receive multiple requests for + // the same folder and will not throw errors if another racing + // call succeeded first. + const newContent = 'Updates to the small file'; + await Promise.all([ + service.writeFile(file1, VSBuffer.fromString(newContent)), + service.writeFile(file2, VSBuffer.fromString(newContent)), + service.writeFile(file3, VSBuffer.fromString(newContent)) + ]); + + assert.ok(service.exists(file1)); + assert.ok(service.exists(file2)); + assert.ok(service.exists(file3)); + }); + + test('writeFile - error when writing to folder that is a file', async () => { + const existingFile = URI.file(join(testDir, 'my-file')); + + await service.createFile(existingFile); + + const newFile = joinPath(existingFile, 'file-1'); + + let error; + const newContent = 'Updates to the small file'; + try { + await service.writeFile(newFile, VSBuffer.fromString(newContent)); + } catch (e) { + error = e; + } + + assert.ok(error); + }); + const runWatchTests = isLinux; (runWatchTests ? test : test.skip)('watch - file', done => { diff --git a/test/smoke/src/areas/workbench/data-loss.test.ts b/test/smoke/src/areas/workbench/data-loss.test.ts index a6cc6577675..cb049e59ad3 100644 --- a/test/smoke/src/areas/workbench/data-loss.test.ts +++ b/test/smoke/src/areas/workbench/data-loss.test.ts @@ -12,7 +12,7 @@ export function setup() { await app.workbench.editors.newUntitledFile(); const untitled = 'Untitled-1'; - const textToTypeInUntitled = 'Hello, Untitled Code'; + const textToTypeInUntitled = untitled; await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled); const readmeMd = 'readme.md'; diff --git a/test/smoke/src/areas/workbench/data-migration.test.ts b/test/smoke/src/areas/workbench/data-migration.test.ts index 7e9fb9cc68e..e455105ed4d 100644 --- a/test/smoke/src/areas/workbench/data-migration.test.ts +++ b/test/smoke/src/areas/workbench/data-migration.test.ts @@ -66,7 +66,7 @@ export function setup(stableCodePath: string, testDataPath: string) { await stableApp.workbench.editors.newUntitledFile(); const untitled = 'Untitled-1'; - const textToTypeInUntitled = 'Hello, Untitled Code'; + const textToTypeInUntitled = untitled; await stableApp.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled); const readmeMd = 'readme.md'; From c48988365b72d261179adbd283fb6341482daa11 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 3 Feb 2020 10:38:09 +0100 Subject: [PATCH 050/624] Fixes #89675: Simplify logic for horizontal positioning --- .../contentWidgets/contentWidgets.ts | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts index 92f0ba71d28..c22e5e84ad0 100644 --- a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts +++ b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts @@ -317,28 +317,8 @@ class Widget { private _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] { // Initially, the limits are defined as the dom node limits - let MIN_LIMIT = domNodePosition.left; - let MAX_LIMIT = domNodePosition.left + domNodePosition.width - 20; - if (MAX_LIMIT - MIN_LIMIT < width) { - // If the width is too large, we must expand the limits - const delta1 = Math.ceil((width - (MAX_LIMIT - MIN_LIMIT)) / 2); - MIN_LIMIT -= delta1; - MAX_LIMIT += delta1; - - if (MAX_LIMIT > windowSize.width) { - // But we need to make sure we haven't expanded the limits over the page width - const delta2 = MAX_LIMIT - windowSize.width; - MIN_LIMIT -= delta2; - MAX_LIMIT -= delta2; - } - - if (MIN_LIMIT < 0) { - // And we need to make sure we haven't expanded them before the page - const delta3 = -MIN_LIMIT; - MIN_LIMIT += delta3; - MAX_LIMIT += delta3; - } - } + const MIN_LIMIT = Math.max(0, domNodePosition.left - width); + const MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width); let absoluteLeft = domNodePosition.left + left - dom.StandardWindow.scrollX; From 547cf4e81f1262042915dcf7494ab03b5030b15e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 3 Feb 2020 02:26:55 -0800 Subject: [PATCH 051/624] Run smoke tests against actual build (#83799) * Run web against actual server Part of #80308 * Fix strict null check errors * Fix folder arg * Disable unit tests and integration tests temporarily * Allow running on node 12 * Fix smoke test condition * Disable continue on error * Add web to server dir * fix smoke test to use build for web * enable in product build Co-authored-by: Benjamin Pasero --- .../darwin/product-build-darwin.yml | 20 ++--- test/automation/src/puppeteerDriver.ts | 10 ++- test/smoke/src/main.ts | 88 +++++++++++-------- 3 files changed, 70 insertions(+), 48 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 273a728927f..50c85822a53 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -114,16 +114,16 @@ steps: displayName: Run integration tests condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) -# Web Smoke Tests disabled due to https://github.com/microsoft/vscode/issues/80308 -# - script: | -# set -e -# cd test/smoke -# yarn compile -# cd - -# yarn smoketest --web --headless -# continueOnError: true -# displayName: Run web smoke tests -# condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) +- script: | + set -e + cd test/smoke + yarn compile + cd - + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \ + yarn smoketest --web --headless + continueOnError: true + displayName: Run web smoke tests + condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e diff --git a/test/automation/src/puppeteerDriver.ts b/test/automation/src/puppeteerDriver.ts index 40fd699b6d3..73a118b6043 100644 --- a/test/automation/src/puppeteerDriver.ts +++ b/test/automation/src/puppeteerDriver.ts @@ -98,8 +98,14 @@ export async function launch(_args: string[]): Promise { VSCODE_AGENT_FOLDER: agentFolder, ...process.env }; + let serverLocation: string | undefined; + if (process.env.VSCODE_REMOTE_SERVER_PATH) { + serverLocation = join(process.env.VSCODE_REMOTE_SERVER_PATH, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`); + } else { + serverLocation = join(args[0], `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`); + } server = spawn( - join(args[0], `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`), + serverLocation, ['--browser', 'none', '--driver', 'web'], { env } ); @@ -140,7 +146,7 @@ export function connect(headless: boolean, outPath: string, handle: string): Pro }); const page = (await browser.pages())[0]; await page.setViewport({ width, height }); - await page.goto(`${endpoint}&folder=${args![1]}`); + await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${args![1]}`); const result = { client: { dispose: () => teardown }, driver: buildDriver(browser, page) diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 0e34ec32cd9..1d84795e1b9 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -37,8 +37,8 @@ import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.te import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test'; import { setup as setupLaunchTests } from './areas/workbench/launch.test'; -if (!/^v10/.test(process.version)) { - console.error('Error: Smoketest must be run using Node 10. Currently running', process.version); +if (!/^v10/.test(process.version) && !/^v12/.test(process.version)) { + console.error('Error: Smoketest must be run using Node 10/12. Currently running', process.version); process.exit(1); } @@ -73,7 +73,6 @@ const extensionsPath = path.join(testDataPath, 'extensions-dir'); mkdirp.sync(extensionsPath); const screenshotsPath = opts.screenshots ? path.resolve(opts.screenshots) : null; - if (screenshotsPath) { mkdirp.sync(screenshotsPath); } @@ -83,10 +82,6 @@ function fail(errorMessage): void { process.exit(1); } -if (parseInt(process.version.substr(1)) < 6) { - fail('Please update your Node version to greater than 6 to run the smoke test.'); -} - const repoPath = path.join(__dirname, '..', '..', '..'); function getDevElectronPath(): string { @@ -122,44 +117,65 @@ function getBuildElectronPath(root: string): string { } } -let testCodePath = opts.build; -let stableCodePath = opts['stable-build']; -let electronPath: string; -let stablePath: string | undefined = undefined; +let quality: Quality; -if (testCodePath) { - electronPath = getBuildElectronPath(testCodePath); +if (!opts.web) { + let testCodePath = opts.build; + let stableCodePath = opts['stable-build']; + let electronPath: string; + let stablePath: string | undefined = undefined; - if (stableCodePath) { - stablePath = getBuildElectronPath(stableCodePath); + if (testCodePath) { + electronPath = getBuildElectronPath(testCodePath); + + if (stableCodePath) { + stablePath = getBuildElectronPath(stableCodePath); + } + } else { + testCodePath = getDevElectronPath(); + electronPath = testCodePath; + process.env.VSCODE_REPOSITORY = repoPath; + process.env.VSCODE_DEV = '1'; + process.env.VSCODE_CLI = '1'; + } + + if (!fs.existsSync(electronPath || '')) { + fail(`Can't find VSCode at ${electronPath}.`); + } + + if (typeof stablePath === 'string' && !fs.existsSync(stablePath)) { + fail(`Can't find Stable VSCode at ${stablePath}.`); + } + + if (process.env.VSCODE_DEV === '1') { + quality = Quality.Dev; + } else if (electronPath.indexOf('Code - Insiders') >= 0 /* macOS/Windows */ || electronPath.indexOf('code-insiders') /* Linux */ >= 0) { + quality = Quality.Insiders; + } else { + quality = Quality.Stable; } } else { - testCodePath = getDevElectronPath(); - electronPath = testCodePath; - process.env.VSCODE_REPOSITORY = repoPath; - process.env.VSCODE_DEV = '1'; - process.env.VSCODE_CLI = '1'; -} + let testCodeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH; -if (!opts.web && !fs.existsSync(electronPath || '')) { - fail(`Can't find Code at ${electronPath}.`); -} + if (typeof testCodeServerPath === 'string' && !fs.existsSync(testCodeServerPath)) { + fail(`Can't find Code server at ${testCodeServerPath}.`); + } -if (typeof stablePath === 'string' && !fs.existsSync(stablePath)) { - fail(`Can't find Stable Code at ${stablePath}.`); + if (!testCodeServerPath) { + process.env.VSCODE_REPOSITORY = repoPath; + process.env.VSCODE_DEV = '1'; + process.env.VSCODE_CLI = '1'; + } + + if (process.env.VSCODE_DEV === '1') { + quality = Quality.Dev; + } else { + quality = Quality.Insiders; + } } const userDataDir = path.join(testDataPath, 'd'); -let quality: Quality; -if (process.env.VSCODE_DEV === '1') { - quality = Quality.Dev; -} else if (electronPath.indexOf('Code - Insiders') >= 0 /* macOS/Windows */ || electronPath.indexOf('code-insiders') /* Linux */ >= 0) { - quality = Quality.Insiders; -} else { - quality = Quality.Stable; -} - async function setupRepository(): Promise { if (opts['test-repo']) { console.log('*** Copying test project repository:', opts['test-repo']); @@ -246,7 +262,7 @@ after(async function () { }); if (!opts.web) { - setupDataMigrationTests(stableCodePath, testDataPath); + setupDataMigrationTests(opts['stable-build'], testDataPath); } describe('Running Code', () => { From 2b235f9571290761f43b49ecf5744a3204735f16 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 11:29:05 +0100 Subject: [PATCH 052/624] fix lint errors --- src/vs/vscode.proposed.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 574893c1218..6acc107f76e 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -152,6 +152,8 @@ declare module 'vscode' { /** * Fired when the list of tunnels has changed. */ + // TODO@alexr + // eslint-disable-next-line vscode-dts-event-naming export const onDidTunnelsChange: Event; } @@ -163,6 +165,8 @@ declare module 'vscode' { export interface ResourceLabelFormatting { label: string; // myLabel:/${path} + // TODO@isi + // eslint-disable-next-line vscode-dts-literal-or-types separator: '/' | '\\' | ''; tildify?: boolean; normalizeDriveLetter?: boolean; @@ -1222,6 +1226,8 @@ declare module 'vscode' { /** * Event triggered by extensions to signal to VS Code that an edit has occurred. */ + // TODO@matt + // eslint-disable-next-line vscode-dts-event-naming readonly onEdit: Event<{ readonly resource: Uri, readonly edit: EditType }>; /** From 6a8dc7ad4fc3996cbfecc1cf2cf6f3ed1479ce38 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 3 Feb 2020 11:33:39 +0100 Subject: [PATCH 053/624] fix #75861 (#89908) --- src/vs/workbench/electron-browser/window.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index 07f56351ccc..4f502198c5b 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -612,10 +612,18 @@ export class ElectronWindow extends Disposable { // are closed that the user wants to wait for. When this happens we delete // the wait marker file to signal to the outside that editing is done. const listener = this.editorService.onDidCloseEditor(async event => { - const closedResource = toResource(event.editor, { supportSideBySide: SideBySideEditor.MASTER }); + const detailsResource = toResource(event.editor, { supportSideBySide: SideBySideEditor.DETAILS }); + const masterResource = toResource(event.editor, { supportSideBySide: SideBySideEditor.MASTER }); - // Remove from resources to wait for - resourcesToWaitFor = resourcesToWaitFor.filter(resourceToWaitFor => !isEqual(closedResource, resourceToWaitFor)); + // Remove from resources to wait for based on the + // resources from editors that got closed + resourcesToWaitFor = resourcesToWaitFor.filter(resourceToWaitFor => { + if (isEqual(resourceToWaitFor, masterResource) || isEqual(resourceToWaitFor, detailsResource)) { + return false; // remove - the closing editor matches this resource + } + + return true; // keep - not yet closed + }); if (resourcesToWaitFor.length === 0) { // If auto save is configured with the default delay (1s) it is possible From 4fac3e22c5d4084fdb97a5c859596dca9d37177b Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 3 Feb 2020 11:49:00 +0100 Subject: [PATCH 054/624] remove the timeout --- test/smoke/src/areas/css/css.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/smoke/src/areas/css/css.test.ts b/test/smoke/src/areas/css/css.test.ts index 454f6eed9e8..aa6ccb9590b 100644 --- a/test/smoke/src/areas/css/css.test.ts +++ b/test/smoke/src/areas/css/css.test.ts @@ -28,9 +28,6 @@ export function setup() { }); it('verifies that warning becomes an error once setting changed', async function () { - // settings might take a while to update? - this.timeout(40000); - const app = this.app as Application; await app.workbench.settingsEditor.addUserSetting('css.lint.emptyRules', '"error"'); await app.workbench.quickopen.openFile('style.css'); From 186a5bfe694f90351ab0665cdb594acd5f39cd9d Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 11:49:22 +0100 Subject: [PATCH 055/624] fix #89499 --- src/vs/editor/browser/services/bulkEditService.ts | 2 ++ src/vs/editor/contrib/rename/rename.ts | 2 +- src/vs/editor/standalone/browser/simpleServices.ts | 4 ++++ src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/services/bulkEditService.ts b/src/vs/editor/browser/services/bulkEditService.ts index d7d1ad70417..3d18020da6f 100644 --- a/src/vs/editor/browser/services/bulkEditService.ts +++ b/src/vs/editor/browser/services/bulkEditService.ts @@ -27,6 +27,8 @@ export type IBulkEditPreviewHandler = (edit: WorkspaceEdit, options?: IBulkEditO export interface IBulkEditService { _serviceBrand: undefined; + hasPreviewHandler(): boolean; + setPreviewHandler(handler: IBulkEditPreviewHandler): IDisposable; apply(edit: WorkspaceEdit, options?: IBulkEditOptions): Promise; diff --git a/src/vs/editor/contrib/rename/rename.ts b/src/vs/editor/contrib/rename/rename.ts index e39a0949664..28aba650e6a 100644 --- a/src/vs/editor/contrib/rename/rename.ts +++ b/src/vs/editor/contrib/rename/rename.ts @@ -179,7 +179,7 @@ class RenameController implements IEditorContribution { selectionEnd = Math.min(loc.range.endColumn, selection.endColumn) - loc.range.startColumn; } - const supportPreview = this._configService.getValue(this.editor.getModel().uri, 'editor.rename.enablePreview'); + const supportPreview = this._bulkEditService.hasPreviewHandler() && this._configService.getValue(this.editor.getModel().uri, 'editor.rename.enablePreview'); const inputFieldResult = await this._renameInputField.getValue().getInput(loc.range, loc.text, selectionStart, selectionEnd, supportPreview); // no result, only hint to focus the editor or not diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 16beda20892..fc5297d75c6 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -635,6 +635,10 @@ export class SimpleBulkEditService implements IBulkEditService { // } + hasPreviewHandler(): false { + return false; + } + setPreviewHandler(): IDisposable { return Disposable.None; } diff --git a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts index 795ce1e8142..58b77063d7f 100644 --- a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts +++ b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts @@ -392,6 +392,10 @@ export class BulkEditService implements IBulkEditService { }); } + hasPreviewHandler(): boolean { + return Boolean(this._previewHandler); + } + async apply(edit: WorkspaceEdit, options?: IBulkEditOptions): Promise { if (edit.edits.length === 0) { From b4663d82e94de6f046288510e91cc8c68aab2be0 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 3 Feb 2020 12:04:50 +0100 Subject: [PATCH 056/624] improve IPC broadcast lifecycle --- src/vs/base/parts/ipc/common/ipc.ts | 58 ++++++++++++++++++----------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 6fa8a0d0fae..be346f10a42 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Event, Emitter, Relay, EventMultiplexer } from 'vs/base/common/event'; -import { IDisposable, toDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, toDisposable, combinedDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import * as errors from 'vs/base/common/errors'; @@ -729,33 +729,47 @@ export class IPCServer implements IChannelServer, I throw new Error('IPC broadcast channels are not supported for calls'); }, listen(eventName: string, arg: any): Event { - const eventMultiplexer = new EventMultiplexer(); - const map = new Map, IDisposable>(); + let disposables = new DisposableStore(); - const onDidAddConnection = (connection: Connection) => { - const channel = connection.channelClient.getChannel(channelName); - const event = channel.listen(eventName, arg); - const disposable = eventMultiplexer.add(event); + const emitter = new Emitter({ + onFirstListenerAdd: () => { + disposables = new DisposableStore(); - map.set(connection, disposable); - }; + const eventMultiplexer = new EventMultiplexer(); + const map = new Map, IDisposable>(); - const onDidRemoveConnection = (connection: Connection) => { - const disposable = map.get(connection); + const onDidAddConnection = (connection: Connection) => { + const channel = connection.channelClient.getChannel(channelName); + const event = channel.listen(eventName, arg); + const disposable = eventMultiplexer.add(event); - if (!disposable) { - return; + map.set(connection, disposable); + }; + + const onDidRemoveConnection = (connection: Connection) => { + const disposable = map.get(connection); + + if (!disposable) { + return; + } + + disposable.dispose(); + map.delete(connection); + }; + + that.connections.forEach(onDidAddConnection); + that.onDidAddConnection(onDidAddConnection, undefined, disposables); + that.onDidRemoveConnection(onDidRemoveConnection, undefined, disposables); + eventMultiplexer.event(emitter.fire, emitter, disposables); + + disposables.add(eventMultiplexer); + }, + onLastListenerRemove: () => { + disposables.dispose(); } + }); - disposable.dispose(); - map.delete(connection); - }; - - that.connections.forEach(onDidAddConnection); - that.onDidAddConnection(onDidAddConnection); - that.onDidRemoveConnection(onDidRemoveConnection); - - return eventMultiplexer.event; + return emitter.event; } } as T; } From 929d775aadc45adb295ddf3b1cf4b72157a9284f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 3 Feb 2020 12:06:51 +0100 Subject: [PATCH 057/624] document IPC broadcast --- src/vs/base/parts/ipc/common/ipc.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index be346f10a42..e22fb97289e 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -731,10 +731,17 @@ export class IPCServer implements IChannelServer, I listen(eventName: string, arg: any): Event { let disposables = new DisposableStore(); + // Create an emitter which hooks up to all clients + // as soon as first listener is added. It also + // disconnects from all clients as soon as the last listener + // is removed. const emitter = new Emitter({ onFirstListenerAdd: () => { disposables = new DisposableStore(); + // The event multiplexer is useful since the active + // client list is dynamic. We need to hook up and disconnection + // to/from clients as they come and go. const eventMultiplexer = new EventMultiplexer(); const map = new Map, IDisposable>(); From 30b939c18f682581a075a2af627b1c4599bed7c3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 12:30:04 +0100 Subject: [PATCH 058/624] fix #89780 --- .../bulkEdit/browser/bulkEditService.ts | 47 ++++------ .../services/bulkEdit/browser/conflicts.ts | 39 ++------ .../api/mainThreadEditors.test.ts | 89 ++++++++++--------- 3 files changed, 70 insertions(+), 105 deletions(-) diff --git a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts index 58b77063d7f..a5bc8f9a21c 100644 --- a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts +++ b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts @@ -25,7 +25,8 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { Recording } from 'vs/workbench/services/bulkEdit/browser/conflicts'; +import { ConflictDetector } from 'vs/workbench/services/bulkEdit/browser/conflicts'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; type ValidationResult = { canApply: true } | { canApply: false, reason: URI }; @@ -234,10 +235,9 @@ class BulkEdit { editor: ICodeEditor | undefined, progress: IProgress | undefined, edits: Edit[], + @IInstantiationService private readonly _instaService: IInstantiationService, @ILogService private readonly _logService: ILogService, - @ITextModelService private readonly _textModelService: ITextModelService, @IFileService private readonly _fileService: IFileService, - @IEditorWorkerService private readonly _workerService: IEditorWorkerService, @ITextFileService private readonly _textFileService: ITextFileService, @ILabelService private readonly _uriLabelServie: ILabelService, @IConfigurationService private readonly _configurationService: IConfigurationService @@ -288,14 +288,15 @@ class BulkEdit { // for child operations this._progress.report({ total }); - let progress: IProgress = { report: _ => this._progress.report({ increment: 1 }) }; + const conflicts = this._instaService.createInstance(ConflictDetector, { edits: this._edits }); + const progress: IProgress = { report: _ => this._progress.report({ increment: 1 }) }; // do it. for (const group of groups) { if (WorkspaceFileEdit.is(group[0])) { await this._performFileEdits(group, progress); } else { - await this._performTextEdits(group, progress); + await this._performTextEdits(group, conflicts, progress); } } } @@ -335,25 +336,14 @@ class BulkEdit { } } - private async _performTextEdits(edits: WorkspaceTextEdit[], progress: IProgress): Promise { + private async _performTextEdits(edits: WorkspaceTextEdit[], conflicts: ConflictDetector, progress: IProgress): Promise { this._logService.debug('_performTextEdits', JSON.stringify(edits)); - const recording = Recording.start(this._fileService); - const model = new BulkEditModel(this._editor, progress, edits, this._workerService, this._textModelService); + const model = this._instaService.createInstance(BulkEditModel, this._editor, progress, edits); await model.prepare(); - const conflicts = edits - .filter(edit => recording.hasChanged(edit.resource)) - .map(edit => this._uriLabelServie.getUriLabel(edit.resource, { relative: true })); - - recording.stop(); - - if (conflicts.length > 0) { - model.dispose(); - throw new Error(localize('conflict', "These files have changed in the meantime: {0}", conflicts.join(', '))); - } - + this._throwIfConflicts(conflicts); const validationResult = model.validate(); if (validationResult.canApply === false) { model.dispose(); @@ -363,6 +353,13 @@ class BulkEdit { model.apply(); model.dispose(); } + + private _throwIfConflicts(conflicts: ConflictDetector) { + if (conflicts.hasConflicts()) { + const paths = conflicts.list().map(uri => this._uriLabelServie.getUriLabel(uri, { relative: true })); + throw new Error(localize('conflict', "These files have changed in the meantime: {0}", paths.join(', '))); + } + } } export class BulkEditService implements IBulkEditService { @@ -372,15 +369,10 @@ export class BulkEditService implements IBulkEditService { private _previewHandler?: IBulkEditPreviewHandler; constructor( + @IInstantiationService private readonly _instaService: IInstantiationService, @ILogService private readonly _logService: ILogService, @IModelService private readonly _modelService: IModelService, @IEditorService private readonly _editorService: IEditorService, - @IEditorWorkerService private readonly _workerService: IEditorWorkerService, - @ITextModelService private readonly _textModelService: ITextModelService, - @IFileService private readonly _fileService: IFileService, - @ITextFileService private readonly _textFileService: ITextFileService, - @ILabelService private readonly _labelService: ILabelService, - @IConfigurationService private readonly _configurationService: IConfigurationService ) { } setPreviewHandler(handler: IBulkEditPreviewHandler): IDisposable { @@ -433,10 +425,7 @@ export class BulkEditService implements IBulkEditService { // If the code editor is readonly still allow bulk edits to be applied #68549 codeEditor = undefined; } - const bulkEdit = new BulkEdit( - codeEditor, options?.progress, edits, - this._logService, this._textModelService, this._fileService, this._workerService, this._textFileService, this._labelService, this._configurationService - ); + const bulkEdit = this._instaService.createInstance(BulkEdit, codeEditor, options?.progress, edits); return bulkEdit.perform().then(() => { return { ariaSummary: bulkEdit.ariaMessage() }; }).catch(err => { diff --git a/src/vs/workbench/services/bulkEdit/browser/conflicts.ts b/src/vs/workbench/services/bulkEdit/browser/conflicts.ts index cd1996d2ab7..66532130949 100644 --- a/src/vs/workbench/services/bulkEdit/browser/conflicts.ts +++ b/src/vs/workbench/services/bulkEdit/browser/conflicts.ts @@ -10,31 +10,11 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { ResourceMap } from 'vs/base/common/map'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { Emitter, Event } from 'vs/base/common/event'; -import type { ITextModel } from 'vs/editor/common/model'; - -export abstract class Recording { - - static start(fileService: IFileService): Recording { - - let _changes = new Set(); - let subscription = fileService.onAfterOperation(e => { - _changes.add(e.resource.toString()); - }); - - return { - stop() { return subscription.dispose(); }, - hasChanged(resource) { return _changes.has(resource.toString()); } - }; - } - - abstract stop(): void; - abstract hasChanged(resource: URI): boolean; -} +import { ITextModel } from 'vs/editor/common/model'; export class ConflictDetector { private readonly _conflicts = new ResourceMap(); - private readonly _changes = new ResourceMap(); private readonly _disposables = new DisposableStore(); private readonly _onDidConflict = new Emitter(); @@ -79,9 +59,6 @@ export class ConflictDetector { continue; } - // change - this._changes.set(change.resource, true); - // conflict if (_workspaceEditResources.has(change.resource)) { this._conflicts.set(change.resource, true); @@ -92,8 +69,6 @@ export class ConflictDetector { // listen to model changes...? const onDidChangeModel = (model: ITextModel) => { - // change - this._changes.set(model.uri, true); // conflict if (_workspaceEditResources.has(model.uri)) { @@ -112,12 +87,10 @@ export class ConflictDetector { } list(): URI[] { - const result: URI[] = this._conflicts.keys(); - // this._changes.forEach((_value, key) => { - // if (!this._conflicts.has(key)) { - // result.push(key); - // } - // }); - return result; + return this._conflicts.keys(); + } + + hasConflicts(): boolean { + return this._conflicts.size > 0; } } diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts index 46d67163b2c..d44bb6189c0 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts @@ -21,13 +21,25 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; import { BulkEditService } from 'vs/workbench/services/bulkEdit/browser/bulkEditService'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { NullLogService, ILogService } from 'vs/platform/log/common/log'; import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService'; import { IReference, ImmortalReference } from 'vs/base/common/lifecycle'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { LabelService } from 'vs/workbench/services/label/common/labelService'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; +import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { ILabelService } from 'vs/platform/label/common/label'; suite('MainThreadEditors', () => { @@ -42,18 +54,30 @@ suite('MainThreadEditors', () => { const deletedResources = new Set(); setup(() => { - const configService = new TestConfigurationService(); - modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService()); - const codeEditorService = new TestCodeEditorService(); movedResources.clear(); copiedResources.clear(); createdResources.clear(); deletedResources.clear(); - const fileService = new TestFileService(); - const textFileService = new class extends mock() { + const configService = new TestConfigurationService(); + modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService()); + + + const services = new ServiceCollection(); + services.set(IBulkEditService, new SyncDescriptor(BulkEditService)); + services.set(ILabelService, new SyncDescriptor(LabelService)); + services.set(ILogService, new NullLogService()); + services.set(IWorkspaceContextService, new TestContextService()); + services.set(IWorkbenchEnvironmentService, TestEnvironmentService); + services.set(IConfigurationService, configService); + services.set(IModelService, modelService); + services.set(ICodeEditorService, new TestCodeEditorService()); + services.set(IFileService, new TestFileService()); + services.set(IEditorService, new TestEditorService()); + services.set(IEditorGroupsService, new TestEditorGroupsService()); + services.set(ITextFileService, new class extends mock() { isDirty() { return false; } create(uri: URI, contents?: string, options?: any) { createdResources.add(uri); @@ -76,10 +100,8 @@ suite('MainThreadEditors', () => { onDidRevert: Event.None, onDidChangeDirty: Event.None }; - }; - const workbenchEditorService = new TestEditorService(); - const editorGroupService = new TestEditorGroupsService(); - const textModelService = new class extends mock() { + }); + services.set(ITextModelService, new class extends mock() { createModelReference(resource: URI): Promise> { const textEditorModel = new class extends mock() { textEditorModel = modelService.getModel(resource)!; @@ -87,13 +109,20 @@ suite('MainThreadEditors', () => { textEditorModel.isReadonly = () => false; return Promise.resolve(new ImmortalReference(textEditorModel)); } - }; + }); + services.set(IEditorWorkerService, new class extends mock() { - const editorWorkerService = new class extends mock() { + }); + services.set(IPanelService, new class extends mock() implements IPanelService { + _serviceBrand: undefined; + onDidPanelOpen = Event.None; + onDidPanelClose = Event.None; + getActivePanel() { + return undefined; + } + }); - }; - - const bulkEditService = new BulkEditService(new NullLogService(), modelService, new TestEditorService(), editorWorkerService, textModelService, new TestFileService(), textFileService, new LabelService(TestEnvironmentService, new TestContextService()), configService); + const instaService = new InstantiationService(services); const rpcProtocol = new TestRPCProtocol(); rpcProtocol.set(ExtHostContext.ExtHostDocuments, new class extends mock() { @@ -105,35 +134,9 @@ suite('MainThreadEditors', () => { } }); - const documentAndEditor = new MainThreadDocumentsAndEditors( - rpcProtocol, - modelService, - textFileService, - workbenchEditorService, - codeEditorService, - fileService, - null!, - editorGroupService, - bulkEditService, - new class extends mock() implements IPanelService { - _serviceBrand: undefined; - onDidPanelOpen = Event.None; - onDidPanelClose = Event.None; - getActivePanel() { - return undefined; - } - }, - TestEnvironmentService - ); + const documentAndEditor = instaService.createInstance(MainThreadDocumentsAndEditors, rpcProtocol); - editors = new MainThreadTextEditors( - documentAndEditor, - SingleProxyRPCProtocol(null), - codeEditorService, - bulkEditService, - workbenchEditorService, - editorGroupService, - ); + editors = instaService.createInstance(MainThreadTextEditors, documentAndEditor, SingleProxyRPCProtocol(null)); }); test(`applyWorkspaceEdit returns false if model is changed by user`, () => { From 0b312b08f22a61416460f6c4373bb55e65120d74 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 3 Feb 2020 12:50:19 +0100 Subject: [PATCH 059/624] CSS smoketest fix for high DPI on Windows @sandy081 and @joaomoreno --- test/automation/src/editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/automation/src/editor.ts b/test/automation/src/editor.ts index 97a8b5214a2..dd564c9bd52 100644 --- a/test/automation/src/editor.ts +++ b/test/automation/src/editor.ts @@ -89,7 +89,7 @@ export class Editor { const line = `${editor} .view-lines > .view-line:nth-child(${lineNumber})`; const textarea = `${editor} textarea`; - await this.code.waitAndClick(line, 0, 0); + await this.code.waitAndClick(line, 1, 1); await this.code.waitForActiveElement(textarea); } From 5f218e53a9c00de9699fc0832ce53763bf8c87de Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Mon, 3 Feb 2020 11:54:04 +0000 Subject: [PATCH 060/624] Fix #89900 - improve text on editor.showFoldingControls setting --- src/vs/editor/common/config/editorOptions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 07200e8eb33..abae1f83f9e 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3675,7 +3675,13 @@ export const EditorOptions = { EditorOption.showFoldingControls, 'showFoldingControls', 'mouseover' as 'always' | 'mouseover', ['always', 'mouseover'] as const, - { description: nls.localize('showFoldingControls', "Controls whether the fold controls on the gutter are automatically hidden.") } + { + enumDescriptions: [ + nls.localize('showFoldingControls.always', "Always show the folding controls."), + nls.localize('showFoldingControls.mouseover', "Only show the folding controls when the mouse is over the gutter."), + ], + description: nls.localize('showFoldingControls', "Controls when the folding controls on the gutter are shown.") + } )), showUnused: register(new EditorBooleanOption( EditorOption.showUnused, 'showUnused', true, From efa12b2f49ec6ee84ed1e7bbd948808efec452f6 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 3 Feb 2020 13:01:47 +0100 Subject: [PATCH 061/624] Update grammars --- extensions/cpp/cgmanifest.json | 4 +- extensions/cpp/syntaxes/c.tmLanguage.json | 292 +- .../cpp.embedded.macro.tmLanguage.json | 11668 ++++-------- extensions/cpp/syntaxes/cpp.tmLanguage.json | 14741 ++++++++++------ .../test/colorize-results/test-78769_cpp.json | 12 +- .../test/colorize-results/test-80644_cpp.json | 6 +- .../cpp/test/colorize-results/test_cc.json | 26 +- .../cpp/test/colorize-results/test_cpp.json | 32 +- extensions/go/syntaxes/go.tmLanguage.json | 33 +- extensions/hlsl/cgmanifest.json | 2 +- extensions/hlsl/syntaxes/hlsl.tmLanguage.json | 16 +- extensions/log/cgmanifest.json | 4 +- extensions/log/syntaxes/log.tmLanguage.json | 8 +- extensions/objective-c/cgmanifest.json | 2 +- .../syntaxes/objective-c++.tmLanguage.json | 2 +- .../syntaxes/objective-c.tmLanguage.json | 2 +- extensions/php/cgmanifest.json | 4 +- extensions/php/syntaxes/php.tmLanguage.json | 124 +- extensions/r/cgmanifest.json | 4 +- extensions/r/syntaxes/r.tmLanguage.json | 4 +- .../r/test/colorize-results/test_r.json | 6 +- .../test/colorize-results/test_shader.json | 4 +- 22 files changed, 13338 insertions(+), 13658 deletions(-) diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index c216c10420b..cdcea133032 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/cpp-textmate-grammar", "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", - "commitHash": "666808cab3907fc91ed4d3901060ee6b045cca58" + "commitHash": "5b6f67859e895da83dc242b849480ee04ce7ce38" } }, "license": "MIT", - "version": "1.14.15", + "version": "1.14.20", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/cpp/syntaxes/c.tmLanguage.json b/extensions/cpp/syntaxes/c.tmLanguage.json index bb037f684a5..acf62fab955 100644 --- a/extensions/cpp/syntaxes/c.tmLanguage.json +++ b/extensions/cpp/syntaxes/c.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/jeff-hykin/cpp-textmate-grammar/commit/72b309aabb63bf14a3cdf0280149121db005d616", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/85b9008b406cc9d3b1c9e779e94cc071116c8426", "name": "C", "scopeName": "source.c", "patterns": [ @@ -464,7 +464,7 @@ ] }, "backslash_escapes": { - "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3][0-7]{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", "name": "constant.character.escape.c" }, "block": { @@ -690,12 +690,20 @@ "name": "storage.type.class.doxygen.c" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.c" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { "name": "variable.parameter.c" } } @@ -768,12 +776,20 @@ "name": "storage.type.class.doxygen.c" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.c" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { "name": "variable.parameter.c" } } @@ -859,12 +875,20 @@ "name": "storage.type.class.doxygen.c" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.c" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { "name": "variable.parameter.c" } } @@ -2874,95 +2898,219 @@ }, { "name": "meta.asm.c", - "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", + "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)", "beginCaptures": { "1": { "name": "storage.type.asm.c" }, "2": { "name": "storage.modifier.c" - }, - "3": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.c" } }, + "end": "(?!\\G)", "patterns": [ { - "name": "string.quoted.double.c", - "contentName": "meta.embedded.assembly.c", - "begin": "(R?)(\")", - "beginCaptures": { + "match": "(?:^)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\n|$)", + "captures": { "1": { - "name": "meta.encoding.c" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "2": { - "name": "punctuation.definition.string.begin.assembly.c" - } - }, - "end": "(\")", - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.assembly.c" - } - }, - "patterns": [ - { - "include": "source.asm" + "name": "comment.block.c punctuation.definition.comment.begin.c" }, - { - "include": "source.x86" + "3": { + "name": "comment.block.c" }, - { - "include": "source.x86_64" - }, - { - "include": "source.arm" - }, - { - "include": "#backslash_escapes" - }, - { - "include": "#string_escaped_char" - }, - { - "match": "(?=not)possible" + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] } - ] - }, - { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": ":", - "name": "punctuation.separator.delimiter.colon.assembly.c" + } }, { "include": "#comments_context" }, { "include": "#comments" + }, + { + "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.c" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "4": { + "name": "comment.block.c" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.assembly.c" + } + }, + "patterns": [ + { + "name": "string.quoted.double.c", + "contentName": "meta.embedded.assembly.c", + "begin": "(R?)(\")", + "beginCaptures": { + "1": { + "name": "meta.encoding.c" + }, + "2": { + "name": "punctuation.definition.string.begin.assembly.c" + } + }, + "end": "(\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.assembly.c" + } + }, + "patterns": [ + { + "include": "source.asm" + }, + { + "include": "source.x86" + }, + { + "include": "source.x86_64" + }, + { + "include": "source.arm" + }, + { + "include": "#backslash_escapes" + }, + { + "include": "#string_escaped_char" + } + ] + }, + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" + } + }, + "patterns": [ + { + "include": "#evaluation_context" + } + ] + }, + { + "match": "\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))([a-zA-Z_]\\w*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "3": { + "name": "comment.block.c" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + }, + "5": { + "name": "variable.other.asm.label.c" + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "8": { + "name": "comment.block.c" + }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + } + }, + { + "match": ":", + "name": "punctuation.separator.delimiter.colon.assembly.c" + }, + { + "include": "#comments_context" + }, + { + "include": "#comments" + } + ] } ] } diff --git a/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json b/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json index e1ff11c5d9b..e1a423160dc 100644 --- a/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json +++ b/extensions/cpp/syntaxes/cpp.embedded.macro.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/jeff-hykin/cpp-textmate-grammar/commit/666808cab3907fc91ed4d3901060ee6b045cca58", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/5b6f67859e895da83dc242b849480ee04ce7ce38", "name": "C++", "scopeName": "source.cpp.embedded.macro", "patterns": [ @@ -27,13 +27,13 @@ "include": "#using_namespace" }, { - "include": "#type_alias" + "include": "source.cpp#type_alias" }, { - "include": "#using_name" + "include": "source.cpp#using_name" }, { - "include": "#namespace_alias" + "include": "source.cpp#namespace_alias" }, { "include": "#namespace_block" @@ -51,10 +51,10 @@ "include": "#typedef_union" }, { - "include": "#typedef_keyword" + "include": "source.cpp#misc_keywords" }, { - "include": "#standard_declares" + "include": "source.cpp#standard_declares" }, { "include": "#class_block" @@ -69,13 +69,13 @@ "include": "#enum_block" }, { - "include": "#template_isolated_definition" + "include": "source.cpp#template_isolated_definition" }, { "include": "#template_definition" }, { - "include": "#access_control_keywords" + "include": "source.cpp#access_control_keywords" }, { "include": "#block" @@ -94,56 +94,20 @@ } ], "repository": { - "access_control_keywords": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(((?:protected|private|public))\\s*(:))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "storage.type.modifier.access.control.$6.cpp" - }, - "7": { - "name": "punctuation.separator.colon.access.control.cpp" - } - } - }, "alignas_attribute": { - "name": "support.other.attribute.cpp", - "begin": "(alignas\\()", + "begin": "alignas\\(", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\n)|$)", + "captures": { "1": { - "name": "meta.encoding.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "2": { - "name": "punctuation.definition.string.begin.assembly.cpp" - } - }, - "end": "(\")|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\(", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]", + "captures": { + "1": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "5": { + "name": "variable.other.asm.label.cpp" + }, + "6": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "7": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "8": { + "name": "comment.block.cpp" + }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + }, + { + "match": ":", + "name": "punctuation.separator.delimiter.colon.assembly.cpp" + }, + { + "include": "#comments_context" + }, + { + "include": "#comments" + } + ] } ] }, - "assignment_operator": { - "match": "\\=", - "name": "keyword.operator.assignment.cpp" - }, "attributes_context": { "patterns": [ { @@ -402,24 +489,20 @@ } ] }, - "backslash_escapes": { - "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", - "name": "constant.character.escape.cpp" - }, "block": { - "name": "meta.block.cpp", - "begin": "({)", + "begin": "{", + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", - "captures": { - "1": { - "name": "storage.type.class.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.class.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "comma": { - "match": ",", - "name": "punctuation.separator.delimiter.comma.cpp" - }, - "comma_in_template_argument": { - "match": ",", - "name": "punctuation.separator.delimiter.comma.template.argument.cpp" - }, "comments": { "patterns": [ { - "name": "comment.line.double-slash.documentation.cpp", - "begin": "(?:^)(?>\\s*)(\\/\\/[!\\/]+)", + "begin": "^(?:(?:\\s)+)?+(\\/\\/[!\\/]+)", + "end": "(?<=\\n)(?|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1186,7 +1077,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@]b)(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1197,7 +1088,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1216,12 +1107,20 @@ "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?(?:(?:\\s)+)?(?:in|out)(?:(?:\\s)+)?)+)\\])?(?:\\s)+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.cpp" + } + ] + }, + "3": { "name": "variable.parameter.cpp" } } @@ -1253,7 +1152,7 @@ "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1264,7 +1163,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@]b)(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1275,7 +1174,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1294,12 +1193,20 @@ "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?(?:(?:\\s)+)?(?:in|out)(?:(?:\\s)+)?)+)\\])?(?:\\s)+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.cpp" + } + ] + }, + "3": { "name": "variable.parameter.cpp" } } @@ -1325,26 +1232,26 @@ "name": "comment.block.documentation.cpp" }, { - "name": "comment.block.documentation.cpp", - "begin": "((?>\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))", + "begin": "(?:(?:\\s)+)?+\\/\\*[!*]+(?:(?:(?:\\n)|$)|(?=\\s))", + "end": "[!*]*\\*\\/|(?=(?|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1355,7 +1262,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@]b)(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1366,7 +1273,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1385,12 +1292,20 @@ "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?(?:(?:\\s)+)?(?:in|out)(?:(?:\\s)+)?)+)\\])?(?:\\s)+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.cpp" + } + ] + }, + "3": { "name": "variable.parameter.cpp" } } @@ -1410,7 +1325,7 @@ ] }, { - "include": "#emacs_file_banner" + "include": "source.cpp#emacs_file_banner" }, { "include": "#block_comment" @@ -1419,31 +1334,31 @@ "include": "#line_comment" }, { - "include": "#invalid_comment_end" + "include": "source.cpp#invalid_comment_end" } ] }, "constructor_inline": { - "name": "meta.function.definition.special.constructor.cpp", - "begin": "(^((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:constexpr|explicit|mutable|virtual|inline|friend)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:constexpr)|(?:explicit)|(?:mutable)|(?:virtual)|(?:inline)|(?:friend))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "begin": "(:)", - "beginCaptures": { + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" + } + } + }, + { + "include": "source.cpp#functional_specifiers_pre_parameters" + }, + { + "begin": ":", + "end": "(?=\\{)|(?=(?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", + "begin": "((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))::((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\16((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\()))", + "begin": "\\s*+((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "begin": "(:)", - "beginCaptures": { + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" + } + } + }, + { + "include": "source.cpp#functional_specifiers_pre_parameters" + }, + { + "begin": ":", + "end": "(?=\\{)|(?=(?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", + "begin": "((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", + "end": "\\}|(?=(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:constexpr|explicit|mutable|virtual|inline|friend)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)(~(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:constexpr)|(?:explicit)|(?:mutable)|(?:virtual)|(?:inline)|(?:friend))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(~(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "source.cpp#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))::((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))~\\16((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\()))", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "source.cpp#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?:error|warning)))\\b\\s*", + "begin": "(^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?:error|warning)))\\b(?:(?:\\s)+)?", + "end": "(?[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*(?:\\n|$)))|(^\\s*((\\/\\*)\\s*?((?>[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*\\*\\/)))", - "captures": { - "1": { - "name": "meta.toc-list.banner.double-slash.cpp" - }, - "2": { - "name": "comment.line.double-slash.cpp" - }, - "3": { - "name": "punctuation.definition.comment.cpp" - }, - "4": { - "name": "meta.banner.character.cpp" - }, - "5": { - "name": "meta.toc-list.banner.block.cpp" - }, - "6": { - "name": "comment.line.banner.cpp" - }, - "7": { - "name": "punctuation.definition.comment.cpp" - }, - "8": { - "name": "meta.banner.character.cpp" - } - } - }, - "empty_square_brackets": { - "name": "storage.modifier.array.bracket.square.cpp", - "match": "(?-mix:(?-mix:(?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?(::))?\\s*((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", - "captures": { - "1": { - "name": "storage.type.enum.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.enum.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "enumerator_list": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(extern)(?=\\s*\\\"))", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(extern)(?=\\s*\\\")", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(((?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?(\\()", + "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)|(?=(?))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\())", + "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))", + "match": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))", "captures": { "1": { "name": "storage.modifier.$1.cpp" @@ -4002,7 +3645,7 @@ "2": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -4028,23 +3671,23 @@ } ] }, - "12": { - "name": "storage.modifier.$1.cpp" + "11": { + "name": "storage.modifier.$11.cpp" }, - "13": { + "12": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, - "14": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "15": { + "14": { "name": "comment.block.cpp" }, - "16": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -4056,11 +3699,11 @@ } ] }, - "17": { + "16": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -4264,123 +3927,123 @@ } ] }, + "42": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "43": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "44": { + "name": "comment.block.cpp" + }, "45": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "46": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "47": { - "name": "comment.block.cpp" - }, - "48": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "47": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "48": { + "name": "comment.block.cpp" + }, "49": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "50": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "51": { - "name": "comment.block.cpp" - }, - "52": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "51": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "52": { + "name": "comment.block.cpp" + }, "53": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "54": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "55": { - "name": "comment.block.cpp" - }, - "56": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "55": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "56": { + "name": "comment.block.cpp" + }, "57": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "58": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "storage.type.modifier.calling-convention.cpp" }, "59": { - "name": "comment.block.cpp" - }, - "60": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "60": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, "61": { - "name": "storage.type.modifier.calling-convention.cpp" + "name": "comment.block.cpp" }, "62": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "63": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "64": { - "name": "comment.block.cpp" - }, - "65": { "patterns": [ { "match": "\\*\\/", @@ -4392,17 +4055,17 @@ } ] }, - "66": { + "63": { "patterns": [ { - "include": "#scope_resolution_function_definition_inner_generated" + "include": "source.cpp#scope_resolution_function_definition_inner_generated" } ] }, - "67": { + "64": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" }, - "69": { + "65": { "name": "meta.template.call.cpp", "patterns": [ { @@ -4410,23 +4073,24 @@ } ] }, - "71": { + "66": {}, + "67": { "name": "entity.name.function.definition.cpp" }, - "72": { + "68": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, - "73": { + "69": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "74": { + "70": { "name": "comment.block.cpp" }, - "75": { + "71": { "patterns": [ { "match": "\\*\\/", @@ -4439,35 +4103,37 @@ ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -4739,70 +4429,70 @@ } ] }, - "29": { + "27": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "31": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "35": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "39": { + "37": { "name": "comment.block.cpp" }, - "40": { + "38": { "patterns": [ { "match": "\\*\\/", @@ -4814,36 +4504,35 @@ } ] }, - "41": { + "39": { "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, - "42": { + "40": { "name": "punctuation.definition.function.pointer.dereference.cpp" }, - "43": { + "41": { "name": "variable.other.definition.pointer.function.cpp" }, - "44": { + "42": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "45": { + "43": { "patterns": [ { "include": "#evaluation_context" } ] }, - "46": { + "44": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "47": { + "45": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "48": { + "46": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -5091,70 +4801,70 @@ } ] }, - "29": { + "27": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "31": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "35": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "39": { + "37": { "name": "comment.block.cpp" }, - "40": { + "38": { "patterns": [ { "match": "\\*\\/", @@ -5166,36 +4876,35 @@ } ] }, - "41": { + "39": { "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, - "42": { + "40": { "name": "punctuation.definition.function.pointer.dereference.cpp" }, - "43": { + "41": { "name": "variable.parameter.pointer.function.cpp" }, - "44": { + "42": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "45": { + "43": { "patterns": [ { "include": "#evaluation_context" } ] }, - "46": { + "44": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "47": { + "45": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "48": { + "46": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)", - "captures": { - "1": { - "name": "keyword.control.goto.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.label.call.cpp" - } - } - }, - "include": { - "match": "(?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((#)\\s*((?:include|include_next))\\b)\\s*(?:(?:(?:((<)[^>]*(>?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/))))|(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.control.directive.$7.cpp" - }, - "6": { - "name": "punctuation.definition.directive.cpp" - }, - "8": { - "name": "string.quoted.other.lt-gt.include.cpp" - }, - "9": { - "name": "punctuation.definition.string.begin.cpp" - }, - "10": { - "name": "punctuation.definition.string.end.cpp" - }, - "11": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "13": { - "name": "comment.block.cpp" - }, - "14": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "15": { - "name": "string.quoted.double.include.cpp" - }, - "16": { - "name": "punctuation.definition.string.begin.cpp" - }, - "17": { - "name": "punctuation.definition.string.end.cpp" - }, - "18": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "19": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "20": { - "name": "comment.block.cpp" - }, - "21": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "22": { - "name": "entity.name.other.preprocessor.macro.include.cpp" - }, - "23": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "24": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "25": { - "name": "comment.block.cpp" - }, - "26": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "27": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "28": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "29": { - "name": "comment.block.cpp" - }, - "30": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "31": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "32": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "33": { - "name": "comment.block.cpp" - }, - "34": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "meta.preprocessor.include.cpp" - }, "inheritance_context": { "patterns": [ { @@ -5527,7 +5015,7 @@ "name": "punctuation.separator.delimiter.comma.inheritance.cpp" }, { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:(?:\\s)+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "5": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "7": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#scope_resolution_inner_generated" } ] }, "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#scope_resolution_inner_generated" - } - ] - }, - "13": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "15": { + "9": { + "patterns": [ + { + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } + } + ] + }, + "10": {}, + "11": { + "name": "entity.name.scope-resolution.cpp" + }, + "12": { "name": "meta.template.call.cpp", "patterns": [ { @@ -5652,8 +5197,46 @@ } ] }, + "13": {}, + "14": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "15": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "17": { - "name": "entity.name.scope-resolution.cpp" + "name": "entity.name.type.cpp" }, "18": { "name": "meta.template.call.cpp", @@ -5663,151 +5246,26 @@ } ] }, - "20": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "25": { - "name": "entity.name.type.cpp" - }, - "26": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } + "19": {} } } ] }, - "inline_comment": { - "match": "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))", - "captures": { - "1": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "2": { - "name": "comment.block.cpp" - }, - "3": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "invalid_comment_end": { - "match": "\\*\\/", - "name": "invalid.illegal.unexpected.punctuation.definition.comment.end.cpp" - }, - "label": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "entity.name.label.cpp" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "name": "punctuation.separator.label.cpp" - } - } - }, "lambdas": { - "begin": "((?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[| *+\"| *+\\d))((?>(?:[^\\[\\]]|((?(?:(?>[^\\[\\]]*)\\g<4>?)+)\\]))*))(\\](?!\\[)))", + "begin": "(?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))(?:(?:\\s)+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))[\\[\\];]))", + "end": "(?<=[;}])|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", + "match": "((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", "captures": { "1": { "name": "variable.parameter.capture.cpp" @@ -5815,7 +5273,7 @@ "2": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -5850,26 +5308,52 @@ } ] }, - "5": { + "3": {}, + "4": { "name": "punctuation.definition.capture.end.lambda.cpp" + }, + "5": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "6": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "7": { + "name": "comment.block.cpp" + }, + "8": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] } }, - "end": "(?<=})|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*line\\b)", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?line\\b", + "end": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*define\\b)\\s*((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?define\\b)(?:(?:\\s)+)?((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!uint_least64_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|double[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|float[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|short[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|char[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|void[^(?-mix:\\w)]|long[^(?-mix:\\w)]|auto[^(?-mix:\\w)]|int[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?!\\())", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.language.this.cpp" - }, - "6": { - "name": "variable.other.object.access.cpp" - }, - "7": { - "name": "punctuation.separator.dot-access.cpp" - }, - "8": { - "name": "punctuation.separator.pointer-access.cpp" - }, - "9": { - "patterns": [ - { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.language.this.cpp" - }, - "6": { - "name": "variable.other.object.property.cpp" - }, - "7": { - "name": "punctuation.separator.dot-access.cpp" - }, - "8": { - "name": "punctuation.separator.pointer-access.cpp" - } - } - }, - { - "match": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.language.this.cpp" - }, - "6": { - "name": "variable.other.object.access.cpp" - }, - "7": { - "name": "punctuation.separator.dot-access.cpp" - }, - "8": { - "name": "punctuation.separator.pointer-access.cpp" - } - } - }, - { - "include": "#member_access" - }, - { - "include": "#method_access" - } - ] - }, - "10": { - "name": "variable.other.property.cpp" - } - } - }, - "memory_operators": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:(delete)\\s*(\\[\\])|(delete))|(new))(?!\\w))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.operator.wordlike.cpp" - }, - "6": { - "name": "keyword.operator.delete.array.cpp" - }, - "7": { - "name": "keyword.operator.delete.array.bracket.cpp" - }, - "8": { - "name": "keyword.operator.delete.cpp" - }, - "9": { - "name": "keyword.operator.new.cpp" - } - } - }, "method_access": { - "begin": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(~?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\()", + "begin": "(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:(?:\\s)+)?(?:(?:\\.\\*|\\.)|(?:->\\*|->))(?:(?:\\s)+)?)*)(?:(?:\\s)+)?(~?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?(\\()", + "end": "\\)|(?=(?|->\\*))\\s*(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -6350,12 +5638,12 @@ } }, { - "match": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -6392,7 +5680,7 @@ } }, { - "include": "#member_access" + "include": "source.cpp#member_access" }, { "include": "#method_access" @@ -6406,9 +5694,8 @@ "name": "punctuation.section.arguments.begin.bracket.round.function.member.cpp" } }, - "end": "(\\))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((import))\\s*(?:(?:(?:((<)[^>]*(>?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/))))|(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))\\s*(;?)", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.control.directive.import.cpp" - }, - "7": { - "name": "string.quoted.other.lt-gt.include.cpp" - }, - "8": { - "name": "punctuation.definition.string.begin.cpp" - }, - "9": { - "name": "punctuation.definition.string.end.cpp" - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "string.quoted.double.include.cpp" - }, - "15": { - "name": "punctuation.definition.string.begin.cpp" - }, - "16": { - "name": "punctuation.definition.string.end.cpp" - }, - "17": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "18": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "19": { - "name": "comment.block.cpp" - }, - "20": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "21": { - "name": "entity.name.other.preprocessor.macro.include.cpp" - }, - "22": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "23": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "24": { - "name": "comment.block.cpp" - }, - "25": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "26": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "27": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "28": { - "name": "comment.block.cpp" - }, - "29": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "name": "meta.preprocessor.import.cpp" - }, "ms_attributes": { - "name": "support.other.attribute.cpp", - "begin": "(__declspec\\()", + "begin": "__declspec\\(", + "end": "\\)|(?=(?(?:(?>[^<>]*)\\g<9>?)+)>)\\s*)?::)*\\s*+)\\s*((?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:(?>[^<>]*)\\g<5>?)+)>)\\s*)?::)*\\s*+)\\s*((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)(?:(?:\\s)+)?((?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(operator)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(?:(?:((?:delete\\[\\]|delete|new\\[\\]|<=>|<<=|new|>>=|\\->\\*|\\/=|%=|&=|>=|\\|=|\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|<<|>>|\\-\\-|<=|\\^=|==|!=|&&|\\|\\||\\+=|\\-=|\\*=|,|\\+|\\-|!|~|\\*|&|\\*|\\/|%|\\+|\\-|<|>|&|\\^|\\||=))|((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:\\[\\])?)))|(\"\")((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\<|\\())", + "begin": "(?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -7366,148 +6148,148 @@ } ] }, + "27": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, "30": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "32": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "33": { + "name": "comment.block.cpp" + }, "34": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "35": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "36": { - "name": "comment.block.cpp" - }, - "37": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "36": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "37": { + "name": "comment.block.cpp" + }, "38": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "39": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "40": { - "name": "comment.block.cpp" - }, - "41": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "40": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "41": { + "name": "comment.block.cpp" + }, "42": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "43": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "storage.type.modifier.calling-convention.cpp" }, "44": { - "name": "comment.block.cpp" - }, - "45": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "45": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, "46": { - "name": "storage.type.modifier.calling-convention.cpp" + "name": "comment.block.cpp" }, "47": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "48": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "49": { - "name": "comment.block.cpp" - }, - "50": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, + "49": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "50": { + "name": "comment.block.cpp" + }, "51": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "52": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "53": { - "name": "comment.block.cpp" - }, - "54": { "patterns": [ { "match": "\\*\\/", @@ -7519,7 +6301,7 @@ } ] }, - "55": { + "52": { "patterns": [ { "match": "::", @@ -7534,7 +6316,7 @@ } ] }, - "57": { + "53": { "name": "meta.template.call.cpp", "patterns": [ { @@ -7542,23 +6324,24 @@ } ] }, - "59": { + "54": {}, + "55": { "name": "keyword.other.operator.overload.cpp" }, - "60": { + "56": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, - "61": { + "57": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "62": { + "58": { "name": "comment.block.cpp" }, - "63": { + "59": { "patterns": [ { "match": "\\*\\/", @@ -7570,7 +6353,7 @@ } ] }, - "64": { + "60": { "patterns": [ { "match": "::", @@ -7585,7 +6368,7 @@ } ] }, - "66": { + "61": { "name": "meta.template.call.cpp", "patterns": [ { @@ -7593,25 +6376,26 @@ } ] }, - "68": { + "62": {}, + "63": { "name": "entity.name.operator.cpp" }, - "69": { + "64": { "name": "entity.name.operator.type.cpp" }, - "70": { + "65": { "patterns": [ { "match": "\\*", "name": "entity.name.operator.type.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -7642,70 +6426,101 @@ } ] }, - "71": { + "66": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, - "72": { + "67": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "73": { + "68": { "name": "comment.block.cpp" }, + "69": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "70": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "71": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "72": { + "name": "comment.block.cpp" + }, + "73": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "74": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "source.cpp#inline_comment" } ] }, "75": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "76": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "comment.block.cpp" }, "77": { - "name": "comment.block.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "78": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "entity.name.operator.type.array.cpp" }, "79": { + "name": "entity.name.operator.custom-literal.cpp" + }, + "80": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, - "80": { + "81": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "81": { + "82": { "name": "comment.block.cpp" }, - "82": { + "83": { "patterns": [ { "match": "\\*\\/", @@ -7717,16 +6532,13 @@ } ] }, - "83": { - "name": "entity.name.operator.type.array.cpp" - }, "84": { "name": "entity.name.operator.custom-literal.cpp" }, "85": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -7747,47 +6559,21 @@ "name": "comment.block.cpp" } ] - }, - "89": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "90": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "91": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "92": { - "name": "comment.block.cpp" - }, - "93": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\w)", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\w)", + "end": "(?:(?=\\))|(,))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))+)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=,|\\)|=)", + "match": "((?:((?:(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -7998,7 +7041,7 @@ "3": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8023,7 +7066,7 @@ "7": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8048,7 +7091,7 @@ "11": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8073,7 +7116,7 @@ "15": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8101,7 +7144,7 @@ "20": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8129,7 +7172,7 @@ "25": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8157,7 +7200,7 @@ "30": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8188,7 +7231,7 @@ "36": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8216,15 +7259,16 @@ "include": "#storage_types" }, { - "include": "#scope_resolution_parameter_inner_generated" + "include": "source.cpp#scope_resolution_parameter_inner_generated" }, { - "match": "(?:struct|class|union|enum)", + "match": "(?:(?:struct)|(?:class)|(?:union)|(?:enum))", "name": "storage.type.$0.cpp" }, { "begin": "(?<==)", "end": "(?:(?=\\))|(,))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\)|,|\\[|=|\\n)", + "match": "(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\)|,|\\[|=|\\n)", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8273,7 +7318,7 @@ "6": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8301,19 +7346,19 @@ "include": "#attributes_context" }, { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", + "begin": "\\[", + "end": "\\]|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*)", + "match": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*))", "captures": { "0": { "patterns": [ @@ -8337,12 +7382,12 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8376,7 +7421,7 @@ "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8401,7 +7446,7 @@ "5": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -8427,528 +7472,14 @@ } ] }, - "parameter_class": { - "match": "(class)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.class.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.class.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "parameter_enum": { - "match": "(enum)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.enum.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.enum.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, "parameter_or_maybe_value": { - "name": "meta.parameter.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\w)", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\w)", + "end": "(?:(?=\\))|(,))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))+)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=,|\\)|=)", + "match": "((?:((?:(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -9015,7 +7546,7 @@ "3": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9040,7 +7571,7 @@ "7": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9065,7 +7596,7 @@ "11": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9090,7 +7621,7 @@ "15": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9118,7 +7649,7 @@ "20": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9146,7 +7677,7 @@ "25": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9174,7 +7705,7 @@ "30": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9205,7 +7736,7 @@ "36": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9236,15 +7767,16 @@ "include": "#function_call" }, { - "include": "#scope_resolution_parameter_inner_generated" + "include": "source.cpp#scope_resolution_parameter_inner_generated" }, { - "match": "(?:struct|class|union|enum)", + "match": "(?:(?:struct)|(?:class)|(?:union)|(?:enum))", "name": "storage.type.$0.cpp" }, { "begin": "(?<==)", "end": "(?:(?=\\))|(,))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=(?:\\)|,|\\[|=|\\/\\/|(?:\\n|$)))", + "match": "(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=(?:\\)|,|\\[|=|\\/\\/|(?:(?:\\n)|$)))", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9290,7 +7822,7 @@ "6": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9318,19 +7850,19 @@ "include": "#attributes_context" }, { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", + "begin": "\\[", + "end": "\\]|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*)", + "match": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*))", "captures": { "0": { "patterns": [ @@ -9354,12 +7886,12 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9393,7 +7925,7 @@ "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9418,7 +7950,7 @@ "5": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -9447,537 +7979,23 @@ } ] }, - "parameter_struct": { - "match": "(struct)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.struct.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.struct.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "parameter_union": { - "match": "(union)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.union.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.union.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, "parentheses": { - "name": "meta.parens.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*pragma\\b)", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?pragma\\b", + "end": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*pragma\\s+mark)\\s+(.*)", - "captures": { - "1": { - "name": "keyword.control.directive.pragma.pragma-mark.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.definition.directive.cpp" - }, - "7": { - "name": "entity.name.tag.pragma-mark.cpp" - } - }, - "name": "meta.preprocessor.pragma.cpp" - }, - "predefined_macros": { - "patterns": [ - { - "match": "\\b(__cplusplus|__DATE__|__FILE__|__LINE__|__STDC__|__STDC_HOSTED__|__STDC_NO_COMPLEX__|__STDC_VERSION__|__STDCPP_THREADS__|__TIME__|NDEBUG|__OBJC__|__ASSEMBLER__|__ATOM__|__AVX__|__AVX2__|_CHAR_UNSIGNED|__CLR_VER|_CONTROL_FLOW_GUARD|__COUNTER__|__cplusplus_cli|__cplusplus_winrt|_CPPRTTI|_CPPUNWIND|_DEBUG|_DLL|__FUNCDNAME__|__FUNCSIG__|__FUNCTION__|_INTEGRAL_MAX_BITS|__INTELLISENSE__|_ISO_VOLATILE|_KERNEL_MODE|_M_AMD64|_M_ARM|_M_ARM_ARMV7VE|_M_ARM_FP|_M_ARM64|_M_CEE|_M_CEE_PURE|_M_CEE_SAFE|_M_FP_EXCEPT|_M_FP_FAST|_M_FP_PRECISE|_M_FP_STRICT|_M_IX86|_M_IX86_FP|_M_X64|_MANAGED|_MSC_BUILD|_MSC_EXTENSIONS|_MSC_FULL_VER|_MSC_VER|_MSVC_LANG|__MSVC_RUNTIME_CHECKS|_MT|_NATIVE_WCHAR_T_DEFINED|_OPENMP|_PREFAST|__TIMESTAMP__|_VC_NO_DEFAULTLIB|_WCHAR_T_DEFINED|_WIN32|_WIN64|_WINRT_DLL|_ATL_VER|_MFC_VER|__GFORTRAN__|__GNUC__|__GNUC_MINOR__|__GNUC_PATCHLEVEL__|__GNUG__|__STRICT_ANSI__|__BASE_FILE__|__INCLUDE_LEVEL__|__ELF__|__VERSION__|__OPTIMIZE__|__OPTIMIZE_SIZE__|__NO_INLINE__|__GNUC_STDC_INLINE__|__CHAR_UNSIGNED__|__WCHAR_UNSIGNED__|__REGISTER_PREFIX__|__REGISTER_PREFIX__|__SIZE_TYPE__|__PTRDIFF_TYPE__|__WCHAR_TYPE__|__WINT_TYPE__|__INTMAX_TYPE__|__UINTMAX_TYPE__|__SIG_ATOMIC_TYPE__|__INT8_TYPE__|__INT16_TYPE__|__INT32_TYPE__|__INT64_TYPE__|__UINT8_TYPE__|__UINT16_TYPE__|__UINT32_TYPE__|__UINT64_TYPE__|__INT_LEAST8_TYPE__|__INT_LEAST16_TYPE__|__INT_LEAST32_TYPE__|__INT_LEAST64_TYPE__|__UINT_LEAST8_TYPE__|__UINT_LEAST16_TYPE__|__UINT_LEAST32_TYPE__|__UINT_LEAST64_TYPE__|__INT_FAST8_TYPE__|__INT_FAST16_TYPE__|__INT_FAST32_TYPE__|__INT_FAST64_TYPE__|__UINT_FAST8_TYPE__|__UINT_FAST16_TYPE__|__UINT_FAST32_TYPE__|__UINT_FAST64_TYPE__|__INTPTR_TYPE__|__UINTPTR_TYPE__|__CHAR_BIT__|__SCHAR_MAX__|__WCHAR_MAX__|__SHRT_MAX__|__INT_MAX__|__LONG_MAX__|__LONG_LONG_MAX__|__WINT_MAX__|__SIZE_MAX__|__PTRDIFF_MAX__|__INTMAX_MAX__|__UINTMAX_MAX__|__SIG_ATOMIC_MAX__|__INT8_MAX__|__INT16_MAX__|__INT32_MAX__|__INT64_MAX__|__UINT8_MAX__|__UINT16_MAX__|__UINT32_MAX__|__UINT64_MAX__|__INT_LEAST8_MAX__|__INT_LEAST16_MAX__|__INT_LEAST32_MAX__|__INT_LEAST64_MAX__|__UINT_LEAST8_MAX__|__UINT_LEAST16_MAX__|__UINT_LEAST32_MAX__|__UINT_LEAST64_MAX__|__INT_FAST8_MAX__|__INT_FAST16_MAX__|__INT_FAST32_MAX__|__INT_FAST64_MAX__|__UINT_FAST8_MAX__|__UINT_FAST16_MAX__|__UINT_FAST32_MAX__|__UINT_FAST64_MAX__|__INTPTR_MAX__|__UINTPTR_MAX__|__WCHAR_MIN__|__WINT_MIN__|__SIG_ATOMIC_MIN__|__SCHAR_WIDTH__|__SHRT_WIDTH__|__INT_WIDTH__|__LONG_WIDTH__|__LONG_LONG_WIDTH__|__PTRDIFF_WIDTH__|__SIG_ATOMIC_WIDTH__|__SIZE_WIDTH__|__WCHAR_WIDTH__|__WINT_WIDTH__|__INT_LEAST8_WIDTH__|__INT_LEAST16_WIDTH__|__INT_LEAST32_WIDTH__|__INT_LEAST64_WIDTH__|__INT_FAST8_WIDTH__|__INT_FAST16_WIDTH__|__INT_FAST32_WIDTH__|__INT_FAST64_WIDTH__|__INTPTR_WIDTH__|__INTMAX_WIDTH__|__SIZEOF_INT__|__SIZEOF_LONG__|__SIZEOF_LONG_LONG__|__SIZEOF_SHORT__|__SIZEOF_POINTER__|__SIZEOF_FLOAT__|__SIZEOF_DOUBLE__|__SIZEOF_LONG_DOUBLE__|__SIZEOF_SIZE_T__|__SIZEOF_WCHAR_T__|__SIZEOF_WINT_T__|__SIZEOF_PTRDIFF_T__|__BYTE_ORDER__|__ORDER_LITTLE_ENDIAN__|__ORDER_BIG_ENDIAN__|__ORDER_PDP_ENDIAN__|__FLOAT_WORD_ORDER__|__DEPRECATED|__EXCEPTIONS|__GXX_RTTI|__USING_SJLJ_EXCEPTIONS__|__GXX_EXPERIMENTAL_CXX0X__|__GXX_WEAK__|__NEXT_RUNTIME__|__LP64__|_LP64|__SSP__|__SSP_ALL__|__SSP_STRONG__|__SSP_EXPLICIT__|__SANITIZE_ADDRESS__|__SANITIZE_THREAD__|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8|__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16|__HAVE_SPECULATION_SAFE_VALUE|__GCC_HAVE_DWARF2_CFI_ASM|__FP_FAST_FMA|__FP_FAST_FMAF|__FP_FAST_FMAL|__FP_FAST_FMAF16|__FP_FAST_FMAF32|__FP_FAST_FMAF64|__FP_FAST_FMAF128|__FP_FAST_FMAF32X|__FP_FAST_FMAF64X|__FP_FAST_FMAF128X|__GCC_IEC_559|__GCC_IEC_559_COMPLEX|__NO_MATH_ERRNO__|__has_builtin|__has_feature|__has_extension|__has_cpp_attribute|__has_c_attribute|__has_attribute|__has_declspec_attribute|__is_identifier|__has_include|__has_include_next|__has_warning|__BASE_FILE__|__FILE_NAME__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__fp16|_Float16)\\b", - "captures": { - "1": { - "name": "entity.name.other.preprocessor.macro.predefined.$1.cpp" - } - } - }, - { - "match": "\\b__([A-Z_]+)__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.probably.$1.cpp" + "include": "source.cpp#line_continuation_character" } ] }, @@ -10142,30 +8072,31 @@ "include": "#comments" }, { - "include": "#language_constants" + "include": "source.cpp#language_constants" }, { - "include": "#string_context_c" + "include": "#d9bc4796b0b_string_context_c" }, { - "include": "#preprocessor_number_literal" + "include": "source.cpp#d9bc4796b0b_preprocessor_number_literal" }, { "include": "#operators" }, { - "include": "#predefined_macros" + "include": "source.cpp#predefined_macros" }, { - "include": "#macro_name" + "include": "source.cpp#macro_name" }, { - "include": "#line_continuation_character" + "include": "source.cpp#line_continuation_character" } ] }, "preprocessor_conditional_defined": { "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?:(?:ifndef|ifdef)|if)))", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?:(?:ifndef|ifdef)|if))", + "end": "^(?!\\s*+#\\s*(?:else|endif))|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(?![\\w<:.])", - "captures": { - "0": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_call_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_call_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.call.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - } - } - }, - "scope_resolution_function_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.definition.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - } - } - }, - "scope_resolution_function_definition_operator_overload": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_operator_overload_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_definition_operator_overload_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_operator_overload_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.definition.operator-overload.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - } - } - }, - "scope_resolution_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - } - } - }, - "scope_resolution_namespace_alias": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_alias_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_alias_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_alias_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.alias.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - } - } - }, - "scope_resolution_namespace_block": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_block_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_block_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_block_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.block.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - } - } - }, - "scope_resolution_namespace_using": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_using_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_using_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_using_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.using.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - } - } - }, - "scope_resolution_parameter": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_parameter_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_parameter_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_parameter_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.parameter.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - } - } - }, - "scope_resolution_template_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_template_call_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_template_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_template_call_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.template.call.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - } - } - }, - "scope_resolution_template_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_template_definition_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_template_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_template_definition_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.template.definition.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - } - } - }, - "semicolon": { - "match": ";", - "name": "punctuation.terminator.statement.cpp" - }, - "simple_type": { - "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?", - "captures": { - "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "single_line_macro": { - "match": "^((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))#define.*(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "(\\bsizeof\\.\\.\\.)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", - "captures": { - "1": { - "name": "storage.type.struct.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.struct.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, "switch_conditional_parentheses": { - "name": "meta.conditional.switch.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?>[^<>]*)\\g<1>?)+)>)\\s*", - "captures": { - "0": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, "template_call_range": { - "name": "meta.template.call.cpp", - "begin": "(<)", + "begin": "<", + "end": ">|(?=(?)|(?=(?|(?=(?)|(?=(?|(?=(?)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*(?:(,)|(?=>|$))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "storage.type.template.argument.$5.cpp" - }, - "6": { - "patterns": [ - { - "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", - "name": "storage.type.template.argument.$0.cpp" - } - ] - }, - "7": { - "name": "entity.name.type.template.cpp" - }, - "8": { - "name": "storage.type.template.cpp" - }, - "9": { - "name": "punctuation.vararg-ellipses.template.definition.cpp" - }, - "10": { - "name": "entity.name.type.template.cpp" - }, - "11": { - "name": "punctuation.separator.delimiter.comma.template.argument.cpp" - } - } - }, "template_definition_context": { "patterns": [ { - "include": "#scope_resolution_template_definition_inner_generated" + "include": "source.cpp#scope_resolution_template_definition_inner_generated" }, { - "include": "#template_definition_argument" + "include": "source.cpp#template_definition_argument" }, { - "include": "#template_argument_defaulted" + "include": "source.cpp#template_argument_defaulted" }, { - "include": "#template_call_innards" + "include": "source.cpp#template_call_innards" }, { "include": "#evaluation_context" } ] }, - "template_isolated_definition": { - "match": "(?\\s*$)", - "captures": { - "1": { - "name": "storage.type.template.cpp" - }, - "2": { - "name": "punctuation.section.angle-brackets.start.template.definition.cpp" - }, - "3": { - "name": "meta.template.definition.cpp", - "patterns": [ - { - "include": "#template_definition_context" - } - ] - }, - "4": { - "name": "punctuation.section.angle-brackets.end.template.definition.cpp" - } - } - }, "ternary_operator": { - "applyEndPatternLast": true, - "begin": "(\\?)", + "begin": "\\?", + "end": ":|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))\\s*(\\=)\\s*((?:typename)?)\\s*((?:(?:(?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)(?:(?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))|(.*(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:(\\[)(\\w*)(\\])\\s*)?\\s*(?:(;)|\\n)", - "captures": { - "1": { - "name": "keyword.other.using.directive.cpp" - }, - "2": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "61": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "62": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "63": { - "name": "comment.block.cpp" - }, - "64": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "65": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "66": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "67": { - "name": "comment.block.cpp" - }, - "68": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "69": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "70": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "71": { - "name": "comment.block.cpp" - }, - "72": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "73": { - "name": "punctuation.definition.begin.bracket.square.cpp" - }, - "74": { - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "75": { - "name": "punctuation.definition.end.bracket.square.cpp" - }, - "76": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "name": "meta.declaration.type.alias.cpp" - }, - "type_casting_operators": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -13998,7 +9588,7 @@ "2": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14023,7 +9613,7 @@ "6": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14048,7 +9638,7 @@ "10": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14085,22 +9675,24 @@ ] }, "typedef_function_pointer": { - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14304,70 +9916,70 @@ } ] }, - "29": { + "27": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "31": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "35": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] }, "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "39": { + "37": { "name": "comment.block.cpp" }, - "40": { + "38": { "patterns": [ { "match": "\\*\\/", @@ -14379,36 +9991,35 @@ } ] }, - "41": { + "39": { "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, - "42": { + "40": { "name": "punctuation.definition.function.pointer.dereference.cpp" }, - "43": { + "41": { "name": "entity.name.type.alias.cpp entity.name.type.pointer.function.cpp" }, - "44": { + "42": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "45": { + "43": { "patterns": [ { "include": "#evaluation_context" } ] }, - "46": { + "44": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "47": { + "45": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "48": { + "46": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14826,7 +10402,7 @@ "2": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14851,7 +10427,7 @@ "6": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14876,7 +10452,7 @@ "10": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -14913,101 +10489,102 @@ ] }, "typedef_union": { - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -15258,7 +10832,7 @@ "2": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -15283,7 +10857,7 @@ "6": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -15308,7 +10882,7 @@ "10": { "patterns": [ { - "include": "#inline_comment" + "include": "source.cpp#inline_comment" } ] }, @@ -15345,8 +10919,8 @@ ] }, "typeid_operator": { - "contentName": "meta.arguments.operator.typeid.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(?![\\w<:.]))", - "captures": { - "1": { - "name": "storage.modifier.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*undef\\b)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=(?|\\?\\?>|(?=(?|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)|(?=(?|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)|(?=(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", - "captures": { - "1": { - "name": "storage.type.union.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.union.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "using_name": { - "match": "(using)\\s+(?!namespace\\b)", - "captures": { - "1": { - "name": "keyword.other.using.directive.cpp" - } - } - }, "using_namespace": { - "name": "meta.using-namespace.cpp", - "begin": "(?(?:(?>[^<>]*)\\g<7>?)+)>)\\s*)?::)*\\s*+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)?((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(((?:protected|private|public))\\s*(:))", + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?:(?:protected)|(?:private)|(?:public)))(?:(?:\\s)+)?(:))", "captures": { "1": { "patterns": [ @@ -105,45 +105,55 @@ ] }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "storage.type.modifier.access.control.$6.cpp" + "3": { + "name": "storage.type.modifier.access.control.$4.cpp" }, - "7": { + "4": {}, + "5": { "name": "punctuation.separator.colon.access.control.cpp" } } }, "alignas_attribute": { - "name": "support.other.attribute.cpp", - "begin": "(alignas\\()", + "begin": "alignas\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.begin.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.end.cpp" } }, + "name": "support.other.attribute.cpp", "patterns": [ { "include": "#attributes_context" @@ -151,6 +161,8 @@ { "begin": "\\(", "end": "\\)", + "beginCaptures": {}, + "endCaptures": {}, "patterns": [ { "include": "#attributes_context" @@ -161,7 +173,7 @@ ] }, { - "match": "(using)\\s+((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp" @@ -228,12 +240,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp" } }, + "contentName": "meta.arguments.operator.alignas", "patterns": [ { "include": "#evaluation_context" @@ -241,8 +253,8 @@ ] }, "alignof_operator": { - "contentName": "meta.arguments.operator.alignof.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.alignof.cpp" @@ -276,12 +288,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.alignof.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.alignof.cpp" } }, + "contentName": "meta.arguments.operator.alignof", "patterns": [ { "include": "#evaluation_context" @@ -289,96 +301,221 @@ ] }, "assembly": { - "name": "meta.asm.cpp", - "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", + "begin": "(\\b(?:__asm__|asm)\\b)(?:(?:\\s)+)?((?:volatile)?)", + "end": "(?!\\G)", "beginCaptures": { "1": { "name": "storage.type.asm.cpp" }, "2": { "name": "storage.modifier.cpp" - }, - "3": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.cpp" } }, + "endCaptures": {}, + "name": "meta.asm.cpp", "patterns": [ { - "name": "string.quoted.double.cpp", - "contentName": "meta.embedded.assembly.cpp", - "begin": "(R?)(\")", - "beginCaptures": { + "match": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\n)|$)", + "captures": { "1": { - "name": "meta.encoding.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "2": { - "name": "punctuation.definition.string.begin.assembly.cpp" - } - }, - "end": "(\")", - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.assembly.cpp" - } - }, - "patterns": [ - { - "include": "source.asm" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - { - "include": "source.x86" + "3": { + "name": "comment.block.cpp" }, - { - "include": "source.x86_64" - }, - { - "include": "source.arm" - }, - { - "include": "#backslash_escapes" - }, - { - "include": "#string_escaped_char" - }, - { - "match": "(?=not)possible" + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] } - ] - }, - { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.inner.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": ":", - "name": "punctuation.separator.delimiter.colon.assembly.cpp" + } }, { "include": "#comments_context" }, { "include": "#comments" + }, + { + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\(", + "end": "\\)", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.cpp" + }, + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.assembly.cpp" + } + }, + "patterns": [ + { + "begin": "(R?)(\")", + "end": "\"", + "beginCaptures": { + "1": { + "name": "meta.encoding.cpp" + }, + "2": { + "name": "punctuation.definition.string.begin.assembly.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.assembly.cpp" + } + }, + "name": "string.quoted.double.cpp", + "contentName": "meta.embedded.assembly", + "patterns": [ + { + "include": "source.asm" + }, + { + "include": "source.x86" + }, + { + "include": "source.x86_64" + }, + { + "include": "source.arm" + }, + { + "include": "#backslash_escapes" + }, + { + "include": "#string_escaped_char" + } + ] + }, + { + "begin": "\\(", + "end": "\\)", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.assembly.inner.cpp" + } + }, + "patterns": [ + { + "include": "#evaluation_context" + } + ] + }, + { + "match": "\\[((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "5": { + "name": "variable.other.asm.label.cpp" + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "8": { + "name": "comment.block.cpp" + }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + }, + { + "match": ":", + "name": "punctuation.separator.delimiter.colon.assembly.cpp" + }, + { + "include": "#comments_context" + }, + { + "include": "#comments" + } + ] } ] }, @@ -403,23 +540,23 @@ ] }, "backslash_escapes": { - "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", - "name": "constant.character.escape.cpp" + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3][0-7]{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "name": "constant.character.escape" }, "block": { - "name": "meta.block.cpp", - "begin": "({)", + "begin": "{", + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.cpp" } }, - "end": "(}|(?=\\s*#\\s*(?:elif|else|endif)\\b))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.cpp" } }, + "name": "meta.block.cpp", "patterns": [ { "include": "#function_body_context" @@ -427,22 +564,23 @@ ] }, "block_comment": { - "name": "comment.block.cpp", "begin": "\\s*+(\\/\\*)", + "end": "\\*\\/", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.cpp" } }, - "end": "(\\*\\/)", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.comment.end.cpp" } - } + }, + "name": "comment.block.cpp" }, "builtin_storage_type_initilizer": { - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "patterns": [ @@ -610,9 +748,8 @@ "name": "punctuation.section.arguments.begin.bracket.round.initializer.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.initializer.cpp" } }, @@ -623,8 +760,8 @@ ] }, "case_statement": { - "name": "meta.conditional.case.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.class.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -768,7 +905,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -778,76 +915,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -859,20 +996,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -884,18 +1021,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -904,16 +1033,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.class.cpp", "patterns": [ { - "name": "meta.head.class.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.class.cpp" } }, + "name": "meta.head.class.cpp", "patterns": [ { "include": "#ever_present_context" @@ -927,14 +1058,15 @@ ] }, { - "name": "meta.body.class.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.class.cpp" } }, + "name": "meta.body.class.cpp", "patterns": [ { "include": "#function_pointer" @@ -954,9 +1086,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -966,7 +1100,7 @@ ] }, "class_declare": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", "captures": { "1": { "name": "storage.type.class.declare.cpp" @@ -979,34 +1113,43 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.class.cpp" }, - "7": { + "5": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -1042,6 +1185,40 @@ } ] }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "8": { "patterns": [ { @@ -1050,98 +1227,100 @@ ] }, "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "10": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "11": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { "name": "variable.other.object.declare.cpp" }, - "21": { + "13": { "patterns": [ { "include": "#inline_comment" } ] }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { + "14": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } @@ -1158,14 +1337,15 @@ "comments": { "patterns": [ { - "name": "comment.line.double-slash.documentation.cpp", - "begin": "(?:^)(?>\\s*)(\\/\\/[!\\/]+)", + "begin": "^(?:(?:\\s)+)?+(\\/\\/[!\\/]+)", + "end": "(?<=\\n)(?\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))", + "begin": "(?:(?:\\s)+)?+\\/\\*[!*]+(?:(?:(?:\\n)|$)|(?=\\s))", + "end": "[!*]*\\*\\/", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.comment.begin.documentation.cpp" } }, - "end": "([!*]*\\*\\/)", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.comment.end.documentation.cpp" } }, + "name": "comment.block.documentation.cpp", "patterns": [ { "match": "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||\\-\\-|\\-\\-\\-)\\b(?:\\{[^}]*\\})?", "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1355,7 +1551,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@]b)(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1366,7 +1562,7 @@ } }, { - "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)", + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))(?:\\s)+(\\S+)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" @@ -1385,12 +1581,20 @@ "name": "storage.type.class.doxygen.cpp" }, { - "match": "((?<=[\\s*!\\/])[\\\\@]param)\\s+(\\b\\w+\\b)", + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?(?:(?:\\s)+)?(?:in|out)(?:(?:\\s)+)?)+)\\])?(?:\\s)+(\\b\\w+\\b)", "captures": { "1": { "name": "storage.type.class.doxygen.cpp" }, "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.cpp" + } + ] + }, + "3": { "name": "variable.parameter.cpp" } } @@ -1424,26 +1628,26 @@ ] }, "constructor_inline": { - "name": "meta.function.definition.special.constructor.cpp", - "begin": "(^((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:constexpr|explicit|mutable|virtual|inline|friend)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:constexpr)|(?:explicit)|(?:mutable)|(?:virtual)|(?:inline)|(?:friend))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.special.constructor.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -1455,52 +1659,52 @@ } ] }, + "5": { + "patterns": [ + { + "include": "#functional_specifiers_pre_parameters" + } + ] + }, "6": { "patterns": [ { - "include": "#functional_specifiers_pre_parameters" + "include": "#inline_comment" } ] }, "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "9": { + "8": { "name": "comment.block.cpp" }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "10": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "11": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "13": { "name": "comment.block.cpp" }, - "14": { + "13": { "patterns": [ { "match": "\\*\\/", @@ -1512,23 +1716,23 @@ } ] }, - "15": { + "14": { "name": "storage.type.modifier.calling-convention.cpp" }, - "16": { + "15": { "patterns": [ { "include": "#inline_comment" } ] }, - "17": { + "16": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "18": { + "17": { "name": "comment.block.cpp" }, - "19": { + "18": { "patterns": [ { "match": "\\*\\/", @@ -1540,83 +1744,82 @@ } ] }, - "20": { + "19": { "name": "entity.name.function.constructor.cpp entity.name.function.definition.special.constructor.cpp" } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.special.constructor.cpp", "patterns": [ { - "name": "meta.head.function.definition.special.constructor.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp" } }, + "name": "meta.head.function.definition.special.constructor.cpp", "patterns": [ { "include": "#ever_present_context" }, { - "patterns": [ - { - "match": "(\\=)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { "include": "#functional_specifiers_pre_parameters" }, { - "begin": "(:)", + "begin": ":", + "end": "(?=\\{)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.separator.initializers.cpp" } }, - "end": "(?=\\{)", + "endCaptures": {}, "patterns": [ { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", + "begin": "((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "entity.name.function.call.initializer.cpp" @@ -1629,16 +1832,17 @@ } ] }, + "3": {}, "4": { "name": "punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp" } }, + "contentName": "meta.parameter.initialization", "patterns": [ { "include": "#evaluation_context" @@ -1646,8 +1850,8 @@ ] }, { - "contentName": "meta.parameter.initialization.cpp", "begin": "((?|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp" } }, + "name": "meta.body.function.definition.special.constructor.cpp", "patterns": [ { "include": "#function_body_context" @@ -1720,9 +1926,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.special.constructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -1732,26 +1940,26 @@ ] }, "constructor_root": { - "name": "meta.function.definition.special.constructor.cpp", - "begin": "(\\s*+((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))::((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\16((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\()))", + "begin": "\\s*+((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.special.constructor.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -1763,23 +1971,23 @@ } ] }, - "6": { + "5": { "name": "storage.type.modifier.calling-convention.cpp" }, - "7": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { + "7": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "9": { + "8": { "name": "comment.block.cpp" }, - "10": { + "9": { "patterns": [ { "match": "\\*\\/", @@ -1791,7 +1999,7 @@ } ] }, - "11": { + "10": { "patterns": [ { "match": "::", @@ -1806,7 +2014,7 @@ } ] }, - "13": { + "11": { "name": "meta.template.call.cpp", "patterns": [ { @@ -1814,7 +2022,8 @@ } ] }, - "15": { + "12": {}, + "13": { "patterns": [ { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?=:)", @@ -1830,45 +2039,46 @@ } ] }, - "17": { + "14": {}, + "15": { "patterns": [ { "include": "#inline_comment" } ] }, + "16": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "17": { + "name": "comment.block.cpp" + }, "18": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "19": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "20": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { "name": "comment.block.cpp" }, - "24": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -1880,20 +2090,20 @@ } ] }, - "25": { + "23": { "patterns": [ { "include": "#inline_comment" } ] }, - "26": { + "24": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "27": { + "25": { "name": "comment.block.cpp" }, - "28": { + "26": { "patterns": [ { "match": "\\*\\/", @@ -1906,79 +2116,78 @@ ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.special.constructor.cpp", "patterns": [ { - "name": "meta.head.function.definition.special.constructor.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp" } }, + "name": "meta.head.function.definition.special.constructor.cpp", "patterns": [ { "include": "#ever_present_context" }, { - "patterns": [ - { - "match": "(\\=)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { "include": "#functional_specifiers_pre_parameters" }, { - "begin": "(:)", + "begin": ":", + "end": "(?=\\{)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.separator.initializers.cpp" } }, - "end": "(?=\\{)", + "endCaptures": {}, "patterns": [ { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", + "begin": "((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "entity.name.function.call.initializer.cpp" @@ -1991,16 +2200,17 @@ } ] }, + "3": {}, "4": { "name": "punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp" } }, + "contentName": "meta.parameter.initialization", "patterns": [ { "include": "#evaluation_context" @@ -2008,8 +2218,8 @@ ] }, { - "contentName": "meta.parameter.initialization.cpp", "begin": "((?|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp" } }, + "name": "meta.body.function.definition.special.constructor.cpp", "patterns": [ { "include": "#function_body_context" @@ -2082,9 +2294,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.special.constructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -2094,7 +2308,7 @@ ] }, "control_flow_keywords": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "keyword.control.$5.cpp" + "3": { + "name": "keyword.control.$3.cpp" } } }, "cpp_attributes": { - "name": "support.other.attribute.cpp", - "begin": "(\\[\\[)", + "begin": "\\[\\[", + "end": "\\]\\]", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.begin.cpp" } }, - "end": "(\\]\\])", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.end.cpp" } }, + "name": "support.other.attribute.cpp", "patterns": [ { "include": "#attributes_context" @@ -2147,6 +2370,8 @@ { "begin": "\\(", "end": "\\)", + "beginCaptures": {}, + "endCaptures": {}, "patterns": [ { "include": "#attributes_context" @@ -2157,7 +2382,7 @@ ] }, { - "match": "(using)\\s+((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", + "end": "\\}", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -2289,17 +2531,17 @@ } ] }, - "12": { + "11": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "13": { + "12": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "15": { + "13": { "name": "meta.template.call.cpp", "patterns": [ { @@ -2307,10 +2549,11 @@ } ] }, - "17": { + "14": {}, + "15": { "name": "entity.name.scope-resolution.cpp" }, - "18": { + "16": { "name": "meta.template.call.cpp", "patterns": [ { @@ -2318,23 +2561,24 @@ } ] }, + "17": {}, + "18": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, "20": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "23": { + "21": { "name": "comment.block.cpp" }, - "24": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -2346,10 +2590,10 @@ } ] }, - "25": { + "23": { "name": "entity.name.type.cpp" }, - "26": { + "24": { "name": "meta.template.call.cpp", "patterns": [ { @@ -2357,20 +2601,21 @@ } ] }, - "28": { + "25": {}, + "26": { "patterns": [ { "include": "#inline_comment" } ] }, - "29": { + "27": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "30": { + "28": { "name": "comment.block.cpp" }, - "31": { + "29": { "patterns": [ { "match": "\\*\\/", @@ -2382,16 +2627,16 @@ } ] }, - "32": { + "30": { "name": "punctuation.section.arguments.begin.bracket.curly.initializer.cpp" } }, - "end": "(\\})", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.curly.initializer.cpp" } }, + "name": "meta.initialization.cpp", "patterns": [ { "include": "#evaluation_context" @@ -2401,9 +2646,501 @@ } ] }, + "d9bc4796b0b_module_import": { + "match": "^((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((import))(?:(?:\\s)+)?(?:(?:(?:((<)[^>]*(>?)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/)))|((\\\")[^\\\"]*((?:\\\")?)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/))))|(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;)))))|((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;))))(?:(?:\\s)+)?(;?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "3": { + "name": "keyword.control.directive.import.cpp" + }, + "5": { + "name": "string.quoted.other.lt-gt.include.cpp" + }, + "6": { + "name": "punctuation.definition.string.begin.cpp" + }, + "7": { + "name": "punctuation.definition.string.end.cpp" + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "name": "string.quoted.double.include.cpp" + }, + "11": { + "name": "punctuation.definition.string.begin.cpp" + }, + "12": { + "name": "punctuation.definition.string.end.cpp" + }, + "13": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "14": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "15": { + "name": "entity.name.other.preprocessor.macro.include.cpp" + }, + "16": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "17": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "18": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "19": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "20": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "21": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "22": { + "name": "punctuation.terminator.statement.cpp" + } + }, + "name": "meta.preprocessor.import.cpp" + }, + "d9bc4796b0b_preprocessor_number_literal": { + "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.other.decltype.cpp storage.type.decltype.cpp" @@ -2437,12 +3174,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.decltype.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.decltype.cpp" } }, + "contentName": "meta.arguments.decltype", "patterns": [ { "include": "#evaluation_context" @@ -2450,8 +3187,8 @@ ] }, "decltype_specifier": { - "contentName": "meta.arguments.decltype.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.other.decltype.cpp storage.type.decltype.cpp" @@ -2485,12 +3222,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.decltype.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.decltype.cpp" } }, + "contentName": "meta.arguments.decltype", "patterns": [ { "include": "#evaluation_context" @@ -2498,8 +3235,8 @@ ] }, "default_statement": { - "name": "meta.conditional.case.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:constexpr|explicit|mutable|virtual|inline|friend)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)(~(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:constexpr)|(?:explicit)|(?:mutable)|(?:virtual)|(?:inline)|(?:friend))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(~(?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.special.member.destructor.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { "name": "comment.block.cpp" }, - "9": { + "8": { "patterns": [ { "match": "\\*\\/", @@ -2602,23 +3339,23 @@ } ] }, - "10": { + "9": { "name": "storage.type.modifier.calling-convention.cpp" }, - "11": { + "10": { "patterns": [ { "include": "#inline_comment" } ] }, - "12": { + "11": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "13": { + "12": { "name": "comment.block.cpp" }, - "14": { + "13": { "patterns": [ { "match": "\\*\\/", @@ -2630,27 +3367,27 @@ } ] }, - "15": { + "14": { "patterns": [ { "include": "#functional_specifiers_pre_parameters" } ] }, - "16": { + "15": { "patterns": [ { "include": "#inline_comment" } ] }, - "17": { + "16": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "18": { + "17": { "name": "comment.block.cpp" }, - "19": { + "18": { "patterns": [ { "match": "\\*\\/", @@ -2662,82 +3399,81 @@ } ] }, - "20": { + "19": { "name": "entity.name.function.destructor.cpp entity.name.function.definition.special.member.destructor.cpp" } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.special.member.destructor.cpp", "patterns": [ { - "name": "meta.head.function.definition.special.member.destructor.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.member.destructor.cpp" } }, + "name": "meta.head.function.definition.special.member.destructor.cpp", "patterns": [ { "include": "#ever_present_context" }, { - "patterns": [ - { - "match": "(\\=)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.begin.bracket.round.special.member.destructor.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.end.bracket.round.special.member.destructor.cpp" } - } + }, + "contentName": "meta.function.definition.parameters.special.member.destructor", + "patterns": [] }, { "include": "$self" @@ -2745,14 +3481,15 @@ ] }, { - "name": "meta.body.function.definition.special.member.destructor.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.special.member.destructor.cpp" } }, + "name": "meta.body.function.definition.special.member.destructor.cpp", "patterns": [ { "include": "#function_body_context" @@ -2760,9 +3497,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -2772,26 +3511,26 @@ ] }, "destructor_root": { - "name": "meta.function.definition.special.member.destructor.cpp", - "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))::((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))~\\16((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\()))", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.special.member.destructor.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -2803,23 +3542,23 @@ } ] }, - "6": { + "5": { "name": "storage.type.modifier.calling-convention.cpp" }, - "7": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { + "7": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "9": { + "8": { "name": "comment.block.cpp" }, - "10": { + "9": { "patterns": [ { "match": "\\*\\/", @@ -2831,7 +3570,7 @@ } ] }, - "11": { + "10": { "patterns": [ { "match": "::", @@ -2846,7 +3585,7 @@ } ] }, - "13": { + "11": { "name": "meta.template.call.cpp", "patterns": [ { @@ -2854,7 +3593,8 @@ } ] }, - "15": { + "12": {}, + "13": { "patterns": [ { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?=:)", @@ -2870,45 +3610,46 @@ } ] }, - "17": { + "14": {}, + "15": { "patterns": [ { "include": "#inline_comment" } ] }, + "16": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "17": { + "name": "comment.block.cpp" + }, "18": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "19": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "20": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { "name": "comment.block.cpp" }, - "24": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -2920,20 +3661,20 @@ } ] }, - "25": { + "23": { "patterns": [ { "include": "#inline_comment" } ] }, - "26": { + "24": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "27": { + "25": { "name": "comment.block.cpp" }, - "28": { + "26": { "patterns": [ { "match": "\\*\\/", @@ -2946,78 +3687,77 @@ ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.special.member.destructor.cpp", "patterns": [ { - "name": "meta.head.function.definition.special.member.destructor.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.member.destructor.cpp" } }, + "name": "meta.head.function.definition.special.member.destructor.cpp", "patterns": [ { "include": "#ever_present_context" }, { - "patterns": [ - { - "match": "(\\=)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" } - } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.constructor.cpp" + }, + "7": { + "name": "keyword.other.delete.constructor.cpp" } - ] + } }, { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.begin.bracket.round.special.member.destructor.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.end.bracket.round.special.member.destructor.cpp" } - } + }, + "contentName": "meta.function.definition.parameters.special.member.destructor", + "patterns": [] }, { "include": "$self" @@ -3025,14 +3765,15 @@ ] }, { - "name": "meta.body.function.definition.special.member.destructor.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.special.member.destructor.cpp" } }, + "name": "meta.body.function.definition.special.member.destructor.cpp", "patterns": [ { "include": "#function_body_context" @@ -3040,9 +3781,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -3052,8 +3795,8 @@ ] }, "diagnostic": { - "name": "meta.preprocessor.diagnostic.$reference(directive).cpp", - "begin": "((?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?:error|warning)))\\b\\s*", + "begin": "(^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?:error|warning)))\\b(?:(?:\\s)+)?", + "end": "(?[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*(?:\\n|$)))|(^\\s*((\\/\\*)\\s*?((?>[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*\\*\\/)))", + "match": "(?:(^(?:(?:\\s)+)?((\\/\\/)(?:(?:\\s)+)?((?:[#;\\/=*C~]+)++(?![#;\\/=*C~]))(?:(?:\\s)+)?.+(?:(?:\\s)+)?\\4(?:(?:\\s)+)?(?:\\n|$)))|(^(?:(?:\\s)+)?((\\/\\*)(?:(?:\\s)+)?((?:[#;\\/=*C~]+)++(?![#;\\/=*C~]))(?:(?:\\s)+)?.+(?:(?:\\s)+)?\\8(?:(?:\\s)+)?\\*\\/)))", "captures": { "1": { "name": "meta.toc-list.banner.double-slash.cpp" @@ -3174,23 +3921,23 @@ } }, "empty_square_brackets": { - "name": "storage.modifier.array.bracket.square.cpp", - "match": "(?-mix:(?-mix:(?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?(::))?\\s*((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:(?:\\s)+)?)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.enum.cpp" }, - "2": { + "1": { "name": "storage.type.enum.cpp" }, - "3": { - "name": "storage.type.enum.enum-key.$3.cpp" + "2": { + "name": "storage.type.enum.enum-key.$2.cpp" }, - "4": { + "3": { "patterns": [ { "include": "#attributes_context" @@ -3200,22 +3947,34 @@ } ] }, - "5": { + "4": { "name": "entity.name.type.enum.cpp" }, - "6": { + "5": { "name": "punctuation.separator.colon.type-specifier.cpp" }, - "8": { + "6": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "9": { + "7": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, + "8": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "9": {}, + "10": { + "name": "entity.name.scope-resolution.cpp" + }, "11": { "name": "meta.template.call.cpp", "patterns": [ @@ -3224,25 +3983,14 @@ } ] }, + "12": {}, "13": { - "name": "entity.name.scope-resolution.cpp" - }, - "14": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "16": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "17": { - "name": "storage.type.integral.$17.cpp" + "14": { + "name": "storage.type.integral.$14.cpp" } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -3251,16 +3999,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.enum.cpp", "patterns": [ { - "name": "meta.head.enum.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.enum.cpp" } }, + "name": "meta.head.enum.cpp", "patterns": [ { "include": "$self" @@ -3268,14 +4018,15 @@ ] }, { - "name": "meta.body.enum.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.enum.cpp" } }, + "name": "meta.body.enum.cpp", "patterns": [ { "include": "#ever_present_context" @@ -3295,9 +4046,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.enum.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -3307,7 +4060,7 @@ ] }, "enum_declare": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", "captures": { "1": { "name": "storage.type.enum.declare.cpp" @@ -3320,34 +4073,43 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.enum.cpp" }, - "7": { + "5": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -3383,6 +4145,40 @@ } ] }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "8": { "patterns": [ { @@ -3391,105 +4187,107 @@ ] }, "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "10": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "11": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { "name": "variable.other.object.declare.cpp" }, - "21": { + "13": { "patterns": [ { "include": "#inline_comment" } ] }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { + "14": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "enumerator_list": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "keyword.control.exception.$5.cpp" + "3": { + "name": "keyword.control.exception.$3.cpp" } } }, "extern_block": { - "name": "meta.block.extern.cpp", - "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(extern)(?=\\s*\\\"))", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(extern)(?=\\s*\\\")", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.extern.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -3726,11 +4527,10 @@ } ] }, - "6": { + "5": { "name": "storage.type.extern.cpp" } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -3739,16 +4539,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.extern.cpp", "patterns": [ { - "name": "meta.head.extern.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.extern.cpp" } }, + "name": "meta.head.extern.cpp", "patterns": [ { "include": "$self" @@ -3756,14 +4558,15 @@ ] }, { - "name": "meta.body.extern.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.extern.cpp" } }, + "name": "meta.body.extern.cpp", "patterns": [ { "include": "$self" @@ -3771,9 +4574,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.extern.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -3812,7 +4617,7 @@ "include": "#typedef_union" }, { - "include": "#typedef_keyword" + "include": "#misc_keywords" }, { "include": "#standard_declares" @@ -3859,7 +4664,8 @@ ] }, "function_call": { - "begin": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(((?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?(\\()", + "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:(?:\\s)+)?)?(\\()", + "end": "\\)", "beginCaptures": { "1": { "patterns": [ @@ -3871,7 +4677,7 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" }, - "4": { + "3": { "name": "meta.template.call.cpp", "patterns": [ { @@ -3879,23 +4685,24 @@ } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.function.call.cpp" }, - "7": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { + "7": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "9": { + "8": { "name": "comment.block.cpp" }, - "10": { + "9": { "patterns": [ { "match": "\\*\\/", @@ -3907,7 +4714,7 @@ } ] }, - "11": { + "10": { "name": "meta.template.call.cpp", "patterns": [ { @@ -3915,13 +4722,13 @@ } ] }, - "13": { + "11": {}, + "12": { "name": "punctuation.section.arguments.begin.bracket.round.function.call.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.function.call.cpp" } }, @@ -3932,26 +4739,26 @@ ] }, "function_definition": { - "name": "meta.function.definition.cpp", - "begin": "((?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<70>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\())", + "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<66>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -3963,38 +4770,38 @@ } ] }, - "6": { + "5": { "name": "storage.type.template.cpp" }, - "7": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { + "7": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "9": { + "8": { "name": "comment.block.cpp" }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "10": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))", + "match": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))", "captures": { "1": { "name": "storage.modifier.$1.cpp" @@ -4028,23 +4835,23 @@ } ] }, - "12": { - "name": "storage.modifier.$1.cpp" + "11": { + "name": "storage.modifier.$11.cpp" }, - "13": { + "12": { "patterns": [ { "include": "#inline_comment" } ] }, - "14": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "15": { + "14": { "name": "comment.block.cpp" }, - "16": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -4056,11 +4863,11 @@ } ] }, - "17": { + "16": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -4093,7 +4917,7 @@ } ] }, - "18": { + "17": { "patterns": [ { "include": "#attributes_context" @@ -4103,45 +4927,45 @@ } ] }, - "19": { + "18": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "19": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "20": { "name": "comment.block.cpp" }, + "21": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { "patterns": [ { "include": "#inline_comment" } ] }, - "24": { + "23": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "25": { + "24": { "name": "comment.block.cpp" }, - "26": { + "25": { "patterns": [ { "match": "\\*\\/", @@ -4153,16 +4977,28 @@ } ] }, - "28": { + "26": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "29": { + "27": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, + "28": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "29": {}, + "30": { + "name": "entity.name.scope-resolution.cpp" + }, "31": { "name": "meta.template.call.cpp", "patterns": [ @@ -4171,34 +5007,24 @@ } ] }, + "32": {}, "33": { - "name": "entity.name.scope-resolution.cpp" - }, - "34": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "36": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "37": { + "34": { "patterns": [ { "include": "#inline_comment" } ] }, - "38": { + "35": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "39": { + "36": { "name": "comment.block.cpp" }, - "40": { + "37": { "patterns": [ { "match": "\\*\\/", @@ -4210,10 +5036,10 @@ } ] }, - "41": { + "38": { "name": "entity.name.type.cpp" }, - "42": { + "39": { "name": "meta.template.call.cpp", "patterns": [ { @@ -4221,14 +5047,15 @@ } ] }, - "44": { + "40": {}, + "41": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -4264,123 +5091,123 @@ } ] }, - "45": { + "42": { "patterns": [ { "include": "#inline_comment" } ] }, + "43": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "44": { + "name": "comment.block.cpp" + }, + "45": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "46": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "47": { - "name": "comment.block.cpp" - }, - "48": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "47": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "48": { + "name": "comment.block.cpp" + }, "49": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "50": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "51": { - "name": "comment.block.cpp" - }, - "52": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "51": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "52": { + "name": "comment.block.cpp" + }, "53": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "54": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "55": { - "name": "comment.block.cpp" - }, - "56": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "55": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "56": { + "name": "comment.block.cpp" + }, "57": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "58": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "59": { - "name": "comment.block.cpp" - }, - "60": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "61": { "name": "storage.type.modifier.calling-convention.cpp" }, - "62": { + "59": { "patterns": [ { "include": "#inline_comment" } ] }, - "63": { + "60": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "64": { + "61": { "name": "comment.block.cpp" }, - "65": { + "62": { "patterns": [ { "match": "\\*\\/", @@ -4392,17 +5219,17 @@ } ] }, - "66": { + "63": { "patterns": [ { "include": "#scope_resolution_function_definition_inner_generated" } ] }, - "67": { + "64": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" }, - "69": { + "65": { "name": "meta.template.call.cpp", "patterns": [ { @@ -4410,23 +5237,24 @@ } ] }, - "71": { + "66": {}, + "67": { "name": "entity.name.function.definition.cpp" }, - "72": { + "68": { "patterns": [ { "include": "#inline_comment" } ] }, - "73": { + "69": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "74": { + "70": { "name": "comment.block.cpp" }, - "75": { + "71": { "patterns": [ { "match": "\\*\\/", @@ -4439,35 +5267,37 @@ ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.cpp", "patterns": [ { - "name": "meta.head.function.definition.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.cpp" } }, + "name": "meta.head.function.definition.cpp", "patterns": [ { "include": "#ever_present_context" }, { - "contentName": "meta.function.definition.parameters.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.begin.bracket.round.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.end.bracket.round.cpp" } }, + "contentName": "meta.function.definition.parameters", "patterns": [ { "include": "#ever_present_context" @@ -4489,14 +5319,15 @@ ] }, { - "name": "meta.body.function.definition.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.cpp" } }, + "name": "meta.body.function.definition.cpp", "patterns": [ { "include": "#function_body_context" @@ -4504,9 +5335,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -4529,13 +5362,14 @@ ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -4628,803 +5479,54 @@ } ] }, - "12": { - "patterns": [ - { - "include": "#scope_resolution_inner_generated" - } - ] - }, - "13": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "15": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "17": { - "name": "entity.name.scope-resolution.cpp" - }, - "18": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "20": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "25": { - "name": "entity.name.type.cpp" - }, - "26": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "28": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "39": { - "name": "comment.block.cpp" - }, - "40": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "41": { - "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" - }, - "42": { - "name": "punctuation.definition.function.pointer.dereference.cpp" - }, - "43": { - "name": "variable.other.definition.pointer.function.cpp" - }, - "44": { - "name": "punctuation.definition.begin.bracket.square.cpp" - }, - "45": { - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "46": { - "name": "punctuation.definition.end.bracket.square.cpp" - }, - "47": { - "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" - }, - "48": { - "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" - } - }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "patterns": [ - { - "include": "#function_parameter_context" - } - ] - }, - "function_pointer_parameter": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "39": { - "name": "comment.block.cpp" - }, - "40": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "41": { - "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" - }, - "42": { - "name": "punctuation.definition.function.pointer.dereference.cpp" - }, - "43": { - "name": "variable.parameter.pointer.function.cpp" - }, - "44": { - "name": "punctuation.definition.begin.bracket.square.cpp" - }, - "45": { - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "46": { - "name": "punctuation.definition.end.bracket.square.cpp" - }, - "47": { - "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" - }, - "48": { - "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" - } - }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "patterns": [ - { - "include": "#function_parameter_context" - } - ] - }, - "functional_specifiers_pre_parameters": { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)", - "captures": { - "1": { - "name": "keyword.control.goto.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.label.call.cpp" - } - } - }, - "include": { - "match": "(?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((#)\\s*((?:include|include_next))\\b)\\s*(?:(?:(?:((<)[^>]*(>?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/))))|(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.control.directive.$7.cpp" - }, - "6": { - "name": "punctuation.definition.directive.cpp" - }, - "8": { - "name": "string.quoted.other.lt-gt.include.cpp" - }, - "9": { - "name": "punctuation.definition.string.begin.cpp" - }, - "10": { - "name": "punctuation.definition.string.end.cpp" - }, "11": { "patterns": [ { - "include": "#inline_comment" + "include": "#scope_resolution_inner_generated" } ] }, "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, "13": { - "name": "comment.block.cpp" - }, - "14": { + "name": "meta.template.call.cpp", "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#template_call_range" } ] }, + "14": {}, "15": { - "name": "string.quoted.double.include.cpp" + "name": "entity.name.scope-resolution.cpp" }, "16": { - "name": "punctuation.definition.string.begin.cpp" - }, - "17": { - "name": "punctuation.definition.string.end.cpp" + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] }, + "17": {}, "18": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "19": { "patterns": [ { "include": "#inline_comment" } ] }, - "19": { + "20": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "20": { + "21": { "name": "comment.block.cpp" }, - "21": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -5436,31 +5538,58 @@ } ] }, - "22": { - "name": "entity.name.other.preprocessor.macro.include.cpp" - }, "23": { + "name": "entity.name.type.cpp" + }, + "24": { + "name": "meta.template.call.cpp", "patterns": [ { - "include": "#inline_comment" + "include": "#template_call_range" } ] }, - "24": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "25": { - "name": "comment.block.cpp" - }, + "25": {}, "26": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + "match": "\\*", + "name": "storage.modifier.pointer.cpp" }, { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" } ] }, @@ -5513,6 +5642,818 @@ "name": "comment.block.cpp" } ] + }, + "35": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "36": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "37": { + "name": "comment.block.cpp" + }, + "38": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "39": { + "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" + }, + "40": { + "name": "punctuation.definition.function.pointer.dereference.cpp" + }, + "41": { + "name": "variable.other.definition.pointer.function.cpp" + }, + "42": { + "name": "punctuation.definition.begin.bracket.square.cpp" + }, + "43": { + "patterns": [ + { + "include": "#evaluation_context" + } + ] + }, + "44": { + "name": "punctuation.definition.end.bracket.square.cpp" + }, + "45": { + "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" + }, + "46": { + "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "patterns": [ + { + "include": "#function_parameter_context" + } + ] + }, + "function_pointer_parameter": { + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", + "beginCaptures": { + "1": { + "name": "meta.qualified_type.cpp", + "patterns": [ + { + "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] + }, + { + "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", + "name": "entity.name.type.cpp" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "4": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "5": { + "name": "comment.block.cpp" + }, + "6": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "8": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "9": { + "name": "comment.block.cpp" + }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "patterns": [ + { + "include": "#scope_resolution_inner_generated" + } + ] + }, + "12": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "13": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "14": {}, + "15": { + "name": "entity.name.scope-resolution.cpp" + }, + "16": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "17": {}, + "18": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "21": { + "name": "comment.block.cpp" + }, + "22": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "23": { + "name": "entity.name.type.cpp" + }, + "24": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "25": {}, + "26": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "27": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, + "30": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "31": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "32": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "33": { + "name": "comment.block.cpp" + }, + "34": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "35": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "36": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "37": { + "name": "comment.block.cpp" + }, + "38": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "39": { + "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" + }, + "40": { + "name": "punctuation.definition.function.pointer.dereference.cpp" + }, + "41": { + "name": "variable.parameter.pointer.function.cpp" + }, + "42": { + "name": "punctuation.definition.begin.bracket.square.cpp" + }, + "43": { + "patterns": [ + { + "include": "#evaluation_context" + } + ] + }, + "44": { + "name": "punctuation.definition.end.bracket.square.cpp" + }, + "45": { + "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" + }, + "46": { + "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "patterns": [ + { + "include": "#function_parameter_context" + } + ] + }, + "functional_specifiers_pre_parameters": { + "match": "(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)", + "captures": { + "1": { + "name": "keyword.control.goto.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.label.call.cpp" + } + } + }, + "identifier": { + "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*" + }, + "include": { + "match": "^((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((#)(?:(?:\\s)+)?((?:include|include_next))\\b)(?:(?:\\s)+)?(?:(?:(?:((<)[^>]*(>?)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/)))|((\\\")[^\\\"]*((?:\\\")?)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/))))|(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;)))))|((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;))))", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "3": { + "name": "keyword.control.directive.$5.cpp" + }, + "4": { + "name": "punctuation.definition.directive.cpp" + }, + "6": { + "name": "string.quoted.other.lt-gt.include.cpp" + }, + "7": { + "name": "punctuation.definition.string.begin.cpp" + }, + "8": { + "name": "punctuation.definition.string.end.cpp" + }, + "9": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "10": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "11": { + "name": "string.quoted.double.include.cpp" + }, + "12": { + "name": "punctuation.definition.string.begin.cpp" + }, + "13": { + "name": "punctuation.definition.string.end.cpp" + }, + "14": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "15": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "16": { + "name": "entity.name.other.preprocessor.macro.include.cpp" + }, + "17": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "18": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "21": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "22": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] } }, "name": "meta.preprocessor.include.cpp" @@ -5527,7 +6468,7 @@ "name": "punctuation.separator.delimiter.comma.inheritance.cpp" }, { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:(?:\\s)+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -5592,59 +6550,99 @@ ] }, "4": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "5": { - "name": "comment.block.cpp" - }, - "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "12": { + "7": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "13": { + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "15": { + "9": { + "patterns": [ + { + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } + } + ] + }, + "10": {}, + "11": { + "name": "entity.name.scope-resolution.cpp" + }, + "12": { "name": "meta.template.call.cpp", "patterns": [ { @@ -5652,8 +6650,46 @@ } ] }, + "13": {}, + "14": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "17": { - "name": "entity.name.scope-resolution.cpp" + "name": "entity.name.type.cpp" }, "18": { "name": "meta.template.call.cpp", @@ -5663,51 +6699,13 @@ } ] }, - "20": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "25": { - "name": "entity.name.type.cpp" - }, - "26": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } + "19": {} } } ] }, "inline_comment": { - "match": "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))", + "match": "(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/))", "captures": { "1": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" @@ -5734,7 +6732,7 @@ "name": "invalid.illegal.unexpected.punctuation.definition.comment.end.cpp" }, "label": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)", + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:)", "captures": { "1": { "patterns": [ @@ -5744,70 +6742,89 @@ ] }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "entity.name.label.cpp" }, - "6": { + "4": { "patterns": [ { "include": "#inline_comment" } ] }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { + "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "10": { + "6": { "name": "punctuation.separator.label.cpp" } } }, "lambdas": { - "begin": "((?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[| *+\"| *+\\d))((?>(?:[^\\[\\]]|((?(?:(?>[^\\[\\]]*)\\g<4>?)+)\\]))*))(\\](?!\\[)))", + "begin": "(?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))(?:(?:\\s)+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))[\\[\\];]))", + "end": "(?<=[;}])", "beginCaptures": { - "2": { + "1": { "name": "punctuation.definition.capture.begin.lambda.cpp" }, - "3": { + "2": { "name": "meta.lambda.capture.cpp", "patterns": [ { "include": "#the_this_keyword" }, { - "match": "((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", + "match": "((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", "captures": { "1": { "name": "variable.parameter.capture.cpp" @@ -5850,26 +6867,52 @@ } ] }, - "5": { + "3": {}, + "4": { "name": "punctuation.definition.capture.end.lambda.cpp" + }, + "5": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "6": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "7": { + "name": "comment.block.cpp" + }, + "8": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] } }, - "end": "(?<=})", + "endCaptures": {}, "patterns": [ { - "name": "meta.function.definition.parameters.lambda.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.parameters.begin.lambda.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.parameters.end.lambda.cpp" } }, + "name": "meta.function.definition.parameters.lambda.cpp", "patterns": [ { "include": "#function_parameter_context" @@ -5877,7 +6920,7 @@ ] }, { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*line\\b)", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?line\\b", + "end": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*define\\b)\\s*((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?define\\b)(?:(?:\\s)+)?((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!uint_least64_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|double[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|float[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|short[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|char[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|void[^(?-mix:\\w)]|long[^(?-mix:\\w)]|auto[^(?-mix:\\w)]|int[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?!\\())", + "match": "(?:((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:(?:\\s)+)?(?:(?:\\.\\*|\\.)|(?:->\\*|->))(?:(?:\\s)+)?)*)(?:(?:\\s)+)?(\\b(?!uint_least64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_least16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_least32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_least16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_fast64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_fast32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_fast16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_least8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_least64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_least32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_fast32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_fast16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_least8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint_fast8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_fast64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int_fast8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|suseconds_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|useconds_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|in_addr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uintmax_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uintmax_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uintptr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|blksize_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|in_port_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|intmax_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|unsigned[^Pattern.new(\n match: \\/\\w\\/,\n)]|blkcnt_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|u_quad_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|intmax_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|intptr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|swblk_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|wchar_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|u_short[^Pattern.new(\n match: \\/\\w\\/,\n)]|qaddr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|caddr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|daddr_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|fixpt_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|nlink_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|segsz_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|clock_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|ssize_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int16_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int32_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int64_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|int8_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|mode_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|quad_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|ushort[^Pattern.new(\n match: \\/\\w\\/,\n)]|u_long[^Pattern.new(\n match: \\/\\w\\/,\n)]|u_char[^Pattern.new(\n match: \\/\\w\\/,\n)]|double[^Pattern.new(\n match: \\/\\w\\/,\n)]|size_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|signed[^Pattern.new(\n match: \\/\\w\\/,\n)]|time_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|key_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|ino_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|gid_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|dev_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|div_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|float[^Pattern.new(\n match: \\/\\w\\/,\n)]|u_int[^Pattern.new(\n match: \\/\\w\\/,\n)]|uid_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|short[^Pattern.new(\n match: \\/\\w\\/,\n)]|off_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|pid_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|id_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|bool[^Pattern.new(\n match: \\/\\w\\/,\n)]|char[^Pattern.new(\n match: \\/\\w\\/,\n)]|id_t[^Pattern.new(\n match: \\/\\w\\/,\n)]|uint[^Pattern.new(\n match: \\/\\w\\/,\n)]|void[^Pattern.new(\n match: \\/\\w\\/,\n)]|long[^Pattern.new(\n match: \\/\\w\\/,\n)]|auto[^Pattern.new(\n match: \\/\\w\\/,\n)]|int[^Pattern.new(\n match: \\/\\w\\/,\n)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?!\\())", "captures": { "1": { "patterns": [ @@ -6092,39 +7138,48 @@ ] }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "variable.language.this.cpp" }, - "6": { + "4": { "name": "variable.other.object.access.cpp" }, - "7": { + "5": { "name": "punctuation.separator.dot-access.cpp" }, - "8": { + "6": { "name": "punctuation.separator.pointer-access.cpp" }, - "9": { + "7": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6166,7 +7221,7 @@ } }, { - "match": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6215,13 +7270,13 @@ } ] }, - "10": { + "8": { "name": "variable.other.property.cpp" } } }, "memory_operators": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?:(delete)\\s*(\\[\\])|(delete))|(new))(?!\\w))", + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(delete)(?:(?:\\s)+)?(\\[\\])|(delete))|(new))(?!\\w))", "captures": { "1": { "patterns": [ @@ -6231,42 +7286,52 @@ ] }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "keyword.operator.wordlike.cpp" }, - "6": { + "4": { "name": "keyword.operator.delete.array.cpp" }, - "7": { + "5": { "name": "keyword.operator.delete.array.bracket.cpp" }, - "8": { + "6": { "name": "keyword.operator.delete.cpp" }, - "9": { + "7": { "name": "keyword.operator.new.cpp" } } }, "method_access": { - "begin": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(~?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\()", + "begin": "(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:(?:\\s)+)?(?:(?:\\.\\*|\\.)|(?:->\\*|->))(?:(?:\\s)+)?)*)(?:(?:\\s)+)?(~?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?(\\()", + "end": "\\)", "beginCaptures": { "1": { "patterns": [ @@ -6308,7 +7373,7 @@ "9": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6350,7 +7415,7 @@ } }, { - "match": "(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\*|->)))", + "match": "(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6406,9 +7471,8 @@ "name": "punctuation.section.arguments.begin.bracket.round.function.member.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.function.member.cpp" } }, @@ -6418,12 +7482,8 @@ } ] }, - "misc_storage_modifiers": { - "match": "\\b(?:export|mutable|typename|thread_local|register|restrict|static|volatile|inline)\\b", - "name": "storage.modifier.$0.cpp" - }, - "module_import": { - "match": "(?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((import))\\s*(?:(?:(?:((<)[^>]*(>?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=\\/\\/))))|(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\.(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)*((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))\\s*(;?)", + "misc_keywords": { + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.control.directive.import.cpp" - }, - "7": { - "name": "string.quoted.other.lt-gt.include.cpp" - }, - "8": { - "name": "punctuation.definition.string.begin.cpp" - }, - "9": { - "name": "punctuation.definition.string.end.cpp" - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "string.quoted.double.include.cpp" - }, - "15": { - "name": "punctuation.definition.string.begin.cpp" - }, - "16": { - "name": "punctuation.definition.string.end.cpp" - }, - "17": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "18": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "19": { - "name": "comment.block.cpp" - }, - "20": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "21": { - "name": "entity.name.other.preprocessor.macro.include.cpp" - }, - "22": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "23": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "24": { - "name": "comment.block.cpp" - }, - "25": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "26": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "27": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "28": { - "name": "comment.block.cpp" - }, - "29": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "name": "punctuation.terminator.statement.cpp" + "name": "keyword.other.$3.cpp" } - }, - "name": "meta.preprocessor.import.cpp" + } }, "ms_attributes": { - "name": "support.other.attribute.cpp", - "begin": "(__declspec\\()", + "begin": "__declspec\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.begin.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.attribute.end.cpp" } }, + "name": "support.other.attribute.cpp", "patterns": [ { "include": "#attributes_context" @@ -6626,6 +7545,8 @@ { "begin": "\\(", "end": "\\)", + "beginCaptures": {}, + "endCaptures": {}, "patterns": [ { "include": "#attributes_context" @@ -6636,7 +7557,7 @@ ] }, { - "match": "(using)\\s+((?(?:(?>[^<>]*)\\g<9>?)+)>)\\s*)?::)*\\s*+)\\s*((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<8>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "10": { + "9": { "name": "entity.name.namespace.cpp" }, - "11": { + "10": { "name": "punctuation.terminator.statement.cpp" } }, "name": "meta.declaration.namespace.alias.cpp" }, "namespace_block": { - "name": "meta.block.namespace.cpp", - "begin": "(((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.namespace.cpp" }, - "2": { + "1": { "name": "keyword.other.namespace.definition.cpp storage.type.namespace.definition.cpp" } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.block.namespace.cpp", "patterns": [ { - "name": "meta.head.namespace.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.namespace.cpp" } }, + "name": "meta.head.namespace.cpp", "patterns": [ { "include": "#ever_present_context" @@ -6739,7 +7672,7 @@ "include": "#attributes_context" }, { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<5>?)+)>)\\s*)?::)*\\s*+)\\s*((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)(?:(?:\\s)+)?((?|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.namespace.cpp" } }, + "name": "meta.body.namespace.cpp", "patterns": [ { "include": "$self" @@ -6788,9 +7723,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.namespace.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -6800,8 +7737,8 @@ ] }, "noexcept_operator": { - "contentName": "meta.arguments.operator.noexcept.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.noexcept.cpp" @@ -6835,12 +7772,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.noexcept.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.noexcept.cpp" } }, + "contentName": "meta.arguments.operator.noexcept", "patterns": [ { "include": "#evaluation_context" @@ -6848,7 +7785,7 @@ ] }, "non_primitive_types": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "storage.type.cpp storage.type.built-in.cpp" } } @@ -6888,9 +7834,11 @@ { "begin": "(?=.)", "end": "$", + "beginCaptures": {}, + "endCaptures": {}, "patterns": [ { - "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(operator)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(?:(?:((?:delete\\[\\]|delete|new\\[\\]|<=>|<<=|new|>>=|\\->\\*|\\/=|%=|&=|>=|\\|=|\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|<<|>>|\\-\\-|<=|\\^=|==|!=|&&|\\|\\||\\+=|\\-=|\\*=|,|\\+|\\-|!|~|\\*|&|\\*|\\/|%|\\+|\\-|<|>|&|\\^|\\||=))|((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:\\[\\])?)))|(\"\")((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\<|\\())", + "begin": "(?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<62>?)+>)(?:(?:\\s)+)?)?::)*)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.function.definition.special.operator-overload.cpp" }, - "2": { + "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -7195,7 +8160,7 @@ } ] }, - "3": { + "2": { "patterns": [ { "include": "#attributes_context" @@ -7205,45 +8170,45 @@ } ] }, - "4": { + "3": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "4": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "5": { "name": "comment.block.cpp" }, + "6": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { "patterns": [ { "include": "#inline_comment" } ] }, - "9": { + "8": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "10": { + "9": { "name": "comment.block.cpp" }, - "11": { + "10": { "patterns": [ { "match": "\\*\\/", @@ -7255,16 +8220,28 @@ } ] }, - "13": { + "11": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "14": { + "12": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, + "13": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "14": {}, + "15": { + "name": "entity.name.scope-resolution.cpp" + }, "16": { "name": "meta.template.call.cpp", "patterns": [ @@ -7273,34 +8250,24 @@ } ] }, + "17": {}, "18": { - "name": "entity.name.scope-resolution.cpp" - }, - "19": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "21": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "22": { + "19": { "patterns": [ { "include": "#inline_comment" } ] }, - "23": { + "20": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "24": { + "21": { "name": "comment.block.cpp" }, - "25": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -7312,10 +8279,10 @@ } ] }, - "26": { + "23": { "name": "entity.name.type.cpp" }, - "27": { + "24": { "name": "meta.template.call.cpp", "patterns": [ { @@ -7323,14 +8290,15 @@ } ] }, - "29": { + "25": {}, + "26": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -7366,148 +8334,148 @@ } ] }, - "30": { + "27": { "patterns": [ { "include": "#inline_comment" } ] }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, + "30": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "32": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "33": { + "name": "comment.block.cpp" + }, "34": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "35": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "36": { - "name": "comment.block.cpp" - }, - "37": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "36": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "37": { + "name": "comment.block.cpp" + }, "38": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "39": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "40": { - "name": "comment.block.cpp" - }, - "41": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "40": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "41": { + "name": "comment.block.cpp" + }, "42": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "43": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "storage.type.modifier.calling-convention.cpp" }, "44": { - "name": "comment.block.cpp" - }, - "45": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, + "45": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, "46": { - "name": "storage.type.modifier.calling-convention.cpp" + "name": "comment.block.cpp" }, "47": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, "48": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "49": { - "name": "comment.block.cpp" - }, - "50": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "51": { "patterns": [ { "include": "#inline_comment" } ] }, - "52": { + "49": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "53": { + "50": { "name": "comment.block.cpp" }, - "54": { + "51": { "patterns": [ { "match": "\\*\\/", @@ -7519,7 +8487,7 @@ } ] }, - "55": { + "52": { "patterns": [ { "match": "::", @@ -7534,7 +8502,7 @@ } ] }, - "57": { + "53": { "name": "meta.template.call.cpp", "patterns": [ { @@ -7542,23 +8510,24 @@ } ] }, - "59": { + "54": {}, + "55": { "name": "keyword.other.operator.overload.cpp" }, - "60": { + "56": { "patterns": [ { "include": "#inline_comment" } ] }, - "61": { + "57": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "62": { + "58": { "name": "comment.block.cpp" }, - "63": { + "59": { "patterns": [ { "match": "\\*\\/", @@ -7570,7 +8539,7 @@ } ] }, - "64": { + "60": { "patterns": [ { "match": "::", @@ -7585,7 +8554,7 @@ } ] }, - "66": { + "61": { "name": "meta.template.call.cpp", "patterns": [ { @@ -7593,20 +8562,21 @@ } ] }, - "68": { + "62": {}, + "63": { "name": "entity.name.operator.cpp" }, - "69": { + "64": { "name": "entity.name.operator.type.cpp" }, - "70": { + "65": { "patterns": [ { "match": "\\*", "name": "entity.name.operator.type.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -7642,45 +8612,70 @@ } ] }, - "71": { + "66": { "patterns": [ { "include": "#inline_comment" } ] }, - "72": { + "67": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "73": { + "68": { "name": "comment.block.cpp" }, + "69": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "70": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "71": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "72": { + "name": "comment.block.cpp" + }, + "73": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, "74": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "75": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "76": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "77": { "name": "comment.block.cpp" }, - "78": { + "77": { "patterns": [ { "match": "\\*\\/", @@ -7692,20 +8687,26 @@ } ] }, + "78": { + "name": "entity.name.operator.type.array.cpp" + }, "79": { + "name": "entity.name.operator.custom-literal.cpp" + }, + "80": { "patterns": [ { "include": "#inline_comment" } ] }, - "80": { + "81": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "81": { + "82": { "name": "comment.block.cpp" }, - "82": { + "83": { "patterns": [ { "match": "\\*\\/", @@ -7717,9 +8718,6 @@ } ] }, - "83": { - "name": "entity.name.operator.type.array.cpp" - }, "84": { "name": "entity.name.operator.custom-literal.cpp" }, @@ -7747,47 +8745,21 @@ "name": "comment.block.cpp" } ] - }, - "89": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "90": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "91": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "92": { - "name": "comment.block.cpp" - }, - "93": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.function.definition.special.operator-overload.cpp", "patterns": [ { - "name": "meta.head.function.definition.special.operator-overload.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.operator-overload.cpp" } }, + "name": "meta.head.function.definition.special.operator-overload.cpp", "patterns": [ { "include": "#ever_present_context" @@ -7796,19 +8768,19 @@ "include": "#template_call_range" }, { - "contentName": "meta.function.definition.parameters.special.operator-overload.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.begin.bracket.round.special.operator-overload.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parameters.end.bracket.round.special.operator-overload.cpp" } }, + "contentName": "meta.function.definition.parameters.special.operator-overload", "patterns": [ { "include": "#function_parameter_context" @@ -7827,14 +8799,15 @@ ] }, { - "name": "meta.body.function.definition.special.operator-overload.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.function.definition.special.operator-overload.cpp" } }, + "name": "meta.body.function.definition.special.operator-overload.cpp", "patterns": [ { "include": "#function_body_context" @@ -7842,9 +8815,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.function.definition.special.operator-overload.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -7856,22 +8831,292 @@ "operators": { "patterns": [ { - "include": "#sizeof_operator" + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.cpp" + } + }, + "contentName": "meta.arguments.operator.sizeof", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { - "include": "#alignof_operator" + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.alignof.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.alignof.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.alignof.cpp" + } + }, + "contentName": "meta.arguments.operator.alignof", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { - "include": "#alignas_operator" + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp" + } + }, + "contentName": "meta.arguments.operator.alignas", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { - "include": "#typeid_operator" + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.typeid.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.typeid.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.typeid.cpp" + } + }, + "contentName": "meta.arguments.operator.typeid", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { - "include": "#noexcept_operator" + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.noexcept.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.noexcept.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.noexcept.cpp" + } + }, + "contentName": "meta.arguments.operator.noexcept", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { - "include": "#sizeof_variadic_operator" + "begin": "(\\bsizeof\\.\\.\\.)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", + "beginCaptures": { + "1": { + "name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.variadic.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.variadic.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.variadic.cpp" + } + }, + "contentName": "meta.arguments.operator.sizeof.variadic", + "patterns": [ + { + "include": "#evaluation_context" + } + ] }, { "match": "--", @@ -7920,22 +9165,1326 @@ "over_qualified_types": { "patterns": [ { - "include": "#parameter_struct" + "match": "(struct)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", + "captures": { + "1": { + "name": "storage.type.struct.parameter.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.struct.parameter.cpp" + }, + "5": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "6": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "7": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "13": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "14": { + "name": "variable.other.object.declare.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "17": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "18": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#parameter_enum" + "match": "(enum)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", + "captures": { + "1": { + "name": "storage.type.enum.parameter.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.enum.parameter.cpp" + }, + "5": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "6": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "7": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "13": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "14": { + "name": "variable.other.object.declare.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "17": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "18": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#parameter_union" + "match": "(union)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", + "captures": { + "1": { + "name": "storage.type.union.parameter.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.union.parameter.cpp" + }, + "5": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "6": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "7": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "13": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "14": { + "name": "variable.other.object.declare.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "17": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "18": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#parameter_class" + "match": "(class)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", + "captures": { + "1": { + "name": "storage.type.class.parameter.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.class.parameter.cpp" + }, + "5": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "6": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "7": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "13": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "14": { + "name": "variable.other.object.declare.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "17": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "18": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "19": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "20": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } } ] }, "parameter": { - "name": "meta.parameter.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\w)", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\w)", + "end": "(?:(?=\\))|(,))", "beginCaptures": { "1": { "patterns": [ @@ -7963,12 +10512,12 @@ ] } }, - "end": "(?:(?=\\))|(,))", "endCaptures": { "1": { "name": "punctuation.separator.delimiter.comma.cpp" } }, + "name": "meta.parameter.cpp", "patterns": [ { "include": "#ever_present_context" @@ -7983,7 +10532,7 @@ "include": "#vararg_ellipses" }, { - "match": "((?:((?:volatile|register|restrict|static|extern|const))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))+)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=,|\\)|=)", + "match": "((?:((?:(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -8219,12 +10768,13 @@ "include": "#scope_resolution_parameter_inner_generated" }, { - "match": "(?:struct|class|union|enum)", + "match": "(?:(?:struct)|(?:class)|(?:union)|(?:enum))", "name": "storage.type.$0.cpp" }, { "begin": "(?<==)", "end": "(?:(?=\\))|(,))", + "beginCaptures": {}, "endCaptures": { "1": { "name": "punctuation.separator.delimiter.comma.cpp" @@ -8237,10 +10787,11 @@ ] }, { - "include": "#assignment_operator" + "match": "\\=", + "name": "keyword.operator.assignment.cpp" }, { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\)|,|\\[|=|\\n)", + "match": "(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\)|,|\\[|=|\\n)", "captures": { "1": { "patterns": [ @@ -8301,19 +10852,19 @@ "include": "#attributes_context" }, { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", + "begin": "\\[", + "end": "\\]", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.begin.bracket.square.array.type.cpp" } }, - "end": "(\\])", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.end.bracket.square.array.type.cpp" } }, + "name": "meta.bracket.square.array.cpp", "patterns": [ { "include": "#evaluation_context" @@ -8328,7 +10879,7 @@ "include": "#template_call_range" }, { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*)", + "match": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*))", "captures": { "0": { "patterns": [ @@ -8337,7 +10888,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -8428,7 +10979,7 @@ ] }, "parameter_class": { - "match": "(class)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", + "match": "(class)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", "captures": { "1": { "name": "storage.type.class.parameter.cpp" @@ -8441,59 +10992,77 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.class.parameter.cpp" }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "7": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -8529,6 +11098,74 @@ } ] }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "12": { "patterns": [ { @@ -8537,155 +11174,141 @@ ] }, "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "14": { - "name": "comment.block.cpp" + "name": "variable.other.object.declare.cpp" }, "15": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "16": { "patterns": [ { - "include": "#inline_comment" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "18": { - "name": "comment.block.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "19": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "20": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "parameter_enum": { - "match": "(enum)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", + "match": "(enum)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", "captures": { "1": { "name": "storage.type.enum.parameter.cpp" @@ -8698,59 +11321,77 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.enum.parameter.cpp" }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "7": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -8786,6 +11427,74 @@ } ] }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "12": { "patterns": [ { @@ -8794,156 +11503,142 @@ ] }, "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "14": { - "name": "comment.block.cpp" + "name": "variable.other.object.declare.cpp" }, "15": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "16": { "patterns": [ { - "include": "#inline_comment" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "18": { - "name": "comment.block.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "19": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "20": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "parameter_or_maybe_value": { - "name": "meta.parameter.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\w)", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\w)", + "end": "(?:(?=\\))|(,))", "beginCaptures": { "1": { "patterns": [ @@ -8971,12 +11666,12 @@ ] } }, - "end": "(?:(?=\\))|(,))", "endCaptures": { "1": { "name": "punctuation.separator.delimiter.comma.cpp" } }, + "name": "meta.parameter.cpp", "patterns": [ { "include": "#ever_present_context" @@ -9000,7 +11695,7 @@ "include": "#vararg_ellipses" }, { - "match": "((?:((?:volatile|register|restrict|static|extern|const))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))+)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=,|\\)|=)", + "match": "((?:((?:(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -9239,12 +11934,13 @@ "include": "#scope_resolution_parameter_inner_generated" }, { - "match": "(?:struct|class|union|enum)", + "match": "(?:(?:struct)|(?:class)|(?:union)|(?:enum))", "name": "storage.type.$0.cpp" }, { "begin": "(?<==)", "end": "(?:(?=\\))|(,))", + "beginCaptures": {}, "endCaptures": { "1": { "name": "punctuation.separator.delimiter.comma.cpp" @@ -9257,7 +11953,7 @@ ] }, { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=(?:\\)|,|\\[|=|\\/\\/|(?:\\n|$)))", + "match": "(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=(?:\\)|,|\\[|=|\\/\\/|(?:(?:\\n)|$)))", "captures": { "1": { "patterns": [ @@ -9318,19 +12014,19 @@ "include": "#attributes_context" }, { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", + "begin": "\\[", + "end": "\\]", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.begin.bracket.square.array.type.cpp" } }, - "end": "(\\])", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.end.bracket.square.array.type.cpp" } }, + "name": "meta.bracket.square.array.cpp", "patterns": [ { "include": "#evaluation_context" @@ -9345,7 +12041,7 @@ "include": "#template_call_range" }, { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*)", + "match": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*))", "captures": { "0": { "patterns": [ @@ -9354,7 +12050,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -9448,7 +12144,7 @@ ] }, "parameter_struct": { - "match": "(struct)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", + "match": "(struct)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", "captures": { "1": { "name": "storage.type.struct.parameter.cpp" @@ -9461,59 +12157,77 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.struct.parameter.cpp" }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "7": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -9549,6 +12263,74 @@ } ] }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "12": { "patterns": [ { @@ -9557,155 +12339,141 @@ ] }, "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "14": { - "name": "comment.block.cpp" + "name": "variable.other.object.declare.cpp" }, "15": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "16": { "patterns": [ { - "include": "#inline_comment" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "18": { - "name": "comment.block.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "19": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "20": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "parameter_union": { - "match": "(union)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:\\[((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\]((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?=,|\\)|\\n)", + "match": "(union)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:\\[((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\]((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?=,|\\)|\\n)", "captures": { "1": { "name": "storage.type.union.parameter.cpp" @@ -9718,59 +12486,77 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.union.parameter.cpp" }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "7": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -9806,6 +12592,74 @@ } ] }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "12": { "patterns": [ { @@ -9814,167 +12668,153 @@ ] }, "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "14": { - "name": "comment.block.cpp" + "name": "variable.other.object.declare.cpp" }, "15": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "16": { "patterns": [ { - "include": "#inline_comment" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "18": { - "name": "comment.block.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "19": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "20": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "parentheses": { - "name": "meta.parens.cpp", - "begin": "(\\()", + "begin": "\\(", + "end": "\\)", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parens.begin.bracket.round.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parens.end.bracket.round.cpp" } }, + "name": "meta.parens.cpp", "patterns": [ { "include": "#over_qualified_types" @@ -9989,7 +12829,7 @@ ] }, "posix_reserved_types": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp" } } }, "pragma": { - "name": "meta.preprocessor.pragma.cpp", - "begin": "((?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*pragma\\b)", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?pragma\\b", + "end": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*pragma\\s+mark)\\s+(.*)", + "match": "(^((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?pragma(?:\\s)+mark)(?:\\s)+(.*)", "captures": { "1": { "name": "keyword.control.directive.pragma.pragma-mark.cpp" @@ -10091,27 +12941,36 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "punctuation.definition.directive.cpp" }, - "7": { + "5": { "name": "entity.name.tag.pragma-mark.cpp" } }, @@ -10145,10 +13004,10 @@ "include": "#language_constants" }, { - "include": "#string_context_c" + "include": "#d9bc4796b0b_string_context_c" }, { - "include": "#preprocessor_number_literal" + "include": "#d9bc4796b0b_preprocessor_number_literal" }, { "include": "#operators" @@ -10166,6 +13025,7 @@ }, "preprocessor_conditional_defined": { "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?:(?:ifndef|ifdef)|if)))", + "begin": "^((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?:(?:ifndef|ifdef)|if))", + "end": "^(?!\\s*+#\\s*(?:else|endif))", "beginCaptures": { - "1": { - "name": "keyword.control.directive.conditional.$7.cpp" + "0": { + "name": "keyword.control.directive.conditional.$6.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -10232,16 +13092,19 @@ } ] }, - "6": { + "5": { "name": "punctuation.definition.directive.cpp" - } + }, + "6": {} }, - "end": "(?:^)(?!\\s*+#\\s*(?:else|endif))", + "endCaptures": {}, "patterns": [ { - "name": "meta.preprocessor.conditional.cpp", "begin": "\\G(?<=ifndef|ifdef|if)", "end": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "punctuation.definition.directive.cpp" } }, - "name": "keyword.control.directive.$6.cpp" + "name": "keyword.control.directive.$4.cpp" }, - "preprocessor_number_literal": { - "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp" } } }, "pthread_types": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp" } } }, "qualified_type": { - "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(?![\\w<:.])", + "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.])", "captures": { "0": { - "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -10664,59 +13354,98 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "patterns": [ { "include": "#inline_comment" } ] }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { + "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "6": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "12": { + "7": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "14": { + "8": { + "patterns": [ + { + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } + } + ] + }, + "10": { + "name": "entity.name.scope-resolution.cpp" + }, + "11": { "name": "meta.template.call.cpp", "patterns": [ { @@ -10724,8 +13453,45 @@ } ] }, + "13": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "14": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "15": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "16": { - "name": "entity.name.scope-resolution.cpp" + "name": "entity.name.type.cpp" }, "17": { "name": "meta.template.call.cpp", @@ -10734,50 +13500,12 @@ "include": "#template_call_range" } ] - }, - "19": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "entity.name.type.cpp" - }, - "25": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] } - } + }, + "name": "meta.qualified_type.cpp" }, "qualifiers_and_specifiers_post_parameters": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "storage.modifier.specifier.functional.post-parameters.$5.cpp" + "3": { + "name": "storage.modifier.specifier.functional.post-parameters.$3.cpp" } } }, "scope_resolution": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -10822,18 +13559,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_function_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -10845,18 +13592,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_function_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -10868,18 +13625,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.function.call.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -10887,13 +13655,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" } } }, "scope_resolution_function_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -10905,18 +13674,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_function_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -10928,18 +13707,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.function.definition.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -10947,13 +13737,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" } } }, "scope_resolution_function_definition_operator_overload": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -10965,18 +13756,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_function_definition_operator_overload_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -10988,18 +13789,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.function.definition.operator-overload.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11007,13 +13819,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" } } }, "scope_resolution_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11025,18 +13838,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11044,13 +13868,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" } } }, "scope_resolution_namespace_alias": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11062,18 +13887,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_namespace_alias_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11085,18 +13920,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.namespace.alias.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11104,13 +13950,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" } } }, "scope_resolution_namespace_block": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11122,18 +13969,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_namespace_block_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11145,18 +14002,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.namespace.block.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11164,13 +14032,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" } } }, "scope_resolution_namespace_using": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11182,18 +14051,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_namespace_using_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11205,18 +14084,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.namespace.using.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11224,13 +14114,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" } } }, "scope_resolution_parameter": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11242,18 +14133,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_parameter_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11265,18 +14166,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.parameter.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11284,13 +14196,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" } } }, "scope_resolution_template_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11302,18 +14215,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_template_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11325,18 +14248,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.template.call.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11344,13 +14278,14 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" } } }, "scope_resolution_template_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "(::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+", "captures": { "0": { "patterns": [ @@ -11362,18 +14297,28 @@ "1": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" }, - "3": { - "name": "meta.template.call.cpp", + "2": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] } } }, "scope_resolution_template_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", + "match": "((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:(?:\\s)+)?)?(::)", "captures": { "1": { "patterns": [ @@ -11385,18 +14330,29 @@ "2": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" }, - "4": { - "name": "meta.template.call.cpp", + "3": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "6": { + "4": {}, + "5": { "name": "entity.name.scope-resolution.template.definition.cpp" }, - "7": { + "6": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11404,7 +14360,8 @@ } ] }, - "9": { + "7": {}, + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" } } @@ -11414,13 +14371,13 @@ "name": "punctuation.terminator.statement.cpp" }, "simple_type": { - "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?", + "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<19>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?", "captures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -11471,59 +14445,99 @@ ] }, "4": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "5": { - "name": "comment.block.cpp" - }, - "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "12": { + "7": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "13": { + "8": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "15": { + "9": { + "patterns": [ + { + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } + } + ] + }, + "10": {}, + "11": { + "name": "entity.name.scope-resolution.cpp" + }, + "12": { "name": "meta.template.call.cpp", "patterns": [ { @@ -11531,8 +14545,46 @@ } ] }, + "13": {}, + "14": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "15": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "16": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "17": { - "name": "entity.name.scope-resolution.cpp" + "name": "entity.name.type.cpp" }, "18": { "name": "meta.template.call.cpp", @@ -11542,53 +14594,15 @@ } ] }, + "19": {}, "20": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "25": { - "name": "entity.name.type.cpp" - }, - "26": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "28": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -11624,60 +14638,78 @@ } ] }, - "29": { + "21": { "patterns": [ { "include": "#inline_comment" } ] }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { + "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "33": { + "23": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { + "24": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "single_line_macro": { - "match": "^((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))#define.*(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))#define.*(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "sizeof_operator": { - "contentName": "meta.arguments.operator.sizeof.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.cpp" @@ -11752,12 +14793,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.cpp" } }, + "contentName": "meta.arguments.operator.sizeof", "patterns": [ { "include": "#evaluation_context" @@ -11765,8 +14806,8 @@ ] }, "sizeof_variadic_operator": { - "contentName": "meta.arguments.operator.sizeof.variadic.cpp", - "begin": "(\\bsizeof\\.\\.\\.)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "(\\bsizeof\\.\\.\\.)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.variadic.cpp" @@ -11800,12 +14841,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.variadic.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.variadic.cpp" } }, + "contentName": "meta.arguments.operator.sizeof.variadic", "patterns": [ { "include": "#evaluation_context" @@ -11813,20 +14854,20 @@ ] }, "square_brackets": { - "name": "meta.bracket.square.access.cpp", + "name": "meta.bracket.square.access", "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))?(\\[)(?!\\])", "beginCaptures": { "1": { - "name": "variable.other.object.cpp" + "name": "variable.other.object" }, "2": { - "name": "punctuation.definition.begin.bracket.square.cpp" + "name": "punctuation.definition.begin.bracket.square" } }, "end": "\\]", "endCaptures": { "0": { - "name": "punctuation.definition.end.bracket.square.cpp" + "name": "punctuation.definition.end.bracket.square" } }, "patterns": [ @@ -11838,21 +14879,918 @@ "standard_declares": { "patterns": [ { - "include": "#struct_declare" + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", + "captures": { + "1": { + "name": "storage.type.struct.declare.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.struct.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "name": "variable.other.object.declare.cpp" + }, + "13": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "14": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#union_declare" + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", + "captures": { + "1": { + "name": "storage.type.union.declare.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.union.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "name": "variable.other.object.declare.cpp" + }, + "13": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "14": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#enum_declare" + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", + "captures": { + "1": { + "name": "storage.type.enum.declare.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.enum.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "name": "variable.other.object.declare.cpp" + }, + "13": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "14": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } }, { - "include": "#class_declare" + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", + "captures": { + "1": { + "name": "storage.type.class.declare.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "4": { + "name": "entity.name.type.class.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*", + "name": "storage.modifier.pointer.cpp" + }, + { + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + }, + "name": "invalid.illegal.reference-type.cpp" + }, + { + "match": "\\&", + "name": "storage.modifier.reference.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "12": { + "name": "variable.other.object.declare.cpp" + }, + "13": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "14": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } } ] }, "static_assert": { - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "patterns": [ @@ -11911,22 +15849,22 @@ "name": "punctuation.section.arguments.begin.bracket.round.static_assert.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.static_assert.cpp" } }, "patterns": [ { - "name": "meta.static_assert.message.cpp", - "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", + "begin": "(,)(?:(?:\\s)+)?(?=(?:L|u8|u|U(?:(?:\\s)+)?\\\")?)", + "end": "(?=\\))", "beginCaptures": { "1": { "name": "punctuation.separator.delimiter.comma.cpp" } }, - "end": "(?=\\))", + "endCaptures": {}, + "name": "meta.static_assert.message.cpp", "patterns": [ { "include": "#string_context" @@ -11938,8 +15876,47 @@ } ] }, + "std_space": { + "match": "(?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))", + "captures": { + "0": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "1": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + } + } + }, "storage_specifiers": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "storage.modifier.specifier.$5.cpp" + "3": { + "name": "storage.modifier.specifier.$3.cpp" } } }, @@ -11999,22 +15985,22 @@ "string_context": { "patterns": [ { - "name": "string.quoted.double.cpp", - "begin": "(((?:u|u8|U|L)?)\")", + "begin": "((?:u|u8|U|L)?)\"", + "end": "\"", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.string.begin.cpp" }, - "2": { + "1": { "name": "meta.encoding.cpp" } }, - "end": "(\")", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.string.end.cpp" } }, + "name": "string.quoted.double.cpp", "patterns": [ { "match": "(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})", @@ -12029,7 +16015,7 @@ "name": "constant.character.escape.cpp" }, { - "match": "\\\\x[0-9a-fA-F]{2,2}", + "match": "\\\\x[0-9a-fA-F]{2}", "name": "constant.character.escape.cpp" }, { @@ -12038,22 +16024,22 @@ ] }, { - "name": "string.quoted.single.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.struct.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -12252,7 +16235,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -12262,76 +16245,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -12343,20 +16326,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -12368,18 +16351,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -12388,16 +16363,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.struct.cpp", "patterns": [ { - "name": "meta.head.struct.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" } }, + "name": "meta.head.struct.cpp", "patterns": [ { "include": "#ever_present_context" @@ -12411,14 +16388,15 @@ ] }, { - "name": "meta.body.struct.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.struct.cpp" } }, + "name": "meta.body.struct.cpp", "patterns": [ { "include": "#function_pointer" @@ -12438,9 +16416,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -12450,7 +16430,7 @@ ] }, "struct_declare": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", "captures": { "1": { "name": "storage.type.struct.declare.cpp" @@ -12463,34 +16443,43 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.struct.cpp" }, - "7": { + "5": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -12526,6 +16515,40 @@ } ] }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "8": { "patterns": [ { @@ -12534,106 +16557,108 @@ ] }, "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "10": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "11": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { "name": "variable.other.object.declare.cpp" }, - "21": { + "13": { "patterns": [ { "include": "#inline_comment" } ] }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { + "14": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "switch_conditional_parentheses": { - "name": "meta.conditional.switch.cpp", - "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "patterns": [ @@ -12664,12 +16689,12 @@ "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parens.end.bracket.round.conditional.switch.cpp" } }, + "name": "meta.conditional.switch.cpp", "patterns": [ { "include": "#evaluation_context" @@ -12680,26 +16705,26 @@ ] }, "switch_statement": { - "name": "meta.block.switch.cpp", - "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.switch.cpp" }, - "2": { + "1": { "patterns": [ { "include": "#inline_comment" } ] }, - "3": { + "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "4": { + "3": { "name": "comment.block.cpp" }, - "5": { + "4": { "patterns": [ { "match": "\\*\\/", @@ -12711,21 +16736,23 @@ } ] }, - "6": { + "5": { "name": "keyword.control.switch.cpp" } }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "endCaptures": {}, + "name": "meta.block.switch.cpp", "patterns": [ { - "name": "meta.head.switch.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.switch.cpp" } }, + "name": "meta.head.switch.cpp", "patterns": [ { "include": "#switch_conditional_parentheses" @@ -12736,14 +16763,15 @@ ] }, { - "name": "meta.body.switch.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.switch.cpp" } }, + "name": "meta.body.switch.cpp", "patterns": [ { "include": "#default_statement" @@ -12760,9 +16788,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.switch.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -12772,7 +16802,7 @@ ] }, "template_argument_defaulted": { - "match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*([=])", + "match": "(?<=<|,)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\s)+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?([=])", "captures": { "1": { "name": "storage.type.template.cpp" @@ -12820,32 +16850,32 @@ ] }, "template_call_innards": { - "match": "((?(?:(?>[^<>]*)\\g<1>?)+)>)\\s*", + "match": "((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<1>?)+>)(?:(?:\\s)+)?", "captures": { "0": { - "name": "meta.template.call.cpp", "patterns": [ { "include": "#template_call_range" } ] } - } + }, + "name": "meta.template.call.cpp" }, "template_call_range": { - "name": "meta.template.call.cpp", - "begin": "(<)", + "begin": "<", + "end": ">", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.angle-brackets.begin.template.call.cpp" } }, - "end": "(>)", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.angle-brackets.end.template.call.cpp" } }, + "name": "meta.template.call.cpp", "patterns": [ { "include": "#template_call_context" @@ -12853,8 +16883,8 @@ ] }, "template_definition": { - "name": "meta.template.definition.cpp", - "begin": "(?", "beginCaptures": { "1": { "name": "storage.type.template.cpp" @@ -12863,23 +16893,23 @@ "name": "punctuation.section.angle-brackets.start.template.definition.cpp" } }, - "end": "(>)", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.angle-brackets.end.template.definition.cpp" } }, + "name": "meta.template.definition.cpp", "patterns": [ { - "begin": "((?<=\\w)\\s*<)", + "begin": "(?<=\\w)(?:(?:\\s)+)?<", + "end": ">", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.angle-brackets.begin.template.call.cpp" } }, - "end": "(>)", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.angle-brackets.begin.template.call.cpp" } }, @@ -12895,7 +16925,7 @@ ] }, "template_definition_argument": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*(?:(,)|(?=>|$))", + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\s)+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?(\\.\\.\\.)(?:(?:\\s)+)?((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))(?:(?:\\s)+)?(?:(,)|(?=>|$))", "captures": { "1": { "patterns": [ @@ -12905,27 +16935,36 @@ ] }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "storage.type.template.argument.$5.cpp" + "3": { + "name": "storage.type.template.argument.$3.cpp" }, - "6": { + "4": { "patterns": [ { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -12933,19 +16972,19 @@ } ] }, - "7": { + "5": { "name": "entity.name.type.template.cpp" }, - "8": { + "6": { "name": "storage.type.template.cpp" }, - "9": { + "7": { "name": "punctuation.vararg-ellipses.template.definition.cpp" }, - "10": { + "8": { "name": "entity.name.type.template.cpp" }, - "11": { + "9": { "name": "punctuation.separator.delimiter.comma.template.argument.cpp" } } @@ -12970,7 +17009,7 @@ ] }, "template_isolated_definition": { - "match": "(?\\s*$)", + "match": "(?(?:(?:\\s)+)?$)", "captures": { "1": { "name": "storage.type.template.cpp" @@ -12992,16 +17031,15 @@ } }, "ternary_operator": { - "applyEndPatternLast": true, - "begin": "(\\?)", + "begin": "\\?", + "end": ":", "beginCaptures": { - "1": { + "0": { "name": "keyword.operator.ternary.cpp" } }, - "end": "(:)", "endCaptures": { - "1": { + "0": { "name": "keyword.operator.ternary.cpp" } }, @@ -13081,9 +17119,6 @@ { "include": "#square_brackets" }, - { - "include": "#empty_square_brackets" - }, { "include": "#semicolon" }, @@ -13093,7 +17128,7 @@ ] }, "the_this_keyword": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { + "3": { "name": "variable.language.this.cpp" } } }, "type_alias": { - "match": "(using)\\s*(?!namespace)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))\\s*(\\=)\\s*((?:typename)?)\\s*((?:(?:(?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)(?:(?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))|(.*(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:(\\[)(\\w*)(\\])\\s*)?\\s*(?:(;)|\\n)", + "match": "(using)(?:(?:\\s)+)?(?!namespace)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(?:(?:\\s)+)?(\\=)(?:(?:\\s)+)?((?:typename)?)(?:(?:\\s)+)?((?:(?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<43>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))|(.*(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)?(?:(?:\\s)+)?(?:(;)|\\n)", "captures": { "1": { "name": "keyword.other.using.directive.cpp" @@ -13135,7 +17179,7 @@ "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -13186,59 +17247,98 @@ ] }, "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "8": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { + "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "13": { + "8": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "14": { + "9": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "16": { + "10": { + "patterns": [ + { + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } + } + ] + }, + "12": { + "name": "entity.name.scope-resolution.cpp" + }, + "13": { "name": "meta.template.call.cpp", "patterns": [ { @@ -13246,8 +17346,45 @@ } ] }, + "15": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "16": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "17": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "18": { - "name": "entity.name.scope-resolution.cpp" + "name": "entity.name.type.cpp" }, "19": { "name": "meta.template.call.cpp", @@ -13258,62 +17395,50 @@ ] }, "21": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" - }, - "22": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "23": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "24": { - "name": "comment.block.cpp" - }, - "25": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "26": { - "name": "entity.name.type.cpp" - }, - "27": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "29": { "name": "keyword.operator.assignment.cpp" }, - "30": { + "22": { "name": "keyword.other.typename.cpp" }, - "31": { + "23": { "patterns": [ { "include": "#storage_specifiers" } ] }, - "32": { + "24": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "25": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -13346,7 +17488,7 @@ } ] }, - "33": { + "26": { "patterns": [ { "include": "#attributes_context" @@ -13356,78 +17498,106 @@ } ] }, - "34": { + "27": { "patterns": [ { "include": "#inline_comment" } ] }, - "35": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "36": { - "name": "comment.block.cpp" - }, - "37": { + "28": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "38": { + "29": { "patterns": [ { "include": "#inline_comment" } ] }, - "39": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "40": { - "name": "comment.block.cpp" - }, - "41": { + "30": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "43": { + "31": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "44": { + "32": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "46": { - "name": "meta.template.call.cpp", + "33": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "48": { + "35": { "name": "entity.name.scope-resolution.cpp" }, - "49": { + "36": { "name": "meta.template.call.cpp", "patterns": [ { @@ -13435,38 +17605,47 @@ } ] }, - "51": { + "38": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "52": { + "39": { "patterns": [ { "include": "#inline_comment" } ] }, - "53": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "54": { - "name": "comment.block.cpp" - }, - "55": { + "40": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "56": { + "41": { "name": "entity.name.type.cpp" }, - "57": { + "42": { "name": "meta.template.call.cpp", "patterns": [ { @@ -13474,7 +17653,7 @@ } ] }, - "59": { + "44": { "name": "meta.declaration.type.alias.value.unknown.cpp", "patterns": [ { @@ -13482,14 +17661,14 @@ } ] }, - "60": { + "45": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -13525,102 +17704,129 @@ } ] }, - "61": { + "46": { "patterns": [ { "include": "#inline_comment" } ] }, - "62": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "63": { - "name": "comment.block.cpp" - }, - "64": { + "47": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "65": { + "48": { "patterns": [ { "include": "#inline_comment" } ] }, - "66": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "67": { - "name": "comment.block.cpp" - }, - "68": { + "49": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "69": { + "50": { "patterns": [ { "include": "#inline_comment" } ] }, - "70": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "71": { - "name": "comment.block.cpp" - }, - "72": { + "51": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "73": { + "52": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "74": { + "53": { "patterns": [ { "include": "#evaluation_context" } ] }, - "75": { + "54": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "76": { + "55": { "name": "punctuation.terminator.statement.cpp" } }, "name": "meta.declaration.type.alias.cpp" }, "type_casting_operators": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "5": { - "name": "keyword.operator.wordlike.cpp keyword.operator.cast.$5.cpp" + "3": { + "name": "keyword.operator.wordlike.cpp keyword.operator.cast.$3.cpp" } } }, "typedef_class": { - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.class.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -13759,7 +17975,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -13769,76 +17985,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -13850,20 +18066,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -13875,18 +18091,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -13895,16 +18103,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.class.cpp", "patterns": [ { - "name": "meta.head.class.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.class.cpp" } }, + "name": "meta.head.class.cpp", "patterns": [ { "include": "#ever_present_context" @@ -13918,14 +18128,15 @@ ] }, { - "name": "meta.body.class.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.class.cpp" } }, + "name": "meta.body.class.cpp", "patterns": [ { "include": "#function_pointer" @@ -13945,12 +18156,14 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { - "match": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -14085,22 +18298,24 @@ ] }, "typedef_function_pointer": { - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(::))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<25>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -14193,17 +18425,17 @@ } ] }, - "12": { + "11": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "13": { + "12": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "15": { + "13": { "name": "meta.template.call.cpp", "patterns": [ { @@ -14211,10 +18443,11 @@ } ] }, - "17": { + "14": {}, + "15": { "name": "entity.name.scope-resolution.cpp" }, - "18": { + "16": { "name": "meta.template.call.cpp", "patterns": [ { @@ -14222,23 +18455,24 @@ } ] }, - "20": { + "17": {}, + "18": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "21": { + "19": { "patterns": [ { "include": "#inline_comment" } ] }, - "22": { + "20": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "23": { + "21": { "name": "comment.block.cpp" }, - "24": { + "22": { "patterns": [ { "match": "\\*\\/", @@ -14250,10 +18484,10 @@ } ] }, - "25": { + "23": { "name": "entity.name.type.cpp" }, - "26": { + "24": { "name": "meta.template.call.cpp", "patterns": [ { @@ -14261,14 +18495,15 @@ } ] }, - "28": { + "25": {}, + "26": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -14304,45 +18539,45 @@ } ] }, - "29": { + "27": { "patterns": [ { "include": "#inline_comment" } ] }, + "28": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "29": { + "name": "comment.block.cpp" + }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] }, "31": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { "patterns": [ { "match": "\\*\\/", @@ -14354,20 +18589,20 @@ } ] }, - "37": { + "35": { "patterns": [ { "include": "#inline_comment" } ] }, - "38": { + "36": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "39": { + "37": { "name": "comment.block.cpp" }, - "40": { + "38": { "patterns": [ { "match": "\\*\\/", @@ -14379,36 +18614,35 @@ } ] }, - "41": { + "39": { "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, - "42": { + "40": { "name": "punctuation.definition.function.pointer.dereference.cpp" }, - "43": { + "41": { "name": "entity.name.type.alias.cpp entity.name.type.pointer.function.cpp" }, - "44": { + "42": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "45": { + "43": { "patterns": [ { "include": "#evaluation_context" } ] }, - "46": { + "44": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "47": { + "45": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "48": { + "46": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, - "end": "(\\))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=[{=,);]|\\n)(?!\\()", "endCaptures": { "1": { "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" @@ -14447,135 +18681,103 @@ } ] }, - "typedef_keyword": { - "match": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.struct.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -14587,7 +18789,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -14597,76 +18799,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -14678,20 +18880,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -14703,18 +18905,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -14723,16 +18917,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.struct.cpp", "patterns": [ { - "name": "meta.head.struct.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" } }, + "name": "meta.head.struct.cpp", "patterns": [ { "include": "#ever_present_context" @@ -14746,14 +18942,15 @@ ] }, { - "name": "meta.body.struct.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.struct.cpp" } }, + "name": "meta.body.struct.cpp", "patterns": [ { "include": "#function_pointer" @@ -14773,12 +18970,14 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { - "match": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -14913,101 +19112,102 @@ ] }, "typedef_union": { - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.union.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -15019,7 +19219,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -15029,76 +19229,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -15110,20 +19310,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -15135,18 +19335,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -15155,16 +19347,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.union.cpp", "patterns": [ { - "name": "meta.head.union.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.union.cpp" } }, + "name": "meta.head.union.cpp", "patterns": [ { "include": "#ever_present_context" @@ -15178,14 +19372,15 @@ ] }, { - "name": "meta.body.union.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.union.cpp" } }, + "name": "meta.body.union.cpp", "patterns": [ { "include": "#function_pointer" @@ -15205,12 +19400,14 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { - "match": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -15345,8 +19542,8 @@ ] }, "typeid_operator": { - "contentName": "meta.arguments.operator.typeid.cpp", - "begin": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()", + "end": "\\)", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.typeid.cpp" @@ -15380,12 +19577,12 @@ "name": "punctuation.section.arguments.begin.bracket.round.operator.typeid.cpp" } }, - "end": "(\\))", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.typeid.cpp" } }, + "contentName": "meta.arguments.operator.typeid", "patterns": [ { "include": "#evaluation_context" @@ -15393,7 +19590,7 @@ ] }, "typename": { - "match": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?:(?:(?:unsigned|signed|short|long)|(?:struct|class|union|enum))((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(((::)?(?:((?-mix:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_cancel|atomic_commit|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|consteval|constexpr|protected|namespace|co_return|constexpr|constexpr|continue|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|co_await|template|volatile|register|restrict|reflexpr|alignof|private|default|mutable|include|concept|__asm__|defined|_Pragma|alignas|typedef|warning|virtual|mutable|struct|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|while|compl|bitor|const|union|ifdef|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|asm|try|for|new|and|xor|not|do|or|if|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(::))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?!(?:transaction_safe_dynamic|__has_cpp_attribute|transaction_safe|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|dynamic_cast|thread_local|synchronized|static_cast|const_cast|constexpr|consteval|protected|constexpr|co_return|namespace|constexpr|noexcept|typename|decltype|template|operator|noexcept|co_yield|co_await|continue|volatile|register|restrict|explicit|override|volatile|reflexpr|noexcept|requires|default|typedef|nullptr|alignof|mutable|concept|virtual|defined|__asm__|include|_Pragma|mutable|warning|private|alignas|module|switch|not_eq|bitand|and_eq|ifndef|return|sizeof|xor_eq|export|static|delete|public|define|extern|inline|import|pragma|friend|typeid|const|compl|bitor|throw|or_eq|while|catch|break|false|final|const|endif|ifdef|undef|error|using|audit|axiom|line|else|elif|true|NULL|case|goto|else|this|new|asm|not|and|xor|try|for|if|do|or|if)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(?![\\w<:.]))", + "match": "(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:((::)?((?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(?:((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<24>?)+>)(?:(?:\\s)+)?)?::)*)\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<24>?)+>)(?:(?:\\s)+)?)?(::))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:atomic_cancel)|(?:__has_include)|(?:dynamic_cast)|(?:synchronized)|(?:thread_local)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:consteval)|(?:co_return)|(?:co_return)|(?:constexpr)|(?:protected)|(?:constexpr)|(?:namespace)|(?:noexcept)|(?:typename)|(?:decltype)|(?:template)|(?:operator)|(?:noexcept)|(?:co_yield)|(?:co_await)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:reflexpr)|(?:noexcept)|(?:requires)|(?:alignas)|(?:typedef)|(?:nullptr)|(?:alignof)|(?:mutable)|(?:concept)|(?:virtual)|(?:defined)|(?:__asm__)|(?:include)|(?:_Pragma)|(?:mutable)|(?:default)|(?:warning)|(?:private)|(?:module)|(?:return)|(?:not_eq)|(?:xor_eq)|(?:and_eq)|(?:ifndef)|(?:pragma)|(?:export)|(?:import)|(?:sizeof)|(?:static)|(?:delete)|(?:public)|(?:define)|(?:extern)|(?:inline)|(?:typeid)|(?:switch)|(?:friend)|(?:bitand)|(?:false)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:line)|(?:else)|(?:elif)|(?:true)|(?:NULL)|(?:case)|(?:goto)|(?:else)|(?:this)|(?:new)|(?:asm)|(?:not)|(?:and)|(?:xor)|(?:try)|(?:for)|(?:if)|(?:do)|(?:or)|(?:if))\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<24>?)+>)(?:(?:\\s)+)?)?(?![\\w<:.]))", "captures": { "1": { "name": "storage.modifier.cpp" @@ -15406,53 +19603,71 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "patterns": [ { "include": "#inline_comment" } ] }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { + "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "10": { + "6": { "name": "meta.qualified_type.cpp", "patterns": [ { - "match": "(?", + "beginCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.angle-brackets.end.template.call.cpp" + } + }, + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_context" + } + ] }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", @@ -15485,7 +19717,7 @@ } ] }, - "11": { + "7": { "patterns": [ { "include": "#attributes_context" @@ -15495,78 +19727,107 @@ } ] }, + "8": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "9": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, + "10": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "11": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "21": { "patterns": [ { "include": "#scope_resolution_inner_generated" } ] }, - "22": { + "13": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "24": { - "name": "meta.template.call.cpp", + "14": { "patterns": [ { - "include": "#template_call_range" + "match": "(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|synchronized|dynamic_cast|thread_local|static_cast|const_cast|co_return|constexpr|constexpr|constexpr|co_return|protected|namespace|consteval|noexcept|decltype|template|operator|noexcept|co_yield|co_await|reflexpr|continue|co_await|co_yield|requires|volatile|register|restrict|explicit|volatile|noexcept|typename|default|_Pragma|mutable|include|concept|alignas|virtual|alignof|__asm__|defined|mutable|typedef|warning|private|and_eq|define|pragma|typeid|switch|bitand|return|ifndef|export|struct|sizeof|module|static|public|extern|inline|friend|delete|xor_eq|import|not_eq|class|compl|bitor|throw|or_eq|while|catch|break|union|const|const|endif|ifdef|undef|error|using|else|line|goto|else|elif|this|enum|case|new|asm|not|try|for|and|xor|or|if|do|if)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*+(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<2>?)+>)(?:(?:\\s)+)?)?::", + "captures": { + "1": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "2": {} + } } ] }, - "26": { + "15": {}, + "16": { "name": "entity.name.scope-resolution.cpp" }, - "27": { + "17": { "name": "meta.template.call.cpp", "patterns": [ { @@ -15574,49 +19835,60 @@ } ] }, - "29": { + "18": {}, + "19": { "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "30": { + "20": { "patterns": [ { "include": "#inline_comment" } ] }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { + "21": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "34": { + "22": { "name": "entity.name.type.cpp" }, - "35": { + "23": { "name": "meta.template.call.cpp", "patterns": [ { "include": "#template_call_range" } ] - } + }, + "24": {} } }, "undef": { - "match": "((?:^)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(#)\\s*undef\\b)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?undef\\b)((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "punctuation.definition.directive.cpp" }, - "7": { + "5": { "patterns": [ { "include": "#inline_comment" } ] }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { + "6": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "11": { + "7": { "name": "entity.name.function.preprocessor.cpp" } }, "name": "meta.preprocessor.undef.cpp" }, "union_block": { - "name": "meta.block.union.cpp", - "begin": "((((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(DLLEXPORT)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?:(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(final)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))?(?:((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(:)((?>[^{]*)))?))", + "begin": "((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(DLLEXPORT)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(final)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(:))?", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { - "1": { + "0": { "name": "meta.head.union.cpp" }, - "3": { - "name": "storage.type.$3.cpp" + "1": { + "name": "storage.type.$1.cpp" }, - "4": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "5": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "6": { + "4": { "name": "comment.block.cpp" }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, "7": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "11": { + "9": { "name": "comment.block.cpp" }, + "10": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "11": { + "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" + }, "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "14": { "name": "comment.block.cpp" }, - "17": { + "15": { "patterns": [ { "match": "\\*\\/", @@ -15778,7 +20068,7 @@ } ] }, - "18": { + "16": { "patterns": [ { "include": "#attributes_context" @@ -15788,76 +20078,76 @@ } ] }, - "19": { + "17": { "patterns": [ { "include": "#inline_comment" } ] }, - "20": { + "18": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "21": { + "19": { "name": "comment.block.cpp" }, + "20": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "21": { + "name": "entity.name.type.$1.cpp" + }, "22": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "23": { - "name": "entity.name.type.$3.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "24": { + "name": "comment.block.cpp" + }, + "25": { "patterns": [ { - "include": "#inline_comment" + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" } ] }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, "26": { - "name": "comment.block.cpp" + "name": "storage.type.modifier.final.cpp" }, "27": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#inline_comment" } ] }, "28": { - "name": "storage.type.modifier.final.cpp" + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "comment.block.cpp" }, "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { "patterns": [ { "match": "\\*\\/", @@ -15869,20 +20159,20 @@ } ] }, - "33": { + "31": { "patterns": [ { "include": "#inline_comment" } ] }, - "34": { + "32": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "35": { + "33": { "name": "comment.block.cpp" }, - "36": { + "34": { "patterns": [ { "match": "\\*\\/", @@ -15894,18 +20184,10 @@ } ] }, - "37": { + "35": { "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -15914,16 +20196,18 @@ "name": "punctuation.terminator.statement.cpp" } }, + "name": "meta.block.union.cpp", "patterns": [ { - "name": "meta.head.union.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "(?:\\{|<%|\\?\\?<|(?=;))", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.begin.bracket.curly.union.cpp" } }, + "name": "meta.head.union.cpp", "patterns": [ { "include": "#ever_present_context" @@ -15937,14 +20221,15 @@ ] }, { - "name": "meta.body.union.cpp", "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "end": "\\}|%>|\\?\\?>", + "beginCaptures": {}, "endCaptures": { - "1": { + "0": { "name": "punctuation.section.block.end.bracket.curly.union.cpp" } }, + "name": "meta.body.union.cpp", "patterns": [ { "include": "#function_pointer" @@ -15964,9 +20249,11 @@ ] }, { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s]*", + "end": "[\\s]*(?=;)", + "beginCaptures": {}, + "endCaptures": {}, "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", "patterns": [ { "include": "$self" @@ -15976,7 +20263,7 @@ ] }, "union_declare": { - "match": "((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(?:\\&|\\*)((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))))*(?:\\&|\\*))?((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(?=\\S)(?![:{])", + "match": "((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\b(?!override\\W|override\\$|final\\W|final\\$)((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\S)(?![:{])", "captures": { "1": { "name": "storage.type.union.declare.cpp" @@ -15989,34 +20276,43 @@ ] }, "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, - "6": { + "4": { "name": "entity.name.type.union.cpp" }, - "7": { + "5": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))){2,}\\&", + "match": "(?:\\&((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))){2,}\\&", "captures": { "1": { "patterns": [ @@ -16052,6 +20348,40 @@ } ] }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] + }, "8": { "patterns": [ { @@ -16060,105 +20390,107 @@ ] }, "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "patterns": [ + { + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } + } + ] }, "10": { - "name": "comment.block.cpp" + "patterns": [ + { + "include": "#inline_comment" + } + ] }, "11": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] }, "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { "name": "variable.other.object.declare.cpp" }, - "21": { + "13": { "patterns": [ { "include": "#inline_comment" } ] }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { + "14": { "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "match": "(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "captures": { + "1": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "2": { + "name": "comment.block.cpp" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + } + } } ] } } }, "using_name": { - "match": "(using)\\s+(?!namespace\\b)", + "match": "(using)(?:\\s)+(?!namespace\\b)", "captures": { "1": { "name": "keyword.other.using.directive.cpp" @@ -16166,8 +20498,8 @@ } }, "using_namespace": { - "name": "meta.using-namespace.cpp", - "begin": "(?(?:(?>[^<>]*)\\g<7>?)+)>)\\s*)?::)*\\s*+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:(?:\\s)+)?)?::)*\\s*+)?((?)", @@ -525,7 +531,61 @@ ] }, { - "begin": "(?x)\n((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n(function)\\s+\n(?i:\n (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|toString|\n clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n |(?:(&)?\\s*([a-zA-Z_\\x{7f}-\\x{7fffffff}][a-zA-Z0-9_\\x{7f}-\\x{7fffffff}]*))\n)\n\\s*(\\()", + "begin": "(?i)\\b(fn)\\s*(?=&?\\s*\\()", + "beginCaptures": { + "1": { + "name": "storage.type.function.php" + } + }, + "end": "=>", + "endCaptures": { + "0": { + "name": "punctuation.definition.arrow.php" + } + }, + "name": "meta.function.closure.php", + "patterns": [ + { + "begin": "(&)?\\s*(\\()", + "beginCaptures": { + "1": { + "name": "storage.modifier.reference.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "match": "(:)\\s*(\\?)?\\s*((?:\\\\?[a-zA-Z_\\x{7f}-\\x{7fffffff}][a-zA-Z0-9_\\x{7f}-\\x{7fffffff}]*)+)\\s*", + "captures": { + "1": { + "name": "keyword.operator.return-value.php" + }, + "2": { + "name": "keyword.operator.nullable-type.php" + }, + "3": { + "name": "storage.type.php" + } + } + } + ] + }, + { + "begin": "(?x)\n((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n(function)\\s+\n(?i:\n (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|toString|\n clone|set_state|sleep|wakeup|autoload|invoke|callStatic|serialize|unserialize))\n |(?:(&)?\\s*([a-zA-Z_\\x{7f}-\\x{7fffffff}][a-zA-Z0-9_\\x{7f}-\\x{7fffffff}]*))\n)\n\\s*(\\()", "beginCaptures": { "1": { "patterns": [ @@ -574,6 +634,44 @@ } ] }, + { + "match": "(?xi)\n((?:(?:public|private|protected|static)(?:\\s+|(?=\\?)))+) # At least one modifier\n(?:(\\?)?\\s* # Optional nullable\n (\\\\?(?:[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)*) # Optional namespace\n ([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))? # Typehinted class name\n\\s+((\\$)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) # Variable name", + "captures": { + "1": { + "patterns": [ + { + "match": "public|private|protected|static", + "name": "storage.modifier.php" + } + ] + }, + "2": { + "name": "keyword.operator.nullable-type.php" + }, + "3": { + "name": "support.other.namespace.php", + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*", + "name": "storage.type.php" + }, + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + }, + "4": { + "name": "storage.type.php" + }, + "5": { + "name": "variable.other.php" + }, + "6": { + "name": "punctuation.definition.variable.php" + } + } + }, { "include": "#invoke-call" }, @@ -667,6 +765,10 @@ "match": "(?i)\\bclone\\b", "name": "keyword.other.clone.php" }, + { + "match": "\\.\\.\\.", + "name": "keyword.operator.spread.php" + }, { "match": "\\.=?", "name": "keyword.operator.string.php" @@ -698,7 +800,7 @@ "name": "keyword.operator.comparison.php" }, { - "match": "=|\\+=|\\-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=", + "match": "=|\\+=|\\-=|\\*\\*?=|/=|%=|&=|\\|=|\\^=|<<=|>>=|\\?\\?=", "name": "keyword.operator.assignment.php" }, { @@ -710,7 +812,7 @@ "name": "keyword.operator.increment-decrement.php" }, { - "match": "\\-|\\+|\\*|/|%", + "match": "\\-|\\+|\\*\\*?|/|%", "name": "keyword.operator.arithmetic.php" }, { @@ -1959,7 +2061,7 @@ ] }, "instantiation": { - "begin": "(?i)(new)\\s+", + "begin": "(?i)(new)\\s+(?!class\\b)", "beginCaptures": { "1": { "name": "keyword.other.new.php" @@ -2066,19 +2168,19 @@ "numbers": { "patterns": [ { - "match": "0[xX][0-9a-fA-F]+", + "match": "0[xX][0-9a-fA-F]+(?:_[0-9a-fA-F]+)*", "name": "constant.numeric.hex.php" }, { - "match": "0[bB][01]+", + "match": "0[bB][01]+(?:_[01]+)*", "name": "constant.numeric.binary.php" }, { - "match": "0[0-7]+", + "match": "0(?:_?[0-7]+)+", "name": "constant.numeric.octal.php" }, { - "match": "(?x)\n(?:\n [0-9]*(\\.)[0-9]+(?:[eE][+-]?[0-9]+)?|\n [0-9]+(\\.)[0-9]*(?:[eE][+-]?[0-9]+)?|\n [0-9]+[eE][+-]?[0-9]+\n)", + "match": "(?x)\n(?:\n (?:[0-9]+(?:_[0-9]+)*)?(\\.)[0-9]+(?:_[0-9]+)*(?:[eE][+-]?[0-9]+(?:_[0-9]+)*)?| # .3\n [0-9]+(?:_[0-9]+)*(\\.)(?:[0-9]+(?:_[0-9]+)*)?(?:[eE][+-]?[0-9]+(?:_[0-9]+)*)?| # 3.\n [0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)* # 2e-3\n)", "name": "constant.numeric.decimal.php", "captures": { "1": { @@ -2090,7 +2192,7 @@ } }, { - "match": "0|[1-9][0-9]*", + "match": "0|[1-9](?:_?[0-9]+)*", "name": "constant.numeric.decimal.php" } ] diff --git a/extensions/r/cgmanifest.json b/extensions/r/cgmanifest.json index 0781a150722..7cf785d7140 100644 --- a/extensions/r/cgmanifest.json +++ b/extensions/r/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "Ikuyadeu/vscode-R", "repositoryUrl": "https://github.com/Ikuyadeu/vscode-R", - "commitHash": "1cd3d42a6b2e54276ef2d71fe33bb3fefb1d6cff" + "commitHash": "bc79e9245682ee09b4f0b742b927a37702d91b82" } }, "license": "MIT", - "version": "0.5.5" + "version": "1.1.8" } ], "version": 1 diff --git a/extensions/r/syntaxes/r.tmLanguage.json b/extensions/r/syntaxes/r.tmLanguage.json index db37b8421fe..2b6c4368da9 100644 --- a/extensions/r/syntaxes/r.tmLanguage.json +++ b/extensions/r/syntaxes/r.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/Ikuyadeu/vscode-R/commit/1cd3d42a6b2e54276ef2d71fe33bb3fefb1d6cff", + "version": "https://github.com/Ikuyadeu/vscode-R/commit/bc79e9245682ee09b4f0b742b927a37702d91b82", "name": "R", "scopeName": "source.r", "patterns": [ @@ -417,7 +417,7 @@ "end": "(\\))", "endCaptures": { "1": { - "name": "punctuation.definition.parameters.r" + "name": "punctuation.section.parens.end.r" } }, "name": "meta.function-call.r", diff --git a/extensions/r/test/colorize-results/test_r.json b/extensions/r/test/colorize-results/test_r.json index 2d3e504f8de..3ecd0091ce5 100644 --- a/extensions/r/test/colorize-results/test_r.json +++ b/extensions/r/test/colorize-results/test_r.json @@ -639,7 +639,7 @@ }, { "c": ")", - "t": "source.r meta.function-call.r punctuation.definition.parameters.r", + "t": "source.r meta.function-call.r punctuation.section.parens.end.r", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -716,7 +716,7 @@ }, { "c": ")", - "t": "source.r meta.function-call.r punctuation.definition.parameters.r", + "t": "source.r meta.function-call.r punctuation.section.parens.end.r", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1044,4 +1044,4 @@ "hc_black": "default: #FFFFFF" } } -] +] \ No newline at end of file diff --git a/extensions/shaderlab/test/colorize-results/test_shader.json b/extensions/shaderlab/test/colorize-results/test_shader.json index 80eff76e153..fac0a925a41 100644 --- a/extensions/shaderlab/test/colorize-results/test_shader.json +++ b/extensions/shaderlab/test/colorize-results/test_shader.json @@ -452,7 +452,7 @@ }, { "c": "1", - "t": "source.shaderlab meta.cgblock constant.numeric.hlsl", + "t": "source.shaderlab meta.cgblock constant.numeric.decimal.hlsl", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #098658", @@ -571,4 +571,4 @@ "hc_black": "default: #FFFFFF" } } -] +] \ No newline at end of file From e49d387220dd57404e77ba410df5de9e1d697220 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 13:08:11 +0100 Subject: [PATCH 062/624] fix #89596 --- src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts index 4e560d2cfe5..5a86187b937 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts @@ -42,6 +42,7 @@ export class EditorBreadcrumbsModel { private readonly _disposables = new DisposableStore(); private readonly _fileInfo: FileInfo; + private readonly _cfgEnabled: BreadcrumbsConfig; private readonly _cfgFilePath: BreadcrumbsConfig<'on' | 'off' | 'last'>; private readonly _cfgSymbolPath: BreadcrumbsConfig<'on' | 'off' | 'last'>; @@ -58,6 +59,7 @@ export class EditorBreadcrumbsModel { @ITextResourceConfigurationService private readonly _textResourceConfigurationService: ITextResourceConfigurationService, @IWorkspaceContextService workspaceService: IWorkspaceContextService, ) { + this._cfgEnabled = BreadcrumbsConfig.IsEnabled.bindTo(_configurationService); this._cfgFilePath = BreadcrumbsConfig.FilePath.bindTo(_configurationService); this._cfgSymbolPath = BreadcrumbsConfig.SymbolPath.bindTo(_configurationService); @@ -69,6 +71,7 @@ export class EditorBreadcrumbsModel { } dispose(): void { + this._cfgEnabled.dispose(); this._cfgFilePath.dispose(); this._cfgSymbolPath.dispose(); this._outlineDisposables.dispose(); @@ -144,6 +147,11 @@ export class EditorBreadcrumbsModel { // update when config changes (re-render) this._disposables.add(this._configurationService.onDidChangeConfiguration(e => { + if (!this._cfgEnabled.getValue()) { + // breadcrumbs might be disabled (also via a setting/config) and that is + // something we must check before proceeding. + return; + } if (e.affectsConfiguration('breadcrumbs')) { this._updateOutline(true); return; From 3d0dbfb8261bf68bf355d83a94ad9d43509b7684 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 13:18:15 +0100 Subject: [PATCH 063/624] no conflicts for now... --- .../bulkEdit/browser/bulkEditService.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts index a5bc8f9a21c..2d103e7bf89 100644 --- a/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts +++ b/src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts @@ -21,11 +21,9 @@ import { ILogService } from 'vs/platform/log/common/log'; import { IProgress, IProgressStep, emptyProgress } from 'vs/platform/progress/common/progress'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { ILabelService } from 'vs/platform/label/common/label'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { ConflictDetector } from 'vs/workbench/services/bulkEdit/browser/conflicts'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -239,7 +237,6 @@ class BulkEdit { @ILogService private readonly _logService: ILogService, @IFileService private readonly _fileService: IFileService, @ITextFileService private readonly _textFileService: ITextFileService, - @ILabelService private readonly _uriLabelServie: ILabelService, @IConfigurationService private readonly _configurationService: IConfigurationService ) { this._editor = editor; @@ -288,7 +285,6 @@ class BulkEdit { // for child operations this._progress.report({ total }); - const conflicts = this._instaService.createInstance(ConflictDetector, { edits: this._edits }); const progress: IProgress = { report: _ => this._progress.report({ increment: 1 }) }; // do it. @@ -296,7 +292,7 @@ class BulkEdit { if (WorkspaceFileEdit.is(group[0])) { await this._performFileEdits(group, progress); } else { - await this._performTextEdits(group, conflicts, progress); + await this._performTextEdits(group, progress); } } } @@ -336,14 +332,14 @@ class BulkEdit { } } - private async _performTextEdits(edits: WorkspaceTextEdit[], conflicts: ConflictDetector, progress: IProgress): Promise { + private async _performTextEdits(edits: WorkspaceTextEdit[], progress: IProgress): Promise { this._logService.debug('_performTextEdits', JSON.stringify(edits)); const model = this._instaService.createInstance(BulkEditModel, this._editor, progress, edits); await model.prepare(); - this._throwIfConflicts(conflicts); + // this._throwIfConflicts(conflicts); const validationResult = model.validate(); if (validationResult.canApply === false) { model.dispose(); @@ -353,13 +349,6 @@ class BulkEdit { model.apply(); model.dispose(); } - - private _throwIfConflicts(conflicts: ConflictDetector) { - if (conflicts.hasConflicts()) { - const paths = conflicts.list().map(uri => this._uriLabelServie.getUriLabel(uri, { relative: true })); - throw new Error(localize('conflict', "These files have changed in the meantime: {0}", paths.join(', '))); - } - } } export class BulkEditService implements IBulkEditService { From ce8009cb331bcdedcd0d935bffeb65191b264534 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 14:12:32 +0100 Subject: [PATCH 064/624] use Action2 for MeasureExtHostLatencyAction --- .../common/extensionHostProcessManager.ts | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts index f3b6c2bf21d..624fd0b4735 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts @@ -9,7 +9,7 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import * as strings from 'vs/base/common/strings'; import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ExtHostCustomersRegistry } from 'vs/workbench/api/common/extHostCustomers'; import { ExtHostContext, ExtHostExtensionServiceShape, IExtHostContext, MainContext } from 'vs/workbench/api/common/extHost.protocol'; import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier'; @@ -17,10 +17,7 @@ import { IRPCProtocolLogger, RPCProtocol, RequestInitiator, ResponsiveState } fr import { RemoteAuthorityResolverError, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as nls from 'vs/nls'; -import { Action } from 'vs/base/common/actions'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; +import { registerAction2, Action2 } from 'vs/platform/actions/common/actions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IUntitledTextResourceInput } from 'vs/workbench/common/editor'; import { StopWatch } from 'vs/base/common/stopwatch'; @@ -389,21 +386,26 @@ function getLatencyTestProviders(): ExtHostLatencyProvider[] { return providers.slice(0); } -export class MeasureExtHostLatencyAction extends Action { - public static readonly ID = 'editor.action.measureExtHostLatency'; - public static readonly LABEL = nls.localize('measureExtHostLatency', "Measure Extension Host Latency"); +registerAction2(class MeasureExtHostLatencyAction extends Action2 { - constructor( - id: string, - label: string, - @IEditorService private readonly _editorService: IEditorService - ) { - super(id, label); + constructor() { + super({ + id: 'editor.action.measureExtHostLatency', + title: { + value: nls.localize('measureExtHostLatency', "Measure Extension Host Latency"), + original: 'Developer: Measure Extension Host Latency' + }, + category: nls.localize('developer', "Developer"), + f1: true + }); } - public async run(): Promise { + async run(accessor: ServicesAccessor) { + + const editorService = accessor.get(IEditorService); + const measurements = await Promise.all(getLatencyTestProviders().map(provider => provider.measure())); - this._editorService.openEditor({ contents: measurements.map(MeasureExtHostLatencyAction._print).join('\n\n'), options: { pinned: true } } as IUntitledTextResourceInput); + editorService.openEditor({ contents: measurements.map(MeasureExtHostLatencyAction._print).join('\n\n'), options: { pinned: true } } as IUntitledTextResourceInput); } private static _print(m: ExtHostLatencyResult | null): string { @@ -422,7 +424,4 @@ export class MeasureExtHostLatencyAction extends Action { } return `${(n / 1024 / 1024).toFixed(1)} Mbps`; } -} - -const registry = Registry.as(ActionExtensions.WorkbenchActions); -registry.registerWorkbenchAction(SyncActionDescriptor.create(MeasureExtHostLatencyAction, MeasureExtHostLatencyAction.ID, MeasureExtHostLatencyAction.LABEL), 'Developer: Measure Extension Host Latency', nls.localize('developer', "Developer")); +}); From ec28475881d4b5ad4570a579381317b29bbd2a5d Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 3 Feb 2020 14:36:30 +0100 Subject: [PATCH 065/624] make MenuId dynamic --- src/vs/platform/actions/common/actions.ts | 72 ++++++++++++++++++- .../actions/test/common/menuService.test.ts | 2 +- .../browser/parts/titlebar/menubarControl.ts | 4 +- src/vs/workbench/electron-browser/window.ts | 4 +- 4 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 0a1e2917c54..201198887a0 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -56,7 +56,75 @@ export function isISubmenuItem(item: IMenuItem | ISubmenuItem): item is ISubmenu return (item as ISubmenuItem).submenu !== undefined; } -export const enum MenuId { +export class MenuId { + + static readonly CommandPalette = new MenuId('CommandPalette'); + static readonly DebugBreakpointsContext = new MenuId('DebugBreakpointsContext'); + static readonly DebugCallStackContext = new MenuId('DebugCallStackContext'); + static readonly DebugConsoleContext = new MenuId('DebugConsoleContext'); + static readonly DebugVariablesContext = new MenuId('DebugVariablesContext'); + static readonly DebugWatchContext = new MenuId('DebugWatchContext'); + static readonly DebugToolBar = new MenuId('DebugToolBar'); + static readonly EditorContext = new MenuId('EditorContext'); + static readonly EditorContextPeek = new MenuId('EditorContextPeek'); + static readonly EditorTitle = new MenuId('EditorTitle'); + static readonly EditorTitleContext = new MenuId('EditorTitleContext'); + static readonly EmptyEditorGroupContext = new MenuId('EmptyEditorGroupContext'); + static readonly ExplorerContext = new MenuId('ExplorerContext'); + static readonly ExtensionContext = new MenuId('ExtensionContext'); + static readonly GlobalActivity = new MenuId('GlobalActivity'); + static readonly MenubarAppearanceMenu = new MenuId('MenubarAppearanceMenu'); + static readonly MenubarDebugMenu = new MenuId('MenubarDebugMenu'); + static readonly MenubarEditMenu = new MenuId('MenubarEditMenu'); + static readonly MenubarFileMenu = new MenuId('MenubarFileMenu'); + static readonly MenubarGoMenu = new MenuId('MenubarGoMenu'); + static readonly MenubarHelpMenu = new MenuId('MenubarHelpMenu'); + static readonly MenubarLayoutMenu = new MenuId('MenubarLayoutMenu'); + static readonly MenubarNewBreakpointMenu = new MenuId('MenubarNewBreakpointMenu'); + static readonly MenubarPreferencesMenu = new MenuId('MenubarPreferencesMenu'); + static readonly MenubarRecentMenu = new MenuId('MenubarRecentMenu'); + static readonly MenubarSelectionMenu = new MenuId('MenubarSelectionMenu'); + static readonly MenubarSwitchEditorMenu = new MenuId('MenubarSwitchEditorMenu'); + static readonly MenubarSwitchGroupMenu = new MenuId('MenubarSwitchGroupMenu'); + static readonly MenubarTerminalMenu = new MenuId('MenubarTerminalMenu'); + static readonly MenubarViewMenu = new MenuId('MenubarViewMenu'); + static readonly OpenEditorsContext = new MenuId('OpenEditorsContext'); + static readonly ProblemsPanelContext = new MenuId('ProblemsPanelContext'); + static readonly SCMChangeContext = new MenuId('SCMChangeContext'); + static readonly SCMResourceContext = new MenuId('SCMResourceContext'); + static readonly SCMResourceFolderContext = new MenuId('SCMResourceFolderContext'); + static readonly SCMResourceGroupContext = new MenuId('SCMResourceGroupContext'); + static readonly SCMSourceControl = new MenuId('SCMSourceControl'); + static readonly SCMTitle = new MenuId('SCMTitle'); + static readonly SearchContext = new MenuId('SearchContext'); + static readonly StatusBarWindowIndicatorMenu = new MenuId('StatusBarWindowIndicatorMenu'); + static readonly TouchBarContext = new MenuId('TouchBarContext'); + static readonly TitleBarContext = new MenuId('TitleBarContext'); + static readonly TunnelContext = new MenuId('TunnelContext'); + static readonly TunnelInline = new MenuId('TunnelInline'); + static readonly TunnelTitle = new MenuId('TunnelTitle'); + static readonly ViewItemContext = new MenuId('ViewItemContext'); + static readonly ViewTitle = new MenuId('ViewTitle'); + static readonly ViewTitleContext = new MenuId('ViewTitleContext'); + static readonly CommentThreadTitle = new MenuId('CommentThreadTitle'); + static readonly CommentThreadActions = new MenuId('CommentThreadActions'); + static readonly CommentTitle = new MenuId('CommentTitle'); + static readonly CommentActions = new MenuId('CommentActions'); + static readonly BulkEditTitle = new MenuId('BulkEditTitle'); + static readonly BulkEditContext = new MenuId('BulkEditContext'); + + private static _idPool = 0; + + readonly id: number; + readonly _debugName: string; + + constructor(debugName: string) { + this.id = MenuId._idPool++; + this._debugName = debugName; + } +} + +export const enum MenuId3 { CommandPalette, DebugBreakpointsContext, DebugCallStackContext, @@ -146,7 +214,7 @@ export interface IMenuRegistry { export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { private readonly _commands = new Map(); - private readonly _menuItems = new Map>(); + private readonly _menuItems = new Map>(); private readonly _onDidChangeMenu = new Emitter(); readonly onDidChangeMenu: Event = this._onDidChangeMenu.event; diff --git a/src/vs/platform/actions/test/common/menuService.test.ts b/src/vs/platform/actions/test/common/menuService.test.ts index b49eca01673..48b8fdd9186 100644 --- a/src/vs/platform/actions/test/common/menuService.test.ts +++ b/src/vs/platform/actions/test/common/menuService.test.ts @@ -28,7 +28,7 @@ suite('MenuService', function () { setup(function () { menuService = new MenuService(NullCommandService); - testMenuId = Math.PI; + testMenuId = new MenuId('testo'); disposables.clear(); }); diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index 76a3ea95bf2..086764a05e0 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -573,9 +573,9 @@ export class CustomMenubarControl extends MenubarControl { for (let action of actions) { this.insertActionsBefore(action, target); if (action instanceof SubmenuItemAction) { - let submenu = this.menus[action.item.submenu]; + let submenu = this.menus[action.item.submenu.id]; if (!submenu) { - submenu = this.menus[action.item.submenu] = this.menuService.createMenu(action.item.submenu, this.contextKeyService); + submenu = this.menus[action.item.submenu.id] = this.menuService.createMenu(action.item.submenu, this.contextKeyService); this._register(submenu.onDidChange(() => { if (!this.focusInsideMenubar) { const actions: IAction[] = []; diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index 4f502198c5b..debe0d0e1d6 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -778,8 +778,8 @@ class NativeMenubarControl extends MenubarControl { if (menuItem instanceof SubmenuItemAction) { const submenu = { items: [] }; - if (!this.menus[menuItem.item.submenu]) { - const menu = this.menus[menuItem.item.submenu] = this.menuService.createMenu(menuItem.item.submenu, this.contextKeyService); + if (!this.menus[menuItem.item.submenu.id]) { + const menu = this.menus[menuItem.item.submenu.id] = this.menuService.createMenu(menuItem.item.submenu, this.contextKeyService); this._register(menu.onDidChange(() => this.updateMenubar())); } From d79b7a418a5483e7b9be9641a79cfc57447067ae Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Mon, 3 Feb 2020 13:46:50 +0000 Subject: [PATCH 066/624] Fix 89899 - improve description of editor.foldingStrategy setting --- src/vs/editor/common/config/editorOptions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 07200e8eb33..106cc059c6a 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3440,7 +3440,13 @@ export const EditorOptions = { EditorOption.foldingStrategy, 'foldingStrategy', 'auto' as 'auto' | 'indentation', ['auto', 'indentation'] as const, - { markdownDescription: nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.") } + { + enumDescriptions: [ + nls.localize('foldingStrategy.auto', "Use a language-specific folding strategy if available, else the indentation-based one."), + nls.localize('foldingStrategy.indentation', "Use the indentation-based folding strategy."), + ], + description: nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges.") + } )), foldingHighlight: register(new EditorBooleanOption( EditorOption.foldingHighlight, 'foldingHighlight', true, From 260b72e2ab1acd5edf83bfd9908929a88043e8b1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 3 Feb 2020 14:58:27 +0100 Subject: [PATCH 067/624] ipc: multicast events --- src/vs/base/common/arrays.ts | 4 + src/vs/base/parts/ipc/common/ipc.ts | 104 ++++++++++---------- src/vs/base/parts/ipc/test/node/ipc.test.ts | 6 +- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index 8ddd98a5a82..0f300db10c6 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -584,3 +584,7 @@ export function mapArrayOrNot(items: T | T[], fn: (_: T) => U): U | U[] { export function asArray(x: T | T[]): T[] { return Array.isArray(x) ? x : [x]; } + +export function getRandomElement(arr: T[]): T { + return arr[Math.floor(Math.random() * arr.length)]; +} diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index e22fb97289e..397a44cb283 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -9,6 +9,7 @@ import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/com import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import * as errors from 'vs/base/common/errors'; import { VSBuffer } from 'vs/base/common/buffer'; +import { getRandomElement } from 'vs/base/common/arrays'; /** * An `IChannel` is an abstraction over a collection of commands. @@ -117,8 +118,7 @@ export interface IClientRouter { * order to pick the right one. */ export interface IRoutingChannelClient { - getChannel(channelName: string, router: IClientRouter): T; - getBroadcastChannel(channelName: string): T; + getChannel(channelName: string, router?: IClientRouter): T; } interface IReader { @@ -700,18 +700,26 @@ export class IPCServer implements IChannelServer, I }); } - getChannel(channelName: string, router: IClientRouter): T { + getChannel(channelName: string, router?: IClientRouter): T { const that = this; return { call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { - const channelPromise = router.routeCall(that, command, arg) + const connectionPromise = router + ? router.routeCall(that, command, arg) + : Promise.resolve(getRandomElement(that.connections)); + + const channelPromise = connectionPromise .then(connection => (connection as Connection).channelClient.getChannel(channelName)); return getDelayedChannel(channelPromise) .call(command, arg, cancellationToken); }, listen(event: string, arg: any): Event { + if (!router) { + return that.getMulticastEvent(channelName, event, arg); + } + const channelPromise = router.routeEvent(that, event, arg) .then(connection => (connection as Connection).channelClient.getChannel(channelName)); @@ -721,64 +729,56 @@ export class IPCServer implements IChannelServer, I } as T; } - getBroadcastChannel(channelName: string): T { + private getMulticastEvent(channelName: string, eventName: string, arg: any): Event { const that = this; + let disposables = new DisposableStore(); - return { - call(_): Promise { - throw new Error('IPC broadcast channels are not supported for calls'); - }, - listen(eventName: string, arg: any): Event { - let disposables = new DisposableStore(); + // Create an emitter which hooks up to all clients + // as soon as first listener is added. It also + // disconnects from all clients as soon as the last listener + // is removed. + const emitter = new Emitter({ + onFirstListenerAdd: () => { + disposables = new DisposableStore(); - // Create an emitter which hooks up to all clients - // as soon as first listener is added. It also - // disconnects from all clients as soon as the last listener - // is removed. - const emitter = new Emitter({ - onFirstListenerAdd: () => { - disposables = new DisposableStore(); + // The event multiplexer is useful since the active + // client list is dynamic. We need to hook up and disconnection + // to/from clients as they come and go. + const eventMultiplexer = new EventMultiplexer(); + const map = new Map, IDisposable>(); - // The event multiplexer is useful since the active - // client list is dynamic. We need to hook up and disconnection - // to/from clients as they come and go. - const eventMultiplexer = new EventMultiplexer(); - const map = new Map, IDisposable>(); + const onDidAddConnection = (connection: Connection) => { + const channel = connection.channelClient.getChannel(channelName); + const event = channel.listen(eventName, arg); + const disposable = eventMultiplexer.add(event); - const onDidAddConnection = (connection: Connection) => { - const channel = connection.channelClient.getChannel(channelName); - const event = channel.listen(eventName, arg); - const disposable = eventMultiplexer.add(event); + map.set(connection, disposable); + }; - map.set(connection, disposable); - }; + const onDidRemoveConnection = (connection: Connection) => { + const disposable = map.get(connection); - const onDidRemoveConnection = (connection: Connection) => { - const disposable = map.get(connection); - - if (!disposable) { - return; - } - - disposable.dispose(); - map.delete(connection); - }; - - that.connections.forEach(onDidAddConnection); - that.onDidAddConnection(onDidAddConnection, undefined, disposables); - that.onDidRemoveConnection(onDidRemoveConnection, undefined, disposables); - eventMultiplexer.event(emitter.fire, emitter, disposables); - - disposables.add(eventMultiplexer); - }, - onLastListenerRemove: () => { - disposables.dispose(); + if (!disposable) { + return; } - }); - return emitter.event; + disposable.dispose(); + map.delete(connection); + }; + + that.connections.forEach(onDidAddConnection); + that.onDidAddConnection(onDidAddConnection, undefined, disposables); + that.onDidRemoveConnection(onDidRemoveConnection, undefined, disposables); + eventMultiplexer.event(emitter.fire, emitter, disposables); + + disposables.add(eventMultiplexer); + }, + onLastListenerRemove: () => { + disposables.dispose(); } - } as T; + }); + + return emitter.event; } registerChannel(channelName: string, channel: IServerChannel): void { diff --git a/src/vs/base/parts/ipc/test/node/ipc.test.ts b/src/vs/base/parts/ipc/test/node/ipc.test.ts index d0aeee23d47..5839c45dab7 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.test.ts @@ -454,9 +454,9 @@ suite('Base IPC', function () { client1.registerChannel('channel', clientChannel1); const pings: string[] = []; - const broadcastChannel = server.getBroadcastChannel('channel'); - const broadcastService = new TestChannelClient(broadcastChannel); - broadcastService.onPong(msg => pings.push(msg)); + const channel = server.getChannel('channel'); + const service = new TestChannelClient(channel); + service.onPong(msg => pings.push(msg)); await timeout(1); clientService1.ping('hello 1'); From a99b0779172d122c85b208e47134f3530bee1cd3 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 3 Feb 2020 15:06:41 +0100 Subject: [PATCH 068/624] :up: distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e67b14e4b37..41725c5340f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.43.0", - "distro": "37cc2dc2461194a03cadbd9de5030ac3b6eb1109", + "distro": "efecc155935e7eb2f21b904b59991b07b0d58e58", "author": { "name": "Microsoft Corporation" }, From 2524412d5c400f94f75e5e4098e8d65654837e58 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 3 Feb 2020 16:00:52 +0100 Subject: [PATCH 069/624] Keep process info when forwarding candidate port Fixes https://github.com/microsoft/vscode/issues/89424 --- .../contrib/remote/browser/tunnelView.ts | 44 +++++++++++++------ .../remote/common/remoteExplorerService.ts | 2 +- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/contrib/remote/browser/tunnelView.ts b/src/vs/workbench/contrib/remote/browser/tunnelView.ts index 7991e44e2c9..2d5bd081693 100644 --- a/src/vs/workbench/contrib/remote/browser/tunnelView.ts +++ b/src/vs/workbench/contrib/remote/browser/tunnelView.ts @@ -57,7 +57,7 @@ export interface ITunnelViewModel { onForwardedPortsChanged: Event; readonly forwarded: TunnelItem[]; readonly detected: TunnelItem[]; - readonly candidates: Promise; + readonly candidates: TunnelItem[]; readonly input: TunnelItem; groups(): Promise; } @@ -67,6 +67,7 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel { public onForwardedPortsChanged: Event = this._onForwardedPortsChanged.event; private model: TunnelModel; private _input: TunnelItem; + private _candidates: Map = new Map(); constructor( @IRemoteExplorerService private readonly remoteExplorerService: IRemoteExplorerService) { @@ -87,6 +88,10 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel { async groups(): Promise { const groups: ITunnelGroup[] = []; + this._candidates = new Map(); + (await this.model.candidates).forEach(candidate => { + this._candidates.set(MakeAddress(candidate.host, candidate.port), candidate); + }); if ((this.model.forwarded.size > 0) || this.remoteExplorerService.getEditableData(undefined)) { groups.push({ label: nls.localize('remote.tunnelsView.forwarded', "Forwarded"), @@ -115,9 +120,18 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel { return groups; } + private addProcessInfoFromCandidate(tunnelItem: ITunnelItem) { + const key = MakeAddress(tunnelItem.remoteHost, tunnelItem.remotePort); + if (this._candidates.has(key)) { + tunnelItem.description = this._candidates.get(key)!.detail; + } + } + get forwarded(): TunnelItem[] { const forwarded = Array.from(this.model.forwarded.values()).map(tunnel => { - return TunnelItem.createFromTunnel(tunnel); + const tunnelItem = TunnelItem.createFromTunnel(tunnel); + this.addProcessInfoFromCandidate(tunnelItem); + return tunnelItem; }).sort((a: TunnelItem, b: TunnelItem) => { if (a.remotePort === b.remotePort) { return a.remoteHost < b.remoteHost ? -1 : 1; @@ -133,21 +147,21 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel { get detected(): TunnelItem[] { return Array.from(this.model.detected.values()).map(tunnel => { - return TunnelItem.createFromTunnel(tunnel, TunnelType.Detected, false); + const tunnelItem = TunnelItem.createFromTunnel(tunnel, TunnelType.Detected, false); + this.addProcessInfoFromCandidate(tunnelItem); + return tunnelItem; }); } - get candidates(): Promise { - return this.model.candidates.then(values => { - const candidates: TunnelItem[] = []; - values.forEach(value => { - const key = MakeAddress(value.host, value.port); - if (!this.model.forwarded.has(key) && !this.model.detected.has(key)) { - candidates.push(new TunnelItem(TunnelType.Candidate, value.host, value.port, undefined, false, undefined, value.detail)); - } - }); - return candidates; + get candidates(): TunnelItem[] { + const candidates: TunnelItem[] = []; + this._candidates.forEach(value => { + const key = MakeAddress(value.host, value.port); + if (!this.model.forwarded.has(key) && !this.model.detected.has(key)) { + candidates.push(new TunnelItem(TunnelType.Candidate, value.host, value.port, undefined, false, undefined, value.detail)); + } }); + return candidates; } get input(): TunnelItem { @@ -386,6 +400,10 @@ class TunnelItem implements ITunnelItem { } } + set description(description: string | undefined) { + this._description = description; + } + get description(): string | undefined { if (this._description) { return this._description; diff --git a/src/vs/workbench/services/remote/common/remoteExplorerService.ts b/src/vs/workbench/services/remote/common/remoteExplorerService.ts index 4ff49607444..67fc3030120 100644 --- a/src/vs/workbench/services/remote/common/remoteExplorerService.ts +++ b/src/vs/workbench/services/remote/common/remoteExplorerService.ts @@ -31,7 +31,7 @@ export interface ITunnelItem { localAddress?: string; name?: string; closeable?: boolean; - readonly description?: string; + description?: string; readonly label: string; } From ee50ba7266dc518756a9b870775d2e66ec66efcd Mon Sep 17 00:00:00 2001 From: Gustavo Cassel Date: Mon, 3 Feb 2020 13:04:06 -0300 Subject: [PATCH 070/624] Renamed 'mouseOpensDefinitionInPeek' to 'definitionLinkOpensInPeek' --- src/vs/editor/common/config/editorOptions.ts | 12 ++++++------ src/vs/editor/common/standalone/standaloneEnums.ts | 2 +- .../gotoSymbol/link/goToDefinitionAtPosition.ts | 2 +- src/vs/monaco.d.ts | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index a436c18203d..f14f6687364 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -556,10 +556,10 @@ export interface IEditorOptions { */ peekWidgetDefaultFocus?: 'tree' | 'editor'; /** - * Controls whether the mouse click opens element definition in the peek widget. + * Controls whether the definition link opens element in the peek widget. * Defaults to false. */ - mouseOpensDefinitionInPeek?: boolean; + definitionLinkOpensInPeek?: boolean; } export interface IEditorConstructionOptions extends IEditorOptions { @@ -3197,7 +3197,7 @@ export const enum EditorOption { overviewRulerLanes, parameterHints, peekWidgetDefaultFocus, - mouseOpensDefinitionInPeek, + definitionLinkOpensInPeek, quickSuggestions, quickSuggestionsDelay, readOnly, @@ -3589,9 +3589,9 @@ export const EditorOptions = { description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.") } )), - mouseOpensDefinitionInPeek: register(new EditorBooleanOption( - EditorOption.mouseOpensDefinitionInPeek, 'mouseOpensDefinitionInPeek', false, - { description: nls.localize('mouseOpensDefinitionInPeek', "Controls whether the mouse click opens element definition in the peek widget.") } + definitionLinkOpensInPeek: register(new EditorBooleanOption( + EditorOption.definitionLinkOpensInPeek, 'definitionLinkOpensInPeek', false, + { description: nls.localize('definitionLinkOpensInPeek', "Controls whether the definition link opens element in the peek widget.") } )), quickSuggestions: register(new EditorQuickSuggestions()), quickSuggestionsDelay: register(new EditorIntOption( diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 919c871a8c1..5041c28367c 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -231,7 +231,7 @@ export enum EditorOption { overviewRulerLanes = 63, parameterHints = 64, peekWidgetDefaultFocus = 65, - mouseOpensDefinitionInPeek = 66, + definitionLinkOpensInPeek = 66, quickSuggestions = 67, quickSuggestionsDelay = 68, readOnly = 69, diff --git a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts index b609be4291e..64ae38189a0 100644 --- a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts +++ b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts @@ -335,7 +335,7 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri private gotoDefinition(position: Position, openToSide: boolean): Promise { this.editor.setPosition(position); - const openInPeek = this.editor.getOption(EditorOption.mouseOpensDefinitionInPeek); + const openInPeek = this.editor.getOption(EditorOption.definitionLinkOpensInPeek); const action = new DefinitionAction({ openToSide, openInPeek: openInPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined }); return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor)); } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 84522b4c21d..9b2a0613025 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3036,10 +3036,10 @@ declare namespace monaco.editor { */ peekWidgetDefaultFocus?: 'tree' | 'editor'; /** - * Controls whether the mouse click opens element definition in the peek widget. + * Controls whether the definition link opens element in the peek widget. * Defaults to false. */ - mouseOpensDefinitionInPeek?: boolean; + definitionLinkOpensInPeek?: boolean; } export interface IEditorConstructionOptions extends IEditorOptions { @@ -3766,7 +3766,7 @@ declare namespace monaco.editor { overviewRulerLanes = 63, parameterHints = 64, peekWidgetDefaultFocus = 65, - mouseOpensDefinitionInPeek = 66, + definitionLinkOpensInPeek = 66, quickSuggestions = 67, quickSuggestionsDelay = 68, readOnly = 69, @@ -3879,7 +3879,7 @@ declare namespace monaco.editor { overviewRulerLanes: IEditorOption; parameterHints: IEditorOption; peekWidgetDefaultFocus: IEditorOption; - mouseOpensDefinitionInPeek: IEditorOption; + definitionLinkOpensInPeek: IEditorOption; quickSuggestions: IEditorOption; quickSuggestionsDelay: IEditorOption; readOnly: IEditorOption; From 2a8adf5b24ed8b9bcd279c73ee654f7ebec0ab9e Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Mon, 3 Feb 2020 11:00:00 -0800 Subject: [PATCH 071/624] Better handle suggestion enablement in SuggestEnabledInput Fixes #89541. --- .../suggestEnabledInput/suggestEnabledInput.ts | 10 +++++++--- .../contrib/extensions/common/extensionQuery.ts | 16 ++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts index 8300818b619..003a1d771cd 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts @@ -187,11 +187,15 @@ export class SuggestEnabledInput extends Widget implements IThemable { provideCompletionItems: (model: ITextModel, position: Position, _context: modes.CompletionContext) => { let query = model.getValue(); - let wordStart = query.lastIndexOf(' ', position.column - 1) + 1; - let alreadyTypedCount = position.column - wordStart - 1; + const zeroIndexedColumn = position.column - 1; + + let zeroIndexedWordStart = query.lastIndexOf(' ', zeroIndexedColumn - 1) + 1; + let alreadyTypedCount = zeroIndexedColumn - zeroIndexedWordStart; // dont show suggestions if the user has typed something, but hasn't used the trigger character - if (alreadyTypedCount > 0 && (validatedSuggestProvider.triggerCharacters).indexOf(query[wordStart]) === -1) { return { suggestions: [] }; } + if (alreadyTypedCount > 0 && validatedSuggestProvider.triggerCharacters.indexOf(query[zeroIndexedWordStart]) === -1) { + return { suggestions: [] }; + } return { suggestions: suggestionProvider.provideResults(query).map(result => { diff --git a/src/vs/workbench/contrib/extensions/common/extensionQuery.ts b/src/vs/workbench/contrib/extensions/common/extensionQuery.ts index 6c5a2505331..83ab00fd66c 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionQuery.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionQuery.ts @@ -12,32 +12,32 @@ export class Query { } static suggestions(query: string): string[] { - const commands = ['installed', 'outdated', 'enabled', 'disabled', 'builtin', 'recommended', 'sort', 'category', 'tag', 'ext', 'id']; + const commands = ['installed', 'outdated', 'enabled', 'disabled', 'builtin', 'recommended', 'sort', 'category', 'tag', 'ext', 'id'] as const; const subcommands = { 'sort': ['installs', 'rating', 'name'], 'category': ['"programming languages"', 'snippets', 'linters', 'themes', 'debuggers', 'formatters', 'keymaps', '"scm providers"', 'other', '"extension packs"', '"language packs"'], 'tag': [''], 'ext': [''], 'id': [''] - }; + } as const; - let queryContains = (substr: string) => query.indexOf(substr) > -1; - let hasSort = subcommands.sort.some(subcommand => queryContains(`@sort:${subcommand}`)); - let hasCategory = subcommands.category.some(subcommand => queryContains(`@category:${subcommand}`)); + const queryContains = (substr: string) => query.indexOf(substr) > -1; + const hasSort = subcommands.sort.some(subcommand => queryContains(`@sort:${subcommand}`)); + const hasCategory = subcommands.category.some(subcommand => queryContains(`@category:${subcommand}`)); return flatten( commands.map(command => { if (hasSort && command === 'sort' || hasCategory && command === 'category') { return []; } - if ((subcommands as any)[command]) { - return (subcommands as any)[command].map((subcommand: string) => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`); + if (command in subcommands) { + return (subcommands as Record)[command] + .map(subcommand => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`); } else { return [`@${command} `]; } })); - } static parse(value: string): Query { From a14ad2f8b0a83bace3dae6c83c49224a3fb870aa Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Mon, 3 Feb 2020 11:18:59 -0800 Subject: [PATCH 072/624] Filter out duplicate extension search flags --- src/vs/workbench/contrib/extensions/common/extensionQuery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/extensions/common/extensionQuery.ts b/src/vs/workbench/contrib/extensions/common/extensionQuery.ts index 83ab00fd66c..e46b0ee8260 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionQuery.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionQuery.ts @@ -35,7 +35,7 @@ export class Query { .map(subcommand => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`); } else { - return [`@${command} `]; + return queryContains(`@${command}`) ? [] : [`@${command} `]; } })); } From 58e3989d05f1bec8420614f7350ef2109c91e3bb Mon Sep 17 00:00:00 2001 From: Brett Cannon <54418+brettcannon@users.noreply.github.com> Date: Mon, 3 Feb 2020 13:41:04 -0800 Subject: [PATCH 073/624] Fix plurality in command docs Manually fixed in docs at https://github.com/microsoft/vscode-docs/pull/3379. --- src/vs/workbench/api/common/extHostApiCommands.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 0435b0a59b6..a8b6923f8fb 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -142,7 +142,7 @@ const newCommands: ApiCommand[] = [ ), // -- go to symbol (definition, type definition, declaration, impl, references) new ApiCommand( - 'vscode.executeDefinitionProvider', '_executeDefinitionProvider', 'Execute all definition provider.', + 'vscode.executeDefinitionProvider', '_executeDefinitionProvider', 'Execute all definition providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult('A promise that resolves to an array of Location-instances.', tryMapWith(typeConverters.location.to)) ), @@ -168,7 +168,7 @@ const newCommands: ApiCommand[] = [ ), // -- hover new ApiCommand( - 'vscode.executeHoverProvider', '_executeHoverProvider', 'Execute all hover provider.', + 'vscode.executeHoverProvider', '_executeHoverProvider', 'Execute all hover providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult('A promise that resolves to an array of Hover-instances.', tryMapWith(typeConverters.Hover.to)) ), @@ -188,7 +188,7 @@ const newCommands: ApiCommand[] = [ ), // -- symbol search new ApiCommand( - 'vscode.executeWorkspaceSymbolProvider', '_executeWorkspaceSymbolProvider', 'Execute all workspace symbol provider.', + 'vscode.executeWorkspaceSymbolProvider', '_executeWorkspaceSymbolProvider', 'Execute all workspace symbol providers.', [new ApiCommandArgument('query', 'Search string', v => typeof v === 'string', v => v)], new ApiCommandResult<[search.IWorkspaceSymbolProvider, search.IWorkspaceSymbol[]][], types.SymbolInformation[]>('A promise that resolves to an array of SymbolInformation-instances.', value => { const result: types.SymbolInformation[] = []; From 8fd777f649146b50785693f16453216248d50303 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 11:45:44 -0800 Subject: [PATCH 074/624] Remove extra not null checks --- .../typescript-language-features/src/utils/previewer.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index 6a79f34b56a..e93fe83094e 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -72,16 +72,11 @@ function getTagDocumentation(tag: Proto.JSDocTagInfo): string | undefined { } export function plain(parts: Proto.SymbolDisplayPart[]): string { - if (!parts) { - return ''; - } return parts.map(part => part.text).join(''); } export function tagsMarkdownPreview(tags: Proto.JSDocTagInfo[]): string { - return (tags || []) - .map(getTagDocumentation) - .join(' \n\n'); + return tags.map(getTagDocumentation).join(' \n\n'); } export function markdownDocumentation( From 55e72d8d0220dcfe1746721032cb6fbcb26de534 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 13:59:35 -0800 Subject: [PATCH 075/624] Add support for rendering jsdoc inline `@link` tags Fixes #28624 --- .../src/features/hover.ts | 6 +-- .../src/test/previewer.test.ts | 38 ++++++++++++++++++- .../src/utils/previewer.ts | 33 +++++++++++++--- 3 files changed, 66 insertions(+), 11 deletions(-) diff --git a/extensions/typescript-language-features/src/features/hover.ts b/extensions/typescript-language-features/src/features/hover.ts index ecc331d08b7..2ff92d6e308 100644 --- a/extensions/typescript-language-features/src/features/hover.ts +++ b/extensions/typescript-language-features/src/features/hover.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import type * as Proto from '../protocol'; import { ITypeScriptServiceClient } from '../typescriptService'; -import { tagsMarkdownPreview } from '../utils/previewer'; +import { markdownDocumentation } from '../utils/previewer'; import * as typeConverters from '../utils/typeConverters'; @@ -45,9 +45,7 @@ class TypeScriptHoverProvider implements vscode.HoverProvider { if (data.displayString) { parts.push({ language: 'typescript', value: data.displayString }); } - - const tags = tagsMarkdownPreview(data.tags); - parts.push(data.documentation + (tags ? '\n\n' + tags : '')); + parts.push(markdownDocumentation(data.documentation, data.tags)); return parts; } } diff --git a/extensions/typescript-language-features/src/test/previewer.test.ts b/extensions/typescript-language-features/src/test/previewer.test.ts index 011187b2af4..abcdace9f60 100644 --- a/extensions/typescript-language-features/src/test/previewer.test.ts +++ b/extensions/typescript-language-features/src/test/previewer.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import 'mocha'; -import { tagsMarkdownPreview } from '../utils/previewer'; +import { tagsMarkdownPreview, markdownDocumentation } from '../utils/previewer'; suite('typescript.previewer', () => { test('Should ignore hyphens after a param tag', async () => { @@ -18,5 +18,41 @@ suite('typescript.previewer', () => { ]), '*@param* `a` — b'); }); + + test('Should parse url jsdoc @link', async () => { + assert.strictEqual( + markdownDocumentation('x {@link http://www.example.com/foo} y {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} z', []).value, + 'x [http://www.example.com/foo](http://www.example.com/foo) y [https://api.jquery.com/bind/#bind-eventType-eventData-handler](https://api.jquery.com/bind/#bind-eventType-eventData-handler) z'); + }); + + test('Should parse url jsdoc @link with text', async () => { + assert.strictEqual( + markdownDocumentation('x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z', []).value, + 'x [abc xyz](http://www.example.com/foo) y [b a z](http://www.example.com/bar) z'); + }); + + test('Should treat @linkcode jsdocs links as monospace', async () => { + assert.strictEqual( + markdownDocumentation('x {@linkcode http://www.example.com/foo} y {@linkplain http://www.example.com/bar} z', []).value, + 'x [`http://www.example.com/foo`](http://www.example.com/foo) y [http://www.example.com/bar](http://www.example.com/bar) z'); + }); + + test('Should parse url jsdoc @link in param tag', async () => { + assert.strictEqual( + tagsMarkdownPreview([ + { + name: 'param', + text: 'a x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z' + } + ]), + '*@param* `a` — x [abc xyz](http://www.example.com/foo) y [b a z](http://www.example.com/bar) z'); + }); + + test('Should ignore unclosed jsdocs @link', async () => { + assert.strictEqual( + markdownDocumentation('x {@link http://www.example.com/foo y {@link http://www.example.com/bar bar} z', []).value, + 'x {@link http://www.example.com/foo y [bar](http://www.example.com/bar) z'); + }); + }); diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index e93fe83094e..f29d03189ff 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -6,6 +6,24 @@ import * as vscode from 'vscode'; import type * as Proto from '../protocol'; +function replaceLinks(text: string): string { + return text + // Http(s) links + .replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi, (_, tag: string, link: string, text?: string) => { + switch (tag) { + case 'linkcode': + return `[\`${text ? text.trim() : link}\`](${link})`; + + default: + return `[${text ? text.trim() : link}](${link})`; + } + }); +} + +function processInlineTags(text: string): string { + return replaceLinks(text); +} + function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined { if (!tag.text) { return undefined; @@ -41,7 +59,7 @@ function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined { return makeCodeblock(tag.text); } - return tag.text; + return processInlineTags(tag.text); } function getTagDocumentation(tag: Proto.JSDocTagInfo): string | undefined { @@ -58,7 +76,7 @@ function getTagDocumentation(tag: Proto.JSDocTagInfo): string | undefined { if (!doc) { return label; } - return label + (doc.match(/\r\n|\n/g) ? ' \n' + doc : ` — ${doc}`); + return label + (doc.match(/\r\n|\n/g) ? ' \n' + processInlineTags(doc) : ` — ${processInlineTags(doc)}`); } } @@ -71,8 +89,11 @@ function getTagDocumentation(tag: Proto.JSDocTagInfo): string | undefined { return label + (text.match(/\r\n|\n/g) ? ' \n' + text : ` — ${text}`); } -export function plain(parts: Proto.SymbolDisplayPart[]): string { - return parts.map(part => part.text).join(''); +export function plain(parts: Proto.SymbolDisplayPart[] | string): string { + return processInlineTags( + typeof parts === 'string' + ? parts + : parts.map(part => part.text).join('')); } export function tagsMarkdownPreview(tags: Proto.JSDocTagInfo[]): string { @@ -80,7 +101,7 @@ export function tagsMarkdownPreview(tags: Proto.JSDocTagInfo[]): string { } export function markdownDocumentation( - documentation: Proto.SymbolDisplayPart[], + documentation: Proto.SymbolDisplayPart[] | string, tags: Proto.JSDocTagInfo[] ): vscode.MarkdownString { const out = new vscode.MarkdownString(); @@ -90,7 +111,7 @@ export function markdownDocumentation( export function addMarkdownDocumentation( out: vscode.MarkdownString, - documentation: Proto.SymbolDisplayPart[] | undefined, + documentation: Proto.SymbolDisplayPart[] | string | undefined, tags: Proto.JSDocTagInfo[] | undefined ): vscode.MarkdownString { if (documentation) { From 91514faebcfe44cd1c79eea4c35cc222620e3096 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 14:00:04 -0800 Subject: [PATCH 076/624] Pick up typescript@next for insiders --- extensions/package.json | 2 +- extensions/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/package.json b/extensions/package.json index f2f1225c829..1e42a54acdb 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "3.7.5" + "typescript": "^3.8.0-dev.20200201" }, "scripts": { "postinstall": "node ./postinstall" diff --git a/extensions/yarn.lock b/extensions/yarn.lock index dc1fa7c2de8..7c7f1ef6e52 100644 --- a/extensions/yarn.lock +++ b/extensions/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -typescript@3.7.5: - version "3.7.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" - integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== +typescript@^3.8.0-dev.20200201: + version "3.8.0-dev.20200201" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-dev.20200201.tgz#e03210f5c7915f89cb77bd38793d12a69933a1a6" + integrity sha512-KhaK6J3dIg6p9t24UVhBLcBIav4MpMExlD6nf18cVwp9LELuqhWu0NDmnLdSN0ovsrbcIJNmobQ1xC7vLN21eg== From 7c502bbb6af6ad85bd2bd4d9b4985bf9c182d72a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 14:20:17 -0800 Subject: [PATCH 077/624] Fix compile error related to new TS version --- .../src/protocol.d.ts | 59 ------------------- 1 file changed, 59 deletions(-) diff --git a/extensions/typescript-language-features/src/protocol.d.ts b/extensions/typescript-language-features/src/protocol.d.ts index 62d6c4793ca..6e926eb8d7e 100644 --- a/extensions/typescript-language-features/src/protocol.d.ts +++ b/extensions/typescript-language-features/src/protocol.d.ts @@ -1,61 +1,2 @@ import * as Proto from 'typescript/lib/protocol'; export = Proto; - -declare module "typescript/lib/protocol" { - // TODO: Remove this hardcoded type once we update to TS 3.8+ that brings in the proper types - interface Response { - performanceData?: { - updateGraphDurationMs?: number; - } - } - - const enum CommandTypes { - PrepareCallHierarchy = "prepareCallHierarchy", - ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls", - ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls", - } - - interface CallHierarchyItem { - name: string; - kind: ScriptElementKind; - file: string; - span: TextSpan; - selectionSpan: TextSpan; - } - - interface CallHierarchyIncomingCall { - from: CallHierarchyItem; - fromSpans: TextSpan[]; - } - - interface CallHierarchyOutgoingCall { - to: CallHierarchyItem; - fromSpans: TextSpan[]; - } - - interface PrepareCallHierarchyRequest extends FileLocationRequest { - command: CommandTypes.PrepareCallHierarchy; - } - - interface PrepareCallHierarchyResponse extends Response { - readonly body: CallHierarchyItem | CallHierarchyItem[]; - } - - interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest { - command: CommandTypes.ProvideCallHierarchyIncomingCalls; - kind: ScriptElementKind; - } - - interface ProvideCallHierarchyIncomingCallsResponse extends Response { - readonly body: CallHierarchyIncomingCall[]; - } - - interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest { - command: CommandTypes.ProvideCallHierarchyOutgoingCalls; - kind: ScriptElementKind; - } - - interface ProvideCallHierarchyOutgoingCallsResponse extends Response { - readonly body: CallHierarchyOutgoingCall[]; - } -} From 3f5fda18007a100b990a8fb67ce0b898ce7f2263 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 14:31:21 -0800 Subject: [PATCH 078/624] Redefine performanceData --- .../typescript-language-features/src/protocol.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/typescript-language-features/src/protocol.d.ts b/extensions/typescript-language-features/src/protocol.d.ts index 6e926eb8d7e..5652967abfc 100644 --- a/extensions/typescript-language-features/src/protocol.d.ts +++ b/extensions/typescript-language-features/src/protocol.d.ts @@ -1,2 +1,11 @@ import * as Proto from 'typescript/lib/protocol'; export = Proto; + +declare module "typescript/lib/protocol" { + // TODO: Remove this hardcoded type once we update to TS 3.8+ that brings in the proper types + interface Response { + performanceData?: { + updateGraphDurationMs?: number; + } + } +} From 18559fdd60fee32efc55ecf88d0992c80a44c344 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 3 Feb 2020 14:37:54 -0800 Subject: [PATCH 079/624] add unit tests for view descriptor service refs #89686 --- .../test/browser/parts/views/views.test.ts | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/src/vs/workbench/test/browser/parts/views/views.test.ts b/src/vs/workbench/test/browser/parts/views/views.test.ts index 926536d805f..aa3aff7d4e7 100644 --- a/src/vs/workbench/test/browser/parts/views/views.test.ts +++ b/src/vs/workbench/test/browser/parts/views/views.test.ts @@ -16,6 +16,7 @@ import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyServ import sinon = require('sinon'); import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ViewDescriptorService } from 'vs/workbench/services/views/browser/viewDescriptorService'; +import { assertIsDefined } from 'vs/base/common/types'; const container = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'test', name: 'test', ctorDescriptor: new SyncDescriptor({}) }, ViewContainerLocation.Sidebar); const ViewsRegistry = Registry.as(ViewContainerExtensions.ViewsRegistry); @@ -374,3 +375,171 @@ suite('ContributableViewsModel', () => { }); }); + +const sidebarContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testSidebar', name: 'test', ctorDescriptor: new SyncDescriptor({}) }, ViewContainerLocation.Sidebar); +const panelContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testPanel', name: 'test', ctorDescriptor: new SyncDescriptor({}) }, ViewContainerLocation.Panel); + +suite('ViewDescriptorService', () => { + + let viewDescriptorService: IViewDescriptorService; + + setup(() => { + const instantiationService: TestInstantiationService = workbenchInstantiationService(); + viewDescriptorService = instantiationService.createInstance(ViewDescriptorService); + }); + + teardown(() => { + ViewsRegistry.deregisterViews(ViewsRegistry.getViews(sidebarContainer), sidebarContainer); + ViewsRegistry.deregisterViews(ViewsRegistry.getViews(panelContainer), panelContainer); + }); + + test('Empty Containers', function () { + const sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + const panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + assert.equal(sidebarViews.allViewDescriptors.length, 0, 'The sidebar container should have no views yet.'); + assert.equal(panelViews.allViewDescriptors.length, 0, 'The panel container should have no views yet.'); + }); + + test('Register/Deregister', () => { + const viewDescriptors: IViewDescriptor[] = [ + { + id: 'view1', + ctorDescriptor: null!, + name: 'Test View 1', + canMoveView: true + }, + { + id: 'view2', + ctorDescriptor: null!, + name: 'Test View 2', + canMoveView: true + }, + { + id: 'view3', + ctorDescriptor: null!, + name: 'Test View 3', + canMoveView: true + } + ]; + + + ViewsRegistry.registerViews(viewDescriptors.slice(0, 2), sidebarContainer); + ViewsRegistry.registerViews(viewDescriptors.slice(2), panelContainer); + + + let sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + let panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + + assert.equal(sidebarViews.activeViewDescriptors.length, 2, 'Sidebar should have 2 views'); + assert.equal(panelViews.activeViewDescriptors.length, 1, 'Panel should have 1 view'); + + ViewsRegistry.deregisterViews(viewDescriptors.slice(0, 2), sidebarContainer); + ViewsRegistry.deregisterViews(viewDescriptors.slice(2), panelContainer); + + + sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + + assert.equal(sidebarViews.activeViewDescriptors.length, 0, 'Sidebar should have no views'); + assert.equal(panelViews.activeViewDescriptors.length, 0, 'Panel should have no views'); + }); + + test('move views to existing containers', async function () { + const viewDescriptors: IViewDescriptor[] = [ + { + id: 'view1', + ctorDescriptor: null!, + name: 'Test View 1', + canMoveView: true + }, + { + id: 'view2', + ctorDescriptor: null!, + name: 'Test View 2', + canMoveView: true + }, + { + id: 'view3', + ctorDescriptor: null!, + name: 'Test View 3', + canMoveView: true + } + ]; + + ViewsRegistry.registerViews(viewDescriptors.slice(0, 2), sidebarContainer); + ViewsRegistry.registerViews(viewDescriptors.slice(2), panelContainer); + + viewDescriptorService.moveViewsToContainer(viewDescriptors.slice(2), sidebarContainer); + viewDescriptorService.moveViewsToContainer(viewDescriptors.slice(0, 2), panelContainer); + + let sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + let panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + + assert.equal(sidebarViews.activeViewDescriptors.length, 1, 'Sidebar should have 2 views'); + assert.equal(panelViews.activeViewDescriptors.length, 2, 'Panel should have 1 view'); + + assert.notEqual(sidebarViews.activeViewDescriptors.indexOf(viewDescriptors[2]), -1, `Sidebar should have ${viewDescriptors[2].name}`); + assert.notEqual(panelViews.activeViewDescriptors.indexOf(viewDescriptors[0]), -1, `Panel should have ${viewDescriptors[0].name}`); + assert.notEqual(panelViews.activeViewDescriptors.indexOf(viewDescriptors[1]), -1, `Panel should have ${viewDescriptors[1].name}`); + }); + + test('move views to generated containers', async function () { + const viewDescriptors: IViewDescriptor[] = [ + { + id: 'view1', + ctorDescriptor: null!, + name: 'Test View 1', + canMoveView: true + }, + { + id: 'view2', + ctorDescriptor: null!, + name: 'Test View 2', + canMoveView: true + }, + { + id: 'view3', + ctorDescriptor: null!, + name: 'Test View 3', + canMoveView: true + } + ]; + + ViewsRegistry.registerViews(viewDescriptors.slice(0, 2), sidebarContainer); + ViewsRegistry.registerViews(viewDescriptors.slice(2), panelContainer); + + viewDescriptorService.moveViewToLocation(viewDescriptors[0], ViewContainerLocation.Panel); + viewDescriptorService.moveViewToLocation(viewDescriptors[2], ViewContainerLocation.Sidebar); + + let sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + let panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + + assert.equal(sidebarViews.activeViewDescriptors.length, 1, 'Sidebar container should have 1 view'); + assert.equal(panelViews.activeViewDescriptors.length, 0, 'Panel container should have no views'); + + const generatedPanel = assertIsDefined(viewDescriptorService.getViewContainer(viewDescriptors[0].id)); + const generatedSidebar = assertIsDefined(viewDescriptorService.getViewContainer(viewDescriptors[2].id)); + + assert.equal(viewDescriptorService.getViewContainerLocation(generatedPanel), ViewContainerLocation.Panel, 'Generated Panel should be in located in the panel'); + assert.equal(viewDescriptorService.getViewContainerLocation(generatedSidebar), ViewContainerLocation.Sidebar, 'Generated Sidebar should be in located in the sidebar'); + + assert.equal(viewDescriptorService.getViewContainerLocation(generatedPanel), viewDescriptorService.getViewLocation(viewDescriptors[0].id), 'Panel view location and container location should match'); + assert.equal(viewDescriptorService.getViewContainerLocation(generatedSidebar), viewDescriptorService.getViewLocation(viewDescriptors[2].id), 'Sidebar view location and container location should match'); + + assert.equal(viewDescriptorService.getDefaultContainer(viewDescriptors[2].id), panelContainer, `${viewDescriptors[2].name} has wrong default container`); + assert.equal(viewDescriptorService.getDefaultContainer(viewDescriptors[0].id), sidebarContainer, `${viewDescriptors[0].name} has wrong default container`); + + viewDescriptorService.moveViewToLocation(viewDescriptors[0], ViewContainerLocation.Sidebar); + viewDescriptorService.moveViewToLocation(viewDescriptors[2], ViewContainerLocation.Panel); + + sidebarViews = viewDescriptorService.getViewDescriptors(sidebarContainer); + panelViews = viewDescriptorService.getViewDescriptors(panelContainer); + + assert.equal(sidebarViews.activeViewDescriptors.length, 2, 'Sidebar should have 2 views'); + assert.equal(panelViews.activeViewDescriptors.length, 1, 'Panel should have 1 view'); + + assert.equal(viewDescriptorService.getViewLocation(viewDescriptors[0].id), ViewContainerLocation.Sidebar, 'View should be located in the sidebar'); + assert.equal(viewDescriptorService.getViewLocation(viewDescriptors[2].id), ViewContainerLocation.Panel, 'View should be located in the panel'); + }); + +}); From 05567322f7dee7b14b0c502e6bfcf460163f64c5 Mon Sep 17 00:00:00 2001 From: Evan Krause Date: Mon, 3 Feb 2020 15:15:20 -0800 Subject: [PATCH 080/624] Fix undo/redo broken in non-editor webviews (#89961) --- src/vs/workbench/contrib/customEditor/browser/customEditors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts index ba8cff7a7f6..07351da72e8 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts @@ -281,7 +281,7 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ ]; this._hasCustomEditor.set(possibleEditors.length > 0); this._focusedCustomEditorIsEditable.set(activeControl?.input instanceof CustomFileEditorInput); - this._webviewHasOwnEditFunctions.set(true); + this._webviewHasOwnEditFunctions.set(possibleEditors.length > 0); } private handleMovedFileInOpenedFileEditors(oldResource: URI, newResource: URI): void { From c52bfa890698294a5ab23eac6c648a531c32d461 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Mon, 3 Feb 2020 09:59:59 -0800 Subject: [PATCH 081/624] Rename Session to AuthenticationSession --- src/vs/editor/common/modes.ts | 2 +- src/vs/vscode.proposed.d.ts | 6 +++--- .../workbench/api/browser/mainThreadAuthentication.ts | 4 ++-- src/vs/workbench/api/common/extHost.protocol.ts | 4 ++-- src/vs/workbench/api/common/extHostAuthentication.ts | 8 ++++---- .../contrib/userDataSync/browser/userDataSync.ts | 8 ++++---- .../authentication/browser/authenticationService.ts | 10 +++++----- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 8438a570562..5211de85bbc 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1338,7 +1338,7 @@ export interface RenameProvider { /** * @internal */ -export interface Session { +export interface AuthenticationSession { id: string; accessToken: string; accountName: string; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index e0cf0d07220..ac6df8714ea 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -18,7 +18,7 @@ declare module 'vscode' { // #region auth provider: https://github.com/microsoft/vscode/issues/88309 - export interface Session { + export interface AuthenticationSession { id: string; accessToken: string; accountName: string; @@ -58,12 +58,12 @@ declare module 'vscode' { /** * Returns an array of current sessions. */ - getSessions(): Promise>; + getSessions(): Promise>; /** * Prompts a user to login. */ - login(scopes: string[]): Promise; + login(scopes: string[]): Promise; logout(sessionId: string): Promise; } diff --git a/src/vs/workbench/api/browser/mainThreadAuthentication.ts b/src/vs/workbench/api/browser/mainThreadAuthentication.ts index d2d98d8987b..8dbf1647508 100644 --- a/src/vs/workbench/api/browser/mainThreadAuthentication.ts +++ b/src/vs/workbench/api/browser/mainThreadAuthentication.ts @@ -20,11 +20,11 @@ export class MainThreadAuthenticationProvider { public readonly displayName: string ) { } - getSessions(): Promise> { + getSessions(): Promise> { return this._proxy.$getSessions(this.id); } - login(scopes: string[]): Promise { + login(scopes: string[]): Promise { return this._proxy.$login(this.id, scopes); } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 55130ff9189..d4dd3fb7288 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -918,8 +918,8 @@ export interface ExtHostLabelServiceShape { } export interface ExtHostAuthenticationShape { - $getSessions(id: string): Promise>; - $login(id: string, scopes: string[]): Promise; + $getSessions(id: string): Promise>; + $login(id: string, scopes: string[]): Promise; $logout(id: string, sessionId: string): Promise; } diff --git a/src/vs/workbench/api/common/extHostAuthentication.ts b/src/vs/workbench/api/common/extHostAuthentication.ts index 326610264f7..324a3bfbb7b 100644 --- a/src/vs/workbench/api/common/extHostAuthentication.ts +++ b/src/vs/workbench/api/common/extHostAuthentication.ts @@ -28,7 +28,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi return this._provider.displayName; } - async getSessions(): Promise> { + async getSessions(): Promise> { const isAllowed = await this._proxy.$getSessionsPrompt(this._provider.id, this.displayName, ExtensionIdentifier.toKey(this._requestingExtension.identifier), this._requestingExtension.displayName || this._requestingExtension.name); if (!isAllowed) { throw new Error('User did not consent to session access.'); @@ -37,7 +37,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi return this._provider.getSessions(); } - async login(scopes: string[]): Promise { + async login(scopes: string[]): Promise { const isAllowed = await this._proxy.$loginPrompt(this._provider.id, this.displayName, ExtensionIdentifier.toKey(this._requestingExtension.identifier), this._requestingExtension.displayName || this._requestingExtension.name); if (!isAllowed) { throw new Error('User did not consent to login.'); @@ -90,7 +90,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { }); } - $login(providerId: string, scopes: string[]): Promise { + $login(providerId: string, scopes: string[]): Promise { const authProvider = this._authenticationProviders.get(providerId); if (authProvider) { return Promise.resolve(authProvider.login(scopes)); @@ -108,7 +108,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { throw new Error(`Unable to find authentication provider with handle: ${0}`); } - $getSessions(providerId: string): Promise> { + $getSessions(providerId: string): Promise> { const authProvider = this._authenticationProviders.get(providerId); if (authProvider) { return Promise.resolve(authProvider.getSessions()); diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 72115c36e8f..fbdfed7cd26 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -29,7 +29,7 @@ import { timeout } from 'vs/base/common/async'; import { IOutputService } from 'vs/workbench/contrib/output/common/output'; import * as Constants from 'vs/workbench/contrib/logs/common/logConstants'; import { IAuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService'; -import { Session } from 'vs/editor/common/modes'; +import { AuthenticationSession } from 'vs/editor/common/modes'; import { isPromiseCanceledError, canceled } from 'vs/base/common/errors'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; @@ -82,7 +82,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo private readonly badgeDisposable = this._register(new MutableDisposable()); private readonly conflictsWarningDisposable = this._register(new MutableDisposable()); private readonly signInNotificationDisposable = this._register(new MutableDisposable()); - private _activeAccount: Session | undefined; + private _activeAccount: AuthenticationSession | undefined; constructor( @IUserDataSyncService private readonly userDataSyncService: IUserDataSyncService, @@ -159,11 +159,11 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo } } - get activeAccount(): Session | undefined { + get activeAccount(): AuthenticationSession | undefined { return this._activeAccount; } - set activeAccount(account: Session | undefined) { + set activeAccount(account: AuthenticationSession | undefined) { this._activeAccount = account; if (account) { diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts index 57b75baa80b..ef3552ed42f 100644 --- a/src/vs/workbench/services/authentication/browser/authenticationService.ts +++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { Session } from 'vs/editor/common/modes'; +import { AuthenticationSession } from 'vs/editor/common/modes'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { MainThreadAuthenticationProvider } from 'vs/workbench/api/browser/mainThreadAuthentication'; @@ -23,9 +23,9 @@ export interface IAuthenticationService { readonly onDidUnregisterAuthenticationProvider: Event; readonly onDidChangeSessions: Event; - getSessions(providerId: string): Promise | undefined>; + getSessions(providerId: string): Promise | undefined>; getDisplayName(providerId: string): string; - login(providerId: string, scopes: string[]): Promise; + login(providerId: string, scopes: string[]): Promise; logout(providerId: string, accountId: string): Promise; } @@ -70,7 +70,7 @@ export class AuthenticationService extends Disposable implements IAuthentication } } - async getSessions(id: string): Promise | undefined> { + async getSessions(id: string): Promise | undefined> { const authProvider = this._authenticationProviders.get(id); if (authProvider) { return await authProvider.getSessions(); @@ -79,7 +79,7 @@ export class AuthenticationService extends Disposable implements IAuthentication return undefined; } - async login(id: string, scopes: string[]): Promise { + async login(id: string, scopes: string[]): Promise { const authProvider = this._authenticationProviders.get(id); if (authProvider) { return authProvider.login(scopes); From 31919f338a2c1279bd69ea87b355880e810ba07f Mon Sep 17 00:00:00 2001 From: chrisdias Date: Mon, 3 Feb 2020 21:59:32 -0800 Subject: [PATCH 082/624] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 41725c5340f..30ccf466b08 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.43.0", - "distro": "efecc155935e7eb2f21b904b59991b07b0d58e58", + "distro": "466c88f52cc67d1bc57378639bc2f32e93dfa572", "author": { "name": "Microsoft Corporation" }, From 94015d3aa6ffefec5d4500dcc589be6ba4889eda Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:19:26 +0100 Subject: [PATCH 083/624] Properly apply aria-label to editors (fix #89621) --- .../browser/parts/editor/textEditor.ts | 28 ++++++++----------- .../parts/editor/textResourceEditor.ts | 5 ++-- .../contrib/output/browser/logViewer.ts | 5 ++++ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 93a1cc718cc..99dbe8e9106 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -23,7 +23,6 @@ import { isCodeEditor, getCodeEditor } from 'vs/editor/browser/editorBrowser'; import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; export interface IEditorConfiguration { editor: object; @@ -43,7 +42,6 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { private hasPendingConfigurationChange: boolean | undefined; private lastAppliedEditorOptions?: IEditorOptions; private editorMemento: IEditorMemento; - private inputDisposable: IDisposable | undefined; constructor( id: string, @@ -65,10 +63,14 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { return this.handleConfigurationChangeEvent(value); })); + + // ARIA: if a group is added or removed, update the editor's ARIA + // label so that it appears in the label for when there are > 1 groups this._register(Event.any(this.editorGroupService.onDidAddGroup, this.editorGroupService.onDidRemoveGroup)(() => { - if (this.editorContainer) { - this.editorContainer.setAttribute('aria-label', this.computeAriaLabel()); - } + const ariaLabel = this.computeAriaLabel(); + + this.editorContainer?.setAttribute('aria-label', ariaLabel); + this.editorControl?.updateOptions({ ariaLabel }); })); } @@ -102,8 +104,10 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { private computeAriaLabel(): string { let ariaLabel = this.getAriaLabel(); - // Apply group information to help identify in which group we are - if (ariaLabel && this.group && this.editorGroupService.groups.length > 1) { + // Apply group information to help identify in + // which group we are (only if more than one group + // is actually opened) + if (ariaLabel && this.group && this.editorGroupService.count > 1) { ariaLabel = localize('editorLabelWithGroup', "{0}, {1}", ariaLabel, this.group.ariaLabel); } @@ -158,10 +162,6 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { // Update aria label on editor const editorContainer = assertIsDefined(this.editorContainer); editorContainer.setAttribute('aria-label', this.computeAriaLabel()); - - // Keep aria label up to date whenever editor label changes - dispose(this.inputDisposable); - this.inputDisposable = input.onDidChangeLabel(() => editorContainer.setAttribute('aria-label', this.computeAriaLabel())); } setOptions(options: EditorOptions | undefined): void { @@ -310,12 +310,6 @@ export abstract class BaseTextEditor extends BaseEditor implements ITextEditor { protected abstract getAriaLabel(): string; - clearInput(): void { - super.clearInput(); - - this.inputDisposable = dispose(this.inputDisposable); - } - dispose(): void { this.lastAppliedEditorOptions = undefined; diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index b02453b85df..cf6a9146b7d 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -25,6 +25,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; import { EditorOption, IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { basenameOrAuthority } from 'vs/base/common/resources'; /** * An editor implementation that is capable of showing the contents of resource inputs. Uses @@ -109,11 +110,11 @@ export class AbstractTextResourceEditor extends BaseTextEditor { protected getAriaLabel(): string { let ariaLabel: string; - const inputName = this.input?.getName(); + const inputName = this.input instanceof UntitledTextEditorInput ? basenameOrAuthority(this.input.getResource()) : this.input?.getName(); if (this.input?.isReadonly()) { ariaLabel = inputName ? nls.localize('readonlyEditorWithInputAriaLabel', "{0} readonly editor", inputName) : nls.localize('readonlyEditorAriaLabel', "Readonly editor"); } else { - ariaLabel = inputName ? nls.localize('untitledFileEditorWithInputAriaLabel', "{0} editor", inputName) : nls.localize('untitledFileEditorAriaLabel', "Editor"); + ariaLabel = inputName ? nls.localize('writeableEditorWithInputAriaLabel', "{0} editor", inputName) : nls.localize('writeableEditorAriaLabel', "Editor"); } return ariaLabel; diff --git a/src/vs/workbench/contrib/output/browser/logViewer.ts b/src/vs/workbench/contrib/output/browser/logViewer.ts index fab74175772..d3081d1ca49 100644 --- a/src/vs/workbench/contrib/output/browser/logViewer.ts +++ b/src/vs/workbench/contrib/output/browser/logViewer.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { localize } from 'vs/nls'; import { dirname, basename } from 'vs/base/common/path'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -67,4 +68,8 @@ export class LogViewer extends AbstractTextResourceEditor { options.renderValidationDecorations = 'editable'; return options; } + + protected getAriaLabel(): string { + return localize('logViewerAriaLabel', "Log viewer"); + } } From e6bb3ae006232a16e121174770de8dab14169cd6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:22:27 +0100 Subject: [PATCH 084/624] debt - drop labels#setEditor() --- src/vs/workbench/browser/labels.ts | 67 +++++++------------ .../files/browser/views/openEditorsView.ts | 18 +++-- .../workbench/contrib/files/common/files.ts | 8 --- .../markers/browser/markersTreeViewer.ts | 6 +- 4 files changed, 40 insertions(+), 59 deletions(-) diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 356faee9982..b7be1aa763c 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -8,7 +8,6 @@ import * as resources from 'vs/base/common/resources'; import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { toResource, IEditorInput, SideBySideEditor, Verbosity } from 'vs/workbench/common/editor'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -35,13 +34,11 @@ export interface IResourceLabelProps { export interface IResourceLabelOptions extends IIconLabelValueOptions { fileKind?: FileKind; fileDecorations?: { colors: boolean, badges: boolean }; - descriptionVerbosity?: Verbosity; } export interface IFileLabelOptions extends IResourceLabelOptions { hideLabel?: boolean; hidePath?: boolean; - readonly parentCount?: number; } export interface IResourceLabel extends IDisposable { @@ -65,11 +62,6 @@ export interface IResourceLabel extends IDisposable { */ setFile(resource: URI, options?: IFileLabelOptions): void; - /** - * Convenient method to apply a label by passing an editor along. - */ - setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void; - /** * Resets the label to be empty. */ @@ -174,7 +166,6 @@ export class ResourceLabels extends Disposable { onDidRender: widget.onDidRender, setLabel: (label: string, description?: string, options?: IIconLabelValueOptions) => widget.setLabel(label, description, options), setResource: (label: IResourceLabelProps, options?: IResourceLabelOptions) => widget.setResource(label, options), - setEditor: (editor: IEditorInput, options?: IResourceLabelOptions) => widget.setEditor(editor, options), setFile: (resource: URI, options?: IFileLabelOptions) => widget.setFile(resource, options), clear: () => widget.clear(), dispose: () => this.disposeWidget(widget) @@ -337,6 +328,30 @@ class ResourceLabelWidget extends IconLabel { } } + setFile(resource: URI, options?: IFileLabelOptions): void { + const hideLabel = options && options.hideLabel; + let name: string | undefined; + if (!hideLabel) { + if (options && options.fileKind === FileKind.ROOT_FOLDER) { + const workspaceFolder = this.contextService.getWorkspaceFolder(resource); + if (workspaceFolder) { + name = workspaceFolder.name; + } + } + + if (!name) { + name = resources.basenameOrAuthority(resource); + } + } + + let description: string | undefined; + if (!options?.hidePath) { + description = this.labelService.getUriLabel(resources.dirname(resource), { relative: true }); + } + + this.setResource({ resource, name, description }, options); + } + setResource(label: IResourceLabelProps, options?: IResourceLabelOptions): void { if (label.resource?.scheme === Schemas.untitled) { // Untitled labels are very dynamic because they may change @@ -353,7 +368,7 @@ class ResourceLabelWidget extends IconLabel { } if (typeof label.description === 'string') { - const untitledDescription = untitledEditor.getDescription(options?.descriptionVerbosity); + const untitledDescription = untitledEditor.getDescription(); if (label.name !== untitledDescription) { label.description = untitledDescription; } @@ -402,38 +417,6 @@ class ResourceLabelWidget extends IconLabel { return !!newResource && this.computedPathLabel !== this.labelService.getUriLabel(newResource); } - setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void { - this.setResource({ - resource: toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }), - name: editor.getName(), - description: editor.getDescription(options ? options.descriptionVerbosity : undefined) - }, options); - } - - setFile(resource: URI, options?: IFileLabelOptions): void { - const hideLabel = options && options.hideLabel; - let name: string | undefined; - if (!hideLabel) { - if (options && options.fileKind === FileKind.ROOT_FOLDER) { - const workspaceFolder = this.contextService.getWorkspaceFolder(resource); - if (workspaceFolder) { - name = workspaceFolder.name; - } - } - - if (!name) { - name = resources.basenameOrAuthority(resource); - } - } - - let description: string | undefined; - if (!options?.hidePath) { - description = this.labelService.getUriLabel(resources.dirname(resource), { relative: true }); - } - - this.setResource({ resource, name, description }, options); - } - clear(): void { this.label = undefined; this.options = undefined; diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 23e04225b58..5b9d427175a 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -12,7 +12,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IEditorGroupsService, IEditorGroup, GroupChangeKind, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IEditorInput, Verbosity } from 'vs/workbench/common/editor'; +import { IEditorInput, Verbosity, toResource, SideBySideEditor } from 'vs/workbench/common/editor'; import { SaveAllAction, SaveAllInGroupAction, CloseGroupAction } from 'vs/workbench/contrib/files/browser/fileActions'; import { OpenEditorsFocusedContext, ExplorerFocusedContext, IFilesConfiguration, OpenEditor } from 'vs/workbench/contrib/files/common/files'; import { CloseAllEditorsAction, CloseEditorAction } from 'vs/workbench/browser/parts/editor/editorActions'; @@ -586,15 +586,19 @@ class OpenEditorRenderer implements IListRenderer().explorer.decorations, - descriptionVerbosity: Verbosity.MEDIUM, - title: editor.editor.getTitle(Verbosity.LONG) + title: editor.getTitle(Verbosity.LONG) }); } diff --git a/src/vs/workbench/contrib/files/common/files.ts b/src/vs/workbench/contrib/files/common/files.ts index 066cbd51ec5..6f74715b376 100644 --- a/src/vs/workbench/contrib/files/common/files.ts +++ b/src/vs/workbench/contrib/files/common/files.ts @@ -242,14 +242,6 @@ export class OpenEditor implements IEditorIdentifier { return this._group.previewEditor === this.editor; } - isDirty(): boolean { - return this.editor.isDirty(); - } - - isSaving(): boolean { - return this.editor.isSaving(); - } - getResource(): URI | undefined { return toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER }); } diff --git a/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts b/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts index f95d2c7873c..e6144e21170 100644 --- a/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts @@ -47,6 +47,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { OS, OperatingSystem } from 'vs/base/common/platform'; +import { IFileService } from 'vs/platform/files/common/files'; export type TreeElement = ResourceMarkers | Marker | RelatedInformation; @@ -152,7 +153,8 @@ export class ResourceMarkersRenderer implements ITreeRenderer>, @IThemeService private readonly themeService: IThemeService, - @ILabelService private readonly labelService: ILabelService + @ILabelService private readonly labelService: ILabelService, + @IFileService private readonly fileService: IFileService ) { onDidChangeRenderNodeCount(this.onDidChangeRenderNodeCount, this, this.disposables); } @@ -176,7 +178,7 @@ export class ResourceMarkersRenderer implements ITreeRenderer Date: Tue, 4 Feb 2020 08:34:55 +0100 Subject: [PATCH 085/624] working copy - support initial working copies --- src/vs/workbench/browser/contextkeys.ts | 3 ++- .../browser/parts/editor/editorAutoSave.ts | 22 ++++++++++++++----- .../contrib/backup/common/backupTracker.ts | 22 ++++++++++++++----- .../contrib/files/browser/fileActions.ts | 12 +++++----- .../files/browser/views/openEditorsView.ts | 2 +- .../files/common/dirtyFilesIndicator.ts | 15 +++++-------- .../search/browser/searchEditorInput.ts | 7 +----- src/vs/workbench/electron-browser/window.ts | 22 ++++++++++++------- 8 files changed, 62 insertions(+), 43 deletions(-) diff --git a/src/vs/workbench/browser/contextkeys.ts b/src/vs/workbench/browser/contextkeys.ts index 6f1eebf4841..2f138cb0c65 100644 --- a/src/vs/workbench/browser/contextkeys.ts +++ b/src/vs/workbench/browser/contextkeys.ts @@ -118,6 +118,7 @@ export class WorkbenchContextKeysHandler extends Disposable { // Working Copies this.dirtyWorkingCopiesContext = DirtyWorkingCopiesContext.bindTo(this.contextKeyService); + this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty); // Inputs this.inputFocusedContext = InputFocusedContext.bindTo(this.contextKeyService); @@ -187,7 +188,7 @@ export class WorkbenchContextKeysHandler extends Disposable { this._register(this.layoutService.onPartVisibilityChange(() => this.editorAreaVisibleContext.set(this.layoutService.isVisible(Parts.EDITOR_PART)))); - this._register(this.workingCopyService.onDidChangeDirty(w => this.dirtyWorkingCopiesContext.set(w.isDirty() || this.workingCopyService.hasDirty))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty))); } private updateEditorContextKeys(): void { diff --git a/src/vs/workbench/browser/parts/editor/editorAutoSave.ts b/src/vs/workbench/browser/parts/editor/editorAutoSave.ts index 4bf84682dba..ddd07b51647 100644 --- a/src/vs/workbench/browser/parts/editor/editorAutoSave.ts +++ b/src/vs/workbench/browser/parts/editor/editorAutoSave.ts @@ -38,6 +38,9 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution // Figure out initial auto save config this.onAutoSaveConfigurationChange(filesConfigurationService.getAutoSaveConfiguration(), false); + // Fill in initial dirty working copies + this.workingCopyService.dirtyWorkingCopies.forEach(workingCopy => this.onDidRegister(workingCopy)); + this.registerListeners(); } @@ -47,10 +50,10 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution this._register(this.filesConfigurationService.onAutoSaveConfigurationChange(config => this.onAutoSaveConfigurationChange(config, true))); // Working Copy events - this._register(this.workingCopyService.onDidRegister(c => this.onDidRegister(c))); - this._register(this.workingCopyService.onDidUnregister(c => this.onDidUnregister(c))); - this._register(this.workingCopyService.onDidChangeDirty(c => this.onDidChangeDirty(c))); - this._register(this.workingCopyService.onDidChangeContent(c => this.onDidChangeContent(c))); + this._register(this.workingCopyService.onDidRegister(workingCopy => this.onDidRegister(workingCopy))); + this._register(this.workingCopyService.onDidUnregister(workingCopy => this.onDidUnregister(workingCopy))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.onDidChangeDirty(workingCopy))); + this._register(this.workingCopyService.onDidChangeContent(workingCopy => this.onDidChangeContent(workingCopy))); } private onWindowFocusChange(focused: boolean): void { @@ -141,7 +144,9 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution } private onDidRegister(workingCopy: IWorkingCopy): void { - this.scheduleAutoSave(workingCopy); + if (workingCopy.isDirty()) { + this.scheduleAutoSave(workingCopy); + } } private onDidUnregister(workingCopy: IWorkingCopy): void { @@ -149,13 +154,18 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution } private onDidChangeDirty(workingCopy: IWorkingCopy): void { - if (!workingCopy.isDirty()) { + if (workingCopy.isDirty()) { + this.scheduleAutoSave(workingCopy); + } else { this.discardAutoSave(workingCopy); } } private onDidChangeContent(workingCopy: IWorkingCopy): void { if (workingCopy.isDirty()) { + // this listener will make sure that the auto save is + // pushed out for as long as the user is still changing + // the content of the working copy. this.scheduleAutoSave(workingCopy); } } diff --git a/src/vs/workbench/contrib/backup/common/backupTracker.ts b/src/vs/workbench/contrib/backup/common/backupTracker.ts index 9de7c678112..074a0c545aa 100644 --- a/src/vs/workbench/contrib/backup/common/backupTracker.ts +++ b/src/vs/workbench/contrib/backup/common/backupTracker.ts @@ -46,16 +46,19 @@ export abstract class BackupTracker extends Disposable { // Figure out initial auto save config this.onAutoSaveConfigurationChange(filesConfigurationService.getAutoSaveConfiguration()); + // Fill in initial dirty working copies + this.workingCopyService.dirtyWorkingCopies.forEach(workingCopy => this.onDidRegister(workingCopy)); + this.registerListeners(); } private registerListeners() { // Working Copy events - this._register(this.workingCopyService.onDidRegister(c => this.onDidRegister(c))); - this._register(this.workingCopyService.onDidUnregister(c => this.onDidUnregister(c))); - this._register(this.workingCopyService.onDidChangeDirty(c => this.onDidChangeDirty(c))); - this._register(this.workingCopyService.onDidChangeContent(c => this.onDidChangeContent(c))); + this._register(this.workingCopyService.onDidRegister(workingCopy => this.onDidRegister(workingCopy))); + this._register(this.workingCopyService.onDidUnregister(workingCopy => this.onDidUnregister(workingCopy))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.onDidChangeDirty(workingCopy))); + this._register(this.workingCopyService.onDidChangeContent(workingCopy => this.onDidChangeContent(workingCopy))); // Listen to auto save config changes this._register(this.filesConfigurationService.onAutoSaveConfigurationChange(c => this.onAutoSaveConfigurationChange(c))); @@ -65,7 +68,9 @@ export abstract class BackupTracker extends Disposable { } private onDidRegister(workingCopy: IWorkingCopy): void { - this.scheduleBackup(workingCopy); + if (workingCopy.isDirty()) { + this.scheduleBackup(workingCopy); + } } private onDidUnregister(workingCopy: IWorkingCopy): void { @@ -78,7 +83,9 @@ export abstract class BackupTracker extends Disposable { } private onDidChangeDirty(workingCopy: IWorkingCopy): void { - if (!workingCopy.isDirty()) { + if (workingCopy.isDirty()) { + this.scheduleBackup(workingCopy); + } else { this.discardBackup(workingCopy); } } @@ -91,6 +98,9 @@ export abstract class BackupTracker extends Disposable { // Schedule backup if dirty if (workingCopy.isDirty()) { + // this listener will make sure that the backup is + // pushed out for as long as the user is still changing + // the content of the working copy. this.scheduleBackup(workingCopy); } } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 75143ade13d..6cdee12a156 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -522,7 +522,7 @@ export class ToggleAutoSaveAction extends Action { } export abstract class BaseSaveAllAction extends Action { - private lastIsDirty: boolean; + private lastDirtyState: boolean; constructor( id: string, @@ -533,8 +533,8 @@ export abstract class BaseSaveAllAction extends Action { ) { super(id, label); - this.lastIsDirty = this.workingCopyService.hasDirty; - this.enabled = this.lastIsDirty; + this.lastDirtyState = this.workingCopyService.hasDirty; + this.enabled = this.lastDirtyState; this.registerListeners(); } @@ -544,14 +544,14 @@ export abstract class BaseSaveAllAction extends Action { private registerListeners(): void { // update enablement based on working copy changes - this._register(this.workingCopyService.onDidChangeDirty(w => this.updateEnablement(w))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.updateEnablement(workingCopy))); } private updateEnablement(workingCopy: IWorkingCopy): void { const hasDirty = workingCopy.isDirty() || this.workingCopyService.hasDirty; - if (this.lastIsDirty !== hasDirty) { + if (this.lastDirtyState !== hasDirty) { this.enabled = hasDirty; - this.lastIsDirty = this.enabled; + this.lastDirtyState = this.enabled; } } diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 5b9d427175a..7f4bd5af4e9 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -104,7 +104,7 @@ export class OpenEditorsView extends ViewPane { this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(e))); // Handle dirty counter - this._register(this.workingCopyService.onDidChangeDirty(c => this.updateDirtyIndicator(c))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.updateDirtyIndicator(workingCopy))); } private registerUpdateEvents(): void { diff --git a/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.ts b/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.ts index 369174b9f64..fd1995933f4 100644 --- a/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.ts +++ b/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.ts @@ -15,11 +15,7 @@ import { IFilesConfigurationService, AutoSaveMode } from 'vs/workbench/services/ export class DirtyFilesIndicator extends Disposable implements IWorkbenchContribution { private readonly badgeHandle = this._register(new MutableDisposable()); - private lastKnownDirtyCount: number | undefined; - - private get hasDirtyCount(): boolean { - return typeof this.lastKnownDirtyCount === 'number' && this.lastKnownDirtyCount > 0; - } + private lastKnownDirtyCount = 0; constructor( @ILifecycleService private readonly lifecycleService: ILifecycleService, @@ -29,13 +25,15 @@ export class DirtyFilesIndicator extends Disposable implements IWorkbenchContrib ) { super(); + this.updateActivityBadge(); + this.registerListeners(); } private registerListeners(): void { // Working copy dirty indicator - this._register(this.workingCopyService.onDidChangeDirty(c => this.onWorkingCopyDidChangeDirty(c))); + this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.onWorkingCopyDidChangeDirty(workingCopy))); // Lifecycle this.lifecycleService.onShutdown(this.dispose, this); @@ -47,14 +45,13 @@ export class DirtyFilesIndicator extends Disposable implements IWorkbenchContrib return; // do not indicate dirty of working copies that are auto saved after short delay } - if (gotDirty || this.hasDirtyCount) { + if (gotDirty || this.lastKnownDirtyCount > 0) { this.updateActivityBadge(); } } private updateActivityBadge(): void { - const dirtyCount = this.workingCopyService.dirtyCount; - this.lastKnownDirtyCount = dirtyCount; + const dirtyCount = this.lastKnownDirtyCount = this.workingCopyService.dirtyCount; // Indicate dirty count in badge if any if (dirtyCount > 0) { diff --git a/src/vs/workbench/contrib/search/browser/searchEditorInput.ts b/src/vs/workbench/contrib/search/browser/searchEditorInput.ts index b75ecfed99f..76542852994 100644 --- a/src/vs/workbench/contrib/search/browser/searchEditorInput.ts +++ b/src/vs/workbench/contrib/search/browser/searchEditorInput.ts @@ -172,14 +172,9 @@ export class SearchEditorInput extends EditorInput { return null; } - async setDirty(dirty: boolean) { + setDirty(dirty: boolean) { this.dirty = dirty; this._onDidChangeDirty.fire(); - - await this.model; - - // fire again because some listeners dont attach early enough. See #89406 and #89267. - this._onDidChangeDirty.fire(); } isDirty() { diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index debe0d0e1d6..782483ff9c5 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -272,13 +272,10 @@ export class ElectronWindow extends Disposable { return; // do not indicate dirty of working copies that are auto saved after short delay } - if ((!this.isDocumentedEdited && gotDirty) || (this.isDocumentedEdited && !gotDirty)) { - const hasDirtyFiles = this.workingCopyService.hasDirty; - this.isDocumentedEdited = hasDirtyFiles; - - this.electronService.setDocumentEdited(hasDirtyFiles); - } + this.updateDocumentEdited(gotDirty); })); + + this.updateDocumentEdited(); } // Detect minimize / maximize @@ -290,6 +287,15 @@ export class ElectronWindow extends Disposable { this.onDidChangeMaximized(this.environmentService.configuration.maximized ?? false); } + private updateDocumentEdited(isDirty = this.workingCopyService.hasDirty): void { + if ((!this.isDocumentedEdited && isDirty) || (this.isDocumentedEdited && !isDirty)) { + const hasDirtyFiles = this.workingCopyService.hasDirty; + this.isDocumentedEdited = hasDirtyFiles; + + this.electronService.setDocumentEdited(hasDirtyFiles); + } + } + private onDidChangeMaximized(maximized: boolean): void { this.layoutService.updateWindowMaximizedState(maximized); } @@ -650,8 +656,8 @@ export class ElectronWindow extends Disposable { } // Otherwise resolve promise when resource is saved - const listener = this.workingCopyService.onDidChangeDirty(e => { - if (!e.isDirty() && isEqual(resource, e.resource)) { + const listener = this.workingCopyService.onDidChangeDirty(workingCopy => { + if (!workingCopy.isDirty() && isEqual(resource, workingCopy.resource)) { listener.dispose(); resolve(); From d8e256c6ba605f4c260b52f79567c7cad2609535 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 08:36:43 +0100 Subject: [PATCH 086/624] fix #89948 --- src/vs/platform/actions/common/actions.ts | 3 ++- src/vs/workbench/api/common/menusExtensionPoint.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 201198887a0..dcf943843d6 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -58,6 +58,8 @@ export function isISubmenuItem(item: IMenuItem | ISubmenuItem): item is ISubmenu export class MenuId { + private static _idPool = 0; + static readonly CommandPalette = new MenuId('CommandPalette'); static readonly DebugBreakpointsContext = new MenuId('DebugBreakpointsContext'); static readonly DebugCallStackContext = new MenuId('DebugCallStackContext'); @@ -113,7 +115,6 @@ export class MenuId { static readonly BulkEditTitle = new MenuId('BulkEditTitle'); static readonly BulkEditContext = new MenuId('BulkEditContext'); - private static _idPool = 0; readonly id: number; readonly _debugName: string; diff --git a/src/vs/workbench/api/common/menusExtensionPoint.ts b/src/vs/workbench/api/common/menusExtensionPoint.ts index 0e441ee01d5..c79a3c16ab0 100644 --- a/src/vs/workbench/api/common/menusExtensionPoint.ts +++ b/src/vs/workbench/api/common/menusExtensionPoint.ts @@ -414,7 +414,7 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyM } const menu = schema.parseMenuId(entry.key); - if (typeof menu !== 'number') { + if (typeof menu === 'undefined') { collector.warn(localize('menuId.invalid', "`{0}` is not a valid menu identifier", entry.key)); return; } From 897315e6084f6625de3b7aaf60e966da65648ea1 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:50:26 +0100 Subject: [PATCH 087/624] text input - push more code down for reuse --- src/vs/workbench/common/editor.ts | 114 +++++++++++++++++- .../common/editor/resourceEditorInput.ts | 21 ++-- .../common/editor/untitledTextEditorInput.ts | 89 +++----------- .../common/editor/untitledTextEditorModel.ts | 7 +- .../files/common/editors/fileEditorInput.ts | 92 ++------------ .../contrib/output/browser/logViewer.ts | 22 +++- .../electron-browser/perfviewEditor.ts | 13 +- .../common/preferencesEditorInput.ts | 10 +- 8 files changed, 190 insertions(+), 178 deletions(-) diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 90c2f81985d..a34c440587c 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -18,14 +18,18 @@ import { ITextModel } from 'vs/editor/common/model'; import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { ICompositeControl } from 'vs/workbench/common/composite'; import { ActionRunner, IAction } from 'vs/base/common/actions'; -import { IFileService } from 'vs/platform/files/common/files'; +import { IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; import { IPathData } from 'vs/platform/windows/common/windows'; import { coalesce, firstOrDefault } from 'vs/base/common/arrays'; import { ITextFileSaveOptions, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { isEqual } from 'vs/base/common/resources'; +import { isEqual, dirname } from 'vs/base/common/resources'; import { IPanel } from 'vs/workbench/common/panel'; import { IRange } from 'vs/editor/common/core/range'; +import { createMemoizer } from 'vs/base/common/decorators'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { Schemas } from 'vs/base/common/network'; +import { IFilesConfigurationService, AutoSaveMode } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; export const DirtyWorkingCopiesContext = new RawContextKey('dirtyWorkingCopies', false); export const ActiveEditorContext = new RawContextKey('activeEditor', null); @@ -565,21 +569,123 @@ export abstract class EditorInput extends Disposable implements IEditorInput { } } -export abstract class TextEditorInput extends EditorInput { +export abstract class TextResourceEditorInput extends EditorInput { + + private static readonly MEMOIZER = createMemoizer(); constructor( protected readonly resource: URI, @IEditorService protected readonly editorService: IEditorService, @IEditorGroupsService protected readonly editorGroupService: IEditorGroupsService, - @ITextFileService protected readonly textFileService: ITextFileService + @ITextFileService protected readonly textFileService: ITextFileService, + @ILabelService protected readonly labelService: ILabelService, + @IFileService protected readonly fileService: IFileService, + @IFilesConfigurationService protected readonly filesConfigurationService: IFilesConfigurationService ) { super(); + + // Clear label memoizer on certain events that have impact + this._register(this.labelService.onDidChangeFormatters(() => TextResourceEditorInput.MEMOIZER.clear())); + this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(() => TextResourceEditorInput.MEMOIZER.clear())); } getResource(): URI { return this.resource; } + getName(): string { + return this.basename; + } + + @TextResourceEditorInput.MEMOIZER + private get basename(): string { + return this.labelService.getUriBasenameLabel(this.resource); + } + + getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string | undefined { + switch (verbosity) { + case Verbosity.SHORT: + return this.shortDescription; + case Verbosity.LONG: + return this.longDescription; + case Verbosity.MEDIUM: + default: + return this.mediumDescription; + } + } + + @TextResourceEditorInput.MEMOIZER + private get shortDescription(): string { + return this.labelService.getUriBasenameLabel(dirname(this.resource)); + } + + @TextResourceEditorInput.MEMOIZER + private get mediumDescription(): string { + return this.labelService.getUriLabel(dirname(this.resource), { relative: true }); + } + + @TextResourceEditorInput.MEMOIZER + private get longDescription(): string { + return this.labelService.getUriLabel(dirname(this.resource)); + } + + @TextResourceEditorInput.MEMOIZER + private get shortTitle(): string { + return this.getName(); + } + + @TextResourceEditorInput.MEMOIZER + private get mediumTitle(): string { + return this.labelService.getUriLabel(this.resource, { relative: true }); + } + + @TextResourceEditorInput.MEMOIZER + private get longTitle(): string { + return this.labelService.getUriLabel(this.resource); + } + + getTitle(verbosity: Verbosity): string { + switch (verbosity) { + case Verbosity.SHORT: + return this.shortTitle; + case Verbosity.LONG: + return this.longTitle; + default: + case Verbosity.MEDIUM: + return this.mediumTitle; + } + } + + isUntitled(): boolean { + return this.resource.scheme === Schemas.untitled; + } + + isReadonly(): boolean { + if (this.isUntitled()) { + return false; // untitled is never readonly + } + + if (!this.fileService.canHandleResource(this.resource)) { + return true; // resources without file support are always readonly + } + + const model = this.textFileService.files.get(this.resource); + + return model?.isReadonly() || this.fileService.hasCapability(this.resource, FileSystemProviderCapabilities.Readonly); + } + + isSaving(): boolean { + if (this.isUntitled()) { + return false; // untitled is never saving automatically + } + + if (this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) { + return true; // a short auto save is configured, treat this as being saved + } + + return false; + } + async save(group: GroupIdentifier, options?: ITextFileSaveOptions): Promise { return this.doSave(group, options, false); } diff --git a/src/vs/workbench/common/editor/resourceEditorInput.ts b/src/vs/workbench/common/editor/resourceEditorInput.ts index 48abc1f5100..18d7965ca6b 100644 --- a/src/vs/workbench/common/editor/resourceEditorInput.ts +++ b/src/vs/workbench/common/editor/resourceEditorInput.ts @@ -3,21 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITextEditorModel, IModeSupport, TextEditorInput } from 'vs/workbench/common/editor'; +import { ITextEditorModel, IModeSupport, TextResourceEditorInput } from 'vs/workbench/common/editor'; import { URI } from 'vs/base/common/uri'; import { IReference } from 'vs/base/common/lifecycle'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; -import { basename } from 'vs/base/common/resources'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; /** * A read-only text editor input whos contents are made of the provided resource that points to an existing * code editor model. */ -export class ResourceEditorInput extends TextEditorInput implements IModeSupport { +export class ResourceEditorInput extends TextResourceEditorInput implements IModeSupport { static readonly ID: string = 'workbench.editors.resourceEditorInput'; @@ -32,13 +34,12 @@ export class ResourceEditorInput extends TextEditorInput implements IModeSupport @ITextModelService private readonly textModelResolverService: ITextModelService, @ITextFileService textFileService: ITextFileService, @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @IFileService fileService: IFileService, + @ILabelService labelService: ILabelService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService ) { - super(resource, editorService, editorGroupService, textFileService); - } - - getResource(): URI { - return this.resource; + super(resource, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService); } getTypeId(): string { @@ -46,7 +47,7 @@ export class ResourceEditorInput extends TextEditorInput implements IModeSupport } getName(): string { - return this.name || basename(this.resource); + return this.name || super.getName(); } setName(name: string): void { diff --git a/src/vs/workbench/common/editor/untitledTextEditorInput.ts b/src/vs/workbench/common/editor/untitledTextEditorInput.ts index 2741ad39f35..c8e448d2be6 100644 --- a/src/vs/workbench/common/editor/untitledTextEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledTextEditorInput.ts @@ -4,9 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { URI } from 'vs/base/common/uri'; -import { createMemoizer } from 'vs/base/common/decorators'; -import { basenameOrAuthority, dirname } from 'vs/base/common/resources'; -import { IEncodingSupport, EncodingMode, Verbosity, IModeSupport, TextEditorInput } from 'vs/workbench/common/editor'; +import { IEncodingSupport, EncodingMode, Verbosity, IModeSupport, TextResourceEditorInput } from 'vs/workbench/common/editor'; import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { Emitter } from 'vs/base/common/event'; @@ -15,16 +13,16 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; /** * An editor input to be used for untitled text buffers. */ -export class UntitledTextEditorInput extends TextEditorInput implements IEncodingSupport, IModeSupport { +export class UntitledTextEditorInput extends TextResourceEditorInput implements IEncodingSupport, IModeSupport { static readonly ID: string = 'workbench.editors.untitledEditorInput'; - private static readonly MEMOIZER = createMemoizer(); - private readonly _onDidModelChangeEncoding = this._register(new Emitter()); readonly onDidModelChangeEncoding = this._onDidModelChangeEncoding.event; @@ -42,21 +40,17 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin private preferredEncoding: string | undefined, @IInstantiationService private readonly instantiationService: IInstantiationService, @ITextFileService textFileService: ITextFileService, - @ILabelService private readonly labelService: ILabelService, + @ILabelService labelService: ILabelService, @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @IFileService fileService: IFileService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService ) { - super(resource, editorService, editorGroupService, textFileService); + super(resource, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService); if (preferredMode) { this.setMode(preferredMode); } - - this.registerListeners(); - } - - private registerListeners(): void { - this._register(this.labelService.onDidChangeFormatters(() => UntitledTextEditorInput.MEMOIZER.clear())); } get hasAssociatedFilePath(): boolean { @@ -72,7 +66,7 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin return this.cachedModel.name; } - return this.hasAssociatedFilePath ? basenameOrAuthority(this.resource) : this.resource.path; + return super.getName(); } getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string | undefined { @@ -83,52 +77,12 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin if (descriptionCandidate !== this.getName()) { return descriptionCandidate; } + + return undefined; } // With associated path: use label provider - else { - switch (verbosity) { - case Verbosity.SHORT: - return this.shortDescription; - case Verbosity.LONG: - return this.longDescription; - case Verbosity.MEDIUM: - default: - return this.mediumDescription; - } - } - - return undefined; - } - - @UntitledTextEditorInput.MEMOIZER - private get shortDescription(): string { - return this.labelService.getUriBasenameLabel(dirname(this.resource)); - } - - @UntitledTextEditorInput.MEMOIZER - private get mediumDescription(): string { - return this.labelService.getUriLabel(dirname(this.resource), { relative: true }); - } - - @UntitledTextEditorInput.MEMOIZER - private get longDescription(): string { - return this.labelService.getUriLabel(dirname(this.resource)); - } - - @UntitledTextEditorInput.MEMOIZER - private get shortTitle(): string { - return this.getName(); - } - - @UntitledTextEditorInput.MEMOIZER - private get mediumTitle(): string { - return this.labelService.getUriLabel(this.resource, { relative: true }); - } - - @UntitledTextEditorInput.MEMOIZER - private get longTitle(): string { - return this.labelService.getUriLabel(this.resource); + return super.getDescription(verbosity); } getTitle(verbosity: Verbosity): string { @@ -136,22 +90,7 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin return this.getName(); } - switch (verbosity) { - case Verbosity.SHORT: - return this.shortTitle; - case Verbosity.MEDIUM: - return this.mediumTitle; - case Verbosity.LONG: - return this.longTitle; - } - } - - isReadonly(): boolean { - return false; - } - - isUntitled(): boolean { - return true; + return super.getTitle(verbosity); } isDirty(): boolean { diff --git a/src/vs/workbench/common/editor/untitledTextEditorModel.ts b/src/vs/workbench/common/editor/untitledTextEditorModel.ts index 1ec4d83e7ef..c95993f9105 100644 --- a/src/vs/workbench/common/editor/untitledTextEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledTextEditorModel.ts @@ -18,7 +18,7 @@ import { IWorkingCopyService, IWorkingCopy, WorkingCopyCapabilities, IWorkingCop import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IModelContentChangedEvent } from 'vs/editor/common/model/textModelEvents'; import { withNullAsUndefined, assertIsDefined } from 'vs/base/common/types'; -import { basenameOrAuthority } from 'vs/base/common/resources'; +import { ILabelService } from 'vs/platform/label/common/label'; import { ensureValidWordDefinition } from 'vs/editor/common/model/wordHelper'; export interface IUntitledTextEditorModel extends ITextEditorModel, IModeSupport, IEncodingSupport, IWorkingCopy { } @@ -51,7 +51,7 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt } // Otherwise fallback to resource - return this.hasAssociatedFilePath ? basenameOrAuthority(this.resource) : this.resource.path; + return this.labelService.getUriBasenameLabel(this.resource); } private dirty = false; @@ -69,7 +69,8 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt @IBackupFileService private readonly backupFileService: IBackupFileService, @ITextResourceConfigurationService private readonly textResourceConfigurationService: ITextResourceConfigurationService, @IWorkingCopyService private readonly workingCopyService: IWorkingCopyService, - @ITextFileService private readonly textFileService: ITextFileService + @ITextFileService private readonly textFileService: ITextFileService, + @ILabelService private readonly labelService: ILabelService ) { super(modelService, modeService); diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index 39160fe689c..24be7bf094a 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -4,20 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { createMemoizer } from 'vs/base/common/decorators'; -import { dirname } from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; -import { EncodingMode, IFileEditorInput, ITextEditorModel, Verbosity, TextEditorInput } from 'vs/workbench/common/editor'; +import { EncodingMode, IFileEditorInput, ITextEditorModel, Verbosity, TextResourceEditorInput } from 'vs/workbench/common/editor'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; -import { FileOperationError, FileOperationResult, IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; +import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; import { ITextFileService, ModelState, LoadReason, TextFileOperationError, TextFileOperationResult, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IReference } from 'vs/base/common/lifecycle'; 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'; -import { IFilesConfigurationService, AutoSaveMode } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; @@ -30,9 +28,7 @@ const enum ForceOpenAs { /** * A file editor input is the input type for the file editor of file system resources. */ -export class FileEditorInput extends TextEditorInput implements IFileEditorInput { - - private static readonly MEMOIZER = createMemoizer(); +export class FileEditorInput extends TextResourceEditorInput implements IFileEditorInput { private preferredEncoding: string | undefined; private preferredMode: string | undefined; @@ -48,13 +44,13 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput @IInstantiationService private readonly instantiationService: IInstantiationService, @ITextFileService textFileService: ITextFileService, @ITextModelService private readonly textModelResolverService: ITextModelService, - @ILabelService private readonly labelService: ILabelService, - @IFileService private readonly fileService: IFileService, - @IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService, + @ILabelService labelService: ILabelService, + @IFileService fileService: IFileService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService, @IEditorService editorService: IEditorService, @IEditorGroupsService editorGroupService: IEditorGroupsService ) { - super(resource, editorService, editorGroupService, textFileService); + super(resource, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService); if (preferredEncoding) { this.setPreferredEncoding(preferredEncoding); @@ -68,16 +64,10 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput } private registerListeners(): void { - - // Dirty changes this._register(this.textFileService.files.onDidChangeDirty(m => this.onDirtyStateChange(m))); this._register(this.textFileService.files.onDidSave(e => this.onDirtyStateChange(e.model))); this._register(this.textFileService.files.onDidSaveError(m => this.onDirtyStateChange(m))); this._register(this.textFileService.files.onDidRevert(m => this.onDirtyStateChange(m))); - - // Label changes - this._register(this.labelService.onDidChangeFormatters(() => FileEditorInput.MEMOIZER.clear())); - this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(() => FileEditorInput.MEMOIZER.clear())); this._register(this.textFileService.files.onDidChangeOrphaned(model => this.onModelOrphanedChanged(model))); } @@ -89,7 +79,6 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput private onModelOrphanedChanged(model: ITextFileEditorModel): void { if (model.resource.toString() === this.resource.toString()) { - FileEditorInput.MEMOIZER.clear(); this._onDidChangeLabel.fire(); } } @@ -151,63 +140,16 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput return FILE_EDITOR_INPUT_ID; } - @FileEditorInput.MEMOIZER getName(): string { - return this.decorateLabel(this.labelService.getUriBasenameLabel(this.resource)); - } - - getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string { - switch (verbosity) { - case Verbosity.SHORT: - return this.shortDescription; - case Verbosity.LONG: - return this.longDescription; - case Verbosity.MEDIUM: - default: - return this.mediumDescription; - } - } - - @FileEditorInput.MEMOIZER - private get shortDescription(): string { - return this.labelService.getUriBasenameLabel(dirname(this.resource)); - } - - @FileEditorInput.MEMOIZER - private get mediumDescription(): string { - return this.labelService.getUriLabel(dirname(this.resource), { relative: true }); - } - - @FileEditorInput.MEMOIZER - private get longDescription(): string { - return this.labelService.getUriLabel(dirname(this.resource)); - } - - @FileEditorInput.MEMOIZER - private get shortTitle(): string { - return this.getName(); - } - - @FileEditorInput.MEMOIZER - private get mediumTitle(): string { - return this.labelService.getUriLabel(this.resource, { relative: true }); - } - - @FileEditorInput.MEMOIZER - private get longTitle(): string { - return this.labelService.getUriLabel(this.resource); + return this.decorateLabel(super.getName()); } getTitle(verbosity: Verbosity): string { switch (verbosity) { case Verbosity.SHORT: - // already decorated by getName() - return this.shortTitle; + return super.getTitle(verbosity); // already decorated from getName() default: - case Verbosity.MEDIUM: - return this.decorateLabel(this.mediumTitle); - case Verbosity.LONG: - return this.decorateLabel(this.longTitle); + return this.decorateLabel(super.getTitle(verbosity)); } } @@ -225,12 +167,6 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput return label; } - isReadonly(): boolean { - const model = this.textFileService.files.get(this.resource); - - return model?.isReadonly() || this.fileService.hasCapability(this.resource, FileSystemProviderCapabilities.Readonly); - } - isDirty(): boolean { const model = this.textFileService.files.get(this.resource); if (!model) { @@ -255,11 +191,7 @@ export class FileEditorInput extends TextEditorInput implements IFileEditorInput // and it could result in bad UX where an editor can be closed even though // it shows up as dirty and has not finished saving yet. - if (this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) { - return true; // a short auto save is configured, treat this as being saved - } - - return false; + return super.isSaving(); } getPreferredEditorId(candidates: string[]): string { diff --git a/src/vs/workbench/contrib/output/browser/logViewer.ts b/src/vs/workbench/contrib/output/browser/logViewer.ts index d3081d1ca49..bd1b1846456 100644 --- a/src/vs/workbench/contrib/output/browser/logViewer.ts +++ b/src/vs/workbench/contrib/output/browser/logViewer.ts @@ -20,6 +20,9 @@ import { IFileOutputChannelDescriptor } from 'vs/workbench/services/output/commo import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { IFileService } from 'vs/platform/files/common/files'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; export class LogViewerInput extends ResourceEditorInput { @@ -30,9 +33,24 @@ export class LogViewerInput extends ResourceEditorInput { @ITextModelService textModelResolverService: ITextModelService, @ITextFileService textFileService: ITextFileService, @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @IFileService fileService: IFileService, + @ILabelService labelService: ILabelService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService ) { - super(basename(outputChannelDescriptor.file.path), dirname(outputChannelDescriptor.file.path), URI.from({ scheme: LOG_SCHEME, path: outputChannelDescriptor.id }), undefined, textModelResolverService, textFileService, editorService, editorGroupService); + super( + basename(outputChannelDescriptor.file.path), + dirname(outputChannelDescriptor.file.path), + URI.from({ scheme: LOG_SCHEME, path: outputChannelDescriptor.id }), + undefined, + textModelResolverService, + textFileService, + editorService, + editorGroupService, + fileService, + labelService, + filesConfigurationService + ); } getTypeId(): string { diff --git a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts index bb5033348d3..ad07427a1a4 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts @@ -24,6 +24,9 @@ import product from 'vs/platform/product/common/product'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; export class PerfviewContrib { @@ -50,7 +53,10 @@ export class PerfviewInput extends ResourceEditorInput { @ITextModelService textModelResolverService: ITextModelService, @ITextFileService textFileService: ITextFileService, @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @IFileService fileService: IFileService, + @ILabelService labelService: ILabelService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService ) { super( localize('name', "Startup Performance"), @@ -60,7 +66,10 @@ export class PerfviewInput extends ResourceEditorInput { textModelResolverService, textFileService, editorService, - editorGroupService + editorGroupService, + fileService, + labelService, + filesConfigurationService ); } diff --git a/src/vs/workbench/services/preferences/common/preferencesEditorInput.ts b/src/vs/workbench/services/preferences/common/preferencesEditorInput.ts index 4201d713077..928d441a336 100644 --- a/src/vs/workbench/services/preferences/common/preferencesEditorInput.ts +++ b/src/vs/workbench/services/preferences/common/preferencesEditorInput.ts @@ -16,6 +16,9 @@ import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/p import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; export class PreferencesEditorInput extends SideBySideEditorInput { static readonly ID: string = 'workbench.editorinputs.preferencesEditorInput'; @@ -36,9 +39,12 @@ export class DefaultPreferencesEditorInput extends ResourceEditorInput { @ITextModelService textModelResolverService: ITextModelService, @ITextFileService textFileService: ITextFileService, @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @IFileService fileService: IFileService, + @ILabelService labelService: ILabelService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService ) { - super(nls.localize('settingsEditorName', "Default Settings"), '', defaultSettingsResource, undefined, textModelResolverService, textFileService, editorService, editorGroupService); + super(nls.localize('settingsEditorName', "Default Settings"), '', defaultSettingsResource, undefined, textModelResolverService, textFileService, editorService, editorGroupService, fileService, labelService, filesConfigurationService); } getTypeId(): string { From a07225a3895fbacd61b67280c768c0e6798ca6ae Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:51:53 +0100 Subject: [PATCH 088/624] files input - change to model specific listeners --- .../files/common/editors/fileEditorInput.ts | 84 +++++++++---------- 1 file changed, 40 insertions(+), 44 deletions(-) diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index 24be7bf094a..580ad0daba3 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -5,13 +5,12 @@ import { localize } from 'vs/nls'; import { URI } from 'vs/base/common/uri'; -import { EncodingMode, IFileEditorInput, ITextEditorModel, Verbosity, TextResourceEditorInput } from 'vs/workbench/common/editor'; -import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; +import { EncodingMode, IFileEditorInput, Verbosity, TextResourceEditorInput } from 'vs/workbench/common/editor'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; import { ITextFileService, ModelState, LoadReason, TextFileOperationError, TextFileOperationResult, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IReference } from 'vs/base/common/lifecycle'; +import { IReference, dispose } from 'vs/base/common/lifecycle'; 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'; @@ -35,7 +34,7 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi private forceOpenAs: ForceOpenAs = ForceOpenAs.None; - private textModelReference: Promise> | null = null; + private cachedTextFileModelReference: IReference | undefined = undefined; constructor( resource: URI, @@ -59,28 +58,6 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi if (preferredMode) { this.setPreferredMode(preferredMode); } - - this.registerListeners(); - } - - private registerListeners(): void { - this._register(this.textFileService.files.onDidChangeDirty(m => this.onDirtyStateChange(m))); - this._register(this.textFileService.files.onDidSave(e => this.onDirtyStateChange(e.model))); - this._register(this.textFileService.files.onDidSaveError(m => this.onDirtyStateChange(m))); - this._register(this.textFileService.files.onDidRevert(m => this.onDirtyStateChange(m))); - this._register(this.textFileService.files.onDidChangeOrphaned(model => this.onModelOrphanedChanged(model))); - } - - private onDirtyStateChange(model: ITextFileEditorModel): void { - if (model.resource.toString() === this.resource.toString()) { - this._onDidChangeDirty.fire(); - } - } - - private onModelOrphanedChanged(model: ITextFileEditorModel): void { - if (model.resource.toString() === this.resource.toString()) { - this._onDidChangeLabel.fire(); - } } getEncoding(): string | undefined { @@ -198,7 +175,7 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi return this.forceOpenAs === ForceOpenAs.Binary ? BINARY_FILE_EDITOR_ID : TEXT_FILE_EDITOR_ID; } - resolve(): Promise { + resolve(): Promise { // Resolve as binary if (this.forceOpenAs === ForceOpenAs.Binary) { @@ -209,7 +186,7 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi return this.doResolveAsText(); } - private async doResolveAsText(): Promise { + private async doResolveAsText(): Promise { // Resolve as text try { @@ -225,13 +202,11 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi // or very large files do not resolve to a text file model but should be opened as binary files without text. First calling into // resolve() ensures we are not creating model references for these kind of resources. // In addition we have a bit of payload to take into account (encoding, reload) that the text resolver does not handle yet. - if (!this.textModelReference) { - this.textModelReference = this.textModelResolverService.createModelReference(this.resource); + if (!this.cachedTextFileModelReference) { + this.cachedTextFileModelReference = await this.createTextModelReference(); } - const ref = await this.textModelReference; - - return ref.object as TextFileEditorModel; + return this.cachedTextFileModelReference.object; } catch (error) { // In case of an error that indicates that the file is binary or too large, just return with the binary editor model @@ -247,6 +222,30 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi } } + private async createTextModelReference(): Promise> { + const reference = await this.textModelResolverService.createModelReference(this.resource) as IReference; + + // Fire an initial dirty change if the model is already dirty + const model = reference.object; + if (model.isDirty()) { + this._onDidChangeDirty.fire(); + } + + this.registerModelListeners(model); + + return reference; + } + + private registerModelListeners(model: ITextFileEditorModel): void { + + // re-emit some events from the model + this._register(model.onDidChangeDirty(() => this._onDidChangeDirty.fire())); + this._register(model.onDidSave(() => this._onDidChangeDirty.fire())); + this._register(model.onDidSaveError(() => this._onDidChangeDirty.fire())); + this._register(model.onDidRevert(() => this._onDidChangeDirty.fire())); + this._register(model.onDidChangeOrphaned(() => this._onDidChangeLabel.fire())); + } + private async doResolveAsBinary(): Promise { return this.instantiationService.createInstance(BinaryEditorModel, this.resource, this.getName()).load(); } @@ -255,17 +254,6 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi return !!this.textFileService.files.get(this.resource); } - dispose(): void { - - // Model reference - if (this.textModelReference) { - this.textModelReference.then(ref => ref.dispose()); - this.textModelReference = null; - } - - super.dispose(); - } - matches(otherInput: unknown): boolean { if (super.matches(otherInput) === true) { return true; @@ -277,4 +265,12 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi return false; } + + dispose(): void { + + // Model reference + this.cachedTextFileModelReference = dispose(this.cachedTextFileModelReference); + + super.dispose(); + } } From c6750ffa8754715ace7c348825bb056f53b42f34 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:53:23 +0100 Subject: [PATCH 089/624] debt - careful with dispose() and assignments --- src/vs/base/browser/ui/menu/menubar.ts | 9 +++-- src/vs/base/common/lifecycle.ts | 7 +++- .../editor/contrib/suggest/suggestWidget.ts | 6 ++-- src/vs/platform/list/browser/listService.ts | 5 +-- .../storage/browser/storageService.ts | 5 +-- .../platform/storage/node/storageService.ts | 5 +-- .../debug/browser/loadedScriptsView.ts | 4 +-- .../files/common/editors/fileEditorInput.ts | 11 +++--- .../test/browser/fileEditorInput.test.ts | 35 +++++++++++-------- .../terminal/browser/terminalInstance.ts | 9 +++-- 10 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/vs/base/browser/ui/menu/menubar.ts b/src/vs/base/browser/ui/menu/menubar.ts index 767b62dabec..fa92216ab12 100644 --- a/src/vs/base/browser/ui/menu/menubar.ts +++ b/src/vs/base/browser/ui/menu/menubar.ts @@ -88,7 +88,7 @@ export class MenuBar extends Disposable { private numMenusShown: number = 0; private menuStyle: IMenuStyles | undefined; - private overflowLayoutScheduled: IDisposable | null = null; + private overflowLayoutScheduled: IDisposable | undefined = undefined; constructor(private container: HTMLElement, private options: IMenuBarOptions = {}) { super(); @@ -419,9 +419,8 @@ export class MenuBar extends Disposable { DOM.removeNode(this.overflowMenu.titleElement); DOM.removeNode(this.overflowMenu.buttonElement); - if (this.overflowLayoutScheduled) { - this.overflowLayoutScheduled = dispose(this.overflowLayoutScheduled); - } + dispose(this.overflowLayoutScheduled); + this.overflowLayoutScheduled = undefined; } blur(): void { @@ -561,7 +560,7 @@ export class MenuBar extends Disposable { if (!this.overflowLayoutScheduled) { this.overflowLayoutScheduled = DOM.scheduleAtNextAnimationFrame(() => { this.updateOverflowAction(); - this.overflowLayoutScheduled = null; + this.overflowLayoutScheduled = undefined; }); } diff --git a/src/vs/base/common/lifecycle.ts b/src/vs/base/common/lifecycle.ts index 06e3746750c..a99fc45bd50 100644 --- a/src/vs/base/common/lifecycle.ts +++ b/src/vs/base/common/lifecycle.ts @@ -91,6 +91,9 @@ export function toDisposable(fn: () => void): IDisposable { } export class DisposableStore implements IDisposable { + + static DISABLE_DISPOSED_WARNING = false; + private _toDispose = new Set(); private _isDisposed = false; @@ -127,7 +130,9 @@ export class DisposableStore implements IDisposable { markTracked(t); if (this._isDisposed) { - console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack); + if (!DisposableStore.DISABLE_DISPOSED_WARNING) { + console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack); + } } else { this._toDispose.add(t); } diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index 579305b6fe3..f53c62e3542 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -342,7 +342,8 @@ class SuggestionDetails { } renderItem(item: CompletionItem, explainMode: boolean): void { - this.renderDisposeable = dispose(this.renderDisposeable); + dispose(this.renderDisposeable); + this.renderDisposeable = undefined; let { documentation, detail } = item.completion; // --- documentation @@ -449,7 +450,8 @@ class SuggestionDetails { dispose(): void { this.disposables.dispose(); - this.renderDisposeable = dispose(this.renderDisposeable); + dispose(this.renderDisposeable); + this.renderDisposeable = undefined; } } diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 10f3ec6150f..25a485ac237 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -952,7 +952,7 @@ class WorkbenchTreeInternals { private hasMultiSelection: IContextKey; private _useAltAsMultipleSelectionModifier: boolean; private disposables: IDisposable[] = []; - private styler!: IDisposable; + private styler: IDisposable | undefined; constructor( private tree: WorkbenchObjectTree | CompressibleObjectTree | WorkbenchDataTree | WorkbenchAsyncDataTree | WorkbenchCompressibleAsyncDataTree, @@ -1048,7 +1048,8 @@ class WorkbenchTreeInternals { dispose(): void { this.disposables = dispose(this.disposables); - this.styler = dispose(this.styler); + dispose(this.styler); + this.styler = undefined; } } diff --git a/src/vs/platform/storage/browser/storageService.ts b/src/vs/platform/storage/browser/storageService.ts index c1fa72a27c6..bdadaa8c68b 100644 --- a/src/vs/platform/storage/browser/storageService.ts +++ b/src/vs/platform/storage/browser/storageService.ts @@ -136,7 +136,7 @@ export class BrowserStorageService extends Disposable implements IStorageService private doFlushWhenIdle(): void { // Dispose any previous idle runner - this.runWhenIdleDisposable = dispose(this.runWhenIdleDisposable); + dispose(this.runWhenIdleDisposable); // Run when idle this.runWhenIdleDisposable = runWhenIdle(() => { @@ -180,7 +180,8 @@ export class BrowserStorageService extends Disposable implements IStorageService } dispose(): void { - this.runWhenIdleDisposable = dispose(this.runWhenIdleDisposable); + dispose(this.runWhenIdleDisposable); + this.runWhenIdleDisposable = undefined; super.dispose(); } diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index d51956f6ac4..61e1a8cd30a 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -203,7 +203,7 @@ export class NativeStorageService extends Disposable implements IStorageService private doFlushWhenIdle(): void { // Dispose any previous idle runner - this.runWhenIdleDisposable = dispose(this.runWhenIdleDisposable); + dispose(this.runWhenIdleDisposable); // Run when idle this.runWhenIdleDisposable = runWhenIdle(() => { @@ -224,7 +224,8 @@ export class NativeStorageService extends Disposable implements IStorageService // Stop periodic scheduler and idle runner as we now collect state normally this.periodicFlushScheduler.dispose(); - this.runWhenIdleDisposable = dispose(this.runWhenIdleDisposable); + dispose(this.runWhenIdleDisposable); + this.runWhenIdleDisposable = undefined; // Signal as event so that clients can still store data this._onWillSaveState.fire({ reason: WillSaveStateReason.SHUTDOWN }); diff --git a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts index 52009d76a1f..9771a1b627c 100644 --- a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts @@ -606,8 +606,8 @@ export class LoadedScriptsView extends ViewPane { } dispose(): void { - this.tree = dispose(this.tree); - this.treeLabels = dispose(this.treeLabels); + dispose(this.tree); + dispose(this.treeLabels); super.dispose(); } } diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index 580ad0daba3..a6d58303bdd 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -240,10 +240,12 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi // re-emit some events from the model this._register(model.onDidChangeDirty(() => this._onDidChangeDirty.fire())); - this._register(model.onDidSave(() => this._onDidChangeDirty.fire())); - this._register(model.onDidSaveError(() => this._onDidChangeDirty.fire())); - this._register(model.onDidRevert(() => this._onDidChangeDirty.fire())); this._register(model.onDidChangeOrphaned(() => this._onDidChangeLabel.fire())); + + // important: treat save errors as potential dirty change because + // a file that is in save conflict or error will report dirty even + // if auto save is turned on. + this._register(model.onDidSaveError(() => this._onDidChangeDirty.fire())); } private async doResolveAsBinary(): Promise { @@ -269,7 +271,8 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi dispose(): void { // Model reference - this.cachedTextFileModelReference = dispose(this.cachedTextFileModelReference); + dispose(this.cachedTextFileModelReference); + this.cachedTextFileModelReference = undefined; super.dispose(); } diff --git a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts index 4a059d873ec..60d492ba393 100644 --- a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts @@ -17,6 +17,7 @@ import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textF import { IModelService } from 'vs/editor/common/services/modelService'; import { timeout } from 'vs/base/common/async'; import { ModesRegistry, PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; +import { DisposableStore } from 'vs/base/common/lifecycle'; class ServiceAccessor { constructor( @@ -66,23 +67,29 @@ suite('Files - FileEditorInput', () => { resolved = await inputToResolve.resolve(); assert(resolvedModelA === resolved); // OK: Resolved Model cached globally per input - const otherResolved = await sameOtherInput.resolve(); - assert(otherResolved === resolvedModelA); // OK: Resolved Model cached globally per input - inputToResolve.dispose(); + try { + DisposableStore.DISABLE_DISPOSED_WARNING = true; // prevent unwanted warning output from occuring - resolved = await inputToResolve.resolve(); - assert(resolvedModelA === resolved); // Model is still the same because we had 2 clients - inputToResolve.dispose(); - sameOtherInput.dispose(); - resolvedModelA.dispose(); + const otherResolved = await sameOtherInput.resolve(); + assert(otherResolved === resolvedModelA); // OK: Resolved Model cached globally per input + inputToResolve.dispose(); - resolved = await inputToResolve.resolve(); - assert(resolvedModelA !== resolved); // Different instance, because input got disposed + resolved = await inputToResolve.resolve(); + assert(resolvedModelA === resolved); // Model is still the same because we had 2 clients + inputToResolve.dispose(); + sameOtherInput.dispose(); + resolvedModelA.dispose(); - const stat = (resolved as TextFileEditorModel).getStat(); - resolved = await inputToResolve.resolve(); - await timeout(0); - assert(stat !== (resolved as TextFileEditorModel).getStat()); // Different stat, because resolve always goes to the server for refresh + resolved = await inputToResolve.resolve(); + assert(resolvedModelA !== resolved); // Different instance, because input got disposed + + const stat = (resolved as TextFileEditorModel).getStat(); + resolved = await inputToResolve.resolve(); + await timeout(0); + assert(stat !== (resolved as TextFileEditorModel).getStat()); // Different stat, because resolve always goes to the server for refresh + } finally { + DisposableStore.DISABLE_DISPOSED_WARNING = false; + } }); test('preferred mode', async function () { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 79d9040010d..9f38129fc14 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -795,9 +795,12 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { dispose(this._windowsShellHelper); this._windowsShellHelper = undefined; - this._linkHandler = dispose(this._linkHandler); - this._commandTrackerAddon = dispose(this._commandTrackerAddon); - this._widgetManager = dispose(this._widgetManager); + dispose(this._linkHandler); + this._linkHandler = undefined; + dispose(this._commandTrackerAddon); + this._commandTrackerAddon = undefined; + dispose(this._widgetManager); + this._widgetManager = undefined; if (this._xterm && this._xterm.element) { this._hadFocusOnExit = dom.hasClass(this._xterm.element, 'focus'); From d275d098d99cafeb94641dd924f2c6e593b625bc Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:54:46 +0100 Subject: [PATCH 090/624] text models - reduce need for isResolved() --- .../common/editor/textEditorModel.ts | 6 ++--- .../common/editor/untitledTextEditorModel.ts | 12 ++++------ .../textfile/common/textFileEditorModel.ts | 24 +++++++------------ 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/vs/workbench/common/editor/textEditorModel.ts b/src/vs/workbench/common/editor/textEditorModel.ts index bbc5ce958ea..052c03e2db4 100644 --- a/src/vs/workbench/common/editor/textEditorModel.ts +++ b/src/vs/workbench/common/editor/textEditorModel.ts @@ -81,14 +81,14 @@ export class BaseTextEditorModel extends EditorModel implements ITextEditorModel * Creates the text editor model with the provided value, optional preferred mode * (can be comma separated for multiple values) and optional resource URL. */ - protected createTextEditorModel(value: ITextBufferFactory, resource: URI | undefined, preferredMode?: string): EditorModel { + protected createTextEditorModel(value: ITextBufferFactory, resource: URI | undefined, preferredMode?: string): ITextModel { const firstLineText = this.getFirstLineText(value); const languageSelection = this.getOrCreateMode(resource, this.modeService, preferredMode, firstLineText); return this.doCreateTextEditorModel(value, languageSelection, resource); } - private doCreateTextEditorModel(value: ITextBufferFactory, languageSelection: ILanguageSelection, resource: URI | undefined): EditorModel { + private doCreateTextEditorModel(value: ITextBufferFactory, languageSelection: ILanguageSelection, resource: URI | undefined): ITextModel { let model = resource && this.modelService.getModel(resource); if (!model) { model = this.modelService.createModel(value, languageSelection, resource); @@ -102,7 +102,7 @@ export class BaseTextEditorModel extends EditorModel implements ITextEditorModel this.textEditorModelHandle = model.uri; - return this; + return model; } protected getFirstLineText(value: ITextBufferFactory | ITextModel): string { diff --git a/src/vs/workbench/common/editor/untitledTextEditorModel.ts b/src/vs/workbench/common/editor/untitledTextEditorModel.ts index c95993f9105..2a99ef1aa93 100644 --- a/src/vs/workbench/common/editor/untitledTextEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledTextEditorModel.ts @@ -11,7 +11,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { Emitter } from 'vs/base/common/event'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService'; -import { ITextBufferFactory } from 'vs/editor/common/model'; +import { ITextBufferFactory, ITextModel } from 'vs/editor/common/model'; import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; import { IResolvedTextEditorModel, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { IWorkingCopyService, IWorkingCopy, WorkingCopyCapabilities, IWorkingCopyBackup } from 'vs/workbench/services/workingCopy/common/workingCopyService'; @@ -189,7 +189,7 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt // Listen to text model events const textEditorModel = assertIsDefined(this.textEditorModel); - this._register(textEditorModel.onDidChangeContent(e => this.onModelContentChanged(e))); + this._register(textEditorModel.onDidChangeContent(e => this.onModelContentChanged(textEditorModel, e))); this._register(textEditorModel.onDidChangeLanguage(() => this.onConfigurationChange())); // mode change can have impact on config // Name @@ -209,16 +209,12 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt return this as UntitledTextEditorModel & IResolvedTextEditorModel; } - private onModelContentChanged(e: IModelContentChangedEvent): void { - if (!this.isResolved()) { - return; - } - + private onModelContentChanged(model: ITextModel, e: IModelContentChangedEvent): void { this.versionId++; // mark the untitled text editor as non-dirty once its content becomes empty and we do // not have an associated path set. we never want dirty indicator in that case. - if (!this.hasAssociatedFilePath && this.textEditorModel.getLineCount() === 1 && this.textEditorModel.getLineContent(1) === '') { + if (!this.hasAssociatedFilePath && model.getLineCount() === 1 && model.getLineContent(1) === '') { this.setDirty(false); } diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 59d6f761a26..9e8b2a313e1 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -15,7 +15,7 @@ import { IFileService, FileOperationError, FileOperationResult, FileChangesEvent import { IModeService } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { timeout } from 'vs/base/common/async'; -import { ITextBufferFactory } from 'vs/editor/common/model'; +import { ITextBufferFactory, ITextModel } from 'vs/editor/common/model'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ILogService } from 'vs/platform/log/common/log'; import { basename } from 'vs/base/common/path'; @@ -393,7 +393,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil } // Update Existing Model - if (this.isResolved()) { + if (this.textEditorModel) { this.doUpdateTextModel(content.value); } @@ -412,7 +412,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this.logService.trace('[text file model] load() - created text editor model', this.resource.toString()); // Create model - this.createTextEditorModel(value, resource, this.preferredMode); + const textModel = this.createTextEditorModel(value, resource, this.preferredMode); // We restored a backup so we have to set the model as being dirty if (fromBackup) { @@ -425,7 +425,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil } // Model Listeners - this.installModelListeners(); + this.installModelListeners(textModel); } private doUpdateTextModel(value: ITextBufferFactory): void { @@ -446,19 +446,17 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this.updateSavedVersionId(); } - private installModelListeners(): void { + private installModelListeners(model: ITextModel): void { // See https://github.com/Microsoft/vscode/issues/30189 // This code has been extracted to a different method because it caused a memory leak // where `value` was captured in the content change listener closure scope. // Content Change - if (this.isResolved()) { - this._register(this.textEditorModel.onDidChangeContent(() => this.onModelContentChanged())); - } + this._register(model.onDidChangeContent(() => this.onModelContentChanged(model))); } - private onModelContentChanged(): void { + private onModelContentChanged(model: ITextModel): void { this.logService.trace(`[text file model] onModelContentChanged() - enter`, this.resource.toString()); // In any case increment the version id because it tracks the textual content state of the model at all times @@ -472,7 +470,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // The contents changed as a matter of Undo and the version reached matches the saved one // In this case we clear the dirty flag and emit a SAVED event to indicate this state. - if (this.isResolved() && this.textEditorModel.getAlternativeVersionId() === this.bufferSavedVersionId) { + if (model.getAlternativeVersionId() === this.bufferSavedVersionId) { this.logService.trace('[text file model] onModelContentChanged() - model content changed back to last saved version', this.resource.toString()); // Clear flags @@ -739,11 +737,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this._onDidSaveError.fire(); } - private doTouch(versionId: number, reason: SaveReason): Promise { - if (!this.isResolved()) { - return Promise.resolve(); - } - + private doTouch(this: TextFileEditorModel & IResolvedTextFileEditorModel, versionId: number, reason: SaveReason): Promise { const lastResolvedFileStat = assertIsDefined(this.lastResolvedFileStat); return this.saveSequentializer.setPending(versionId, this.textFileService.write(lastResolvedFileStat.resource, this.createSnapshot(), { mtime: lastResolvedFileStat.mtime, From 76c12206781c288b3082c4ec0e801a4f24c4ba5a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:55:16 +0100 Subject: [PATCH 091/624] text files - remove strange setDirty(false) calls --- .../textfile/common/textFileEditorModel.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 9e8b2a313e1..6880836674f 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -266,14 +266,14 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil const backup = await this.backupFileService.resolve(this.resource); if (this.isResolved()) { - return this; // Make sure meanwhile someone else did not suceed in loading + return this; // Make sure meanwhile someone else did not succeed in loading } if (backup) { try { return await this.loadFromBackup(backup, options); } catch (error) { - this.logService.error('[text file model] load()', error); // ignore error and continue to load as file below + this.logService.error('[text file model] load() from backup', error); // ignore error and continue to load as file below } } } @@ -344,12 +344,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // NotModified status is expected and can be handled gracefully if (result === FileOperationResult.FILE_NOT_MODIFIED_SINCE) { - - // Guard against the model having changed in the meantime - if (currentVersionId === this.versionId) { - this.doSetDirty(false); // Ensure we are not tracking a stale state - } - return this; } @@ -419,11 +413,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this.setDirty(true); } - // Ensure we are not tracking a stale state - else { - this.doSetDirty(false); - } - // Model Listeners this.installModelListeners(textModel); } @@ -431,9 +420,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private doUpdateTextModel(value: ITextBufferFactory): void { this.logService.trace('[text file model] load() - updated text editor model', this.resource.toString()); - // Ensure we are not tracking a stale state - this.doSetDirty(false); - // Update model value in a block that ignores content change events for dirty tracking this.ignoreDirtyOnModelContentChange = true; try { From fe56f6c2b80b7ca078a2f7cc230ac1642d16d76e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 08:55:40 +0100 Subject: [PATCH 092/624] text editors - increase test coverage --- .../textfile/common/textFileEditorModel.ts | 6 +- .../textfile/test/textFileEditorModel.test.ts | 101 ++++++++++++++---- .../common/editor/resourceEditorInput.test.ts | 4 +- .../common/editor/untitledTextEditor.test.ts | 28 ++++- .../workbench/test/workbenchTestServices.ts | 6 ++ 5 files changed, 117 insertions(+), 28 deletions(-) diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 6880836674f..52ef8b8e949 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -46,6 +46,9 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private readonly _onDidLoad = this._register(new Emitter()); readonly onDidLoad = this._onDidLoad.event; + private readonly _onDidChangeDirty = this._register(new Emitter()); + readonly onDidChangeDirty = this._onDidChangeDirty.event; + private readonly _onDidSaveError = this._register(new Emitter()); readonly onDidSaveError = this._onDidSaveError.event; @@ -61,9 +64,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private readonly _onDidChangeOrphaned = this._register(new Emitter()); readonly onDidChangeOrphaned = this._onDidChangeOrphaned.event; - private readonly _onDidChangeDirty = this._register(new Emitter()); - readonly onDidChangeDirty = this._onDidChangeDirty.event; - //#endregion readonly capabilities = 0; diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts index 75dc72b717e..9d4d74cceb3 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts @@ -61,8 +61,13 @@ suite('Files - TextFileEditorModel', () => { test('basic events', async function () { const model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); + let onDidLoadCounter = 0; + model.onDidLoad(() => onDidLoadCounter++); + await model.load(); + assert.equal(onDidLoadCounter, 1); + let onDidChangeContentCounter = 0; model.onDidChangeContent(() => onDidChangeContentCounter++); @@ -101,9 +106,7 @@ suite('Files - TextFileEditorModel', () => { assert.equal(accessor.workingCopyService.isDirty(model.resource), true); let savedEvent = false; - model.onDidSave(e => { - savedEvent = true; - }); + model.onDidSave(e => savedEvent = true); let workingCopyEvent = false; accessor.workingCopyService.onDidChangeDirty(e => { @@ -136,9 +139,7 @@ suite('Files - TextFileEditorModel', () => { await model.load(); let savedEvent = false; - model.onDidSave(e => { - savedEvent = true; - }); + model.onDidSave(e => savedEvent = true); let workingCopyEvent = false; accessor.workingCopyService.onDidChangeDirty(e => { @@ -156,14 +157,81 @@ suite('Files - TextFileEditorModel', () => { assert.ok(!accessor.modelService.getModel(model.resource)); }); + test('save error (generic)', async function () { + const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); + + await model.load(); + + model.textEditorModel!.setValue('bar'); + + let saveErrorEvent = false; + model.onDidSaveError(e => saveErrorEvent = true); + + accessor.fileService.writeShouldThrowError = new Error('failed to write'); + try { + const pendingSave = model.save(); + assert.ok(model.hasState(ModelState.PENDING_SAVE)); + + await pendingSave; + + assert.ok(model.hasState(ModelState.ERROR)); + assert.ok(model.isDirty()); + assert.ok(saveErrorEvent); + + assert.equal(accessor.workingCopyService.dirtyCount, 1); + assert.equal(accessor.workingCopyService.isDirty(model.resource), true); + + model.dispose(); + } finally { + accessor.fileService.writeShouldThrowError = undefined; + } + }); + + test('save error (conflict)', async function () { + const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); + + await model.load(); + + model.textEditorModel!.setValue('bar'); + + let saveErrorEvent = false; + model.onDidSaveError(e => saveErrorEvent = true); + + accessor.fileService.writeShouldThrowError = new FileOperationError('save conflict', FileOperationResult.FILE_MODIFIED_SINCE); + try { + const pendingSave = model.save(); + assert.ok(model.hasState(ModelState.PENDING_SAVE)); + + await pendingSave; + + assert.ok(model.hasState(ModelState.CONFLICT)); + assert.ok(model.isDirty()); + assert.ok(saveErrorEvent); + + assert.equal(accessor.workingCopyService.dirtyCount, 1); + assert.equal(accessor.workingCopyService.isDirty(model.resource), true); + + model.dispose(); + } finally { + accessor.fileService.writeShouldThrowError = undefined; + } + }); + test('setEncoding - encode', function () { const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); + let encodingEvent = false; + model.onDidChangeEncoding(e => encodingEvent = true); + model.setEncoding('utf8', EncodingMode.Encode); // no-op assert.equal(getLastModifiedTime(model), -1); + assert.ok(!encodingEvent); + model.setEncoding('utf16', EncodingMode.Encode); + assert.ok(encodingEvent); + assert.ok(getLastModifiedTime(model) <= Date.now()); // indicates model was saved due to encoding change model.dispose(); @@ -208,13 +276,8 @@ suite('Files - TextFileEditorModel', () => { const model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index.txt'), 'utf8', undefined); assert.ok(model.hasState(ModelState.SAVED)); - model.onDidSave(e => { - assert.fail(); - }); - - model.onDidChangeDirty(e => { - assert.fail(); - }); + model.onDidSave(e => assert.fail()); + model.onDidChangeDirty(e => assert.fail()); await model.load(); assert.ok(model.isResolved()); @@ -240,9 +303,7 @@ suite('Files - TextFileEditorModel', () => { const model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); - model.onDidRevert(e => { - eventCounter++; - }); + model.onDidRevert(e => eventCounter++); let workingCopyEvent = false; accessor.workingCopyService.onDidChangeDirty(e => { @@ -275,9 +336,7 @@ suite('Files - TextFileEditorModel', () => { const model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8', undefined); - model.onDidRevert(e => { - eventCounter++; - }); + model.onDidRevert(e => eventCounter++); let workingCopyEvent = false; accessor.workingCopyService.onDidChangeDirty(e => { @@ -333,9 +392,7 @@ suite('Files - TextFileEditorModel', () => { await model.revert({ soft: true }); assert.ok(!model.isDirty()); - model.onDidChangeDirty(e => { - eventCounter++; - }); + model.onDidChangeDirty(e => eventCounter++); let workingCopyEvent = false; accessor.workingCopyService.onDidChangeDirty(e => { diff --git a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts b/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts index d1e788e80f4..137ced3b7e4 100644 --- a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts +++ b/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts @@ -21,7 +21,7 @@ class ServiceAccessor { ) { } } -suite('Workbench resource editor input', () => { +suite('Resource text editors', () => { let instantiationService: IInstantiationService; let accessor: ServiceAccessor; @@ -59,4 +59,4 @@ suite('Workbench resource editor input', () => { input.setMode('text'); assert.equal(model.textEditorModel.getModeId(), PLAINTEXT_MODE_ID); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts b/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts index d452310ba74..43c68b49e96 100644 --- a/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts +++ b/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts @@ -29,7 +29,7 @@ class ServiceAccessor { ) { } } -suite('Workbench untitled text editors', () => { +suite('Untitled text editors', () => { let instantiationService: IInstantiationService; let accessor: ServiceAccessor; @@ -394,23 +394,29 @@ suite('Workbench untitled text editors', () => { model.textEditorModel.setValue('foo'); assert.equal(input.getName(), 'foo'); + assert.equal(model.name, 'foo'); assert.equal(counter, 1); model.textEditorModel.setValue('bar'); assert.equal(input.getName(), 'bar'); + assert.equal(model.name, 'bar'); assert.equal(counter, 2); model.textEditorModel.setValue(''); assert.equal(input.getName(), 'Untitled-1'); + assert.equal(model.name, 'Untitled-1'); model.textEditorModel.setValue(' '); assert.equal(input.getName(), 'Untitled-1'); + assert.equal(model.name, 'Untitled-1'); model.textEditorModel.setValue('([]}'); // require actual words assert.equal(input.getName(), 'Untitled-1'); + assert.equal(model.name, 'Untitled-1'); model.textEditorModel.setValue('([]}hello '); // require actual words assert.equal(input.getName(), '([]}hello'); + assert.equal(model.name, '([]}hello'); assert.equal(counter, 4); @@ -467,4 +473,24 @@ suite('Workbench untitled text editors', () => { input.dispose(); model.dispose(); }); + + test('model#onDidChangeEncoding', async function () { + const service = accessor.untitledTextEditorService; + const input = service.create(); + + let counter = 0; + + const model = await input.resolve(); + model.onDidChangeEncoding(() => counter++); + + model.setEncoding('utf16'); + + assert.equal(counter, 1, 'Dirty model should trigger event'); + model.setEncoding('utf16'); + + assert.equal(counter, 1, 'Another change to same encoding does not fire event'); + + input.dispose(); + model.dispose(); + }); }); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index d7f854f4ab2..df2d3423f2b 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -1087,9 +1087,15 @@ export class TestFileService implements IFileService { }); } + writeShouldThrowError: Error | undefined = undefined; + async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise { await timeout(0); + if (this.writeShouldThrowError) { + throw this.writeShouldThrowError; + } + return ({ resource, etag: 'index.txt', From 9270dc530ba49b1834ae07108e652a11d4cda3b0 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 09:08:47 +0100 Subject: [PATCH 093/624] untitled - use first line limit properly --- src/vs/workbench/common/editor/untitledTextEditorModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/common/editor/untitledTextEditorModel.ts b/src/vs/workbench/common/editor/untitledTextEditorModel.ts index 2a99ef1aa93..4ab63d12d92 100644 --- a/src/vs/workbench/common/editor/untitledTextEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledTextEditorModel.ts @@ -244,7 +244,7 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt let modelFirstWordsCandidate: string | undefined = undefined; - const firstLineText = this.textEditorModel?.getValueInRange({ startLineNumber: 1, endLineNumber: 1, startColumn: 1, endColumn: UntitledTextEditorModel.FIRST_LINE_NAME_MAX_LENGTH }).trim(); + const firstLineText = this.textEditorModel?.getValueInRange({ startLineNumber: 1, endLineNumber: 1, startColumn: 1, endColumn: UntitledTextEditorModel.FIRST_LINE_NAME_MAX_LENGTH + 1 }).trim(); if (firstLineText && ensureValidWordDefinition().exec(firstLineText)) { modelFirstWordsCandidate = firstLineText; } From 12cf39dea3c87137d4bc1b96c16c4e0a19bd5122 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 09:26:04 +0100 Subject: [PATCH 094/624] Add Untitled-x to the title attribute of Untitled files (fix #89921) --- .../common/editor/untitledTextEditorInput.ts | 14 ++++++++++++-- .../files/common/editors/fileEditorInput.ts | 7 +------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/common/editor/untitledTextEditorInput.ts b/src/vs/workbench/common/editor/untitledTextEditorInput.ts index c8e448d2be6..6f29b401f30 100644 --- a/src/vs/workbench/common/editor/untitledTextEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledTextEditorInput.ts @@ -81,15 +81,25 @@ export class UntitledTextEditorInput extends TextResourceEditorInput implements return undefined; } - // With associated path: use label provider + // With associated path: delegate to parent return super.getDescription(verbosity); } getTitle(verbosity: Verbosity): string { + + // Without associated path: check if name and description differ to decide + // if description should appear besides the name to distinguish better if (!this.hasAssociatedFilePath) { - return this.getName(); + const name = this.getName(); + const description = this.getDescription(); + if (description && description !== name) { + return `${name} • ${description}`; + } + + return name; } + // With associated path: delegate to parent return super.getTitle(verbosity); } diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index a6d58303bdd..684d56f0a60 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -122,12 +122,7 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi } getTitle(verbosity: Verbosity): string { - switch (verbosity) { - case Verbosity.SHORT: - return super.getTitle(verbosity); // already decorated from getName() - default: - return this.decorateLabel(super.getTitle(verbosity)); - } + return this.decorateLabel(super.getTitle(verbosity)); } private decorateLabel(label: string): string { From c520c0c69daf406540aa1645773e5f6afed81427 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 09:37:58 +0100 Subject: [PATCH 095/624] history - add logging for #89257 --- src/vs/workbench/services/history/browser/history.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index dc8aa6e1f53..92357d85c40 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IEditor } from 'vs/editor/common/editorCommon'; import { ITextEditorOptions, IResourceInput, ITextEditorSelection } from 'vs/platform/editor/common/editor'; @@ -35,6 +34,7 @@ import { addDisposableListener, EventType, EventHelper } from 'vs/base/browser/d import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { Schemas } from 'vs/base/common/network'; import { isEqual } from 'vs/base/common/resources'; +import { ILogService } from 'vs/platform/log/common/log'; /** * Stores the selection & view state of an editor and allows to compare it to other selection states. @@ -120,6 +120,7 @@ export class HistoryService extends Disposable implements IHistoryService { @IInstantiationService private readonly instantiationService: IInstantiationService, @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, @IContextKeyService private readonly contextKeyService: IContextKeyService, + @ILogService private readonly logService: ILogService ) { super(); @@ -859,6 +860,7 @@ export class HistoryService extends Disposable implements IHistoryService { return undefined; })); + this.logService.trace(`[editor history] saving ${entries.length} entries`); this.storageService.store(HistoryService.HISTORY_STORAGE_KEY, JSON.stringify(entries), StorageScope.WORKSPACE); } @@ -876,11 +878,13 @@ export class HistoryService extends Disposable implements IHistoryService { try { return this.safeLoadHistoryEntry(registry, entry); } catch (error) { - onUnexpectedError(error); + this.logService.error(`[editor history] error loading one editor history entry: ${error.toString()}`); return undefined; // https://github.com/Microsoft/vscode/issues/60960 } })); + + this.logService.trace(`[editor history] loading ${this.history.length} entries`); } private safeLoadHistoryEntry(registry: IEditorInputFactoryRegistry, entry: ISerializedEditorHistoryEntry): IEditorInput | IResourceInput | undefined { From c635cab02908bd4bf3626dd34bab7f9c3e753468 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 09:46:30 +0100 Subject: [PATCH 096/624] :up: graceful-fs@4.2.3 (related #89887) --- package.json | 2 +- remote/package.json | 2 +- remote/yarn.lock | 7 +------ yarn.lock | 7 ++++++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 30ccf466b08..4c94e8b0512 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "applicationinsights": "1.0.8", "chokidar": "3.2.3", - "graceful-fs": "4.1.11", + "graceful-fs": "4.2.3", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.3", "iconv-lite": "0.5.0", diff --git a/remote/package.json b/remote/package.json index 95ea409067f..532e0f49835 100644 --- a/remote/package.json +++ b/remote/package.json @@ -5,7 +5,7 @@ "applicationinsights": "1.0.8", "chokidar": "3.2.3", "cookie": "^0.4.0", - "graceful-fs": "4.1.11", + "graceful-fs": "4.2.3", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.3", "iconv-lite": "0.5.0", diff --git a/remote/yarn.lock b/remote/yarn.lock index 387226ccd2a..9bafc208dab 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -155,12 +155,7 @@ glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -graceful-fs@4.1.11: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= - -graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@4.2.3, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== diff --git a/yarn.lock b/yarn.lock index a98533bad96..bc18150bc92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4005,7 +4005,12 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -graceful-fs@4.1.11, graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= From f6c0093ecf1890536a95f06fb107976be141f7b2 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 09:59:59 +0100 Subject: [PATCH 097/624] history - preserve selections (fix #89699) --- .../services/history/browser/history.ts | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index 92357d85c40..34b84fcff5a 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -5,7 +5,7 @@ import { URI, UriComponents } from 'vs/base/common/uri'; import { IEditor } from 'vs/editor/common/editorCommon'; -import { ITextEditorOptions, IResourceInput, ITextEditorSelection } from 'vs/platform/editor/common/editor'; +import { ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; import { IEditorInput, IEditor as IBaseEditor, Extensions as EditorExtensions, EditorInput, IEditorCloseEvent, IEditorInputFactoryRegistry, toResource, IEditorIdentifier, GroupIdentifier, EditorsOrder } from 'vs/workbench/common/editor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; @@ -43,21 +43,14 @@ export class TextEditorState { private static readonly EDITOR_SELECTION_THRESHOLD = 10; // number of lines to move in editor to justify for new state - private textEditorSelection?: ITextEditorSelection; - - constructor(private _editorInput: IEditorInput, private _selection: Selection | null) { - this.textEditorSelection = Selection.isISelection(_selection) ? { - startLineNumber: _selection.startLineNumber, - startColumn: _selection.startColumn - } : undefined; - } + constructor(private _editorInput: IEditorInput, private _selection: Selection | null) { } get editorInput(): IEditorInput { return this._editorInput; } - get selection(): ITextEditorSelection | undefined { - return this.textEditorSelection; + get selection(): Selection | undefined { + return withNullAsUndefined(this._selection); } justifiesNewPushState(other: TextEditorState, event?: ICursorPositionChangedEvent): boolean { @@ -91,7 +84,7 @@ interface ISerializedEditorHistoryEntry { interface IStackEntry { input: IEditorInput | IResourceInput; - selection?: ITextEditorSelection; + selection?: Selection; } interface IRecentlyClosedFile { @@ -436,19 +429,19 @@ export class HistoryService extends Disposable implements IHistoryService { this.addToNavigationStack(editor.input); } - private addToNavigationStack(input: IEditorInput, selection?: ITextEditorSelection): void { + private addToNavigationStack(input: IEditorInput, selection?: Selection): void { if (!this.navigatingInStack) { this.doAddOrReplaceInNavigationStack(input, selection); } } - private replaceInNavigationStack(input: IEditorInput, selection?: ITextEditorSelection): void { + private replaceInNavigationStack(input: IEditorInput, selection?: Selection): void { if (!this.navigatingInStack) { this.doAddOrReplaceInNavigationStack(input, selection, true /* force replace */); } } - private doAddOrReplaceInNavigationStack(input: IEditorInput, selection?: ITextEditorSelection, forceReplace?: boolean): void { + private doAddOrReplaceInNavigationStack(input: IEditorInput, selection?: Selection, forceReplace?: boolean): void { // Overwrite an entry in the stack if we have a matching input that comes // with editor options to indicate that this entry is more specific. Also @@ -528,7 +521,7 @@ export class HistoryService extends Disposable implements IHistoryService { return input; } - private sameSelection(selectionA?: ITextEditorSelection, selectionB?: ITextEditorSelection): boolean { + private sameSelection(selectionA?: Selection, selectionB?: Selection): boolean { if (!selectionA && !selectionB) { return true; } @@ -693,10 +686,7 @@ export class HistoryService extends Disposable implements IHistoryService { const position = activeTextEditorWidget.getPosition(); if (position) { - this.lastEditLocation.selection = { - startLineNumber: position.lineNumber, - startColumn: position.column - }; + this.lastEditLocation.selection = new Selection(position.lineNumber, position.column, position.lineNumber, position.column); } } From ac49d59136392d3d40660c49605dfaaec44f1feb Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 10:15:37 +0100 Subject: [PATCH 098/624] Use sorting to avoid N^2 --- .../linesOperations/linesOperations.ts | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/vs/editor/contrib/linesOperations/linesOperations.ts b/src/vs/editor/contrib/linesOperations/linesOperations.ts index 13d5c5629c8..c9bf8a68056 100644 --- a/src/vs/editor/contrib/linesOperations/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/linesOperations.ts @@ -37,24 +37,36 @@ abstract class AbstractCopyLinesAction extends EditorAction { } public run(_accessor: ServicesAccessor, editor: ICodeEditor): void { + if (!editor.hasModel()) { + return; + } - let commands: ICommand[] = []; - let selections = editor.getSelections() || []; - selections = selections.reduce((accumulator, selection) => { - const isCurrentSelectionDuplicated = accumulator.some(value => ( - value.startLineNumber === selection.startLineNumber && - value.endLineNumber === selection.endLineNumber - )); + const selections = editor.getSelections().map((selection, index) => ({ selection, index, ignore: false })); + selections.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); - if (isCurrentSelectionDuplicated) { - return accumulator; + // Remove selections that would result in copying the same line + let prev = selections[0]; + for (let i = 1; i < selections.length; i++) { + const curr = selections[i]; + if (prev.selection.endLineNumber === curr.selection.startLineNumber) { + // these two selections would copy the same line + if (prev.index < curr.index) { + // prev wins + curr.ignore = true; + } else { + // curr wins + prev.ignore = true; + prev = curr; + } } + } - return [...accumulator, selection]; - }, []); - + const commands: ICommand[] = []; for (const selection of selections) { - commands.push(new CopyLinesCommand(selection, this.down)); + if (selection.ignore) { + continue; + } + commands.push(new CopyLinesCommand(selection.selection, this.down)); } editor.pushUndoStop(); From 5bd1290ace1ee4a2b1dbf9b1ea88f35257b2b6a7 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 10:45:55 +0100 Subject: [PATCH 099/624] Web: allow to open a file into a new window (fix #89989) --- .../files/browser/fileActions.contribution.ts | 3 +- .../fileActions.contribution.ts | 8 +---- .../host/browser/browserHostService.ts | 36 +++++++++++++------ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts index ddc912794d0..6876d783a34 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; -import { ToggleAutoSaveAction, GlobalNewUntitledFileAction, FocusFilesExplorer, GlobalCompareResourcesAction, SaveAllAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithClipboardAction, NEW_FILE_COMMAND_ID, NEW_FILE_LABEL, NEW_FOLDER_COMMAND_ID, NEW_FOLDER_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, renameHandler, moveFileToTrashHandler, copyFileHandler, pasteFileHandler, deleteFileHandler, cutFileHandler, DOWNLOAD_COMMAND_ID, openFilePreserveFocusHandler, DOWNLOAD_LABEL } from 'vs/workbench/contrib/files/browser/fileActions'; +import { ToggleAutoSaveAction, GlobalNewUntitledFileAction, FocusFilesExplorer, GlobalCompareResourcesAction, SaveAllAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithClipboardAction, NEW_FILE_COMMAND_ID, NEW_FILE_LABEL, NEW_FOLDER_COMMAND_ID, NEW_FOLDER_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, renameHandler, moveFileToTrashHandler, copyFileHandler, pasteFileHandler, deleteFileHandler, cutFileHandler, DOWNLOAD_COMMAND_ID, openFilePreserveFocusHandler, DOWNLOAD_LABEL, ShowOpenedFileInNewWindow } from 'vs/workbench/contrib/files/browser/fileActions'; import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler'; import { SyncActionDescriptor, MenuId, MenuRegistry, ILocalizedString } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; @@ -42,6 +42,7 @@ registry.registerWorkbenchAction(SyncActionDescriptor.create(RefreshExplorerView registry.registerWorkbenchAction(SyncActionDescriptor.create(GlobalNewUntitledFileAction, GlobalNewUntitledFileAction.ID, GlobalNewUntitledFileAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_N }), 'File: New Untitled File', category.value); registry.registerWorkbenchAction(SyncActionDescriptor.create(CompareWithClipboardAction, CompareWithClipboardAction.ID, CompareWithClipboardAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_C) }), 'File: Compare Active File with Clipboard', category.value); registry.registerWorkbenchAction(SyncActionDescriptor.create(ToggleAutoSaveAction, ToggleAutoSaveAction.ID, ToggleAutoSaveAction.LABEL), 'File: Toggle Auto Save', category.value); +registry.registerWorkbenchAction(SyncActionDescriptor.create(ShowOpenedFileInNewWindow, ShowOpenedFileInNewWindow.ID, ShowOpenedFileInNewWindow.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_O) }), 'File: Open Active File in New Window', category.value); const workspacesCategory = nls.localize('workspaces', "Workspaces"); registry.registerWorkbenchAction(SyncActionDescriptor.create(OpenWorkspaceAction, OpenWorkspaceAction.ID, OpenWorkspaceAction.LABEL), 'Workspaces: Open Workspace...', workspacesCategory); diff --git a/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts index a546415edad..369e59ea29f 100644 --- a/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts @@ -18,12 +18,9 @@ import { getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/fi import { IListService } from 'vs/platform/list/browser/listService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { revealResourcesInOS } from 'vs/workbench/contrib/files/electron-browser/fileCommands'; -import { MenuRegistry, MenuId, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { appendToCommandPalette, appendEditorTitleContextMenuItem } from 'vs/workbench/contrib/files/browser/fileActions.contribution'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; -import { ShowOpenedFileInNewWindow } from 'vs/workbench/contrib/files/browser/fileActions'; import { IExplorerService } from 'vs/workbench/contrib/files/common/files'; const REVEAL_IN_OS_COMMAND_ID = 'revealFileInOS'; @@ -85,6 +82,3 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { const category = { value: nls.localize('filesCategory', "File"), original: 'File' }; appendToCommandPalette(REVEAL_IN_OS_COMMAND_ID, { value: REVEAL_IN_OS_LABEL, original: isWindows ? 'Reveal in File Explorer' : isMacintosh ? 'Reveal in Finder' : 'Open Containing Folder' }, category, ResourceContextKey.Scheme.isEqualTo(Schemas.file)); - -const registry = Registry.as(ActionExtensions.WorkbenchActions); -registry.registerWorkbenchAction(SyncActionDescriptor.create(ShowOpenedFileInNewWindow, ShowOpenedFileInNewWindow.ID, ShowOpenedFileInNewWindow.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_O) }), 'File: Open Active File in New Window', category.value); diff --git a/src/vs/workbench/services/host/browser/browserHostService.ts b/src/vs/workbench/services/host/browser/browserHostService.ts index 2d5d095b490..7c0b27ba490 100644 --- a/src/vs/workbench/services/host/browser/browserHostService.ts +++ b/src/vs/workbench/services/host/browser/browserHostService.ts @@ -17,6 +17,7 @@ import { trackFocus } from 'vs/base/browser/dom'; import { Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { mapToSerializable } from 'vs/base/common/map'; /** * A workspace to open in the workbench can either be: @@ -46,6 +47,7 @@ export interface IWorkspaceProvider { * - `reuse`: whether to open inside the current window or a new window * - `payload`: arbitrary payload that should be made available * to the opening window via the `IWorkspaceProvider.payload` property. + * @param payload optional payload to send to the workspace to open. */ open(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise; } @@ -114,18 +116,30 @@ export class BrowserHostService extends Disposable implements IHostService { // Folder if (isFolderToOpen(openable)) { - this.workspaceProvider.open({ folderUri: openable.folderUri }, { reuse: this.shouldReuse(options) }); + this.workspaceProvider.open({ folderUri: openable.folderUri }, { reuse: this.shouldReuse(options, false /* no file */) }); } // Workspace else if (isWorkspaceToOpen(openable)) { - this.workspaceProvider.open({ workspaceUri: openable.workspaceUri }, { reuse: this.shouldReuse(options) }); + this.workspaceProvider.open({ workspaceUri: openable.workspaceUri }, { reuse: this.shouldReuse(options, false /* no file */) }); } - // File: open via editor service in current window + // File else if (isFileToOpen(openable)) { - const inputs: IResourceEditor[] = await pathsToEditors([openable], this.fileService); - this.editorService.openEditors(inputs); + + // Same Window: open via editor service in current window + if (this.shouldReuse(options, true /* file */)) { + const inputs: IResourceEditor[] = await pathsToEditors([openable], this.fileService); + this.editorService.openEditors(inputs); + } + + // New Window: open into empty window + else { + const environment = new Map(); + environment.set('openFile', openable.fileUri.toString()); + + this.workspaceProvider.open(undefined, { payload: mapToSerializable(environment) }); + } } } } @@ -142,16 +156,16 @@ export class BrowserHostService extends Disposable implements IHostService { return this.labelService.getUriLabel(openable.fileUri); } - private shouldReuse(options: IOpenWindowOptions = {}): boolean { + private shouldReuse(options: IOpenWindowOptions = {}, isFile: boolean): boolean { const windowConfig = this.configurationService.getValue('window'); - const openFolderInNewWindowConfig = windowConfig?.openFoldersInNewWindow || 'default' /* default */; + const openInNewWindowConfig = isFile ? (windowConfig?.openFilesInNewWindow || 'off' /* default */) : (windowConfig?.openFoldersInNewWindow || 'default' /* default */); - let openFolderInNewWindow = (options.preferNewWindow || !!options.forceNewWindow) && !options.forceReuseWindow; - if (!options.forceNewWindow && !options.forceReuseWindow && (openFolderInNewWindowConfig === 'on' || openFolderInNewWindowConfig === 'off')) { - openFolderInNewWindow = (openFolderInNewWindowConfig === 'on'); + let openInNewWindow = (options.preferNewWindow || !!options.forceNewWindow) && !options.forceReuseWindow; + if (!options.forceNewWindow && !options.forceReuseWindow && (openInNewWindowConfig === 'on' || openInNewWindowConfig === 'off')) { + openInNewWindow = (openInNewWindowConfig === 'on'); } - return !openFolderInNewWindow; + return !openInNewWindow; } private async doOpenEmptyWindow(options?: IOpenEmptyWindowOptions): Promise { From 21a8205995658de106e83ecf0362b33770a8f7db Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 10:19:33 +0100 Subject: [PATCH 100/624] ipc: prevent npe on non-router calls by waiting for clients --- src/vs/base/common/arrays.ts | 2 +- src/vs/base/parts/ipc/common/ipc.ts | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index 0f300db10c6..9a9b53a100c 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -585,6 +585,6 @@ export function asArray(x: T | T[]): T[] { return Array.isArray(x) ? x : [x]; } -export function getRandomElement(arr: T[]): T { +export function getRandomElement(arr: T[]): T | undefined { return arr[Math.floor(Math.random() * arr.length)]; } diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 397a44cb283..dc558a4bbc0 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -700,14 +700,32 @@ export class IPCServer implements IChannelServer, I }); } + /** + * Get a channel from a remote client. When passed a router, + * one can specify which client it wants to call and listen to/from. + * Otherwise, when calling without a router, a random client will + * be selected and when listening without a router, every client + * will be listened to. + */ getChannel(channelName: string, router?: IClientRouter): T { const that = this; return { call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { - const connectionPromise = router - ? router.routeCall(that, command, arg) - : Promise.resolve(getRandomElement(that.connections)); + let connectionPromise: Promise>; + + if (router) { + connectionPromise = router.routeCall(that, command, arg); + } else { + // when no router is provided, we go random client picking + let connection = getRandomElement(that.connections); + + connectionPromise = connection + // if we found a client, let's call on it + ? Promise.resolve(connection) + // else, let's wait for a client to come along + : Event.toPromise(that.onDidAddConnection); + } const channelPromise = connectionPromise .then(connection => (connection as Connection).channelClient.getChannel(channelName)); From 788cfa0767b37666827e670ac4b0d8440f29b531 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 10:32:16 +0100 Subject: [PATCH 101/624] use UriComponents for SCMRawResource fixes microsoft/vscode-remote-release#2115 --- src/vs/workbench/api/browser/mainThreadSCM.ts | 4 +-- .../workbench/api/common/extHost.protocol.ts | 2 +- src/vs/workbench/api/common/extHostSCM.ts | 27 +++++++++---------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadSCM.ts b/src/vs/workbench/api/browser/mainThreadSCM.ts index d8d861b8bb7..e75ac0b4da3 100644 --- a/src/vs/workbench/api/browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/browser/mainThreadSCM.ts @@ -202,8 +202,8 @@ class MainThreadSCMProvider implements ISCMProvider { const icon = icons[0]; const iconDark = icons[1] || icon; const decorations = { - icon: icon ? URI.parse(icon) : undefined, - iconDark: iconDark ? URI.parse(iconDark) : undefined, + icon: icon ? URI.revive(icon) : undefined, + iconDark: iconDark ? URI.revive(iconDark) : undefined, tooltip, strikeThrough, faded diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index d4dd3fb7288..40bb47aef3b 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -711,7 +711,7 @@ export interface SCMGroupFeatures { export type SCMRawResource = [ number /*handle*/, UriComponents /*resourceUri*/, - string[] /*icons: light, dark*/, + UriComponents[] /*icons: light, dark*/, string /*tooltip*/, boolean /*strike through*/, boolean /*faded*/ diff --git a/src/vs/workbench/api/common/extHostSCM.ts b/src/vs/workbench/api/common/extHostSCM.ts index e27ae573bdd..34a3138ad32 100644 --- a/src/vs/workbench/api/common/extHostSCM.ts +++ b/src/vs/workbench/api/common/extHostSCM.ts @@ -22,15 +22,14 @@ type ProviderHandle = number; type GroupHandle = number; type ResourceStateHandle = number; -function getIconPath(decorations?: vscode.SourceControlResourceThemableDecorations): string | undefined { +function getIconResource(decorations?: vscode.SourceControlResourceThemableDecorations): vscode.Uri | undefined { if (!decorations) { return undefined; } else if (typeof decorations.iconPath === 'string') { - return URI.file(decorations.iconPath).toString(); - } else if (decorations.iconPath) { - return `${decorations.iconPath}`; + return URI.file(decorations.iconPath); + } else { + return decorations.iconPath; } - return undefined; } function compareResourceThemableDecorations(a: vscode.SourceControlResourceThemableDecorations, b: vscode.SourceControlResourceThemableDecorations): number { @@ -287,28 +286,28 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG this._resourceStatesMap.set(handle, r); const sourceUri = r.resourceUri; - const iconPath = getIconPath(r.decorations); - const lightIconPath = r.decorations && getIconPath(r.decorations.light) || iconPath; - const darkIconPath = r.decorations && getIconPath(r.decorations.dark) || iconPath; - const icons: string[] = []; + const iconUri = getIconResource(r.decorations); + const lightIconUri = r.decorations && getIconResource(r.decorations.light) || iconUri; + const darkIconUri = r.decorations && getIconResource(r.decorations.dark) || iconUri; + const icons: UriComponents[] = []; if (r.command) { this._resourceStatesCommandsMap.set(handle, r.command); } - if (lightIconPath) { - icons.push(lightIconPath); + if (lightIconUri) { + icons.push(lightIconUri); } - if (darkIconPath && (darkIconPath !== lightIconPath)) { - icons.push(darkIconPath); + if (darkIconUri && (darkIconUri.toString() !== lightIconUri?.toString())) { + icons.push(darkIconUri); } const tooltip = (r.decorations && r.decorations.tooltip) || ''; const strikeThrough = r.decorations && !!r.decorations.strikeThrough; const faded = r.decorations && !!r.decorations.faded; - const rawResource = [handle, sourceUri, icons, tooltip, strikeThrough, faded] as SCMRawResource; + const rawResource = [handle, sourceUri, icons, tooltip, strikeThrough, faded] as SCMRawResource; return { rawResource, handle }; }); From baaab064d502e2d1b47a8f1a4f246fb6065d2d91 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 11:04:00 +0100 Subject: [PATCH 102/624] Move CSS participant to the correct place --- .../editor/browser/widget/diffEditorWidget.ts | 30 ++++++++++++++++++- src/vs/workbench/browser/style.ts | 12 -------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index fe47a578263..ffd852ccc1a 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -38,7 +38,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { defaultInsertColor, defaultRemoveColor, diffBorder, diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; +import { defaultInsertColor, defaultRemoveColor, diffBorder, diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from 'vs/platform/theme/common/colorRegistry'; import { ITheme, IThemeService, getThemeTypeSelector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IDiffLinesChange, InlineDiffMargin } from 'vs/editor/browser/widget/inlineDiffMargin'; @@ -2209,4 +2209,32 @@ registerThemingParticipant((theme, collector) => { if (border) { collector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${border}; }`); } + + const scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground); + if (scrollbarSliderBackgroundColor) { + collector.addRule(` + .monaco-diff-editor .diffViewport { + background: ${scrollbarSliderBackgroundColor}; + } + `); + } + + const scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground); + if (scrollbarSliderHoverBackgroundColor) { + collector.addRule(` + .monaco-diff-editor .diffViewport:hover { + background: ${scrollbarSliderHoverBackgroundColor}; + } + `); + } + + const scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground); + if (scrollbarSliderActiveBackgroundColor) { + collector.addRule(` + .monaco-diff-editor .diffViewport:active { + background: ${scrollbarSliderActiveBackgroundColor}; + } + `); + } + }); diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts index 5280cfea434..ea118c2511a 100644 --- a/src/vs/workbench/browser/style.ts +++ b/src/vs/workbench/browser/style.ts @@ -86,10 +86,6 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider { background: ${scrollbarSliderBackgroundColor}; } - - .monaco-workbench .monaco-diff-editor .diffViewport { - background: ${scrollbarSliderBackgroundColor}; - } `); } @@ -99,10 +95,6 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${scrollbarSliderHoverBackgroundColor}; } - - .monaco-workbench .monaco-diff-editor .diffViewport:hover { - background: ${scrollbarSliderHoverBackgroundColor}; - } `); } @@ -112,10 +104,6 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench .monaco-scrollable-element > .scrollbar > .slider.active { background: ${scrollbarSliderActiveBackgroundColor}; } - - .monaco-workbench .monaco-diff-editor .diffViewport:active { - background: ${scrollbarSliderActiveBackgroundColor}; - } `); } From 8c21088378525086bfa2564b0d0cbbb28b672b57 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 11:09:43 +0100 Subject: [PATCH 103/624] also publish legacy codesign --- .../darwin/product-build-darwin.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index cca56ea356c..2b24146e20a 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -128,6 +128,7 @@ steps: - script: | set -e pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd + cp ../VSCode-darwin.zip ../VSCode-darwin-legacy-signed.zip displayName: Archive build - task: PublishPipelineArtifact@0 @@ -136,6 +137,35 @@ steps: artifactName: darwin-unsigned targetPath: ../VSCode-darwin.zip +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + inputs: + ConnectedServiceName: 'ESRP CodeSign' + FolderPath: '$(agent.builddirectory)' + Pattern: 'VSCode-darwin-legacy-signed.zip' + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keyCode": "CP-401337-Apple", + "operationSetCode": "MacAppDeveloperSign", + "parameters": [ ], + "toolName": "sign", + "toolVersion": "1.0" + } + ] + SessionTimeout: 60 + displayName: 'Legacy Codesign' + +- script: | + zip -d ../VSCode-darwin-legacy-signed.zip "*.pkg" + displayName: Clean Archive + +- task: PublishPipelineArtifact@0 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: darwin-legacy-signed + targetPath: ../VSCode-darwin-legacy-signed.zip + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: ConnectedServiceName: 'ESRP CodeSign' From dffdccf821a10c52f2417eb41d9d0845e15a8290 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 11:44:33 +0100 Subject: [PATCH 104/624] Adopt API changes --- .../common/standalone/standaloneEnums.ts | 161 ++++++++--------- .../contrib/focusOnHover/focusOnHover.ts | 29 ++-- src/vs/monaco.d.ts | 162 +++++++++--------- 3 files changed, 173 insertions(+), 179 deletions(-) diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index a828c6bd946..b508fcb05e4 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -195,86 +195,87 @@ export enum EditorOption { fastScrollSensitivity = 27, find = 28, fixedOverflowWidgets = 29, - folding = 30, - foldingStrategy = 31, - foldingHighlight = 32, - fontFamily = 33, - fontInfo = 34, - fontLigatures = 35, - fontSize = 36, - fontWeight = 37, - formatOnPaste = 38, - formatOnType = 39, - glyphMargin = 40, - gotoLocation = 41, - hideCursorInOverviewRuler = 42, - highlightActiveIndentGuide = 43, - hover = 44, - inDiffEditor = 45, - letterSpacing = 46, - lightbulb = 47, - lineDecorationsWidth = 48, - lineHeight = 49, - lineNumbers = 50, - lineNumbersMinChars = 51, - links = 52, - matchBrackets = 53, - minimap = 54, - mouseStyle = 55, - mouseWheelScrollSensitivity = 56, - mouseWheelZoom = 57, - multiCursorMergeOverlapping = 58, - multiCursorModifier = 59, - multiCursorPaste = 60, - occurrencesHighlight = 61, - overviewRulerBorder = 62, - overviewRulerLanes = 63, - parameterHints = 64, - peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - semanticHighlighting = 84, - showFoldingControls = 85, - showUnused = 86, - snippetSuggestions = 87, - smoothScrolling = 88, - stopRenderingLineAfter = 89, - suggest = 90, - suggestFontSize = 91, - suggestLineHeight = 92, - suggestOnTriggerCharacters = 93, - suggestSelection = 94, - tabCompletion = 95, - useTabStops = 96, - wordSeparators = 97, - wordWrap = 98, - wordWrapBreakAfterCharacters = 99, - wordWrapBreakBeforeCharacters = 100, - wordWrapColumn = 101, - wordWrapMinified = 102, - wrappingIndent = 103, - wrappingStrategy = 104, - editorClassName = 105, - pixelRatio = 106, - tabFocusMode = 107, - layoutInfo = 108, - wrappingInfo = 109 + focusOnHover = 30, + folding = 31, + foldingStrategy = 32, + foldingHighlight = 33, + fontFamily = 34, + fontInfo = 35, + fontLigatures = 36, + fontSize = 37, + fontWeight = 38, + formatOnPaste = 39, + formatOnType = 40, + glyphMargin = 41, + gotoLocation = 42, + hideCursorInOverviewRuler = 43, + highlightActiveIndentGuide = 44, + hover = 45, + inDiffEditor = 46, + letterSpacing = 47, + lightbulb = 48, + lineDecorationsWidth = 49, + lineHeight = 50, + lineNumbers = 51, + lineNumbersMinChars = 52, + links = 53, + matchBrackets = 54, + minimap = 55, + mouseStyle = 56, + mouseWheelScrollSensitivity = 57, + mouseWheelZoom = 58, + multiCursorMergeOverlapping = 59, + multiCursorModifier = 60, + multiCursorPaste = 61, + occurrencesHighlight = 62, + overviewRulerBorder = 63, + overviewRulerLanes = 64, + parameterHints = 65, + peekWidgetDefaultFocus = 66, + quickSuggestions = 67, + quickSuggestionsDelay = 68, + readOnly = 69, + renderControlCharacters = 70, + renderIndentGuides = 71, + renderFinalNewline = 72, + renderLineHighlight = 73, + renderValidationDecorations = 74, + renderWhitespace = 75, + revealHorizontalRightPadding = 76, + roundedSelection = 77, + rulers = 78, + scrollbar = 79, + scrollBeyondLastColumn = 80, + scrollBeyondLastLine = 81, + selectionClipboard = 82, + selectionHighlight = 83, + selectOnLineNumbers = 84, + semanticHighlighting = 85, + showFoldingControls = 86, + showUnused = 87, + snippetSuggestions = 88, + smoothScrolling = 89, + stopRenderingLineAfter = 90, + suggest = 91, + suggestFontSize = 92, + suggestLineHeight = 93, + suggestOnTriggerCharacters = 94, + suggestSelection = 95, + tabCompletion = 96, + useTabStops = 97, + wordSeparators = 98, + wordWrap = 99, + wordWrapBreakAfterCharacters = 100, + wordWrapBreakBeforeCharacters = 101, + wordWrapColumn = 102, + wordWrapMinified = 103, + wrappingIndent = 104, + wrappingStrategy = 105, + editorClassName = 106, + pixelRatio = 107, + tabFocusMode = 108, + layoutInfo = 109, + wrappingInfo = 110 } /** diff --git a/src/vs/editor/contrib/focusOnHover/focusOnHover.ts b/src/vs/editor/contrib/focusOnHover/focusOnHover.ts index d715017fd0c..81509872010 100644 --- a/src/vs/editor/contrib/focusOnHover/focusOnHover.ts +++ b/src/vs/editor/contrib/focusOnHover/focusOnHover.ts @@ -3,34 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -export class FocusOnHoverController implements IEditorContribution { +export class FocusOnHoverController extends Disposable implements IEditorContribution { - private static readonly ID = 'editor.contrib.focusOnHover'; + public static readonly ID = 'editor.contrib.focusOnHover'; private _editorMouseMoveHandler: IDisposable | null; - private _didChangeConfigurationHandler: IDisposable; - - static get(editor: ICodeEditor): FocusOnHoverController { - return editor.getContribution(FocusOnHoverController.ID); - } constructor(private readonly _editor: ICodeEditor) { - this._hookEvents(); + super(); + this._editorMouseMoveHandler = null; - this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._hookEvents(); + this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.focusOnHover)) { this._unhookEvents(); this._hookEvents(); } - }); + })); } private _hookEvents(): void { @@ -52,14 +47,10 @@ export class FocusOnHoverController implements IEditorContribution { } } - public getId(): string { - return FocusOnHoverController.ID; - } - public dispose(): void { + super.dispose(); this._unhookEvents(); - this._didChangeConfigurationHandler.dispose(); } } -registerEditorContribution(FocusOnHoverController); +registerEditorContribution(FocusOnHoverController.ID, FocusOnHoverController); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 5650a1bc6e1..1b6ec0079ee 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3729,86 +3729,87 @@ declare namespace monaco.editor { fastScrollSensitivity = 27, find = 28, fixedOverflowWidgets = 29, - folding = 30, - foldingStrategy = 31, - foldingHighlight = 32, - fontFamily = 33, - fontInfo = 34, - fontLigatures = 35, - fontSize = 36, - fontWeight = 37, - formatOnPaste = 38, - formatOnType = 39, - glyphMargin = 40, - gotoLocation = 41, - hideCursorInOverviewRuler = 42, - highlightActiveIndentGuide = 43, - hover = 44, - inDiffEditor = 45, - letterSpacing = 46, - lightbulb = 47, - lineDecorationsWidth = 48, - lineHeight = 49, - lineNumbers = 50, - lineNumbersMinChars = 51, - links = 52, - matchBrackets = 53, - minimap = 54, - mouseStyle = 55, - mouseWheelScrollSensitivity = 56, - mouseWheelZoom = 57, - multiCursorMergeOverlapping = 58, - multiCursorModifier = 59, - multiCursorPaste = 60, - occurrencesHighlight = 61, - overviewRulerBorder = 62, - overviewRulerLanes = 63, - parameterHints = 64, - peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - semanticHighlighting = 84, - showFoldingControls = 85, - showUnused = 86, - snippetSuggestions = 87, - smoothScrolling = 88, - stopRenderingLineAfter = 89, - suggest = 90, - suggestFontSize = 91, - suggestLineHeight = 92, - suggestOnTriggerCharacters = 93, - suggestSelection = 94, - tabCompletion = 95, - useTabStops = 96, - wordSeparators = 97, - wordWrap = 98, - wordWrapBreakAfterCharacters = 99, - wordWrapBreakBeforeCharacters = 100, - wordWrapColumn = 101, - wordWrapMinified = 102, - wrappingIndent = 103, - wrappingStrategy = 104, - editorClassName = 105, - pixelRatio = 106, - tabFocusMode = 107, - layoutInfo = 108, - wrappingInfo = 109 + focusOnHover = 30, + folding = 31, + foldingStrategy = 32, + foldingHighlight = 33, + fontFamily = 34, + fontInfo = 35, + fontLigatures = 36, + fontSize = 37, + fontWeight = 38, + formatOnPaste = 39, + formatOnType = 40, + glyphMargin = 41, + gotoLocation = 42, + hideCursorInOverviewRuler = 43, + highlightActiveIndentGuide = 44, + hover = 45, + inDiffEditor = 46, + letterSpacing = 47, + lightbulb = 48, + lineDecorationsWidth = 49, + lineHeight = 50, + lineNumbers = 51, + lineNumbersMinChars = 52, + links = 53, + matchBrackets = 54, + minimap = 55, + mouseStyle = 56, + mouseWheelScrollSensitivity = 57, + mouseWheelZoom = 58, + multiCursorMergeOverlapping = 59, + multiCursorModifier = 60, + multiCursorPaste = 61, + occurrencesHighlight = 62, + overviewRulerBorder = 63, + overviewRulerLanes = 64, + parameterHints = 65, + peekWidgetDefaultFocus = 66, + quickSuggestions = 67, + quickSuggestionsDelay = 68, + readOnly = 69, + renderControlCharacters = 70, + renderIndentGuides = 71, + renderFinalNewline = 72, + renderLineHighlight = 73, + renderValidationDecorations = 74, + renderWhitespace = 75, + revealHorizontalRightPadding = 76, + roundedSelection = 77, + rulers = 78, + scrollbar = 79, + scrollBeyondLastColumn = 80, + scrollBeyondLastLine = 81, + selectionClipboard = 82, + selectionHighlight = 83, + selectOnLineNumbers = 84, + semanticHighlighting = 85, + showFoldingControls = 86, + showUnused = 87, + snippetSuggestions = 88, + smoothScrolling = 89, + stopRenderingLineAfter = 90, + suggest = 91, + suggestFontSize = 92, + suggestLineHeight = 93, + suggestOnTriggerCharacters = 94, + suggestSelection = 95, + tabCompletion = 96, + useTabStops = 97, + wordSeparators = 98, + wordWrap = 99, + wordWrapBreakAfterCharacters = 100, + wordWrapBreakBeforeCharacters = 101, + wordWrapColumn = 102, + wordWrapMinified = 103, + wrappingIndent = 104, + wrappingStrategy = 105, + editorClassName = 106, + pixelRatio = 107, + tabFocusMode = 108, + layoutInfo = 109, + wrappingInfo = 110 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3841,6 +3842,7 @@ declare namespace monaco.editor { fastScrollSensitivity: IEditorOption; find: IEditorOption; fixedOverflowWidgets: IEditorOption; + focusOnHover: IEditorOption; folding: IEditorOption; foldingStrategy: IEditorOption; foldingHighlight: IEditorOption; From b790d7af218629bc3955d8a5f7c333caff705001 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 11:51:26 +0100 Subject: [PATCH 105/624] Revert "Merge pull request #53963 from 71/focus-on-hover" This reverts commit 5f58ff53438a55a64dbf81370ac3607319307937, reversing changes made to 6346697d9d46acb109a885853cd0d5c210876a61. --- src/vs/editor/common/config/editorOptions.ts | 9 - .../common/standalone/standaloneEnums.ts | 161 +++++++++-------- .../contrib/focusOnHover/focusOnHover.ts | 56 ------ src/vs/editor/editor.all.ts | 1 - src/vs/monaco.d.ts | 166 +++++++++--------- 5 files changed, 160 insertions(+), 233 deletions(-) delete mode 100644 src/vs/editor/contrib/focusOnHover/focusOnHover.ts diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index aa0c4de1164..163833a04d3 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -550,10 +550,6 @@ export interface IEditorOptions { * Controls fading out of unused variables. */ showUnused?: boolean; - /** - * Controls whether editors should be focused on hover. - */ - focusOnHover?: boolean; /** * Controls whether to focus the inline editor in the peek widget by default. * Defaults to false. @@ -3160,7 +3156,6 @@ export const enum EditorOption { fastScrollSensitivity, find, fixedOverflowWidgets, - focusOnHover, folding, foldingStrategy, foldingHighlight, @@ -3437,10 +3432,6 @@ export const EditorOptions = { fixedOverflowWidgets: register(new EditorBooleanOption( EditorOption.fixedOverflowWidgets, 'fixedOverflowWidgets', false, )), - focusOnHover: register(new EditorBooleanOption( - EditorOption.focusOnHover, 'focusOnHover', false, - { description: nls.localize('focusOnHover', "Controls whether editors should be focused when hovered.") } - )), folding: register(new EditorBooleanOption( EditorOption.folding, 'folding', true, { description: nls.localize('folding', "Controls whether the editor has code folding enabled.") } diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index b508fcb05e4..a828c6bd946 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -195,87 +195,86 @@ export enum EditorOption { fastScrollSensitivity = 27, find = 28, fixedOverflowWidgets = 29, - focusOnHover = 30, - folding = 31, - foldingStrategy = 32, - foldingHighlight = 33, - fontFamily = 34, - fontInfo = 35, - fontLigatures = 36, - fontSize = 37, - fontWeight = 38, - formatOnPaste = 39, - formatOnType = 40, - glyphMargin = 41, - gotoLocation = 42, - hideCursorInOverviewRuler = 43, - highlightActiveIndentGuide = 44, - hover = 45, - inDiffEditor = 46, - letterSpacing = 47, - lightbulb = 48, - lineDecorationsWidth = 49, - lineHeight = 50, - lineNumbers = 51, - lineNumbersMinChars = 52, - links = 53, - matchBrackets = 54, - minimap = 55, - mouseStyle = 56, - mouseWheelScrollSensitivity = 57, - mouseWheelZoom = 58, - multiCursorMergeOverlapping = 59, - multiCursorModifier = 60, - multiCursorPaste = 61, - occurrencesHighlight = 62, - overviewRulerBorder = 63, - overviewRulerLanes = 64, - parameterHints = 65, - peekWidgetDefaultFocus = 66, - quickSuggestions = 67, - quickSuggestionsDelay = 68, - readOnly = 69, - renderControlCharacters = 70, - renderIndentGuides = 71, - renderFinalNewline = 72, - renderLineHighlight = 73, - renderValidationDecorations = 74, - renderWhitespace = 75, - revealHorizontalRightPadding = 76, - roundedSelection = 77, - rulers = 78, - scrollbar = 79, - scrollBeyondLastColumn = 80, - scrollBeyondLastLine = 81, - selectionClipboard = 82, - selectionHighlight = 83, - selectOnLineNumbers = 84, - semanticHighlighting = 85, - showFoldingControls = 86, - showUnused = 87, - snippetSuggestions = 88, - smoothScrolling = 89, - stopRenderingLineAfter = 90, - suggest = 91, - suggestFontSize = 92, - suggestLineHeight = 93, - suggestOnTriggerCharacters = 94, - suggestSelection = 95, - tabCompletion = 96, - useTabStops = 97, - wordSeparators = 98, - wordWrap = 99, - wordWrapBreakAfterCharacters = 100, - wordWrapBreakBeforeCharacters = 101, - wordWrapColumn = 102, - wordWrapMinified = 103, - wrappingIndent = 104, - wrappingStrategy = 105, - editorClassName = 106, - pixelRatio = 107, - tabFocusMode = 108, - layoutInfo = 109, - wrappingInfo = 110 + folding = 30, + foldingStrategy = 31, + foldingHighlight = 32, + fontFamily = 33, + fontInfo = 34, + fontLigatures = 35, + fontSize = 36, + fontWeight = 37, + formatOnPaste = 38, + formatOnType = 39, + glyphMargin = 40, + gotoLocation = 41, + hideCursorInOverviewRuler = 42, + highlightActiveIndentGuide = 43, + hover = 44, + inDiffEditor = 45, + letterSpacing = 46, + lightbulb = 47, + lineDecorationsWidth = 48, + lineHeight = 49, + lineNumbers = 50, + lineNumbersMinChars = 51, + links = 52, + matchBrackets = 53, + minimap = 54, + mouseStyle = 55, + mouseWheelScrollSensitivity = 56, + mouseWheelZoom = 57, + multiCursorMergeOverlapping = 58, + multiCursorModifier = 59, + multiCursorPaste = 60, + occurrencesHighlight = 61, + overviewRulerBorder = 62, + overviewRulerLanes = 63, + parameterHints = 64, + peekWidgetDefaultFocus = 65, + quickSuggestions = 66, + quickSuggestionsDelay = 67, + readOnly = 68, + renderControlCharacters = 69, + renderIndentGuides = 70, + renderFinalNewline = 71, + renderLineHighlight = 72, + renderValidationDecorations = 73, + renderWhitespace = 74, + revealHorizontalRightPadding = 75, + roundedSelection = 76, + rulers = 77, + scrollbar = 78, + scrollBeyondLastColumn = 79, + scrollBeyondLastLine = 80, + selectionClipboard = 81, + selectionHighlight = 82, + selectOnLineNumbers = 83, + semanticHighlighting = 84, + showFoldingControls = 85, + showUnused = 86, + snippetSuggestions = 87, + smoothScrolling = 88, + stopRenderingLineAfter = 89, + suggest = 90, + suggestFontSize = 91, + suggestLineHeight = 92, + suggestOnTriggerCharacters = 93, + suggestSelection = 94, + tabCompletion = 95, + useTabStops = 96, + wordSeparators = 97, + wordWrap = 98, + wordWrapBreakAfterCharacters = 99, + wordWrapBreakBeforeCharacters = 100, + wordWrapColumn = 101, + wordWrapMinified = 102, + wrappingIndent = 103, + wrappingStrategy = 104, + editorClassName = 105, + pixelRatio = 106, + tabFocusMode = 107, + layoutInfo = 108, + wrappingInfo = 109 } /** diff --git a/src/vs/editor/contrib/focusOnHover/focusOnHover.ts b/src/vs/editor/contrib/focusOnHover/focusOnHover.ts deleted file mode 100644 index 81509872010..00000000000 --- a/src/vs/editor/contrib/focusOnHover/focusOnHover.ts +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; - -export class FocusOnHoverController extends Disposable implements IEditorContribution { - - public static readonly ID = 'editor.contrib.focusOnHover'; - - private _editorMouseMoveHandler: IDisposable | null; - - constructor(private readonly _editor: ICodeEditor) { - super(); - this._editorMouseMoveHandler = null; - - this._hookEvents(); - this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { - if (e.hasChanged(EditorOption.focusOnHover)) { - this._unhookEvents(); - this._hookEvents(); - } - })); - } - - private _hookEvents(): void { - if (this._editor.getOption(EditorOption.focusOnHover)) { - this._editorMouseMoveHandler = this._editor.onMouseMove(_ => this._onEditorMouseMove()); - } - } - - private _unhookEvents(): void { - if (this._editorMouseMoveHandler) { - this._editorMouseMoveHandler.dispose(); - this._editorMouseMoveHandler = null; - } - } - - private _onEditorMouseMove(): void { - if (!this._editor.hasTextFocus()) { - this._editor.focus(); - } - } - - public dispose(): void { - super.dispose(); - this._unhookEvents(); - } -} - -registerEditorContribution(FocusOnHoverController.ID, FocusOnHoverController); diff --git a/src/vs/editor/editor.all.ts b/src/vs/editor/editor.all.ts index b5b83c3ed61..31a6ad0497b 100644 --- a/src/vs/editor/editor.all.ts +++ b/src/vs/editor/editor.all.ts @@ -19,7 +19,6 @@ import 'vs/editor/contrib/contextmenu/contextmenu'; import 'vs/editor/contrib/cursorUndo/cursorUndo'; import 'vs/editor/contrib/dnd/dnd'; import 'vs/editor/contrib/find/findController'; -import 'vs/editor/contrib/focusOnHover/focusOnHover'; import 'vs/editor/contrib/folding/folding'; import 'vs/editor/contrib/fontZoom/fontZoom'; import 'vs/editor/contrib/format/formatActions'; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 1b6ec0079ee..35f5ded808f 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3030,10 +3030,6 @@ declare namespace monaco.editor { * Controls fading out of unused variables. */ showUnused?: boolean; - /** - * Controls whether editors should be focused on hover. - */ - focusOnHover?: boolean; /** * Controls whether to focus the inline editor in the peek widget by default. * Defaults to false. @@ -3729,87 +3725,86 @@ declare namespace monaco.editor { fastScrollSensitivity = 27, find = 28, fixedOverflowWidgets = 29, - focusOnHover = 30, - folding = 31, - foldingStrategy = 32, - foldingHighlight = 33, - fontFamily = 34, - fontInfo = 35, - fontLigatures = 36, - fontSize = 37, - fontWeight = 38, - formatOnPaste = 39, - formatOnType = 40, - glyphMargin = 41, - gotoLocation = 42, - hideCursorInOverviewRuler = 43, - highlightActiveIndentGuide = 44, - hover = 45, - inDiffEditor = 46, - letterSpacing = 47, - lightbulb = 48, - lineDecorationsWidth = 49, - lineHeight = 50, - lineNumbers = 51, - lineNumbersMinChars = 52, - links = 53, - matchBrackets = 54, - minimap = 55, - mouseStyle = 56, - mouseWheelScrollSensitivity = 57, - mouseWheelZoom = 58, - multiCursorMergeOverlapping = 59, - multiCursorModifier = 60, - multiCursorPaste = 61, - occurrencesHighlight = 62, - overviewRulerBorder = 63, - overviewRulerLanes = 64, - parameterHints = 65, - peekWidgetDefaultFocus = 66, - quickSuggestions = 67, - quickSuggestionsDelay = 68, - readOnly = 69, - renderControlCharacters = 70, - renderIndentGuides = 71, - renderFinalNewline = 72, - renderLineHighlight = 73, - renderValidationDecorations = 74, - renderWhitespace = 75, - revealHorizontalRightPadding = 76, - roundedSelection = 77, - rulers = 78, - scrollbar = 79, - scrollBeyondLastColumn = 80, - scrollBeyondLastLine = 81, - selectionClipboard = 82, - selectionHighlight = 83, - selectOnLineNumbers = 84, - semanticHighlighting = 85, - showFoldingControls = 86, - showUnused = 87, - snippetSuggestions = 88, - smoothScrolling = 89, - stopRenderingLineAfter = 90, - suggest = 91, - suggestFontSize = 92, - suggestLineHeight = 93, - suggestOnTriggerCharacters = 94, - suggestSelection = 95, - tabCompletion = 96, - useTabStops = 97, - wordSeparators = 98, - wordWrap = 99, - wordWrapBreakAfterCharacters = 100, - wordWrapBreakBeforeCharacters = 101, - wordWrapColumn = 102, - wordWrapMinified = 103, - wrappingIndent = 104, - wrappingStrategy = 105, - editorClassName = 106, - pixelRatio = 107, - tabFocusMode = 108, - layoutInfo = 109, - wrappingInfo = 110 + folding = 30, + foldingStrategy = 31, + foldingHighlight = 32, + fontFamily = 33, + fontInfo = 34, + fontLigatures = 35, + fontSize = 36, + fontWeight = 37, + formatOnPaste = 38, + formatOnType = 39, + glyphMargin = 40, + gotoLocation = 41, + hideCursorInOverviewRuler = 42, + highlightActiveIndentGuide = 43, + hover = 44, + inDiffEditor = 45, + letterSpacing = 46, + lightbulb = 47, + lineDecorationsWidth = 48, + lineHeight = 49, + lineNumbers = 50, + lineNumbersMinChars = 51, + links = 52, + matchBrackets = 53, + minimap = 54, + mouseStyle = 55, + mouseWheelScrollSensitivity = 56, + mouseWheelZoom = 57, + multiCursorMergeOverlapping = 58, + multiCursorModifier = 59, + multiCursorPaste = 60, + occurrencesHighlight = 61, + overviewRulerBorder = 62, + overviewRulerLanes = 63, + parameterHints = 64, + peekWidgetDefaultFocus = 65, + quickSuggestions = 66, + quickSuggestionsDelay = 67, + readOnly = 68, + renderControlCharacters = 69, + renderIndentGuides = 70, + renderFinalNewline = 71, + renderLineHighlight = 72, + renderValidationDecorations = 73, + renderWhitespace = 74, + revealHorizontalRightPadding = 75, + roundedSelection = 76, + rulers = 77, + scrollbar = 78, + scrollBeyondLastColumn = 79, + scrollBeyondLastLine = 80, + selectionClipboard = 81, + selectionHighlight = 82, + selectOnLineNumbers = 83, + semanticHighlighting = 84, + showFoldingControls = 85, + showUnused = 86, + snippetSuggestions = 87, + smoothScrolling = 88, + stopRenderingLineAfter = 89, + suggest = 90, + suggestFontSize = 91, + suggestLineHeight = 92, + suggestOnTriggerCharacters = 93, + suggestSelection = 94, + tabCompletion = 95, + useTabStops = 96, + wordSeparators = 97, + wordWrap = 98, + wordWrapBreakAfterCharacters = 99, + wordWrapBreakBeforeCharacters = 100, + wordWrapColumn = 101, + wordWrapMinified = 102, + wrappingIndent = 103, + wrappingStrategy = 104, + editorClassName = 105, + pixelRatio = 106, + tabFocusMode = 107, + layoutInfo = 108, + wrappingInfo = 109 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3842,7 +3837,6 @@ declare namespace monaco.editor { fastScrollSensitivity: IEditorOption; find: IEditorOption; fixedOverflowWidgets: IEditorOption; - focusOnHover: IEditorOption; folding: IEditorOption; foldingStrategy: IEditorOption; foldingHighlight: IEditorOption; From f86418ac57dd63a7047141245f8558a55e5598db Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 12:14:55 +0100 Subject: [PATCH 106/624] Fix bad merge --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 30ccf466b08..4c94e8b0512 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "applicationinsights": "1.0.8", "chokidar": "3.2.3", - "graceful-fs": "4.1.11", + "graceful-fs": "4.2.3", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.3", "iconv-lite": "0.5.0", From d60bf2357cacd342ce9882ed0f8fdf7600433377 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 4 Feb 2020 12:25:19 +0100 Subject: [PATCH 107/624] #89993 Enhance views service - register viewlets and panels for containers - events when view visibility has changed - small refactorings --- .../browser/parts/views/viewPaneContainer.ts | 25 +++- src/vs/workbench/browser/parts/views/views.ts | 115 ++++++++++++++++-- .../browser/parts/views/viewsViewlet.ts | 4 +- .../browser/workbench.contribution.ts | 86 ------------- src/vs/workbench/common/views.ts | 13 +- .../extensions/browser/extensionsViewlet.ts | 4 +- .../contrib/remote/browser/remote.ts | 4 +- 7 files changed, 141 insertions(+), 110 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts index 9ae27329a50..c314a406254 100644 --- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts +++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts @@ -293,6 +293,14 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { private readonly _onDidChangeVisibility = this._register(new Emitter()); readonly onDidChangeVisibility = this._onDidChangeVisibility.event; + private readonly _onDidAddViews = this._register(new Emitter()); + readonly onDidAddViews = this._onDidAddViews.event; + + private readonly _onDidRemoveViews = this._register(new Emitter()); + readonly onDidRemoveViews = this._onDidRemoveViews.event; + + private readonly _onDidChangeViewVisibility = this._register(new Emitter()); + readonly onDidChangeViewVisibility = this._onDidChangeViewVisibility.event; get onDidSashChange(): Event { return assertIsDefined(this.paneview).onDidSashChange; @@ -347,15 +355,15 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { this._register(addDisposableListener(parent, EventType.CONTEXT_MENU, (e: MouseEvent) => this.showContextMenu(new StandardMouseEvent(e)))); this._register(this.onDidSashChange(() => this.saveViewSizes())); - this.viewsModel.onDidAdd(added => this.onDidAddViews(added)); - this.viewsModel.onDidRemove(removed => this.onDidRemoveViews(removed)); + this.viewsModel.onDidAdd(added => this.onDidAddViewDescriptors(added)); + this.viewsModel.onDidRemove(removed => this.onDidRemoveViewDescriptors(removed)); const addedViews: IAddedViewDescriptorRef[] = this.viewsModel.visibleViewDescriptors.map((viewDescriptor, index) => { const size = this.viewsModel.getSize(viewDescriptor.id); const collapsed = this.viewsModel.isCollapsed(viewDescriptor.id); return ({ viewDescriptor, index, size, collapsed }); }); if (addedViews.length) { - this.onDidAddViews(addedViews); + this.onDidAddViewDescriptors(addedViews); } // Update headers after and title contributed views after available, since we read from cache in the beginning to know if the viewlet has single view or not. Ref #29609 @@ -503,6 +511,8 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { if (this.isViewMergedWithContainer() !== wasMerged) { this.updateTitleArea(); } + + this._onDidAddViews.fire(panes.map(({ pane }) => pane)); } setVisible(visible: boolean): void { @@ -606,7 +616,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { return view; } - protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewPane[] { + protected onDidAddViewDescriptors(added: IAddedViewDescriptorRef[]): ViewPane[] { const panesToAdd: { pane: ViewPane, size: number, index: number }[] = []; for (const { viewDescriptor, collapsed, index, size } of added) { @@ -653,7 +663,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { return this.actionRunner; } - private onDidRemoveViews(removed: IViewDescriptorRef[]): void { + private onDidRemoveViewDescriptors(removed: IViewDescriptorRef[]): void { removed = removed.sort((a, b) => b.index - a.index); const panesToRemove: ViewPane[] = []; for (const { index } of removed) { @@ -682,6 +692,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { this.updateTitleArea(); } }); + const onDidChangeVisibility = pane.onDidChangeBodyVisibility(() => this._onDidChangeViewVisibility.fire(pane)); const onDidChange = pane.onDidChange(() => { if (pane === this.lastFocusedPane && !pane.isExpanded()) { this.lastFocusedPane = undefined; @@ -695,7 +706,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { headerBorder: SIDE_BAR_SECTION_HEADER_BORDER, dropBackground: SIDE_BAR_DRAG_AND_DROP_BACKGROUND }, pane); - const disposable = combinedDisposable(onDidFocus, onDidChangeTitleArea, paneStyler, onDidChange); + const disposable = combinedDisposable(onDidFocus, onDidChangeTitleArea, paneStyler, onDidChange, onDidChangeVisibility); const paneItem: IViewPaneItem = { pane: pane, disposable }; this.paneItems.splice(index, 0, paneItem); @@ -711,6 +722,8 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { if (wasMerged !== this.isViewMergedWithContainer()) { this.updateTitleArea(); } + + this._onDidRemoveViews.fire(panes); } private removePane(pane: ViewPane): void { diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 83706144b5a..52ecfe80c29 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -12,7 +12,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; import { firstIndex, move } from 'vs/base/common/arrays'; -import { isUndefinedOrNull, isUndefined } from 'vs/base/common/types'; +import { isUndefinedOrNull, isUndefined, isString } from 'vs/base/common/types'; import { MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; import { localize } from 'vs/nls'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -22,9 +22,19 @@ import { toggleClass, addClass } from 'vs/base/browser/dom'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IPaneComposite } from 'vs/workbench/common/panecomposite'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import type { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { PaneComposite } from 'vs/workbench/browser/panecomposite'; +import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { VIEW_ID as SEARCH_VIEW_ID } from 'vs/workbench/services/search/common/search'; +import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; +import { PaneCompositePanel, PanelRegistry, PanelDescriptor, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { Viewlet, ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; +import { URI } from 'vs/base/common/uri'; export interface IViewState { visibleGlobal: boolean | undefined; @@ -451,10 +461,14 @@ export class ViewsService extends Disposable implements IViewsService { private readonly viewContainersRegistry: IViewContainersRegistry; private readonly viewDisposable: Map; + private readonly _onDidChangeViewVisibility: Emitter<{ id: string, visible: boolean }> = this._register(new Emitter<{ id: string, visible: boolean }>()); + readonly onDidChangeViewVisibility: Event<{ id: string, visible: boolean }> = this._onDidChangeViewVisibility.event; + constructor( @IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService, @IPanelService private readonly panelService: IPanelService, - @IViewletService private readonly viewletService: IViewletService + @IViewletService private readonly viewletService: IViewletService, + @IInstantiationService private readonly instantiationService: IInstantiationService, ) { super(); @@ -466,11 +480,11 @@ export class ViewsService extends Disposable implements IViewsService { this.viewDisposable.clear(); })); - this.viewContainersRegistry.all.forEach(viewContainer => this.onViewContainerRegistered(viewContainer)); - this._register(this.viewContainersRegistry.onDidRegister(({ viewContainer }) => this.onViewContainerRegistered(viewContainer))); + this.viewContainersRegistry.all.forEach(viewContainer => this.onDidRegisterViewContainer(viewContainer, this.viewContainersRegistry.getViewContainerLocation(viewContainer))); + this._register(this.viewContainersRegistry.onDidRegister(({ viewContainer, viewContainerLocation }) => this.onDidRegisterViewContainer(viewContainer, viewContainerLocation))); } - private onViewContainerRegistered(viewContainer: ViewContainer): void { + private onDidRegisterViewContainer(viewContainer: ViewContainer, location: ViewContainerLocation): void { const viewDescriptorCollection = this.viewDescriptorService.getViewDescriptors(viewContainer); this.onViewsAdded(viewDescriptorCollection.allViewDescriptors, viewContainer); this._register(viewDescriptorCollection.onDidChangeViews(({ added, removed }) => { @@ -577,7 +591,7 @@ export class ViewsService extends Disposable implements IViewsService { return undefined; } - getActiveViewWithId(id: string): IView | null { + getActiveViewWithId(id: string): T | null { const viewContainer = this.viewDescriptorService.getViewContainer(id); if (viewContainer) { const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); @@ -585,12 +599,12 @@ export class ViewsService extends Disposable implements IViewsService { if (location === ViewContainerLocation.Sidebar) { const activeViewlet = this.viewletService.getActiveViewlet(); if (activeViewlet?.getId() === viewContainer.id) { - return activeViewlet.getViewPaneContainer().getView(id) ?? null; + return activeViewlet.getViewPaneContainer().getView(id) as T ?? null; } } else if (location === ViewContainerLocation.Panel) { const activePanel = this.panelService.getActivePanel(); - if (activePanel?.getId() === viewContainer.id && activePanel instanceof PaneComposite) { - return activePanel.getViewPaneContainer().getView(id) ?? null; + if (activePanel?.getId() === viewContainer.id) { + return (activePanel as IPaneComposite).getViewPaneContainer().getView(id) as T ?? null; } } } @@ -613,6 +627,14 @@ export class ViewsService extends Disposable implements IViewsService { return null; } + + createContainer(container: ViewContainer): ViewPaneContainer { + const viewPaneContainer: ViewPaneContainer = this._register((this.instantiationService as any).createInstance(container.ctorDescriptor!.ctor, ...(container.ctorDescriptor!.staticArguments || []))); + this._register(viewPaneContainer.onDidAddViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() })))); + this._register(viewPaneContainer.onDidChangeViewVisibility(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() }))); + this._register(viewPaneContainer.onDidRemoveViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: false })))); + return viewPaneContainer; + } } export function createFileIconThemableTreeContainerScope(container: HTMLElement, themeService: IWorkbenchThemeService): IDisposable { @@ -629,3 +651,74 @@ export function createFileIconThemableTreeContainerScope(container: HTMLElement, } registerSingleton(IViewsService, ViewsService); + +// Viewlets & Panels +(function registerViewletsAndPanels(): void { + const registerPanel = (viewContainer: ViewContainer): void => { + class PaneContainerPanel extends PaneCompositePanel { + constructor( + @ITelemetryService telemetryService: ITelemetryService, + @IStorageService storageService: IStorageService, + @IInstantiationService instantiationService: IInstantiationService, + @IThemeService themeService: IThemeService, + @IContextMenuService contextMenuService: IContextMenuService, + @IExtensionService extensionService: IExtensionService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IViewsService viewsService: ViewsService + ) { + super(viewContainer.id, viewsService.createContainer(viewContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); + } + } + Registry.as(PanelExtensions.Panels).registerPanel(PanelDescriptor.create( + PaneContainerPanel, + viewContainer.id, + viewContainer.name, + isString(viewContainer.icon) ? viewContainer.icon : undefined, + viewContainer.order, + viewContainer.focusCommand?.id, + )); + }; + + const registerViewlet = (viewContainer: ViewContainer): void => { + class PaneContainerViewlet extends Viewlet { + constructor( + @IConfigurationService configurationService: IConfigurationService, + @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, + @ITelemetryService telemetryService: ITelemetryService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IStorageService storageService: IStorageService, + @IInstantiationService instantiationService: IInstantiationService, + @IThemeService themeService: IThemeService, + @IContextMenuService contextMenuService: IContextMenuService, + @IExtensionService extensionService: IExtensionService + ) { + super(viewContainer.id, (instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || [])), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService); + } + } + const viewletDescriptor = ViewletDescriptor.create( + PaneContainerViewlet, + viewContainer.id, + viewContainer.name, + isString(viewContainer.icon) ? viewContainer.icon : undefined, + viewContainer.order, + viewContainer.icon instanceof URI ? viewContainer.icon : undefined + ); + + Registry.as(ViewletExtensions.Viewlets).registerViewlet(viewletDescriptor); + }; + + const viewContainerRegistry = Registry.as(ViewExtensions.ViewContainersRegistry); + viewContainerRegistry.getViewContainers(ViewContainerLocation.Panel).forEach(viewContainer => registerPanel(viewContainer)); + viewContainerRegistry.onDidRegister(({ viewContainer, viewContainerLocation }) => { + switch (viewContainerLocation) { + case ViewContainerLocation.Panel: + registerPanel(viewContainer); + return; + case ViewContainerLocation.Sidebar: + if (viewContainer.ctorDescriptor) { + registerViewlet(viewContainer); + } + return; + } + }); +})(); diff --git a/src/vs/workbench/browser/parts/views/viewsViewlet.ts b/src/vs/workbench/browser/parts/views/viewsViewlet.ts index 3ededdd5bf7..b3a0ef0e024 100644 --- a/src/vs/workbench/browser/parts/views/viewsViewlet.ts +++ b/src/vs/workbench/browser/parts/views/viewsViewlet.ts @@ -130,8 +130,8 @@ export abstract class FilterViewPaneContainer extends ViewPaneContainer { return views; } - onDidAddViews(added: IAddedViewDescriptorRef[]): ViewPane[] { - const panes: ViewPane[] = super.onDidAddViews(added); + onDidAddViewDescriptors(added: IAddedViewDescriptorRef[]): ViewPane[] { + const panes: ViewPane[] = super.onDidAddViewDescriptors(added); for (let i = 0; i < added.length; i++) { if (this.constantViewDescriptors.has(added[i].viewDescriptor.id)) { panes[i].setExpanded(false); diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 1da60908997..83d6b8821a7 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -8,21 +8,6 @@ import * as nls from 'vs/nls'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; import { isMacintosh, isWindows, isLinux, isWeb, isNative } from 'vs/base/common/platform'; import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; -import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor, PaneCompositePanel } from 'vs/workbench/browser/panel'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation } from 'vs/workbench/common/views'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { Viewlet, ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; // Configuration (function registerConfiguration(): void { @@ -393,74 +378,3 @@ import { URI } from 'vs/base/common/uri'; } }); })(); - -// Viewlets & Panels -(function registerViewletsAndPanels(): void { - const registerPanel = (viewContainer: ViewContainer): void => { - class PaneContainerPanel extends PaneCompositePanel { - constructor( - @ITelemetryService telemetryService: ITelemetryService, - @IStorageService storageService: IStorageService, - @IInstantiationService instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService, - @IContextMenuService contextMenuService: IContextMenuService, - @IExtensionService extensionService: IExtensionService, - @IWorkspaceContextService contextService: IWorkspaceContextService - ) { - super(viewContainer.id, (instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || [])), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); - } - } - Registry.as(PanelExtensions.Panels).registerPanel(PanelDescriptor.create( - PaneContainerPanel, - viewContainer.id, - viewContainer.name, - isString(viewContainer.icon) ? viewContainer.icon : undefined, - viewContainer.order, - viewContainer.focusCommand?.id, - )); - }; - - const registerViewlet = (viewContainer: ViewContainer): void => { - class PaneContainerViewlet extends Viewlet { - constructor( - @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, - @ITelemetryService telemetryService: ITelemetryService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @IStorageService storageService: IStorageService, - @IEditorService editorService: IEditorService, - @IInstantiationService instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService, - @IContextMenuService contextMenuService: IContextMenuService, - @IExtensionService extensionService: IExtensionService - ) { - super(viewContainer.id, (instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || [])), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService); - } - } - const viewletDescriptor = ViewletDescriptor.create( - PaneContainerViewlet, - viewContainer.id, - viewContainer.name, - isString(viewContainer.icon) ? viewContainer.icon : undefined, - viewContainer.order, - viewContainer.icon instanceof URI ? viewContainer.icon : undefined - ); - - Registry.as(ViewletExtensions.Viewlets).registerViewlet(viewletDescriptor); - }; - - const viewContainerRegistry = Registry.as(ViewContainerExtensions.ViewContainersRegistry); - viewContainerRegistry.getViewContainers(ViewContainerLocation.Panel).forEach(viewContainer => registerPanel(viewContainer)); - viewContainerRegistry.onDidRegister(({ viewContainer, viewContainerLocation }) => { - switch (viewContainerLocation) { - case ViewContainerLocation.Panel: - registerPanel(viewContainer); - return; - case ViewContainerLocation.Sidebar: - if (viewContainer.ctorDescriptor) { - registerViewlet(viewContainer); - } - return; - } - }); -})(); diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 3b43c26044e..fbede54b565 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -341,6 +341,10 @@ export interface IView { readonly id: string; + isVisible(): boolean; + + isBodyVisible(): boolean; + } export interface IViewsViewlet extends IViewlet { @@ -354,9 +358,12 @@ export const IViewsService = createDecorator('viewsService'); export interface IViewsService { _serviceBrand: undefined; - getActiveViewWithId(id: string): IView | null; + readonly onDidChangeViewVisibility: Event<{ id: string, visible: boolean }>; + + getActiveViewWithId(id: string): T | null; openView(id: string, focus?: boolean): Promise; + } export const IViewDescriptorService = createDecorator('viewDescriptorService'); @@ -512,6 +519,10 @@ export interface IEditableData { } export interface IViewPaneContainer { + onDidAddViews: Event; + onDidRemoveViews: Event; + onDidChangeViewVisibility: Event; + setVisible(visible: boolean): void; isVisible(): boolean; focus(): void; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index f0741bcf4f5..97cc84812cb 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -536,8 +536,8 @@ export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IE ))).then(() => undefined); } - protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewPane[] { - const addedViews = super.onDidAddViews(added); + protected onDidAddViewDescriptors(added: IAddedViewDescriptorRef[]): ViewPane[] { + const addedViews = super.onDidAddViewDescriptors(added); this.progress(Promise.all(addedViews.map(addedView => (addedView).show(this.normalizedQuery()) .then(model => this.alertSearchResult(model.length, addedView.id)) diff --git a/src/vs/workbench/contrib/remote/browser/remote.ts b/src/vs/workbench/contrib/remote/browser/remote.ts index a6f5e8b4cae..5feb009f368 100644 --- a/src/vs/workbench/contrib/remote/browser/remote.ts +++ b/src/vs/workbench/contrib/remote/browser/remote.ts @@ -512,9 +512,9 @@ export class RemoteViewPaneContainer extends FilterViewPaneContainer implements return title; } - onDidAddViews(added: IAddedViewDescriptorRef[]): ViewPane[] { + onDidAddViewDescriptors(added: IAddedViewDescriptorRef[]): ViewPane[] { // Call to super MUST be first, since registering the additional view will cause this to be called again. - const panels: ViewPane[] = super.onDidAddViews(added); + const panels: ViewPane[] = super.onDidAddViewDescriptors(added); // This context key is set to false in the constructor, but is expected to be changed by resolver extensions to enable the forwarded ports view. const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService); if (this.environmentService.configuration.remoteAuthority && !this.tunnelPanelDescriptor && viewEnabled) { From c606dd95e1e83436fe2d650bf1011930c8c3b77c Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:10:26 +0100 Subject: [PATCH 108/624] fix git tests --- extensions/git/src/test/git.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extensions/git/src/test/git.test.ts b/extensions/git/src/test/git.test.ts index 1d4c4ebe161..12946a2c5fb 100644 --- a/extensions/git/src/test/git.test.ts +++ b/extensions/git/src/test/git.test.ts @@ -189,7 +189,9 @@ suite('git', () => { suite('parseGitCommit', () => { test('single parent commit', function () { const GIT_OUTPUT_SINGLE_PARENT = `52c293a05038d865604c2284aa8698bd087915a1 +John Doe john.doe@mail.com +1580811030 8e5a374372b8393906c7e380dbb09349c5385554 This is a commit message.\x00`; @@ -197,13 +199,17 @@ This is a commit message.\x00`; hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', parents: ['8e5a374372b8393906c7e380dbb09349c5385554'], + authorDate: new Date(1580811030000), + authorName: 'John Doe', authorEmail: 'john.doe@mail.com', }]); }); test('multiple parent commits', function () { const GIT_OUTPUT_MULTIPLE_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1 +John Doe john.doe@mail.com +1580811030 8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217 This is a commit message.\x00`; @@ -211,13 +217,17 @@ This is a commit message.\x00`; hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217'], + authorDate: new Date(1580811030000), + authorName: 'John Doe', authorEmail: 'john.doe@mail.com', }]); }); test('no parent commits', function () { const GIT_OUTPUT_NO_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1 +John Doe john.doe@mail.com +1580811030 This is a commit message.\x00`; @@ -225,6 +235,8 @@ This is a commit message.\x00`; hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', parents: [], + authorDate: new Date(1580811030000), + authorName: 'John Doe', authorEmail: 'john.doe@mail.com', }]); }); From 1dd16ab72892ca30547da6008eae584faee0c5de Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:10:54 +0100 Subject: [PATCH 109/624] setup git integration tests --- extensions/git/package.json | 3 +- extensions/git/src/test/index.ts | 30 ++ extensions/git/yarn.lock | 511 ++++++++++++++++++++++++++++++- 3 files changed, 541 insertions(+), 3 deletions(-) create mode 100644 extensions/git/src/test/index.ts diff --git a/extensions/git/package.json b/extensions/git/package.json index a98b7ed6c95..b3a7fa221be 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1780,6 +1780,7 @@ "@types/mocha": "2.2.43", "@types/node": "^12.11.7", "@types/which": "^1.0.28", - "mocha": "^3.2.0" + "mocha": "^3.2.0", + "vscode": "^1.1.36" } } diff --git a/extensions/git/src/test/index.ts b/extensions/git/src/test/index.ts new file mode 100644 index 00000000000..747c4562e8a --- /dev/null +++ b/extensions/git/src/test/index.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const path = require('path'); +const testRunner = require('vscode/lib/testrunner'); + +const suite = 'Integration Git Tests'; + +const options: any = { + ui: 'tdd', + useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + timeout: 60000 +}; + +if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { + options.reporter = 'mocha-multi-reporters'; + options.reporterOptions = { + reporterEnabled: 'spec, mocha-junit-reporter', + mochaJunitReporterReporterOptions: { + testsuitesTitle: `${suite} ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`) + } + }; +} + +testRunner.configure(options); + +export = testRunner; diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock index a0d7edf8c69..ae873ebd83a 100644 --- a/extensions/git/yarn.lock +++ b/extensions/git/yarn.lock @@ -36,6 +36,23 @@ resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6" integrity sha1-AW44dim4gXvtZT/jLqtdESecjfY= +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + +ajv@^6.5.5: + version "6.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.11.0.tgz#c3607cbc8ae392d8a5a536f25b21f8e5f3f87fe9" + integrity sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + applicationinsights@1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.8.tgz#db6e3d983cf9f9405fe1ee5ba30ac6e1914537b5" @@ -45,11 +62,45 @@ applicationinsights@1.0.8: diagnostic-channel-publishers "0.2.1" zone.js "0.7.6" +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" + integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" @@ -63,11 +114,38 @@ browser-stdout@1.3.0: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + commander@2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -80,6 +158,18 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + dayjs@1.8.19: version "1.8.19" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.19.tgz#5117dc390d8f8e586d53891dbff3fa308f51abfe" @@ -92,6 +182,25 @@ debug@2.6.8: dependencies: ms "2.0.0" +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + diagnostic-channel-publishers@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3" @@ -109,21 +218,92 @@ diff@3.2.0: resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" integrity sha1-yc45Okt8vQsFinJck98pkCeGj/k= +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + escape-string-regexp@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + file-type@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-7.2.0.tgz#113cfed52e1d6959ab80248906e2f25a8cdccb74" integrity sha1-ETz+1S4daVmrgCSJBuLyWozcy3Q= +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + glob@7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" @@ -136,26 +316,98 @@ glob@7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + 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" + +glob@^7.1.2: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + 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" + "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + growl@1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8= +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== + dependencies: + agent-base "4" + debug "3.1.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -176,21 +428,61 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +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= + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + jschardet@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-2.1.1.tgz#af6f8fd0b3b0f5d46a8fd9614a4fce490575c184" integrity sha512-pA5qG9Zwm8CBpGlK/lo2GE9jPxwqRgMV7Lzc/1iaPccw6v4Rhj8Zg2BTyrdmHmxlJojnbLupLeRnaPLsq03x6Q== +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + json3@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + lodash._baseassign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" @@ -247,7 +539,19 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -minimatch@^3.0.2: +mime-db@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" + integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.26" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" + integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== + dependencies: + mime-db "1.43.0" + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -284,11 +588,38 @@ mocha@^3.2.0: mkdirp "0.5.1" supports-color "3.1.2" +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -301,7 +632,73 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -"safer-buffer@>= 2.1.2 < 3": +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +psl@^1.1.24: + version "1.7.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" + integrity sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +querystringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" + integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== + +request@^2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -311,6 +708,39 @@ semver@^5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== +semver@^5.4.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +source-map-support@^0.5.0: + version "0.5.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" + integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + supports-color@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" @@ -318,6 +748,62 @@ supports-color@3.1.2: dependencies: has-flag "^1.0.0" +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +url-parse@^1.4.4: + version "1.4.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" + integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + vscode-extension-telemetry@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.1.tgz#91387e06b33400c57abd48979b0e790415ae110b" @@ -330,11 +816,32 @@ vscode-nls@^4.0.0: resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002" integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw== +vscode-test@^0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.4.3.tgz#461ebf25fc4bc93d77d982aed556658a2e2b90b8" + integrity sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w== + dependencies: + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + vscode-uri@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.0.tgz#2df704222f72b8a71ff266ba0830ed6c51ac1542" integrity sha512-lWXWofDSYD8r/TIyu64MdwB4FaSirQ608PP/TzUyslyOeHGwQ0eTHUZeJrK1ILOmwUHaJtV693m2JoUYroUDpw== +vscode@^1.1.36: + version "1.1.36" + resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.36.tgz#5e1a0d1bf4977d0c7bc5159a9a13d5b104d4b1b6" + integrity sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ== + dependencies: + glob "^7.1.2" + mocha "^5.2.0" + request "^2.88.0" + semver "^5.4.1" + source-map-support "^0.5.0" + url-parse "^1.4.4" + vscode-test "^0.4.1" + which@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" From e8cb0173719a880ffb60c2762b8a06d683d7dc20 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:22:20 +0100 Subject: [PATCH 110/624] Register mkdtemp command --- .../contrib/files/electron-browser/files.contribution.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts index eda8317d40d..13d6cff9e2e 100644 --- a/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts +++ b/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts @@ -10,6 +10,10 @@ import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileE import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { NativeTextFileEditor } from 'vs/workbench/contrib/files/electron-browser/textFileEditor'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import * as os from 'os'; +import * as fs from 'fs'; +import * as path from 'path'; // Register file editor Registry.as(EditorExtensions.Editors).registerEditor( @@ -22,3 +26,8 @@ Registry.as(EditorExtensions.Editors).registerEditor( new SyncDescriptor(FileEditorInput) ] ); + +// Register mkdtemp command +CommandsRegistry.registerCommand('mkdtemp', function () { + return fs.promises.mkdtemp(path.join(os.tmpdir(), 'vscodetmp-')); +}); From 765a8e1f010852cf7fd1be8dceb4360062919baf Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:32:02 +0100 Subject: [PATCH 111/624] simplify integration script --- scripts/test-integration.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 89851e48908..0bd4e22e7c5 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -4,13 +4,12 @@ set -e if [[ "$OSTYPE" == "darwin"* ]]; then realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } ROOT=$(dirname $(dirname $(realpath "$0"))) - VSCODEUSERDATADIR=`mktemp -d -t 'myuserdatadir'` else ROOT=$(dirname $(dirname $(readlink -f $0))) - VSCODEUSERDATADIR=`mktemp -d 2>/dev/null` LINUX_NO_SANDBOX="--no-sandbox" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox. fi +VSCODEUSERDATADIR=`mktemp -d 2>/dev/null` cd $ROOT # Figure out which Electron to use for running tests From de3513578c6932cd6f4bc774fc33899490810237 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:35:16 +0100 Subject: [PATCH 112/624] add git to integration tests --- scripts/test-integration.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 0bd4e22e7c5..a6b98ca8413 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -45,6 +45,7 @@ fi "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/markdown-language-features/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/git --extensionTestsPath=$ROOT/extensions/git/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR mkdir -p $ROOT/extensions/emmet/test-fixtures "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR From aeb205903a7bf87379cdcdf520ac667f1989c305 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:35:22 +0100 Subject: [PATCH 113/624] add git tests launch config --- .vscode/launch.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 13c87d635f3..2f7b572faec 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -79,6 +79,24 @@ "order": 6 } }, + { + "type": "extensionHost", + "request": "launch", + "name": "VS Code Git Tests", + "runtimeExecutable": "${execPath}", + "args": [ + "/tmp/my4g9l", + "--extensionDevelopmentPath=${workspaceFolder}/extensions/git", + "--extensionTestsPath=${workspaceFolder}/extensions/git/out/test" + ], + "outFiles": [ + "${workspaceFolder}/extensions/git/out/**/*.js" + ], + "presentation": { + "group": "5_tests", + "order": 6 + } + }, { "type": "extensionHost", "request": "launch", @@ -167,7 +185,9 @@ "webRoot": "${workspaceFolder}", // Settings for js-debug: "pauseForSourceMap": false, - "outFiles": ["${workspaceFolder}/out/**/*.js"], + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], }, { "type": "node", From 4945918d221b2026e96b098daf74c951157b2a02 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 4 Feb 2020 12:43:57 +0100 Subject: [PATCH 114/624] Add min and max to devcontainer.json forwardedPorts values Fixes https://github.com/microsoft/vscode-remote-release/issues/2218 --- .../configuration-editing/schemas/devContainer.schema.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/configuration-editing/schemas/devContainer.schema.json b/extensions/configuration-editing/schemas/devContainer.schema.json index b1ed32ab9f2..0d47b27bec9 100644 --- a/extensions/configuration-editing/schemas/devContainer.schema.json +++ b/extensions/configuration-editing/schemas/devContainer.schema.json @@ -29,7 +29,9 @@ "type": "array", "description": "Ports that are forwarded from the container to the local machine.", "items": { - "type": "integer" + "type": "integer", + "maximum": 65535, + "minimum": 0 } }, "remoteEnv": { From ce183bc3489fc4f029da20aff24c4fef3f8c4d59 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:46:15 +0100 Subject: [PATCH 115/624] add git to windows integration tests --- scripts/test-integration.bat | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 695f1c940fe..505faa7e629 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -49,6 +49,9 @@ if %errorlevel% neq 0 exit /b %errorlevel% call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . if %errorlevel% neq 0 exit /b %errorlevel% +call "%INTEGRATION_TEST_ELECTRON_PATH%" %TMP%\git-%RANDOM%-%TIME:~6,5% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . +if %errorlevel% neq 0 exit /b %errorlevel% + :: Tests in commonJS (HTML, CSS, JSON language server tests...) call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js if %errorlevel% neq 0 exit /b %errorlevel% From a2defb0625cfb25738a467aa917d5694b49c27ed Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 12:49:59 +0100 Subject: [PATCH 116/624] fix build --- extensions/git/src/timelineProvider.ts | 4 ++-- extensions/git/src/util.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extensions/git/src/timelineProvider.ts b/extensions/git/src/timelineProvider.ts index 211b1cd1502..5559d785a27 100644 --- a/extensions/git/src/timelineProvider.ts +++ b/extensions/git/src/timelineProvider.ts @@ -85,7 +85,7 @@ export class GitTimelineProvider implements TimelineProvider { return { id: c.hash, timestamp: c.authorDate?.getTime() ?? 0, - iconPath: new ThemeIcon('git-commit'), + iconPath: new (ThemeIcon as any)('git-commit'), label: message, description: `${dateFormatter.fromNow()} \u2022 ${c.authorName}`, detail: `${c.authorName} (${c.authorEmail}) \u2014 ${c.hash.substr(0, 8)}\n${dateFormatter.fromNow()} (${dateFormatter.format('MMMM Do, YYYY h:mma')})\n\n${c.message}`, @@ -129,7 +129,7 @@ export class GitTimelineProvider implements TimelineProvider { id: '~', timestamp: date.getTime(), // TODO[ECA]: Replace with a better icon -- reflecting its status maybe? - iconPath: new ThemeIcon('git-commit'), + iconPath: new (ThemeIcon as any)('git-commit'), label: 'Staged Changes', description: `${dateFormatter.fromNow()} \u2022 You`, detail: `You \u2014 Index\n${dateFormatter.fromNow()} (${dateFormatter.format('MMMM Do, YYYY h:mma')})\n${status}`, diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts index 3110168343b..74b353f518a 100644 --- a/extensions/git/src/util.ts +++ b/extensions/git/src/util.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vscode'; +import { Event, Disposable } from 'vscode'; import { dirname, sep } from 'path'; import { Readable } from 'stream'; import { promises as fs, createReadStream } from 'fs'; @@ -33,15 +33,15 @@ export function combinedDisposable(disposables: IDisposable[]): IDisposable { export const EmptyDisposable = toDisposable(() => null); export function fireEvent(event: Event): Event { - return (listener, thisArgs = null, disposables?) => event(_ => (listener as any).call(thisArgs), null, disposables); + return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => event(_ => (listener as any).call(thisArgs), null, disposables); } export function mapEvent(event: Event, map: (i: I) => O): Event { - return (listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables); + return (listener: (e: O) => any, thisArgs?: any, disposables?: Disposable[]) => event(i => listener.call(thisArgs, map(i)), null, disposables); } export function filterEvent(event: Event, filter: (e: T) => boolean): Event { - return (listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables); + return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables); } export function latchEvent(event: Event): Event { @@ -57,7 +57,7 @@ export function latchEvent(event: Event): Event { } export function anyEvent(...events: Event[]): Event { - return (listener, thisArgs = null, disposables?) => { + return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => { const result = combinedDisposable(events.map(event => event(i => listener.call(thisArgs, i)))); if (disposables) { @@ -73,7 +73,7 @@ export function done(promise: Promise): Promise { } export function onceEvent(event: Event): Event { - return (listener, thisArgs = null, disposables?) => { + return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => { const result = event(e => { result.dispose(); return listener.call(thisArgs, e); @@ -84,7 +84,7 @@ export function onceEvent(event: Event): Event { } export function debounceEvent(event: Event, delay: number): Event { - return (listener, thisArgs = null, disposables?) => { + return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => { let timer: NodeJS.Timer; return event(e => { clearTimeout(timer); From df3b99ba4515f9a2dc4b2b8bfa4008cd4040d638 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 12:51:45 +0100 Subject: [PATCH 117/624] Just use `leftoverVisibleColumns` for having the cursor always go to the end of line --- src/vs/editor/common/controller/cursorCommon.ts | 11 +++-------- .../common/controller/cursorMoveOperations.ts | 15 ++++----------- src/vs/editor/common/controller/oneCursor.ts | 6 +++--- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts index d981f26a0a0..ac269997918 100644 --- a/src/vs/editor/common/controller/cursorCommon.ts +++ b/src/vs/editor/common/controller/cursorCommon.ts @@ -277,21 +277,18 @@ export class SingleCursorState { public readonly position: Position; public readonly leftoverVisibleColumns: number; public readonly selection: Selection; - public readonly isEnd: boolean; constructor( selectionStart: Range, selectionStartLeftoverVisibleColumns: number, position: Position, leftoverVisibleColumns: number, - isEnd: boolean = false ) { this.selectionStart = selectionStart; this.selectionStartLeftoverVisibleColumns = selectionStartLeftoverVisibleColumns; this.position = position; this.leftoverVisibleColumns = leftoverVisibleColumns; this.selection = SingleCursorState._computeSelection(this.selectionStart, this.position); - this.isEnd = isEnd; } public equals(other: SingleCursorState) { @@ -307,15 +304,14 @@ export class SingleCursorState { return (!this.selection.isEmpty() || !this.selectionStart.isEmpty()); } - public move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number, isEnd: boolean = false): SingleCursorState { + public move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState { if (inSelectionMode) { // move just position return new SingleCursorState( this.selectionStart, this.selectionStartLeftoverVisibleColumns, new Position(lineNumber, column), - leftoverVisibleColumns, - isEnd + leftoverVisibleColumns ); } else { // move everything @@ -323,8 +319,7 @@ export class SingleCursorState { new Range(lineNumber, column, lineNumber, column), leftoverVisibleColumns, new Position(lineNumber, column), - leftoverVisibleColumns, - isEnd + leftoverVisibleColumns ); } } diff --git a/src/vs/editor/common/controller/cursorMoveOperations.ts b/src/vs/editor/common/controller/cursorMoveOperations.ts index 8be77b1031c..df45d78e9f9 100644 --- a/src/vs/editor/common/controller/cursorMoveOperations.ts +++ b/src/vs/editor/common/controller/cursorMoveOperations.ts @@ -7,6 +7,7 @@ import { CursorColumns, CursorConfiguration, ICursorSimpleModel, SingleCursorSta import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import * as strings from 'vs/base/common/strings'; +import { Constants } from 'vs/base/common/uint'; export class CursorPosition { _cursorPositionBrand: void; @@ -122,13 +123,9 @@ export class MoveOperations { column = cursor.position.column; } - if (cursor.isEnd) { - column = model.getLineMaxColumn(lineNumber + 1); - } - let r = MoveOperations.down(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, cursor.isEnd ? column : r.column, r.leftoverVisibleColumns, cursor.isEnd); + return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); } public static translateDown(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState { @@ -178,13 +175,9 @@ export class MoveOperations { column = cursor.position.column; } - if (cursor.isEnd) { - column = model.getLineMaxColumn(lineNumber - 1); - } - let r = MoveOperations.up(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, cursor.isEnd ? column : r.column, r.leftoverVisibleColumns, cursor.isEnd); + return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); } public static translateUp(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): SingleCursorState { @@ -222,7 +215,7 @@ export class MoveOperations { public static moveToEndOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState { let lineNumber = cursor.position.lineNumber; let maxColumn = model.getLineMaxColumn(lineNumber); - return cursor.move(inSelectionMode, lineNumber, maxColumn, 0, true); + return cursor.move(inSelectionMode, lineNumber, maxColumn, Constants.MAX_SAFE_SMALL_INTEGER - maxColumn); } public static moveToBeginningOfBuffer(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState { diff --git a/src/vs/editor/common/controller/oneCursor.ts b/src/vs/editor/common/controller/oneCursor.ts index 07716dbb5de..2bb09583133 100644 --- a/src/vs/editor/common/controller/oneCursor.ts +++ b/src/vs/editor/common/controller/oneCursor.ts @@ -99,7 +99,7 @@ export class OneCursor { ); const leftoverVisibleColumns = modelState.position.equals(position) ? modelState.leftoverVisibleColumns : 0; - modelState = new SingleCursorState(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns, modelState.isEnd); + modelState = new SingleCursorState(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns); } if (!viewState) { @@ -108,12 +108,12 @@ export class OneCursor { const viewSelectionStart2 = context.convertModelPositionToViewPosition(new Position(modelState.selectionStart.endLineNumber, modelState.selectionStart.endColumn)); const viewSelectionStart = new Range(viewSelectionStart1.lineNumber, viewSelectionStart1.column, viewSelectionStart2.lineNumber, viewSelectionStart2.column); const viewPosition = context.convertModelPositionToViewPosition(modelState.position); - viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns, modelState.isEnd); + viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); } else { // Validate new view state const viewSelectionStart = context.validateViewRange(viewState.selectionStart, modelState.selectionStart); const viewPosition = context.validateViewPosition(viewState.position, modelState.position); - viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns, viewState.isEnd); + viewState = new SingleCursorState(viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); } this.modelState = modelState; From aad809c0552eca5628f49c3c275dd13889553d7b Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 4 Feb 2020 12:49:22 +0100 Subject: [PATCH 118/624] #89993 use composite's instantiation service --- src/vs/workbench/browser/parts/views/views.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 52ecfe80c29..9945355961e 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -467,8 +467,7 @@ export class ViewsService extends Disposable implements IViewsService { constructor( @IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService, @IPanelService private readonly panelService: IPanelService, - @IViewletService private readonly viewletService: IViewletService, - @IInstantiationService private readonly instantiationService: IInstantiationService, + @IViewletService private readonly viewletService: IViewletService ) { super(); @@ -628,8 +627,7 @@ export class ViewsService extends Disposable implements IViewsService { return null; } - createContainer(container: ViewContainer): ViewPaneContainer { - const viewPaneContainer: ViewPaneContainer = this._register((this.instantiationService as any).createInstance(container.ctorDescriptor!.ctor, ...(container.ctorDescriptor!.staticArguments || []))); + registerViewPaneContainer(viewPaneContainer: ViewPaneContainer): ViewPaneContainer { this._register(viewPaneContainer.onDidAddViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() })))); this._register(viewPaneContainer.onDidChangeViewVisibility(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() }))); this._register(viewPaneContainer.onDidRemoveViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: false })))); @@ -666,7 +664,9 @@ registerSingleton(IViewsService, ViewsService); @IWorkspaceContextService contextService: IWorkspaceContextService, @IViewsService viewsService: ViewsService ) { - super(viewContainer.id, viewsService.createContainer(viewContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); + // Use composite's instantiation service to get the editor progress service for any editors instantiated within the composite + const viewPaneContainer = viewsService.registerViewPaneContainer((instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || []))); + super(viewContainer.id, viewPaneContainer, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); } } Registry.as(PanelExtensions.Panels).registerPanel(PanelDescriptor.create( @@ -690,9 +690,12 @@ registerSingleton(IViewsService, ViewsService); @IInstantiationService instantiationService: IInstantiationService, @IThemeService themeService: IThemeService, @IContextMenuService contextMenuService: IContextMenuService, - @IExtensionService extensionService: IExtensionService + @IExtensionService extensionService: IExtensionService, + @IViewsService viewsService: ViewsService ) { - super(viewContainer.id, (instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || [])), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService); + // Use composite's instantiation service to get the editor progress service for any editors instantiated within the composite + const viewPaneContainer = viewsService.registerViewPaneContainer((instantiationService as any).createInstance(viewContainer.ctorDescriptor!.ctor, ...(viewContainer.ctorDescriptor!.staticArguments || []))); + super(viewContainer.id, viewPaneContainer, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService); } } const viewletDescriptor = ViewletDescriptor.create( From 19de7a566cbcafcae82c3949c04c479b7404fc3b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 13:04:16 +0100 Subject: [PATCH 119/624] add proper git dev dependencies --- extensions/git/package.json | 2 + extensions/git/yarn.lock | 74 ++++++++++++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index b3a7fa221be..c1cd8b5135c 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1781,6 +1781,8 @@ "@types/node": "^12.11.7", "@types/which": "^1.0.28", "mocha": "^3.2.0", + "mocha-junit-reporter": "^1.23.3", + "mocha-multi-reporters": "^1.1.7", "vscode": "^1.1.36" } } diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock index ae873ebd83a..af5b10127dc 100644 --- a/extensions/git/yarn.lock +++ b/extensions/git/yarn.lock @@ -53,6 +53,11 @@ ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + applicationinsights@1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.8.tgz#db6e3d983cf9f9405fe1ee5ba30ac6e1914537b5" @@ -134,6 +139,11 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -163,6 +173,11 @@ core-util-is@1.0.2: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -189,6 +204,13 @@ debug@3.1.0: dependencies: ms "2.0.0" +debug@^2.2.0: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" @@ -428,6 +450,11 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +is-buffer@~1.1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -539,6 +566,20 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" +lodash@^4.16.4: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +md5@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk= + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + mime-db@1.43.0: version "1.43.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" @@ -563,13 +604,32 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -mkdirp@0.5.1: +mkdirp@0.5.1, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" +mocha-junit-reporter@^1.23.3: + version "1.23.3" + resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.23.3.tgz#941e219dd759ed732f8641e165918aa8b167c981" + integrity sha512-ed8LqbRj1RxZfjt/oC9t12sfrWsjZ3gNnbhV1nuj9R/Jb5/P3Xb4duv2eCfCDMYH+fEu0mqca7m4wsiVjsxsvA== + dependencies: + debug "^2.2.0" + md5 "^2.1.0" + mkdirp "~0.5.1" + strip-ansi "^4.0.0" + xml "^1.0.0" + +mocha-multi-reporters@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/mocha-multi-reporters/-/mocha-multi-reporters-1.1.7.tgz#cc7f3f4d32f478520941d852abb64d9988587d82" + integrity sha1-zH8/TTL0eFIJQdhSq7ZNmYhYfYI= + dependencies: + debug "^3.1.0" + lodash "^4.16.4" + mocha@^3.2.0: version "3.5.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" @@ -741,6 +801,13 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + supports-color@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" @@ -854,6 +921,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +xml@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= + zone.js@0.7.6: version "0.7.6" resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009" From acd2c6f387b3cf9f5cbdc02f87b34f2c6aa823a8 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 13:04:38 +0100 Subject: [PATCH 120/624] fix tests --- scripts/test-integration.bat | 1 + scripts/test-integration.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 505faa7e629..9d439a2d191 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -22,6 +22,7 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( call yarn gulp compile-extension:css-language-features-server call yarn gulp compile-extension:html-language-features-server call yarn gulp compile-extension:json-language-features-server + call yarn gulp compile-extension:git :: Configuration for more verbose output set VSCODE_CLI=1 diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index a6b98ca8413..18741689645 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -28,6 +28,7 @@ else yarn gulp compile-extension:css-language-features-server yarn gulp compile-extension:html-language-features-server yarn gulp compile-extension:json-language-features-server + yarn gulp compile-extension:git # Configuration for more verbose output export VSCODE_CLI=1 From cfc452e466b2169e277fd8a9ba10a81d20088f74 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 12:06:50 +0100 Subject: [PATCH 121/624] smoketest - use element ID for status item selectors --- test/automation/src/statusbar.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/automation/src/statusbar.ts b/test/automation/src/statusbar.ts index d090e9938a7..362562c38bc 100644 --- a/test/automation/src/statusbar.ts +++ b/test/automation/src/statusbar.ts @@ -20,8 +20,6 @@ export const enum StatusBarElement { export class StatusBar { private readonly mainSelector = 'div[id="workbench.parts.statusbar"]'; - private readonly leftSelector = '.statusbar-item.left'; - private readonly rightSelector = '.statusbar-item.right'; constructor(private code: Code) { } @@ -44,23 +42,23 @@ export class StatusBar { private getSelector(element: StatusBarElement): string { switch (element) { case StatusBarElement.BRANCH_STATUS: - return `${this.mainSelector} ${this.leftSelector} .codicon.codicon-git-branch`; + return `.statusbar-item[id="status.scm"] .codicon.codicon-git-branch`; case StatusBarElement.SYNC_STATUS: - return `${this.mainSelector} ${this.leftSelector} .codicon.codicon-sync`; + return `.statusbar-item[id="status.scm"] .codicon.codicon-sync`; case StatusBarElement.PROBLEMS_STATUS: - return `${this.mainSelector} ${this.leftSelector} .codicon.codicon-error`; + return `.statusbar-item[id="status.problems"]`; case StatusBarElement.SELECTION_STATUS: - return `${this.mainSelector} ${this.rightSelector}[title="Go to Line"]`; + return `.statusbar-item[id="status.editor.selection"]`; case StatusBarElement.INDENTATION_STATUS: - return `${this.mainSelector} ${this.rightSelector}[title="Select Indentation"]`; + return `.statusbar-item[id="status.editor.indentation"]`; case StatusBarElement.ENCODING_STATUS: - return `${this.mainSelector} ${this.rightSelector}[title="Select Encoding"]`; + return `.statusbar-item[id="status.editor.encoding"]`; case StatusBarElement.EOL_STATUS: - return `${this.mainSelector} ${this.rightSelector}[title="Select End of Line Sequence"]`; + return `.statusbar-item[id="status.editor.eol"]`; case StatusBarElement.LANGUAGE_STATUS: - return `${this.mainSelector} ${this.rightSelector}[title="Select Language Mode"]`; + return `.statusbar-item[id="status.editor.mode"]`; case StatusBarElement.FEEDBACK_ICON: - return `${this.mainSelector} .statusbar-item.right[id="status.feedback"]`; + return `.statusbar-item[id="status.feedback"]`; default: throw new Error(element); } From a15803b9e740f50b7d5a7bb05b724654332b9a0b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 14:50:47 +0100 Subject: [PATCH 122/624] smoke test - add attribute for tabs to simplify lookup --- .../browser/parts/editor/tabsTitleControl.ts | 11 ++++++++++- test/automation/src/editors.ts | 18 +++++++++--------- .../src/areas/workbench/data-loss.test.ts | 6 +++--- .../src/areas/workbench/data-migration.test.ts | 4 ++-- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 54a71784d29..94711974ea8 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -42,6 +42,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { withNullAsUndefined, assertAllDefined, assertIsDefined } from 'vs/base/common/types'; import { ILabelService } from 'vs/platform/label/common/label'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { basenameOrAuthority } from 'vs/base/common/resources'; interface IEditorInputLabel { name?: string; @@ -941,7 +942,15 @@ export class TabsTitleControl extends TitleControl { tabContainer.title = title; // Label - tabLabelWidget.setResource({ name, description, resource: toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }) }, { title, extraClasses: ['tab-label'], italic: !this.group.isPinned(editor) }); + const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }); + tabLabelWidget.setResource({ name, description, resource }, { title, extraClasses: ['tab-label'], italic: !this.group.isPinned(editor) }); + + // Tests helper + if (resource) { + tabContainer.setAttribute('data-resource-name', basenameOrAuthority(resource)); + } else { + tabContainer.removeAttribute('data-resource-name'); + } } private redrawEditorActiveAndDirty(isGroupActive: boolean, editor: IEditorInput, tabContainer: HTMLElement, tabLabelWidget: IResourceLabel): void { diff --git a/test/automation/src/editors.ts b/test/automation/src/editors.ts index ef088e464d2..dac1f1e40df 100644 --- a/test/automation/src/editors.ts +++ b/test/automation/src/editors.ts @@ -17,27 +17,27 @@ export class Editors { } } - async selectTab(tabName: string, untitled: boolean = false): Promise { - await this.code.waitAndClick(`.tabs-container div.tab[aria-label="${tabName}, tab"]`); - await this.waitForEditorFocus(tabName, untitled); + async selectTab(fileName: string): Promise { + await this.code.waitAndClick(`.tabs-container div.tab[data-resource-name$="${fileName}"]`); + await this.waitForEditorFocus(fileName); } - async waitForActiveEditor(filename: string): Promise { - const selector = `.editor-instance .monaco-editor[data-uri$="${filename}"] textarea`; + async waitForActiveEditor(fileName: string): Promise { + const selector = `.editor-instance .monaco-editor[data-uri$="${fileName}"] textarea`; return this.code.waitForActiveElement(selector); } - async waitForEditorFocus(fileName: string, untitled: boolean = false): Promise { + async waitForEditorFocus(fileName: string): Promise { await this.waitForActiveTab(fileName); await this.waitForActiveEditor(fileName); } async waitForActiveTab(fileName: string, isDirty: boolean = false): Promise { - await this.code.waitForElement(`.tabs-container div.tab.active${isDirty ? '.dirty' : ''}[aria-selected="true"][aria-label="${fileName}, tab"]`); + await this.code.waitForElement(`.tabs-container div.tab.active${isDirty ? '.dirty' : ''}[aria-selected="true"][data-resource-name$="${fileName}"]`); } async waitForTab(fileName: string, isDirty: boolean = false): Promise { - await this.code.waitForElement(`.tabs-container div.tab${isDirty ? '.dirty' : ''}[aria-label="${fileName}, tab"]`); + await this.code.waitForElement(`.tabs-container div.tab${isDirty ? '.dirty' : ''}[data-resource-name$="${fileName}"]`); } async newUntitledFile(): Promise { @@ -47,6 +47,6 @@ export class Editors { await this.code.dispatchKeybinding('ctrl+n'); } - await this.waitForEditorFocus('Untitled-1', true); + await this.waitForEditorFocus('Untitled-1'); } } diff --git a/test/smoke/src/areas/workbench/data-loss.test.ts b/test/smoke/src/areas/workbench/data-loss.test.ts index cb049e59ad3..07ca7f83886 100644 --- a/test/smoke/src/areas/workbench/data-loss.test.ts +++ b/test/smoke/src/areas/workbench/data-loss.test.ts @@ -12,7 +12,7 @@ export function setup() { await app.workbench.editors.newUntitledFile(); const untitled = 'Untitled-1'; - const textToTypeInUntitled = untitled; + const textToTypeInUntitled = 'Hello from Untitled'; await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled); const readmeMd = 'readme.md'; @@ -25,8 +25,8 @@ export function setup() { await app.workbench.editors.waitForActiveTab(readmeMd, true); await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1); - await app.workbench.editors.waitForTab(untitled, true); - await app.workbench.editors.selectTab(untitled, true); + await app.workbench.editors.waitForTab(untitled); + await app.workbench.editors.selectTab(untitled); await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1); }); }); diff --git a/test/smoke/src/areas/workbench/data-migration.test.ts b/test/smoke/src/areas/workbench/data-migration.test.ts index e455105ed4d..0a403bef78d 100644 --- a/test/smoke/src/areas/workbench/data-migration.test.ts +++ b/test/smoke/src/areas/workbench/data-migration.test.ts @@ -66,7 +66,7 @@ export function setup(stableCodePath: string, testDataPath: string) { await stableApp.workbench.editors.newUntitledFile(); const untitled = 'Untitled-1'; - const textToTypeInUntitled = untitled; + const textToTypeInUntitled = 'Hello from Untitled'; await stableApp.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled); const readmeMd = 'readme.md'; @@ -86,7 +86,7 @@ export function setup(stableCodePath: string, testDataPath: string) { await insidersApp.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1); await insidersApp.workbench.editors.waitForTab(untitled, true); - await insidersApp.workbench.editors.selectTab(untitled, true); + await insidersApp.workbench.editors.selectTab(untitled); await insidersApp.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1); await insidersApp.stop(); From 6acb1513328c36521a9c0b6f1011fd107be8692c Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 4 Feb 2020 14:54:01 +0100 Subject: [PATCH 123/624] Use originalFSPath in terminal Fixes https://github.com/microsoft/vscode/issues/88906 --- .../contrib/terminal/common/terminalEnvironment.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index 00c70e980e0..8ae397f46e5 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -11,6 +11,7 @@ import { IShellLaunchConfig, ITerminalEnvironment } from 'vs/workbench/contrib/t import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { sanitizeProcessEnvironment } from 'vs/base/common/processes'; import { ILogService } from 'vs/platform/log/common/log'; +import { originalFSPath } from 'vs/base/common/resources'; /** * This module contains utility functions related to the environment, cwd and paths. @@ -184,7 +185,7 @@ export function getCwd( logService?: ILogService ): string { if (shell.cwd) { - const unresolved = (typeof shell.cwd === 'object') ? shell.cwd.fsPath : shell.cwd; + const unresolved = (typeof shell.cwd === 'object') ? originalFSPath(shell.cwd) : shell.cwd; const resolved = _resolveCwd(unresolved, lastActiveWorkspace, configurationResolverService); return resolved || unresolved; } @@ -199,14 +200,14 @@ export function getCwd( if (path.isAbsolute(customCwd)) { cwd = customCwd; } else if (root) { - cwd = path.join(root.fsPath, customCwd); + cwd = path.join(originalFSPath(root), customCwd); } } } // If there was no custom cwd or it was relative with no workspace if (!cwd) { - cwd = root ? root.fsPath : userHome; + cwd = root ? originalFSPath(root) : userHome; } return _sanitizeCwd(cwd); From 8066726b2752fee926dbc4d4b3ba1a9a3968c09d Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 4 Feb 2020 15:00:56 +0100 Subject: [PATCH 124/624] Allow both : an . as time separators in tsc problem pattern Fixes https://github.com/microsoft/vscode/issues/89273 --- extensions/typescript-language-features/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index a964fcfb712..7f2f202e926 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -882,10 +882,10 @@ "background": { "activeOnStart": true, "beginsPattern": { - "regexp": "^\\s*(?:message TS6032:|\\[?\\D*\\d{1,2}:\\d{1,2}:\\d{1,2}\\D*(?:\\]| -)) File change detected\\. Starting incremental compilation\\.\\.\\." + "regexp": "^\\s*(?:message TS6032:|\\[?\\D*\\d{1,2}[:.]\\d{1,2}[:.]\\d{1,2}\\D*(?:\\]| -)) File change detected\\. Starting incremental compilation\\.\\.\\." }, "endsPattern": { - "regexp": "^\\s*(?:message TS6042:|\\[?\\D*\\d{1,2}:\\d{1,2}:\\d{1,2}\\D*(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\." + "regexp": "^\\s*(?:message TS6042:|\\[?\\D*\\d{1,2}[:.]\\d{1,2}[:.]\\d{1,2}\\D*(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\." } } } From b5252d32f71c83c81d0d0431ff7a1e5748c54790 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 15:02:52 +0100 Subject: [PATCH 125/624] use playwright for unit tests --- package.json | 1 + test/browser/index.js | 174 +++++++++++++++++++++++++++++ test/browser/renderer.html | 131 ++++++++++++++++++++++ test/browser/renderer.js | 219 +++++++++++++++++++++++++++++++++++++ yarn.lock | 68 +++++++++++- 5 files changed, 591 insertions(+), 2 deletions(-) create mode 100644 test/browser/index.js create mode 100644 test/browser/renderer.html create mode 100644 test/browser/renderer.js diff --git a/package.json b/package.json index 4c94e8b0512..39f7510aff4 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "opn": "^6.0.0", "optimist": "0.3.5", "p-all": "^1.0.0", + "playwright": "^0.10.0", "pump": "^1.0.1", "queue": "3.0.6", "rcedit": "^1.1.0", diff --git a/test/browser/index.js b/test/browser/index.js new file mode 100644 index 00000000000..373a0fc2d9f --- /dev/null +++ b/test/browser/index.js @@ -0,0 +1,174 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check + +const path = require('path'); +const glob = require('glob'); +const events = require('events'); +const mocha = require('mocha'); +const url = require('url'); +const minimatch = require('minimatch'); +const playwright = require('playwright'); + +// opts +const defaultReporterName = process.platform === 'win32' ? 'list' : 'spec'; +const optimist = require('optimist') + .describe('grep', 'only run tests matching ').alias('grep', 'g').alias('grep', 'f').string('grep') + .describe('run', 'only run tests matching ').alias('run', 'glob').string('runGlob') + .describe('build', 'run with build output (out-build)').boolean('build') + .describe('reporter', 'the mocha reporter').string('reporter').default('reporter', defaultReporterName) + .describe('reporter-options', 'the mocha reporter options').string('reporter-options').default('reporter-options', '') + .describe('tfs', 'tfs').string('tfs') + .describe('help', 'show the help').alias('help', 'h'); + +// logic +const argv = optimist.argv; + + +const Reporter = (function () { + const reporterPath = path.join(path.dirname(require.resolve('mocha')), 'lib', 'reporters', argv.reporter); + let Reporter; + + try { + Reporter = require(reporterPath); + } catch (err) { + try { + Reporter = require(argv.reporter); + } catch (err) { + Reporter = process.platform === 'win32' ? mocha.reporters.List : mocha.reporters.Spec; + console.warn(`could not load reporter: ${argv.reporter}, using ${Reporter.name}`); + } + } + + // let reporterOptions = argv['reporter-options']; + // reporterOptions = typeof reporterOptions === 'string' ? [reporterOptions] : reporterOptions; + // reporterOptions = reporterOptions.reduce((r, o) => Object.assign(r, parseReporterOption(o)), {}); + + return Reporter +})() + +const outdir = argv.build ? 'out-build' : 'out'; +const out = path.join(__dirname, `../../${outdir}`); + +const testModules = (async function () { + + const defaultGlob = '**/test/**/{common,browser}/**/*.test.js'; + const pattern = argv.glob || defaultGlob + + return new Promise((resolve, reject) => { + glob(pattern, { cwd: out }, (err, files) => { + if (err) { + reject(err); + return; + } + + let modules = files.map(file => file.replace(/\.js$/, '')); + + if (pattern !== defaultGlob) { + // defaultGlob is the biggest set of files + const len = modules.length; + modules = modules.filter(module => !minimatch(module, defaultGlob)); + if (len !== modules.length) { + console.warn(`DROPPED ${len - modules.length} files because ${pattern} is more relaxed than ${defaultGlob}`) + } + } + + resolve(modules); + }); + }) +})(); + + +async function runTestsInBrowser(testModules, browserTypes = ['chromium', 'firefox', 'webkit']) { + + for (const browserType of browserTypes) { + + console.group(`running tests in ${browserType.toUpperCase()}`); + + const browser = await playwright[browserType].launch(); + const context = await browser.newContext(); + + const target = url.pathToFileURL(path.join(__dirname, 'renderer.html')); + const page = await context.newPage(target.href); + + const emitter = new events.EventEmitter(); + await page.exposeFunction('mocha_report', (type, data1, data2) => { + emitter.emit(type, data1, data2) + }); + + page.on('console', async msg => { + console[msg.type()](msg.text(), await Promise.all(msg.args().map(async arg => await arg.jsonValue()))); + }); + + new Reporter(new EchoRunner(emitter)); + + try { + // @ts-ignore + await page.evaluate(modules => loadAndRun(modules), testModules); + } catch (err) { + console.error(err); + } + await browser.close(); + + console.groupEnd(); + } +} + +class EchoRunner extends events.EventEmitter { + + constructor(event) { + super(); + event.on('start', () => this.emit('start')); + event.on('end', () => this.emit('end')); + event.on('suite', (suite) => this.emit('suite', EchoRunner.deserializeSuite(suite))); + event.on('suite end', (suite) => this.emit('suite end', EchoRunner.deserializeSuite(suite))); + event.on('test', (test) => this.emit('test', EchoRunner.deserializeRunnable(test))); + event.on('test end', (test) => this.emit('test end', EchoRunner.deserializeRunnable(test))); + event.on('hook', (hook) => this.emit('hook', EchoRunner.deserializeRunnable(hook))); + event.on('hook end', (hook) => this.emit('hook end', EchoRunner.deserializeRunnable(hook))); + event.on('pass', (test) => this.emit('pass', EchoRunner.deserializeRunnable(test))); + event.on('fail', (test, err) => this.emit('fail', EchoRunner.deserializeRunnable(test), EchoRunner.deserializeError(err))); + event.on('pending', (test) => this.emit('pending', EchoRunner.deserializeRunnable(test))); + } + + static deserializeSuite(suite) { + return { + root: suite.root, + suites: suite.suites, + tests: suite.tests, + title: suite.title, + fullTitle: () => suite.fullTitle, + timeout: () => suite.timeout, + retries: () => suite.retries, + enableTimeouts: () => suite.enableTimeouts, + slow: () => suite.slow, + bail: () => suite.bail + }; + } + + static deserializeRunnable(runnable) { + return { + title: runnable.title, + fullTitle: () => runnable.fullTitle, + async: runnable.async, + slow: () => runnable.slow, + speed: runnable.speed, + duration: runnable.duration + }; + } + + static deserializeError(err) { + const inspect = err.inspect; + err.inspect = () => inspect; + return err; + } +} + +testModules.then(async modules => { + await runTestsInBrowser(modules, ['chromium', 'webkit']); +}).catch(err => { + console.error(err); +}); diff --git a/test/browser/renderer.html b/test/browser/renderer.html new file mode 100644 index 00000000000..fa3692e88a0 --- /dev/null +++ b/test/browser/renderer.html @@ -0,0 +1,131 @@ + + + + + VSCode Tests + + + + +
+ + + + + + + + + + diff --git a/test/browser/renderer.js b/test/browser/renderer.js new file mode 100644 index 00000000000..16fd2568a73 --- /dev/null +++ b/test/browser/renderer.js @@ -0,0 +1,219 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/*eslint-env mocha*/ + +const { ipcRenderer } = require('electron'); +const assert = require('assert'); +const path = require('path'); +const glob = require('glob'); +const util = require('util'); +const bootstrap = require('../../src/bootstrap'); +const coverage = require('../coverage'); + +// Disabled custom inspect. See #38847 +if (util.inspect && util.inspect['defaultOptions']) { + util.inspect['defaultOptions'].customInspect = false; +} + +let _tests_glob = '**/test/**/*.test.js'; +let loader; +let _out; + +function initLoader(opts) { + let outdir = opts.build ? 'out-build' : 'out'; + _out = path.join(__dirname, `../../${outdir}`); + + // setup loader + loader = require(`${_out}/vs/loader`); + const loaderConfig = { + nodeRequire: require, + nodeMain: __filename, + catchError: true, + baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../src')), + paths: { + 'vs': `../${outdir}/vs`, + 'lib': `../${outdir}/lib`, + 'bootstrap-fork': `../${outdir}/bootstrap-fork` + } + }; + + if (opts.coverage) { + // initialize coverage if requested + coverage.initialize(loaderConfig); + } + + loader.require.config(loaderConfig); +} + +function loadTestModules(opts) { + + if (opts.run) { + const files = Array.isArray(opts.run) ? opts.run : [opts.run]; + const modules = files.map(file => { + file = file.replace(/^src/, 'out'); + file = file.replace(/\.ts$/, '.js'); + return path.relative(_out, file).replace(/\.js$/, ''); + }); + return new Promise((resolve, reject) => { + loader.require(modules, resolve, reject); + }); + } + + const pattern = opts.runGlob || _tests_glob; + + return new Promise((resolve, reject) => { + glob(pattern, { cwd: _out }, (err, files) => { + if (err) { + reject(err); + return; + } + const modules = files.map(file => file.replace(/\.js$/, '')); + resolve(modules); + }); + }).then(modules => { + return new Promise((resolve, reject) => { + loader.require(modules, resolve, reject); + }); + }); +} + +function loadTests(opts) { + + const _unexpectedErrors = []; + const _loaderErrors = []; + + // collect loader errors + loader.require.config({ + onError(err) { + _loaderErrors.push(err); + console.error(err); + } + }); + + // collect unexpected errors + loader.require(['vs/base/common/errors'], function (errors) { + errors.setUnexpectedErrorHandler(function (err) { + let stack = (err ? err.stack : null); + if (!stack) { + stack = new Error().stack; + } + + _unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + stack); + }); + }); + + loader.require([opts]) + + return loadTestModules(opts).then(() => { + suite('Unexpected Errors & Loader Errors', function () { + test('should not have unexpected errors', function () { + const errors = _unexpectedErrors.concat(_loaderErrors); + if (errors.length) { + errors.forEach(function (stack) { + console.error(''); + console.error(stack); + }); + assert.ok(false, errors); + } + }); + }); + }); +} + +function serializeSuite(suite) { + return { + root: suite.root, + suites: suite.suites.map(serializeSuite), + tests: suite.tests.map(serializeRunnable), + title: suite.title, + fullTitle: suite.fullTitle(), + timeout: suite.timeout(), + retries: suite.retries(), + enableTimeouts: suite.enableTimeouts(), + slow: suite.slow(), + bail: suite.bail() + }; +} + +function serializeRunnable(runnable) { + return { + title: runnable.title, + fullTitle: runnable.fullTitle(), + async: runnable.async, + slow: runnable.slow(), + speed: runnable.speed, + duration: runnable.duration + }; +} + +function serializeError(err) { + return { + message: err.message, + stack: err.stack, + actual: err.actual, + expected: err.expected, + uncaught: err.uncaught, + showDiff: err.showDiff, + inspect: typeof err.inspect === 'function' ? err.inspect() : '' + }; +} + +class IPCReporter { + + constructor(runner) { + runner.on('start', () => ipcRenderer.send('start')); + runner.on('end', () => ipcRenderer.send('end')); + runner.on('suite', suite => ipcRenderer.send('suite', serializeSuite(suite))); + runner.on('suite end', suite => ipcRenderer.send('suite end', serializeSuite(suite))); + runner.on('test', test => ipcRenderer.send('test', serializeRunnable(test))); + runner.on('test end', test => ipcRenderer.send('test end', serializeRunnable(test))); + runner.on('hook', hook => ipcRenderer.send('hook', serializeRunnable(hook))); + runner.on('hook end', hook => ipcRenderer.send('hook end', serializeRunnable(hook))); + runner.on('pass', test => ipcRenderer.send('pass', serializeRunnable(test))); + runner.on('fail', (test, err) => ipcRenderer.send('fail', serializeRunnable(test), serializeError(err))); + runner.on('pending', test => ipcRenderer.send('pending', serializeRunnable(test))); + } +} + +function runTests(opts) { + + return loadTests(opts).then(() => { + + if (opts.grep) { + mocha.grep(opts.grep); + } + + if (!opts.debug) { + mocha.reporter(IPCReporter); + } + + const runner = mocha.run(() => { + createCoverageReport(opts).then(() => { + ipcRenderer.send('all done'); + }); + }); + + if (opts.debug) { + runner.on('fail', (test, err) => { + + console.error(test.fullTitle()); + console.error(err.stack); + }); + } + }); +} + +ipcRenderer.on('run', (e, opts) => { + initLoader(opts); + runTests(opts).catch(err => { + if (typeof err !== 'string') { + err = JSON.stringify(err); + } + + console.error(err); + ipcRenderer.send('error', err); + }); +}); diff --git a/yarn.lock b/yarn.lock index bc18150bc92..5758850d389 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3238,7 +3238,7 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@^1.0.3: +extract-zip@^1.0.3, extract-zip@^1.6.6: version "1.6.7" resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9" integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k= @@ -4526,6 +4526,14 @@ https-proxy-agent@^2.2.3: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" + integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + husky@^0.13.1: version "0.13.4" resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407" @@ -5186,6 +5194,11 @@ jade@0.26.3: commander "0.6.1" mkdirp "0.3.0" +jpeg-js@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.3.6.tgz#c40382aac9506e7d1f2d856eb02f6c7b2a98b37c" + integrity sha512-MUj2XlMB8kpe+8DJUGH/3UJm4XpI8XEgZQ+CiHDeyrGoKPdW/8FJv6ku+3UiYm5Fz3CWaL+iXmD8Q4Ap6aC1Jw== + js-base64@^2.1.9: version "2.3.2" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf" @@ -5946,6 +5959,11 @@ mime@^1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mime@^2.0.3: + version "2.4.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== + mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" @@ -7012,6 +7030,30 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +playwright-core@=0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-0.10.0.tgz#86699c9cc3e613d733e6635a54aceea1993013d5" + integrity sha512-yernA6yrrBhmb8M5eO6GZsJOrBKWOZszlu65Luz8LP7ryaDExN1sE9XjQBNbiwJ5Gfs8cehtAO7GfTDJt+Z2cQ== + dependencies: + debug "^4.1.0" + extract-zip "^1.6.6" + https-proxy-agent "^3.0.0" + jpeg-js "^0.3.6" + mime "^2.0.3" + pngjs "^3.4.0" + progress "^2.0.3" + proxy-from-env "^1.0.0" + rimraf "^2.6.1" + uuid "^3.4.0" + ws "^6.1.0" + +playwright@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-0.10.0.tgz#d37f7e42e0e868dcc4ec35cb0a8dbc6248457642" + integrity sha512-f3VRME/PIO5NbcWnlCDfXwPC0DAZJ7ETkcAdE+sensLCOkfDtLh97E71ZuxNCaPYsUA6FIPi5syD8pHJW/4hQQ== + dependencies: + playwright-core "=0.10.0" + plist@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c" @@ -7042,6 +7084,11 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" +pngjs@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" + integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -7373,7 +7420,7 @@ progress@^1.1.8: resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= -progress@^2.0.0: +progress@^2.0.0, progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -7396,6 +7443,11 @@ proxy-addr@~2.0.2: forwarded "~0.1.2" ipaddr.js "1.5.2" +proxy-from-env@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" + integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -9453,6 +9505,11 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== +uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + v8-compile-cache@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" @@ -9963,6 +10020,13 @@ ws@^3.3.3: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" + integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + dependencies: + async-limiter "~1.0.0" + xml-name-validator@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-1.0.0.tgz#dcf82ee092322951ef8cc1ba596c9cbfd14a83f1" From 874f759bbe6f591a176bee851f345911fe16b4eb Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 15:25:14 +0100 Subject: [PATCH 126/624] better (disabled) one-by-one loading of files --- test/browser/renderer.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/browser/renderer.html b/test/browser/renderer.html index fa3692e88a0..f1815653511 100644 --- a/test/browser/renderer.html +++ b/test/browser/renderer.html @@ -104,10 +104,9 @@ window.loadAndRun = async function (modules) { // load - // await Promise.all(modules.map(module => new Promise((resolve, reject) =>{ // require([module], resolve, err => { - // console.log("BAD " + module); + // console.log("BAD " + module + JSON.stringify(err, undefined, '\t')); // // console.log(module); // resolve({}); // }); From 890b357e94398210696ff4888e0246b8b6f0695b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 15:33:57 +0100 Subject: [PATCH 127/624] run tests in parallel, tweak presentation --- test/browser/index.js | 61 ++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index 373a0fc2d9f..9c85e985af5 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -82,49 +82,42 @@ const testModules = (async function () { })(); -async function runTestsInBrowser(testModules, browserTypes = ['chromium', 'firefox', 'webkit']) { +async function runTestsInBrowser(testModules, browserType) { - for (const browserType of browserTypes) { + const browser = await playwright[browserType].launch(); + const context = await browser.newContext(); - console.group(`running tests in ${browserType.toUpperCase()}`); + const target = url.pathToFileURL(path.join(__dirname, 'renderer.html')); + const page = await context.newPage(target.href); - const browser = await playwright[browserType].launch(); - const context = await browser.newContext(); + const emitter = new events.EventEmitter(); + await page.exposeFunction('mocha_report', (type, data1, data2) => { + emitter.emit(type, data1, data2) + }); - const target = url.pathToFileURL(path.join(__dirname, 'renderer.html')); - const page = await context.newPage(target.href); + page.on('console', async msg => { + console[msg.type()](msg.text(), await Promise.all(msg.args().map(async arg => await arg.jsonValue()))); + }); - const emitter = new events.EventEmitter(); - await page.exposeFunction('mocha_report', (type, data1, data2) => { - emitter.emit(type, data1, data2) - }); + new Reporter(new EchoRunner(emitter, browserType.toUpperCase())); - page.on('console', async msg => { - console[msg.type()](msg.text(), await Promise.all(msg.args().map(async arg => await arg.jsonValue()))); - }); - - new Reporter(new EchoRunner(emitter)); - - try { - // @ts-ignore - await page.evaluate(modules => loadAndRun(modules), testModules); - } catch (err) { - console.error(err); - } - await browser.close(); - - console.groupEnd(); + try { + // @ts-ignore + await page.evaluate(modules => loadAndRun(modules), testModules); + } catch (err) { + console.error(err); } + await browser.close(); } class EchoRunner extends events.EventEmitter { - constructor(event) { + constructor(event, title = '') { super(); event.on('start', () => this.emit('start')); event.on('end', () => this.emit('end')); - event.on('suite', (suite) => this.emit('suite', EchoRunner.deserializeSuite(suite))); - event.on('suite end', (suite) => this.emit('suite end', EchoRunner.deserializeSuite(suite))); + event.on('suite', (suite) => this.emit('suite', EchoRunner.deserializeSuite(suite, title))); + event.on('suite end', (suite) => this.emit('suite end', EchoRunner.deserializeSuite(suite, title))); event.on('test', (test) => this.emit('test', EchoRunner.deserializeRunnable(test))); event.on('test end', (test) => this.emit('test end', EchoRunner.deserializeRunnable(test))); event.on('hook', (hook) => this.emit('hook', EchoRunner.deserializeRunnable(hook))); @@ -134,12 +127,12 @@ class EchoRunner extends events.EventEmitter { event.on('pending', (test) => this.emit('pending', EchoRunner.deserializeRunnable(test))); } - static deserializeSuite(suite) { + static deserializeSuite(suite, titleExtra) { return { root: suite.root, suites: suite.suites, tests: suite.tests, - title: suite.title, + title: titleExtra && suite.title ? `${suite.title} - /${titleExtra}/` : suite.title, fullTitle: () => suite.fullTitle, timeout: () => suite.timeout, retries: () => suite.retries, @@ -168,7 +161,11 @@ class EchoRunner extends events.EventEmitter { } testModules.then(async modules => { - await runTestsInBrowser(modules, ['chromium', 'webkit']); + await Promise.all([ + runTestsInBrowser(modules, 'chromium'), + runTestsInBrowser(modules, 'webkit'), + // runTestsInBrowser(modules, 'firefox'), + ]); }).catch(err => { console.error(err); }); From 3900de53e044b5417a8fb4bf2ba21a6ea0453f88 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 4 Feb 2020 15:43:23 +0100 Subject: [PATCH 128/624] debug: introduce intregration tests --- .../src/singlefolder-tests/debug.test.ts | 130 ++++++++++++++++++ .../testWorkspace/.vscode/launch.json | 15 ++ .../vscode-api-tests/testWorkspace/debug.js | 10 ++ 3 files changed, 155 insertions(+) create mode 100644 extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts create mode 100644 extensions/vscode-api-tests/testWorkspace/.vscode/launch.json create mode 100644 extensions/vscode-api-tests/testWorkspace/debug.js diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts new file mode 100644 index 00000000000..97eca08bc71 --- /dev/null +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; +import { debug, workspace, commands, window, Disposable } from 'vscode'; +import { basename } from 'path'; +import { disposeAll, createRandomFile } from '../utils'; + +suite('Debug', function () { + + test('breakpoints', async function () { + assert.equal(debug.breakpoints.length, 0); + let onDidChangeBreakpointsCounter = 0; + const toDispose: Disposable[] = []; + let onBreakpointsChange: () => void; + + toDispose.push(debug.onDidChangeBreakpoints(() => { + onDidChangeBreakpointsCounter++; + if (onBreakpointsChange) { + onBreakpointsChange(); + } + })); + + debug.addBreakpoints([{ id: '1', enabled: true }, { id: '2', enabled: false, condition: '2 < 5' }]); + assert.equal(onDidChangeBreakpointsCounter, 1); + assert.equal(debug.breakpoints.length, 2); + assert.equal(debug.breakpoints[0].id, '1'); + assert.equal(debug.breakpoints[1].id, '2'); + assert.equal(debug.breakpoints[1].condition, '2 < 5'); + + debug.removeBreakpoints([{ id: '1', enabled: true }]); + assert.equal(onDidChangeBreakpointsCounter, 2); + assert.equal(debug.breakpoints.length, 1); + + debug.removeBreakpoints([{ id: '2', enabled: false }]); + assert.equal(onDidChangeBreakpointsCounter, 3); + assert.equal(debug.breakpoints.length, 0); + + const file = await createRandomFile('let i = 5;', undefined, '.js'); + const doc = await workspace.openTextDocument(file); + await window.showTextDocument(doc, undefined, false); + + const breakpointsChanged = new Promise(resolve => onBreakpointsChange = resolve); + await commands.executeCommand('editor.debug.action.toggleBreakpoint'); + await breakpointsChanged; + assert.equal(debug.breakpoints.length, 1); + assert.equal(debug.breakpoints[0].enabled, true); + + const breakpointsChangedSecond = new Promise(resolve => onBreakpointsChange = resolve); + await commands.executeCommand('editor.debug.action.toggleBreakpoint'); + await breakpointsChangedSecond; + assert.equal(debug.breakpoints.length, 0); + + disposeAll(toDispose); + }); + + test('start debugging', async function () { + assert.equal(debug.activeDebugSession, undefined); + let stoppedEvents = 0; + let variablesRetrieved: () => void; + const firstVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + const toDispose: Disposable[] = []; + toDispose.push(debug.registerDebugAdapterTrackerFactory('node2', { + createDebugAdapterTracker: () => ({ + onDidSendMessage: m => { + if (m.event === 'stopped') { + stoppedEvents++; + } + if (m.type === 'response' && m.command === 'variables') { + variablesRetrieved(); + } + } + }) + })); + + const success = await debug.startDebugging(workspace.workspaceFolders![0], 'Launch debug.js'); + assert.equal(success, true); + assert.notEqual(debug.activeDebugSession, undefined); + assert.equal(debug.activeDebugSession?.name, 'Launch debug.js'); + + await firstVariablesRetrieved; + assert.equal(stoppedEvents, 1); + + const secondVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + await commands.executeCommand('workbench.action.debug.stepOver'); + await secondVariablesRetrieved; + assert.equal(stoppedEvents, 2); + const editor = window.activeTextEditor; + assert.notEqual(editor, undefined); + assert.equal(basename(editor!.document.fileName), 'debug.js'); + + const thirdVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + await commands.executeCommand('workbench.action.debug.stepOver'); + await thirdVariablesRetrieved; + assert.equal(stoppedEvents, 3); + + const fourthVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + await commands.executeCommand('workbench.action.debug.stepInto'); + await fourthVariablesRetrieved; + assert.equal(stoppedEvents, 4); + + const fifthVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + await commands.executeCommand('workbench.action.debug.stepOut'); + await fifthVariablesRetrieved; + assert.equal(stoppedEvents, 5); + + let sessionTerminated: () => void; + toDispose.push(debug.onDidTerminateDebugSession(() => { + sessionTerminated(); + })); + const sessionTerminatedPromise = new Promise(resolve => sessionTerminated = resolve); + await commands.executeCommand('workbench.action.debug.stop'); + await sessionTerminatedPromise; + assert.equal(debug.activeDebugSession, undefined); + + disposeAll(toDispose); + }); + + test('start debugging failure', async function () { + let errorCount = 0; + try { + await debug.startDebugging(workspace.workspaceFolders![0], 'non existent'); + } catch (e) { + errorCount++; + } + assert.equal(errorCount, 1); + }); +}); diff --git a/extensions/vscode-api-tests/testWorkspace/.vscode/launch.json b/extensions/vscode-api-tests/testWorkspace/.vscode/launch.json new file mode 100644 index 00000000000..aab0367ea2b --- /dev/null +++ b/extensions/vscode-api-tests/testWorkspace/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch debug.js", + "stopOnEntry": true, + "program": "${workspaceFolder}/debug.js" + } + ] +} diff --git a/extensions/vscode-api-tests/testWorkspace/debug.js b/extensions/vscode-api-tests/testWorkspace/debug.js new file mode 100644 index 00000000000..1ca212281c7 --- /dev/null +++ b/extensions/vscode-api-tests/testWorkspace/debug.js @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +let y = 0; +for (let i = 0; i < 100; i++) { + console.log(y); + y = y + i; +} From 46d1d77dc7ace7a64745d7cc3388f66d6275696c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 15:49:51 +0100 Subject: [PATCH 129/624] debt - use "correct" context key for focused view --- .../contrib/bulkEdit/browser/bulkEdit.contribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts index d5e503165f4..660b56fd9b4 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts @@ -10,7 +10,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; import { WorkspaceEdit } from 'vs/editor/common/modes'; import { BulkEditPane } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditPane'; -import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry } from 'vs/workbench/common/views'; +import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, FocusedViewContext } from 'vs/workbench/common/views'; import { localize } from 'vs/nls'; import { ViewPaneContainer, ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { PaneCompositePanel } from 'vs/workbench/browser/panel'; @@ -168,7 +168,7 @@ registerAction2(class ApplyAction extends Action2 { }], keybinding: { weight: KeybindingWeight.EditorContrib - 10, - when: ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, ContextKeyExpr.equals('activePanel', BulkEditPane.ID), ContextKeyExpr.has('panelFocus')), + when: ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, FocusedViewContext.isEqualTo(BulkEditPane.ID)), primary: KeyMod.Shift + KeyCode.Enter, } }); From d9b6ba716ec9e69f776d52c55cdb887ef511defc Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 15:59:45 +0100 Subject: [PATCH 130/624] Fix schema, use column instead of size & normalize options --- .../editor/browser/viewParts/rulers/rulers.ts | 14 +--- src/vs/editor/common/config/editorOptions.ts | 67 ++++++++++--------- src/vs/monaco.d.ts | 10 ++- 3 files changed, 42 insertions(+), 49 deletions(-) diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 9f0490762d7..68621081a8e 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -92,19 +92,11 @@ export class Rulers extends ViewPart { for (let i = 0, len = this._rulers.length; i < len; i++) { const node = this._renderedRulers[i]; - const srcNode = this._rulers[i]; + const ruler = this._rulers[i]; - let rulerSize, rulerColor = ''; - if (typeof srcNode === 'number') { - rulerSize = srcNode; - } else { - rulerSize = srcNode.size; - rulerColor = `1px 0 0 0 ${srcNode.color} inset`; - } - - node.setBoxShadow(rulerColor); + node.setBoxShadow(ruler.color ? `1px 0 0 0 ${ruler.color} inset` : ``); node.setHeight(Math.min(ctx.scrollHeight, 1000000)); - node.setLeft(rulerSize * this._typicalHalfwidthCharacterWidth); + node.setLeft(ruler.column * this._typicalHalfwidthCharacterWidth); } } } diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 16908e47dd9..73c30dd221b 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -58,7 +58,7 @@ export interface IEditorOptions { * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: IRulerOption[]; + rulers?: (number | IRulerOption)[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -2361,39 +2361,38 @@ export function filterValidationDecorations(options: IComputedEditorOptions): bo //#region rulers -export interface IRulerColorOption { - readonly size: number; - readonly color: string; +export interface IRulerOption { + readonly column: number; + readonly color: string | null; } -export type IRulerOption = number | IRulerColorOption; - -class EditorRulers extends SimpleEditorOption { +class EditorRulers extends BaseEditorOption { constructor() { const defaults: IRulerOption[] = []; - const sizeSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', "Number of monospace characters at which this editor ruler will render.") }; - + const columnSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', "Number of monospace characters at which this editor ruler will render.") }; super( EditorOption.rulers, 'rulers', defaults, { type: 'array', - items: [ - sizeSchema, - { - type: [ - 'object' - ], - properties: { - size: sizeSchema, - color: { - type: 'string', - description: nls.localize('rulers.color', "Color of this editor ruler."), - format: 'color-hex' + items: { + anyOf: [ + columnSchema, + { + type: [ + 'object' + ], + properties: { + column: columnSchema, + color: { + type: 'string', + description: nls.localize('rulers.color', "Color of this editor ruler."), + format: 'color-hex' + } } } - } - ], + ] + }, default: defaults, description: nls.localize('rulers', "Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.") } @@ -2403,17 +2402,21 @@ class EditorRulers extends SimpleEditorOption ((typeof a === 'number') ? a : a.size) - ((typeof b === 'number') ? b : b.size)); + rulers.sort((a, b) => a.column - b.column); return rulers; } return this.defaultValue; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index f11a4d8bd7f..766b1d38f71 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2538,7 +2538,7 @@ declare namespace monaco.editor { * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: IRulerOption[]; + rulers?: (number | IRulerOption)[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -3445,13 +3445,11 @@ declare namespace monaco.editor { readonly renderFn: ((lineNumber: number) => string) | null; } - export interface IRulerColorOption { - readonly size: number; - readonly color: string; + export interface IRulerOption { + readonly column: number; + readonly color: string | null; } - export type IRulerOption = number | IRulerColorOption; - /** * Configuration options for editor scrollbars */ From 8f90e851c557ed7dd1233573874e2f4db5f5e69b Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 4 Feb 2020 16:13:56 +0100 Subject: [PATCH 131/624] remode debug smoke tests --- test/smoke/src/areas/debug/debug.test.ts | 122 ----------------------- test/smoke/src/main.ts | 2 - 2 files changed, 124 deletions(-) delete mode 100644 test/smoke/src/areas/debug/debug.test.ts diff --git a/test/smoke/src/areas/debug/debug.test.ts b/test/smoke/src/areas/debug/debug.test.ts deleted file mode 100644 index ee19ff9fd16..00000000000 --- a/test/smoke/src/areas/debug/debug.test.ts +++ /dev/null @@ -1,122 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as assert from 'assert'; -import * as http from 'http'; -import * as path from 'path'; -import * as fs from 'fs'; -import * as stripJsonComments from 'strip-json-comments'; -import { Application } from '../../../../automation'; - -export function setup() { - describe('Debug', () => { - it('configure launch json', async function () { - const app = this.app as Application; - - await app.workbench.debug.openDebugViewlet(); - await app.workbench.quickopen.openFile('app.js'); - await app.workbench.quickopen.runCommand('Debug: Open launch.json'); - - const launchJsonPath = path.join(app.workspacePathOrFolder, '.vscode', 'launch.json'); - const content = fs.readFileSync(launchJsonPath, 'utf8'); - const config = JSON.parse(stripJsonComments(content)); - config.configurations[0].protocol = 'inspector'; - fs.writeFileSync(launchJsonPath, JSON.stringify(config, undefined, 4), 'utf8'); - - // force load from disk since file events are sometimes missing - await app.workbench.quickopen.runCommand('File: Revert File'); - await app.workbench.editor.waitForEditorContents('launch.json', contents => /"protocol": "inspector"/.test(contents)); - - assert.equal(config.configurations[0].request, 'launch'); - assert.equal(config.configurations[0].type, 'node'); - if (process.platform === 'win32') { - assert.equal(config.configurations[0].program, '${workspaceFolder}\\bin\\www'); - } else { - assert.equal(config.configurations[0].program, '${workspaceFolder}/bin/www'); - } - }); - - it('breakpoints', async function () { - const app = this.app as Application; - - await app.workbench.quickopen.openFile('index.js'); - await app.workbench.debug.setBreakpointOnLine(6); - }); - - let port: number; - it('start debugging', async function () { - const app = this.app as Application; - - port = await app.workbench.debug.startDebugging(); - - await new Promise((c, e) => { - const request = http.get(`http://localhost:${port}`); - request.on('error', e); - app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 6, 'looking for index.js and line 6').then(c, e); - }); - }); - - it('focus stack frames and variables', async function () { - const app = this.app as Application; - - await app.workbench.debug.waitForVariableCount(4, 5); - - await app.workbench.debug.focusStackFrame('layer.js', 'looking for layer.js'); - await app.workbench.debug.waitForVariableCount(5, 6); - - await app.workbench.debug.focusStackFrame('route.js', 'looking for route.js'); - await app.workbench.debug.waitForVariableCount(3, 4); - - await app.workbench.debug.focusStackFrame('index.js', 'looking for index.js'); - await app.workbench.debug.waitForVariableCount(4, 5); - }); - - it('stepOver, stepIn, stepOut', async function () { - const app = this.app as Application; - - await app.workbench.debug.stepIn(); - - const first = await app.workbench.debug.waitForStackFrame(sf => /response\.js$/.test(sf.name), 'looking for response.js'); - await app.workbench.debug.stepOver(); - - await app.workbench.debug.waitForStackFrame(sf => /response\.js$/.test(sf.name) && sf.lineNumber === first.lineNumber + 1, `looking for response.js and line ${first.lineNumber + 1}`); - await app.workbench.debug.stepOut(); - - await app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 7, `looking for index.js and line 7`); - }); - - it('continue', async function () { - const app = this.app as Application; - - await app.workbench.debug.continue(); - - await new Promise((c, e) => { - const request = http.get(`http://localhost:${port}`); - request.on('error', e); - app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 6, `looking for index.js and line 6`).then(c, e); - }); - - }); - - it('debug console', async function () { - const app = this.app as Application; - - await app.workbench.debug.waitForReplCommand('2 + 2', r => r === '4'); - }); - - it('debug console link', async function () { - const app = this.app as Application; - - await app.workbench.debug.waitForReplCommand('"./app.js:5:1"', r => r.includes('app.js')); - await app.workbench.debug.waitForLink(); - }); - - it('stop debugging', async function () { - const app = this.app as Application; - - await app.workbench.debug.stopDebugging(); - }); - }); -} diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 1d84795e1b9..a6095fa6fa5 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -28,7 +28,6 @@ import { setup as setupDataPreferencesTests } from './areas/preferences/preferen import { setup as setupDataSearchTests } from './areas/search/search.test'; import { setup as setupDataCSSTests } from './areas/css/css.test'; import { setup as setupDataEditorTests } from './areas/editor/editor.test'; -import { setup as setupDataDebugTests } from './areas/debug/debug.test'; import { setup as setupDataGitTests } from './areas/git/git.test'; import { setup as setupDataStatusbarTests } from './areas/statusbar/statusbar.test'; import { setup as setupDataExtensionTests } from './areas/extensions/extensions.test'; @@ -303,7 +302,6 @@ describe('Running Code', () => { setupDataSearchTests(); setupDataCSSTests(); setupDataEditorTests(); - if (!opts.web) { setupDataDebugTests(); } setupDataGitTests(); setupDataStatusbarTests(!!opts.web); setupDataExtensionTests(); From 5df43457e8e9638741add99b35e8f30d6626fbff Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 4 Feb 2020 16:32:21 +0100 Subject: [PATCH 132/624] fix foldBackground description --- src/vs/editor/contrib/folding/folding.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/folding/folding.ts b/src/vs/editor/contrib/folding/folding.ts index b236c12ab2a..71cc7b34b0e 100644 --- a/src/vs/editor/contrib/folding/folding.ts +++ b/src/vs/editor/contrib/folding/folding.ts @@ -885,7 +885,7 @@ for (let i = 1; i <= 7; i++) { ); } -export const foldBackgroundBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hc: null }, nls.localize('editorSelectionBackground', "Color of the editor selection.")); +export const foldBackgroundBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hc: null }, nls.localize('foldBackgroundBackground', "Background color behind folded ranges.")); registerThemingParticipant((theme, collector) => { const foldBackground = theme.getColor(foldBackgroundBackground); From 491a17bd714c9e8784dd383cb546958e7bcee909 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 4 Feb 2020 16:39:10 +0100 Subject: [PATCH 133/624] debug integrations tests: better testing of starting of debug --- .../src/singlefolder-tests/debug.test.ts | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts index 97eca08bc71..57bc7b517fe 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -59,8 +59,12 @@ suite('Debug', function () { test('start debugging', async function () { assert.equal(debug.activeDebugSession, undefined); let stoppedEvents = 0; - let variablesRetrieved: () => void; - const firstVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + let variablesReceived: () => void; + let capabilitiesReceived: () => void; + let initializedReceived: () => void; + let configurationDoneReceived: () => void; + + const firstVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); const toDispose: Disposable[] = []; toDispose.push(debug.registerDebugAdapterTrackerFactory('node2', { createDebugAdapterTracker: () => ({ @@ -69,21 +73,37 @@ suite('Debug', function () { stoppedEvents++; } if (m.type === 'response' && m.command === 'variables') { - variablesRetrieved(); + variablesReceived(); + } + if (m.event === 'capabilities') { + capabilitiesReceived(); + } + if (m.event === 'initialized') { + initializedReceived(); + } + if (m.command === 'configurationDone') { + configurationDoneReceived(); } } }) })); + const capabilitiesPromise = new Promise(resolve => capabilitiesReceived = resolve); + const initializedPromise = new Promise(resolve => initializedReceived = resolve); + const configurationDonePromise = new Promise(resolve => configurationDoneReceived = resolve); const success = await debug.startDebugging(workspace.workspaceFolders![0], 'Launch debug.js'); assert.equal(success, true); + await capabilitiesPromise; + await initializedPromise; + await configurationDonePromise; + assert.notEqual(debug.activeDebugSession, undefined); assert.equal(debug.activeDebugSession?.name, 'Launch debug.js'); await firstVariablesRetrieved; assert.equal(stoppedEvents, 1); - const secondVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + const secondVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); await commands.executeCommand('workbench.action.debug.stepOver'); await secondVariablesRetrieved; assert.equal(stoppedEvents, 2); @@ -91,17 +111,17 @@ suite('Debug', function () { assert.notEqual(editor, undefined); assert.equal(basename(editor!.document.fileName), 'debug.js'); - const thirdVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + const thirdVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); await commands.executeCommand('workbench.action.debug.stepOver'); await thirdVariablesRetrieved; assert.equal(stoppedEvents, 3); - const fourthVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + const fourthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); await commands.executeCommand('workbench.action.debug.stepInto'); await fourthVariablesRetrieved; assert.equal(stoppedEvents, 4); - const fifthVariablesRetrieved = new Promise(resolve => variablesRetrieved = resolve); + const fifthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); await commands.executeCommand('workbench.action.debug.stepOut'); await fifthVariablesRetrieved; assert.equal(stoppedEvents, 5); From 16c7551f3664b713835b39faeb6c2db859c87647 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 16:58:20 +0100 Subject: [PATCH 134/624] move git smoke tests to integration tests --- extensions/git/src/api/api1.ts | 6 +- extensions/git/src/api/git.d.ts | 10 +++ extensions/git/src/commands.ts | 4 +- extensions/git/src/git.ts | 10 +-- extensions/git/src/repository.ts | 4 +- extensions/git/src/test/smoke.test.ts | 116 ++++++++++++++++++++++++++ test/smoke/src/areas/git/git.test.ts | 80 ------------------ test/smoke/src/main.ts | 2 - 8 files changed, 136 insertions(+), 96 deletions(-) create mode 100644 extensions/git/src/test/smoke.test.ts delete mode 100644 test/smoke/src/areas/git/git.test.ts diff --git a/extensions/git/src/api/api1.ts b/extensions/git/src/api/api1.ts index 3e389285312..0b6ed8550aa 100644 --- a/extensions/git/src/api/api1.ts +++ b/extensions/git/src/api/api1.ts @@ -5,7 +5,7 @@ import { Model } from '../model'; import { Repository as BaseRepository, Resource } from '../repository'; -import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState } from './git'; +import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState, CommitOptions } from './git'; import { Event, SourceControlInputBox, Uri, SourceControl } from 'vscode'; import { mapEvent } from '../util'; import { toGitUri } from '../uri'; @@ -202,6 +202,10 @@ export class ApiRepository implements Repository { log(options?: LogOptions): Promise { return this._repository.log(options); } + + commit(message: string, opts?: CommitOptions): Promise { + return this._repository.commit(message, opts); + } } export class ApiGit implements Git { diff --git a/extensions/git/src/api/git.d.ts b/extensions/git/src/api/git.d.ts index d3bdd3de44b..e1efe1299fc 100644 --- a/extensions/git/src/api/git.d.ts +++ b/extensions/git/src/api/git.d.ts @@ -121,6 +121,14 @@ export interface LogOptions { readonly maxEntries?: number; } +export interface CommitOptions { + all?: boolean | 'tracked'; + amend?: boolean; + signoff?: boolean; + signCommit?: boolean; + empty?: boolean; +} + export interface Repository { readonly rootUri: Uri; @@ -176,6 +184,8 @@ export interface Repository { blame(path: string): Promise; log(options?: LogOptions): Promise; + + commit(message: string, opts?: CommitOptions): Promise; } export type APIState = 'uninitialized' | 'initialized'; diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 46958a026aa..be0f5387d15 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -9,8 +9,8 @@ import * as path from 'path'; import { commands, Disposable, LineChange, MessageOptions, OutputChannel, Position, ProgressLocation, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder } from 'vscode'; import TelemetryReporter from 'vscode-extension-telemetry'; import * as nls from 'vscode-nls'; -import { Branch, GitErrorCodes, Ref, RefType, Status } from './api/git'; -import { CommitOptions, ForcePushMode, Git, Stash } from './git'; +import { Branch, GitErrorCodes, Ref, RefType, Status, CommitOptions } from './api/git'; +import { ForcePushMode, Git, Stash } from './git'; import { Model } from './model'; import { Repository, Resource, ResourceGroupType } from './repository'; import { applyLineChanges, getModifiedRange, intersectDiffWithRange, invertLineChange, toLineRanges } from './staging'; diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 07baace3704..ebf998d2168 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -15,7 +15,7 @@ import { assign, groupBy, IDisposable, toDisposable, dispose, mkdirp, readBytes, import { CancellationToken, Progress, Uri } from 'vscode'; import { URI } from 'vscode-uri'; import { detectEncoding } from './encoding'; -import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git'; +import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status, CommitOptions } from './api/git'; import * as byline from 'byline'; import { StringDecoder } from 'string_decoder'; @@ -725,14 +725,6 @@ export function parseLsFiles(raw: string): LsFilesElement[] { .map(([, mode, object, stage, file]) => ({ mode, object, stage, file })); } -export interface CommitOptions { - all?: boolean | 'tracked'; - amend?: boolean; - signoff?: boolean; - signCommit?: boolean; - empty?: boolean; -} - export interface PullOptions { unshallow?: boolean; tags?: boolean; diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 0bc8d8ffb71..eefd59bea6a 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -7,10 +7,10 @@ import * as fs from 'fs'; import * as path from 'path'; import { CancellationToken, Command, Disposable, Event, EventEmitter, Memento, OutputChannel, ProgressLocation, ProgressOptions, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, ThemeColor, Uri, window, workspace, WorkspaceEdit, Decoration } from 'vscode'; import * as nls from 'vscode-nls'; -import { Branch, Change, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status } from './api/git'; +import { Branch, Change, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status, CommitOptions } from './api/git'; import { AutoFetcher } from './autofetch'; import { debounce, memoize, throttle } from './decorators'; -import { Commit, CommitOptions, ForcePushMode, GitError, Repository as BaseRepository, Stash, Submodule, LogFileOptions } from './git'; +import { Commit, ForcePushMode, GitError, Repository as BaseRepository, Stash, Submodule, LogFileOptions } from './git'; import { StatusBarCommands } from './statusbar'; import { toGitUri } from './uri'; import { anyEvent, combinedDisposable, debounceEvent, dispose, EmptyDisposable, eventToPromise, filterEvent, find, IDisposable, isDescendant, onceEvent } from './util'; diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts new file mode 100644 index 00000000000..c7450780cef --- /dev/null +++ b/extensions/git/src/test/smoke.test.ts @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import 'mocha'; +import * as assert from 'assert'; +import { workspace, commands, window, Uri, WorkspaceEdit, Range, TextDocument, extensions } from 'vscode'; +import * as cp from 'child_process'; +import * as fs from 'fs'; +import * as path from 'path'; +import { GitExtension, API, Repository, Status } from '../api/git'; +import { eventToPromise } from '../util'; + +suite('git smoke test', function () { + const cwd = workspace.workspaceFolders![0].uri.path; + const file = (relativePath: string) => path.join(cwd, relativePath); + const uri = (relativePath: string) => Uri.file(file(relativePath)); + const open = async (relativePath: string) => { + const doc = await workspace.openTextDocument(uri(relativePath)); + await window.showTextDocument(doc); + return doc; + }; + const type = async (doc: TextDocument, text: string) => { + const edit = new WorkspaceEdit(); + const end = doc.lineAt(doc.lineCount - 1).range.end; + edit.replace(doc.uri, new Range(end, end), text); + await workspace.applyEdit(edit); + }; + + let git: API; + let repository: Repository; + + suiteSetup(async function () { + fs.writeFileSync(file('app.js'), 'hello', 'utf8'); + fs.writeFileSync(file('index.pug'), 'hello', 'utf8'); + cp.execSync('git init', { cwd }); + cp.execSync('git config user.name testuser', { cwd }); + cp.execSync('git config user.email monacotools@microsoft.com', { cwd }); + cp.execSync('git add .', { cwd }); + cp.execSync('git commit -m "initial commit"', { cwd }); + + git = extensions.getExtension('vscode.git')!.exports.getAPI(1); + + if (git.repositories.length === 0) { + await eventToPromise(git.onDidOpenRepository); + } + + assert.equal(git.repositories.length, 1); + assert.equal(git.repositories[0].rootUri.path, cwd); + + repository = git.repositories[0]; + }); + + test('reflects working tree changes', async function () { + await commands.executeCommand('workbench.view.scm'); + + const appjs = await open('app.js'); + await type(appjs, ' world'); + await appjs.save(); + await eventToPromise(repository.state.onDidChange); + assert.equal(repository.state.workingTreeChanges.length, 1); + repository.state.workingTreeChanges.some(r => r.uri.path === appjs.uri.path && r.status === Status.MODIFIED); + + fs.writeFileSync(file('newfile.txt'), ''); + const newfile = await open('newfile.txt'); + await type(newfile, 'hey there'); + await newfile.save(); + await repository.status(); + assert.equal(repository.state.workingTreeChanges.length, 2); + repository.state.workingTreeChanges.some(r => r.uri.path === appjs.uri.path && r.status === Status.MODIFIED); + repository.state.workingTreeChanges.some(r => r.uri.path === newfile.uri.path && r.status === Status.UNTRACKED); + }); + + test('opens diff editor', async function () { + const appjs = uri('app.js'); + await commands.executeCommand('git.openChange', appjs); + + assert(window.activeTextEditor); + assert.equal(window.activeTextEditor!.document.uri.path, appjs.path); + + // TODO: how do we really know this is a diff editor? + }); + + test('stages correctly', async function () { + const appjs = uri('app.js'); + const newfile = uri('newfile.txt'); + + await commands.executeCommand('git.stage', appjs); + assert.equal(repository.state.workingTreeChanges.length, 1); + repository.state.workingTreeChanges.some(r => r.uri.path === newfile.path && r.status === Status.UNTRACKED); + assert.equal(repository.state.indexChanges.length, 1); + repository.state.indexChanges.some(r => r.uri.path === appjs.path && r.status === Status.INDEX_MODIFIED); + + await commands.executeCommand('git.unstage', appjs); + assert.equal(repository.state.workingTreeChanges.length, 2); + repository.state.workingTreeChanges.some(r => r.uri.path === appjs.path && r.status === Status.MODIFIED); + repository.state.workingTreeChanges.some(r => r.uri.path === newfile.path && r.status === Status.UNTRACKED); + }); + + test('stages, commits changes and verifies outgoing change', async function () { + const appjs = uri('app.js'); + const newfile = uri('newfile.txt'); + + await commands.executeCommand('git.stage', appjs); + await repository.commit('second commit'); + assert.equal(repository.state.workingTreeChanges.length, 1); + repository.state.workingTreeChanges.some(r => r.uri.path === newfile.path && r.status === Status.UNTRACKED); + assert.equal(repository.state.indexChanges.length, 0); + + await commands.executeCommand('git.stageAll', appjs); + await repository.commit('third commit'); + assert.equal(repository.state.workingTreeChanges.length, 0); + assert.equal(repository.state.indexChanges.length, 0); + }); +}); diff --git a/test/smoke/src/areas/git/git.test.ts b/test/smoke/src/areas/git/git.test.ts deleted file mode 100644 index 0d54066c4e5..00000000000 --- a/test/smoke/src/areas/git/git.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as cp from 'child_process'; -import { Application } from '../../../../automation'; - -const DIFF_EDITOR_LINE_INSERT = '.monaco-diff-editor .editor.modified .line-insert'; -const SYNC_STATUSBAR = 'div[id="workbench.parts.statusbar"] .statusbar-item[title$="Synchronize Changes"]'; - -export function setup() { - describe('Git', () => { - before(async function () { - const app = this.app as Application; - - cp.execSync('git config user.name testuser', { cwd: app.workspacePathOrFolder }); - cp.execSync('git config user.email monacotools@microsoft.com', { cwd: app.workspacePathOrFolder }); - }); - - it('reflects working tree changes', async function () { - const app = this.app as Application; - - await app.workbench.scm.openSCMViewlet(); - - await app.workbench.quickopen.openFile('app.js'); - await app.workbench.editor.waitForTypeInEditor('app.js', '.foo{}'); - await app.workbench.editors.saveOpenedFile(); - - await app.workbench.quickopen.openFile('index.pug'); - await app.workbench.editor.waitForTypeInEditor('index.pug', 'hello world'); - await app.workbench.editors.saveOpenedFile(); - - await app.workbench.scm.refreshSCMViewlet(); - await app.workbench.scm.waitForChange('app.js', 'Modified'); - await app.workbench.scm.waitForChange('index.pug', 'Modified'); - }); - - it('opens diff editor', async function () { - const app = this.app as Application; - - await app.workbench.scm.openSCMViewlet(); - await app.workbench.scm.openChange('app.js'); - await app.code.waitForElement(DIFF_EDITOR_LINE_INSERT); - }); - - it('stages correctly', async function () { - const app = this.app as Application; - - await app.workbench.scm.openSCMViewlet(); - await app.workbench.scm.waitForChange('app.js', 'Modified'); - - await app.workbench.scm.stage('app.js'); - await app.workbench.scm.openChange('app.js'); - await new Promise(c => setTimeout(c, 1000)); - await app.workbench.scm.unstage('app.js'); - }); - - it(`stages, commits changes and verifies outgoing change`, async function () { - const app = this.app as Application; - - await app.workbench.scm.openSCMViewlet(); - await app.workbench.scm.waitForChange('app.js', 'Modified'); - - await app.workbench.scm.openChange('app.js'); - await app.workbench.scm.stage('app.js'); - - await app.workbench.scm.commit('first commit'); - await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 1↑'); - - await app.workbench.quickopen.runCommand('Git: Stage All Changes'); - await app.workbench.scm.waitForChange('index.pug', 'Index Modified'); - - await app.workbench.scm.commit('second commit'); - await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 2↑'); - - cp.execSync('git reset --hard origin/master', { cwd: app.workspacePathOrFolder }); - }); - }); -} diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index a6095fa6fa5..7b747a65f66 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -28,7 +28,6 @@ import { setup as setupDataPreferencesTests } from './areas/preferences/preferen import { setup as setupDataSearchTests } from './areas/search/search.test'; import { setup as setupDataCSSTests } from './areas/css/css.test'; import { setup as setupDataEditorTests } from './areas/editor/editor.test'; -import { setup as setupDataGitTests } from './areas/git/git.test'; import { setup as setupDataStatusbarTests } from './areas/statusbar/statusbar.test'; import { setup as setupDataExtensionTests } from './areas/extensions/extensions.test'; import { setup as setupTerminalTests } from './areas/terminal/terminal.test'; @@ -302,7 +301,6 @@ describe('Running Code', () => { setupDataSearchTests(); setupDataCSSTests(); setupDataEditorTests(); - setupDataGitTests(); setupDataStatusbarTests(!!opts.web); setupDataExtensionTests(); setupTerminalTests(); From ec41f20c40f36d1772dece2adbd1a7bd8639fdad Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 17:23:27 +0100 Subject: [PATCH 135/624] Web - run smoke tests using playwright (#89918) * playwright - initial version * browser - use existing page and not create new context * macOS: document how to remove the security flag * smoke test - allow to run against server build with --build option * do not rely on args * fix path for windows * smoke test - smoke :lipstick: and -ci option --- test/automation/package.json | 8 +- test/automation/src/application.ts | 1 + test/automation/src/code.ts | 107 ++++++++------- ...puppeteerDriver.ts => playwrightDriver.ts} | 48 +++---- test/automation/tsconfig.json | 2 +- test/automation/yarn.lock | 91 +++++++----- test/smoke/README.md | 36 ++++- test/smoke/package.json | 2 +- .../areas/workbench/data-migration.test.ts | 1 - test/smoke/src/main.ts | 129 ++++++++++-------- test/smoke/test/index.js | 8 +- test/smoke/yarn.lock | 8 +- 12 files changed, 250 insertions(+), 191 deletions(-) rename test/automation/src/{puppeteerDriver.ts => playwrightDriver.ts} (74%) diff --git a/test/automation/package.json b/test/automation/package.json index 297dce969b7..744778d5785 100644 --- a/test/automation/package.json +++ b/test/automation/package.json @@ -22,18 +22,18 @@ "devDependencies": { "@types/mkdirp": "0.5.1", "@types/ncp": "2.0.1", - "@types/node": "8.0.33", - "@types/puppeteer": "^1.19.0", + "@types/debug": "4.1.5", + "@types/node": "^12.11.7", "@types/tmp": "0.1.0", "concurrently": "^3.5.1", "cpx": "^1.5.0", - "typescript": "2.9.2", + "typescript": "3.7.5", "watch": "^1.0.2" }, "dependencies": { "mkdirp": "^0.5.1", "ncp": "^2.0.0", - "puppeteer": "^1.19.0", + "playwright": "0.10.0", "tmp": "0.1.0", "vscode-uri": "^2.0.3" } diff --git a/test/automation/src/application.ts b/test/automation/src/application.ts index 00005eebbf7..e95b5f561c2 100644 --- a/test/automation/src/application.ts +++ b/test/automation/src/application.ts @@ -126,6 +126,7 @@ export class Application { extraArgs, remote: this.options.remote, web: this.options.web, + browser: this.options.browser, headless: this.options.headless }); diff --git a/test/automation/src/code.ts b/test/automation/src/code.ts index 9900d92a880..dfe20727b8d 100644 --- a/test/automation/src/code.ts +++ b/test/automation/src/code.ts @@ -10,7 +10,7 @@ import * as fs from 'fs'; import * as mkdirp from 'mkdirp'; import { tmpName } from 'tmp'; import { IDriver, connect as connectElectronDriver, IDisposable, IElement, Thenable } from './driver'; -import { connect as connectPuppeteerDriver, launch } from './puppeteerDriver'; +import { connect as connectPlaywrightDriver, launch } from './playwrightDriver'; import { Logger } from './logger'; import { ncp } from 'ncp'; import { URI } from 'vscode-uri'; @@ -101,6 +101,8 @@ export interface SpawnOptions { remote?: boolean; /** Run in the web */ web?: boolean; + /** A specific browser to use (requires web: true) */ + browser?: 'chromium' | 'webkit' | 'firefox'; /** Run in headless mode (only applies when web is true) */ headless?: boolean; } @@ -120,68 +122,69 @@ export async function spawn(options: SpawnOptions): Promise { const outPath = codePath ? getBuildOutPath(codePath) : getDevOutPath(); const handle = await createDriverHandle(); - const args = [ - options.workspacePath, - '--skip-getting-started', - '--skip-release-notes', - '--sticky-quickopen', - '--disable-telemetry', - '--disable-updates', - '--disable-crash-reporter', - `--extensions-dir=${options.extensionsPath}`, - `--user-data-dir=${options.userDataDir}`, - '--driver', handle - ]; - - const env = process.env; - - if (options.remote) { - // Replace workspace path with URI - args[0] = `--${options.workspacePath.endsWith('.code-workspace') ? 'file' : 'folder'}-uri=vscode-remote://test+test/${URI.file(options.workspacePath).path}`; - - if (codePath) { - // running against a build: copy the test resolver extension - const testResolverExtPath = path.join(options.extensionsPath, 'vscode-test-resolver'); - if (!fs.existsSync(testResolverExtPath)) { - const orig = path.join(repoPath, 'extensions', 'vscode-test-resolver'); - await new Promise((c, e) => ncp(orig, testResolverExtPath, err => err ? e(err) : c())); - } - } - args.push('--enable-proposed-api=vscode.vscode-test-resolver'); - const remoteDataDir = `${options.userDataDir}-server`; - mkdirp.sync(remoteDataDir); - env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir; - } - - if (!codePath) { - args.unshift(repoPath); - } - - if (options.verbose) { - args.push('--driver-verbose'); - } - - if (options.log) { - args.push('--log', options.log); - } - - if (options.extraArgs) { - args.push(...options.extraArgs); - } - let child: cp.ChildProcess | undefined; let connectDriver: typeof connectElectronDriver; if (options.web) { - await launch(args); - connectDriver = connectPuppeteerDriver.bind(connectPuppeteerDriver, !!options.headless); + await launch(options.userDataDir, options.workspacePath, options.codePath); + connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, !!options.headless, options.browser); } else { + const env = process.env; + + const args = [ + options.workspacePath, + '--skip-getting-started', + '--skip-release-notes', + '--sticky-quickopen', + '--disable-telemetry', + '--disable-updates', + '--disable-crash-reporter', + `--extensions-dir=${options.extensionsPath}`, + `--user-data-dir=${options.userDataDir}`, + '--driver', handle + ]; + + if (options.remote) { + // Replace workspace path with URI + args[0] = `--${options.workspacePath.endsWith('.code-workspace') ? 'file' : 'folder'}-uri=vscode-remote://test+test/${URI.file(options.workspacePath).path}`; + + if (codePath) { + // running against a build: copy the test resolver extension + const testResolverExtPath = path.join(options.extensionsPath, 'vscode-test-resolver'); + if (!fs.existsSync(testResolverExtPath)) { + const orig = path.join(repoPath, 'extensions', 'vscode-test-resolver'); + await new Promise((c, e) => ncp(orig, testResolverExtPath, err => err ? e(err) : c())); + } + } + args.push('--enable-proposed-api=vscode.vscode-test-resolver'); + const remoteDataDir = `${options.userDataDir}-server`; + mkdirp.sync(remoteDataDir); + env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir; + } + + if (!codePath) { + args.unshift(repoPath); + } + + if (options.verbose) { + args.push('--driver-verbose'); + } + + if (options.log) { + args.push('--log', options.log); + } + + if (options.extraArgs) { + args.push(...options.extraArgs); + } + const spawnOptions: cp.SpawnOptions = { env }; child = cp.spawn(electronPath, args, spawnOptions); instances.add(child); child.once('exit', () => instances.delete(child!)); connectDriver = connectElectronDriver; } + return connect(connectDriver, child, outPath, handle, options.logger); } diff --git a/test/automation/src/puppeteerDriver.ts b/test/automation/src/playwrightDriver.ts similarity index 74% rename from test/automation/src/puppeteerDriver.ts rename to test/automation/src/playwrightDriver.ts index 73a118b6043..d1832f0c2e5 100644 --- a/test/automation/src/puppeteerDriver.ts +++ b/test/automation/src/playwrightDriver.ts @@ -3,17 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as puppeteer from 'puppeteer'; +import * as playwright from 'playwright'; import { ChildProcess, spawn } from 'child_process'; import { join } from 'path'; import { mkdir } from 'fs'; import { promisify } from 'util'; import { IDriver, IDisposable } from './driver'; +import { URI } from 'vscode-uri'; const width = 1200; const height = 800; -const vscodeToPuppeteerKey: { [key: string]: string } = { +const vscodeToPlaywrightKey: { [key: string]: string } = { cmd: 'Meta', ctrl: 'Control', shift: 'Shift', @@ -26,7 +27,7 @@ const vscodeToPuppeteerKey: { [key: string]: string } = { home: 'Home' }; -function buildDriver(browser: puppeteer.Browser, page: puppeteer.Page): IDriver { +function buildDriver(browser: playwright.Browser, page: playwright.Page): IDriver { const driver: IDriver = { _serviceBrand: undefined, getWindowIds: () => { @@ -45,8 +46,8 @@ function buildDriver(browser: puppeteer.Browser, page: puppeteer.Page): IDriver const keys = chord.split('+'); const keysDown: string[] = []; for (let i = 0; i < keys.length; i++) { - if (keys[i] in vscodeToPuppeteerKey) { - keys[i] = vscodeToPuppeteerKey[keys[i]]; + if (keys[i] in vscodeToPlaywrightKey) { + keys[i] = vscodeToPlaywrightKey[keys[i]]; } await page.keyboard.down(keys[i]); keysDown.push(keys[i]); @@ -68,7 +69,7 @@ function buildDriver(browser: puppeteer.Browser, page: puppeteer.Page): IDriver await driver.click(windowId, selector, 0, 0); await timeout(100); }, - setValue: async (windowId, selector, text) => page.evaluate(`window.driver.setValue('${selector}', '${text}')`), + setValue: async (windowId, selector, text) => page.evaluate(`window.driver.setValue('${selector}', '${text}')`).then(undefined), getTitle: (windowId) => page.evaluate(`window.driver.getTitle()`), isActiveElement: (windowId, selector) => page.evaluate(`window.driver.isActiveElement('${selector}')`), getElements: (windowId, selector, recursive) => page.evaluate(`window.driver.getElements('${selector}', ${recursive})`), @@ -86,31 +87,32 @@ function timeout(ms: number): Promise { // function runInDriver(call: string, args: (string | boolean)[]): Promise {} -let args: string[] | undefined; let server: ChildProcess | undefined; let endpoint: string | undefined; +let workspacePath: string | undefined; -export async function launch(_args: string[]): Promise { - args = _args; - const agentFolder = args.filter(e => e.includes('--user-data-dir='))[0].replace('--user-data-dir=', ''); +export async function launch(userDataDir: string, _workspacePath: string, codeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH): Promise { + workspacePath = _workspacePath; + const agentFolder = userDataDir; await promisify(mkdir)(agentFolder); const env = { VSCODE_AGENT_FOLDER: agentFolder, + VSCODE_REMOTE_SERVER_PATH: codeServerPath, ...process.env }; let serverLocation: string | undefined; - if (process.env.VSCODE_REMOTE_SERVER_PATH) { - serverLocation = join(process.env.VSCODE_REMOTE_SERVER_PATH, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`); + if (codeServerPath) { + serverLocation = join(codeServerPath, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`); } else { - serverLocation = join(args[0], `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`); + serverLocation = join(__dirname, '..', '..', '..', `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`); } server = spawn( serverLocation, ['--browser', 'none', '--driver', 'web'], { env } ); - server.stderr.on('data', e => console.log('Server stderr: ' + e)); - server.stdout.on('data', e => console.log('Server stdout: ' + e)); + server.stderr?.on('data', e => console.log('Server stderr: ' + e)); + server.stdout?.on('data', e => console.log('Server stdout: ' + e)); process.on('exit', teardown); process.on('SIGINT', teardown); process.on('SIGTERM', teardown); @@ -126,7 +128,7 @@ function teardown(): void { function waitForEndpoint(): Promise { return new Promise(r => { - server!.stdout.on('data', (d: Buffer) => { + server!.stdout?.on('data', (d: Buffer) => { const matches = d.toString('ascii').match(/Web UI available at (.+)/); if (matches !== null) { r(matches[1]); @@ -135,20 +137,18 @@ function waitForEndpoint(): Promise { }); } -export function connect(headless: boolean, outPath: string, handle: string): Promise<{ client: IDisposable, driver: IDriver }> { +export function connect(headless: boolean, engine: 'chromium' | 'webkit' | 'firefox' = 'chromium'): Promise<{ client: IDisposable, driver: IDriver }> { return new Promise(async (c) => { - const browser = await puppeteer.launch({ + const browser = await playwright[engine].launch({ // Run in Edge dev on macOS // executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev', - headless, - slowMo: 80, - args: [`--window-size=${width},${height}`] + headless }); - const page = (await browser.pages())[0]; + const page = (await browser.defaultContext().pages())[0]; await page.setViewport({ width, height }); - await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${args![1]}`); + await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${URI.file(workspacePath!).path}`); const result = { - client: { dispose: () => teardown }, + client: { dispose: () => teardown() }, driver: buildDriver(browser, page) }; c(result); diff --git a/test/automation/tsconfig.json b/test/automation/tsconfig.json index eecaf21a699..24deb99ddf8 100644 --- a/test/automation/tsconfig.json +++ b/test/automation/tsconfig.json @@ -16,6 +16,6 @@ "exclude": [ "node_modules", "out", - "tools", + "tools" ] } diff --git a/test/automation/yarn.lock b/test/automation/yarn.lock index 94a1350861f..65be684bc57 100644 --- a/test/automation/yarn.lock +++ b/test/automation/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@types/debug@4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== + "@types/mkdirp@0.5.1": version "0.5.1" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.1.tgz#ea887cd024f691c1ca67cce20b7606b053e43b0f" @@ -21,17 +26,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.1.tgz#3b5c3a26393c19b400844ac422bd0f631a94d69d" integrity sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw== -"@types/node@8.0.33": - version "8.0.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd" - integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A== - -"@types/puppeteer@^1.19.0": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.19.1.tgz#942ca62288953a0f5fbbc25c103b5f2ba28b60ab" - integrity sha512-ReWZvoEfMiJIA3AG+eM+nCx5GKrU2ANVYY5TC0nbpeiTCtnJbcqnmBbR8TkXMBTvLBYcuTOAELbTcuX73siDNQ== - dependencies: - "@types/node" "*" +"@types/node@^12.11.7": + version "12.12.26" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.26.tgz#213e153babac0ed169d44a6d919501e68f59dea9" + integrity sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA== "@types/tmp@0.1.0": version "0.1.0" @@ -729,10 +727,10 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== -https-proxy-agent@^2.2.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.3.tgz#fb6cd98ed5b9c35056b5a73cd01a8a721d7193d1" - integrity sha512-Ytgnz23gm2DVftnzqRRz2dOXZbGd2uiajSw/95bPp6v53zPRspQjLm/AfBgqbJ2qfeRXWIOMVLpp86+/5yX39Q== +https-proxy-agent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" + integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== dependencies: agent-base "^4.3.0" debug "^3.1.0" @@ -938,6 +936,11 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +jpeg-js@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.3.6.tgz#c40382aac9506e7d1f2d856eb02f6c7b2a98b37c" + integrity sha512-MUj2XlMB8kpe+8DJUGH/3UJm4XpI8XEgZQ+CiHDeyrGoKPdW/8FJv6ku+3UiYm5Fz3CWaL+iXmD8Q4Ap6aC1Jw== + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -1320,6 +1323,35 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +playwright-core@=0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-0.10.0.tgz#86699c9cc3e613d733e6635a54aceea1993013d5" + integrity sha512-yernA6yrrBhmb8M5eO6GZsJOrBKWOZszlu65Luz8LP7ryaDExN1sE9XjQBNbiwJ5Gfs8cehtAO7GfTDJt+Z2cQ== + dependencies: + debug "^4.1.0" + extract-zip "^1.6.6" + https-proxy-agent "^3.0.0" + jpeg-js "^0.3.6" + mime "^2.0.3" + pngjs "^3.4.0" + progress "^2.0.3" + proxy-from-env "^1.0.0" + rimraf "^2.6.1" + uuid "^3.4.0" + ws "^6.1.0" + +playwright@0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-0.10.0.tgz#d37f7e42e0e868dcc4ec35cb0a8dbc6248457642" + integrity sha512-f3VRME/PIO5NbcWnlCDfXwPC0DAZJ7ETkcAdE+sensLCOkfDtLh97E71ZuxNCaPYsUA6FIPi5syD8pHJW/4hQQ== + dependencies: + playwright-core "=0.10.0" + +pngjs@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" + integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -1335,7 +1367,7 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -progress@^2.0.1: +progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -1345,20 +1377,6 @@ proxy-from-env@^1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= -puppeteer@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.19.0.tgz#e3b7b448c2c97933517078d7a2c53687361bebea" - integrity sha512-2S6E6ygpoqcECaagDbBopoSOPDv0pAZvTbnBgUY+6hq0/XDFDOLEMNlHF/SKJlzcaZ9ckiKjKDuueWI3FN/WXw== - dependencies: - debug "^4.1.0" - extract-zip "^1.6.6" - https-proxy-agent "^2.2.1" - mime "^2.0.3" - progress "^2.0.1" - proxy-from-env "^1.0.0" - rimraf "^2.6.1" - ws "^6.1.0" - randomatic@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" @@ -1751,10 +1769,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== +typescript@3.7.5: + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== union-value@^1.0.0: version "1.0.1" @@ -1789,6 +1807,11 @@ util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +uuid@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" diff --git a/test/smoke/README.md b/test/smoke/README.md index 7fc0ced719f..1060250f7fd 100644 --- a/test/smoke/README.md +++ b/test/smoke/README.md @@ -7,15 +7,22 @@ Make sure you are on **Node v10.x**. ```bash # Install Dependencies and Compile yarn --cwd test/smoke +yarn --cwd test/automation -# Dev +# Dev (Electron) yarn smoketest -# Build -yarn smoketest --build PATH_TO_NEW_BUILD_PARENT_FOLDER --stable-build PATH_TO_LAST_STABLE_BUILD_PARENT_FOLDER +# Dev (Web) +yarn smoketest --web --browser -# Remote -yarn smoketest --build PATH_TO_NEW_BUILD_PARENT_FOLDER --remote +# Build (Electron) +yarn smoketest --build --stable-build + +# Build (Web - read instructions below) +yarn smoketest --build --web --browser + +# Remote (Electron) +yarn smoketest --build --remote ``` ### Run for a release @@ -27,18 +34,33 @@ git checkout release/1.22 yarn --cwd test/smoke ``` +#### Electron + In addition to the new build to be released you will need the previous stable build so that the smoketest can test the data migration. The recommended way to make these builds available for the smoketest is by downloading their archive version (\*.zip) and extracting them into two folders. Pass the folder paths to the smoketest as follows: ```bash -yarn smoketest --build PATH_TO_NEW_RELEASE_PARENT_FOLDER --stable-build PATH_TO_LAST_STABLE_RELEASE_PARENT_FOLDER +yarn smoketest --build --stable-build ``` +#### Web + +**macOS**: if you have downloaded the server with web bits, make sure to run the following command before unzipping it to avoid security issues on startup: + +```bash +xattr -d com.apple.quarantine +``` + +There is no support for testing an old version to a new one yet, so simply configure the `--build` command line argument to point to +the web server folder which includes the web client bits (e.g. `vscode-server-darwin-web` for macOS). + +**Note**: make sure to point to the server that includes the client bits! + ### Debug - `--verbose` logs all the low level driver calls made to Code; -- `-f PATTERN` filters the tests to be run. You can also use pretty much any mocha argument; +- `-f PATTERN` (alias `-g PATTERN`) filters the tests to be run. You can also use pretty much any mocha argument; - `--screenshots SCREENSHOT_DIR` captures screenshots when tests fail. ### Develop diff --git a/test/smoke/package.json b/test/smoke/package.json index 2ae2926ada1..28acde77a9f 100644 --- a/test/smoke/package.json +++ b/test/smoke/package.json @@ -27,7 +27,7 @@ "rimraf": "^2.6.1", "strip-json-comments": "^2.0.1", "tmp": "0.0.33", - "typescript": "2.9.2", + "typescript": "3.7.5", "watch": "^1.0.2" } } diff --git a/test/smoke/src/areas/workbench/data-migration.test.ts b/test/smoke/src/areas/workbench/data-migration.test.ts index 0a403bef78d..659fd62952a 100644 --- a/test/smoke/src/areas/workbench/data-migration.test.ts +++ b/test/smoke/src/areas/workbench/data-migration.test.ts @@ -8,7 +8,6 @@ import { join } from 'path'; export function setup(stableCodePath: string, testDataPath: string) { - describe('Data Migration: This test MUST run before releasing by providing the --stable-build command line argument', () => { it(`verifies opened editors are restored`, async function () { if (!stableCodePath) { diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 7b747a65f66..f792cd1ffa8 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -47,6 +47,7 @@ process.once('exit', () => rimraf.sync(testDataPath)); const [, , ...args] = process.argv; const opts = minimist(args, { string: [ + 'browser', 'build', 'stable-build', 'wait-time', @@ -58,7 +59,8 @@ const opts = minimist(args, { 'verbose', 'remote', 'web', - 'headless' + 'headless', + 'ci' ], default: { verbose: false @@ -82,42 +84,46 @@ function fail(errorMessage): void { const repoPath = path.join(__dirname, '..', '..', '..'); -function getDevElectronPath(): string { - const buildPath = path.join(repoPath, '.build'); - const product = require(path.join(repoPath, 'product.json')); - - switch (process.platform) { - case 'darwin': - return path.join(buildPath, 'electron', `${product.nameLong}.app`, 'Contents', 'MacOS', 'Electron'); - case 'linux': - return path.join(buildPath, 'electron', `${product.applicationName}`); - case 'win32': - return path.join(buildPath, 'electron', `${product.nameShort}.exe`); - default: - throw new Error('Unsupported platform.'); - } -} - -function getBuildElectronPath(root: string): string { - switch (process.platform) { - case 'darwin': - return path.join(root, 'Contents', 'MacOS', 'Electron'); - case 'linux': { - const product = require(path.join(root, 'resources', 'app', 'product.json')); - return path.join(root, product.applicationName); - } - case 'win32': { - const product = require(path.join(root, 'resources', 'app', 'product.json')); - return path.join(root, `${product.nameShort}.exe`); - } - default: - throw new Error('Unsupported platform.'); - } -} - let quality: Quality; +// +// #### Electron Smoke Tests #### +// if (!opts.web) { + + function getDevElectronPath(): string { + const buildPath = path.join(repoPath, '.build'); + const product = require(path.join(repoPath, 'product.json')); + + switch (process.platform) { + case 'darwin': + return path.join(buildPath, 'electron', `${product.nameLong}.app`, 'Contents', 'MacOS', 'Electron'); + case 'linux': + return path.join(buildPath, 'electron', `${product.applicationName}`); + case 'win32': + return path.join(buildPath, 'electron', `${product.nameShort}.exe`); + default: + throw new Error('Unsupported platform.'); + } + } + + function getBuildElectronPath(root: string): string { + switch (process.platform) { + case 'darwin': + return path.join(root, 'Contents', 'MacOS', 'Electron'); + case 'linux': { + const product = require(path.join(root, 'resources', 'app', 'product.json')); + return path.join(root, product.applicationName); + } + case 'win32': { + const product = require(path.join(root, 'resources', 'app', 'product.json')); + return path.join(root, `${product.nameShort}.exe`); + } + default: + throw new Error('Unsupported platform.'); + } + } + let testCodePath = opts.build; let stableCodePath = opts['stable-build']; let electronPath: string; @@ -152,8 +158,13 @@ if (!opts.web) { } else { quality = Quality.Stable; } -} else { - let testCodeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH; +} + +// +// #### Web Smoke Tests #### +// +else { + const testCodeServerPath = opts.build || process.env.VSCODE_REMOTE_SERVER_PATH; if (typeof testCodeServerPath === 'string' && !fs.existsSync(testCodeServerPath)) { fail(`Can't find Code server at ${testCodeServerPath}.`); @@ -236,13 +247,13 @@ function createOptions(): ApplicationOptions { screenshotsPath, remote: opts.remote, web: opts.web, + browser: opts.browser, headless: opts.headless }; } before(async function () { - // allow two minutes for setup - this.timeout(2 * 60 * 1000); + this.timeout(2 * 60 * 1000); // allow two minutes for setup await setup(); this.defaultOptions = createOptions(); }); @@ -259,11 +270,7 @@ after(async function () { await new Promise((c, e) => rimraf(testDataPath, { maxBusyTries: 10 }, err => err ? e(err) : c())); }); -if (!opts.web) { - setupDataMigrationTests(opts['stable-build'], testDataPath); -} - -describe('Running Code', () => { +describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => { before(async function () { const app = new Application(this.defaultOptions); await app!.start(opts.web ? false : undefined); @@ -295,19 +302,25 @@ describe('Running Code', () => { }); } - if (!opts.web) { setupDataLossTests(); } - setupDataExplorerTests(); - if (!opts.web) { setupDataPreferencesTests(); } - setupDataSearchTests(); - setupDataCSSTests(); - setupDataEditorTests(); - setupDataStatusbarTests(!!opts.web); - setupDataExtensionTests(); - setupTerminalTests(); - if (!opts.web) { setupDataMultirootTests(); } - setupDataLocalizationTests(); -}); + // CI only tests (must be reliable) + if (opts.ci) { + // TODO@Ben figure out tests that can run continously and reliably + } -if (!opts.web) { - setupLaunchTests(); -} + // Non-CI execution (all tests) + else { + if (!opts.web) { setupDataMigrationTests(opts['stable-build'], testDataPath); } + if (!opts.web) { setupDataLossTests(); } + setupDataExplorerTests(); + if (!opts.web) { setupDataPreferencesTests(); } + setupDataSearchTests(); + setupDataCSSTests(); + setupDataEditorTests(); + setupDataStatusbarTests(!!opts.web); + setupDataExtensionTests(); + setupTerminalTests(); + if (!opts.web) { setupDataMultirootTests(); } + setupDataLocalizationTests(); + if (!opts.web) { setupLaunchTests(); } + } +}); diff --git a/test/smoke/test/index.js b/test/smoke/test/index.js index 71023e7e91f..5e33b701fa3 100644 --- a/test/smoke/test/index.js +++ b/test/smoke/test/index.js @@ -11,16 +11,14 @@ const suite = 'Smoke Tests'; const [, , ...args] = process.argv; const opts = minimist(args, { - string: [ - 'f' - ] + string: ['f', 'g'] }); const options = { - useColors: true, + color: true, timeout: 60000, slow: 30000, - grep: opts['f'] + grep: opts['f'] || opts['g'] }; if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { diff --git a/test/smoke/yarn.lock b/test/smoke/yarn.lock index 82626a55c7a..8649c9859c9 100644 --- a/test/smoke/yarn.lock +++ b/test/smoke/yarn.lock @@ -2122,10 +2122,10 @@ tree-kill@^1.1.0: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== -typescript@2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== +typescript@3.7.5: + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== union-value@^1.0.0: version "1.0.1" From c91898c08fc5a2e6f0ff85c16844510935b8f445 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Tue, 4 Feb 2020 09:06:41 -0800 Subject: [PATCH 136/624] debug: update js-debug-nightly to "2020.1.43263" @ 2020-02-04T17:02:18.597Z --- build/builtInExtensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 464af9c3511..5634eedbb03 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -46,7 +46,7 @@ }, { "name": "ms-vscode.js-debug-nightly", - "version": "2020.1.43263", + "version": "2020.2.408", "forQualities": [ "insider" ], From 3d4e0f874d9fbd02f3224567b12f7b8df661bd99 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 4 Feb 2020 18:10:47 +0100 Subject: [PATCH 137/624] remove enum-based MenuId --- src/vs/platform/actions/common/actions.ts | 57 ----------------------- 1 file changed, 57 deletions(-) diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index dcf943843d6..be405d6d637 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -125,63 +125,6 @@ export class MenuId { } } -export const enum MenuId3 { - CommandPalette, - DebugBreakpointsContext, - DebugCallStackContext, - DebugConsoleContext, - DebugVariablesContext, - DebugWatchContext, - DebugToolBar, - EditorContext, - EditorContextPeek, - EditorTitle, - EditorTitleContext, - EmptyEditorGroupContext, - ExplorerContext, - ExtensionContext, - GlobalActivity, - MenubarAppearanceMenu, - MenubarDebugMenu, - MenubarEditMenu, - MenubarFileMenu, - MenubarGoMenu, - MenubarHelpMenu, - MenubarLayoutMenu, - MenubarNewBreakpointMenu, - MenubarPreferencesMenu, - MenubarRecentMenu, - MenubarSelectionMenu, - MenubarSwitchEditorMenu, - MenubarSwitchGroupMenu, - MenubarTerminalMenu, - MenubarViewMenu, - OpenEditorsContext, - ProblemsPanelContext, - SCMChangeContext, - SCMResourceContext, - SCMResourceFolderContext, - SCMResourceGroupContext, - SCMSourceControl, - SCMTitle, - SearchContext, - StatusBarWindowIndicatorMenu, - TouchBarContext, - TitleBarContext, - TunnelContext, - TunnelInline, - TunnelTitle, - ViewItemContext, - ViewTitle, - ViewTitleContext, - CommentThreadTitle, - CommentThreadActions, - CommentTitle, - CommentActions, - BulkEditTitle, - BulkEditContext, -} - export interface IMenuActionOptions { arg?: any; shouldForwardArgs?: boolean; From 5782094815936ae7b8eb7c7b8b4b3e64c7054d78 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 18:27:56 +0100 Subject: [PATCH 138/624] Tweak API shape to better reflect call style --- src/vs/editor/standalone/browser/standaloneCodeEditor.ts | 2 +- src/vs/monaco.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 82b3f3475e2..bf61c89c899 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -75,7 +75,7 @@ export interface IActionDescriptor { * Method that will be executed when the action is triggered. * @param editor The editor instance is passed in as a convenience */ - run(editor: ICodeEditor, param?: any): void | Promise; + run(editor: ICodeEditor, ...args: any[]): void | Promise; } /** diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index de1d0cb0634..ad9ede1dca1 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1046,7 +1046,7 @@ declare namespace monaco.editor { * Method that will be executed when the action is triggered. * @param editor The editor instance is passed in as a convenience */ - run(editor: ICodeEditor, param?: any): void | Promise; + run(editor: ICodeEditor, ...args: any[]): void | Promise; } /** From 2ce45bf734bf585d9abb89f976190b37838317a6 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 3 Feb 2020 17:32:06 +0100 Subject: [PATCH 139/624] Fixes microsoft/monaco-editor#1796: Expose ConfigurationChangedEvent.hasChanged in the API --- src/vs/editor/common/config/editorOptions.ts | 3 --- src/vs/monaco.d.ts | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 73c30dd221b..adf546ac92b 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -624,9 +624,6 @@ export class ConfigurationChangedEvent { constructor(values: boolean[]) { this._values = values; } - /** - * @internal - */ public hasChanged(id: EditorOption): boolean { return this._values[id]; } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ad9ede1dca1..a683a9b8e2f 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3089,6 +3089,7 @@ declare namespace monaco.editor { * An event describing that the configuration of the editor has changed. */ export class ConfigurationChangedEvent { + hasChanged(id: EditorOption): boolean; } /** From 65fee791989e5c7b1cc9f46684219547c7dd620f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 3 Feb 2020 23:14:21 +0100 Subject: [PATCH 140/624] Add types for MonacoEnvironment (microsoft/monaco-editor#1795) --- build/gulpfile.editor.js | 7 ++++++- build/monaco/monaco.d.ts.recipe | 10 ++++++++-- src/vs/monaco.d.ts | 10 ++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index b686d280189..105402470d8 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -227,8 +227,13 @@ function toExternalDTS(contents) { if (line.indexOf('declare namespace monaco.') === 0) { lines[i] = line.replace('declare namespace monaco.', 'export namespace '); } + + if (line.indexOf('declare let MonacoEnvironment') === 0) { + lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`; + // lines[i] = line.replace('declare namespace monaco.', 'export namespace '); + } } - return lines.join('\n'); + return lines.join('\n').replace(/\n\n\n+/g, '\n\n'); } function filterStream(testFunc) { diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index fdcdf533406..7288af94c9d 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -3,12 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +declare let MonacoEnvironment: monaco.Environment | undefined; + declare namespace monaco { - // THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. - export type Thenable = PromiseLike; + export interface Environment { + baseUrl?: string; + getWorker?(workerId: string, label: string): Worker; + getWorkerUrl?(workerId: string, label: string): string; + } + export interface IDisposable { dispose(): void; } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index a683a9b8e2f..a5e4ed9546d 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3,12 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +declare let MonacoEnvironment: monaco.Environment | undefined; + declare namespace monaco { - // THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. - export type Thenable = PromiseLike; + export interface Environment { + baseUrl?: string; + getWorker?(workerId: string, label: string): Worker; + getWorkerUrl?(workerId: string, label: string): string; + } + export interface IDisposable { dispose(): void; } From b2000e2c38fa5dc6f0372e25788f338ecc80208a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 3 Feb 2020 23:26:07 +0100 Subject: [PATCH 141/624] editor.semanticHighlighting is not an editor instance option --- .../common/config/commonEditorConfig.ts | 5 ++ src/vs/editor/common/config/editorOptions.ts | 51 --------------- .../common/services/modelServiceImpl.ts | 6 +- .../common/standalone/standaloneEnums.ts | 51 ++++++++------- src/vs/monaco.d.ts | 63 ++++++++----------- .../inspectEditorTokens.ts | 5 +- 6 files changed, 64 insertions(+), 117 deletions(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 7a4bc82f8f1..ed8c20c1674 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -484,6 +484,11 @@ const editorConfiguration: IConfigurationNode = { default: true, description: nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.") }, + 'editor.semanticHighlighting.enabled': { + type: 'boolean', + default: true, + description: nls.localize('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.") + }, 'editor.stablePeek': { type: 'boolean', default: false, diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index adf546ac92b..c66c92d66f9 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -1588,55 +1588,6 @@ class EditorHover extends BaseEditorOption>; - -class EditorSemanticHighlighting extends BaseEditorOption { - - constructor() { - const defaults: EditorSemanticHighlightingOptions = { - enabled: true - }; - super( - EditorOption.semanticHighlighting, 'semanticHighlighting', defaults, - { - 'editor.semanticHighlighting.enabled': { - type: 'boolean', - default: defaults.enabled, - description: nls.localize('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.") - } - } - ); - } - - public validate(_input: any): EditorSemanticHighlightingOptions { - if (typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input as IEditorSemanticHighlightingOptions; - return { - enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled) - }; - } -} - -//#endregion - //#region layoutInfo /** @@ -3245,7 +3196,6 @@ export const enum EditorOption { selectionClipboard, selectionHighlight, selectOnLineNumbers, - semanticHighlighting, showFoldingControls, showUnused, snippetSuggestions, @@ -3715,7 +3665,6 @@ export const EditorOptions = { selectOnLineNumbers: register(new EditorBooleanOption( EditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true, )), - semanticHighlighting: register(new EditorSemanticHighlighting()), showFoldingControls: register(new EditorStringEnumOption( EditorOption.showFoldingControls, 'showFoldingControls', 'mouseover' as 'always' | 'mouseover', diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index ece088d6ee4..bc8824d7f89 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -8,7 +8,7 @@ import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecyc import * as platform from 'vs/base/common/platform'; import * as errors from 'vs/base/common/errors'; import { URI } from 'vs/base/common/uri'; -import { EDITOR_MODEL_DEFAULTS, IEditorSemanticHighlightingOptions } from 'vs/editor/common/config/editorOptions'; +import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; import { DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, IIdentifiedSingleEditOperation, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model'; @@ -26,6 +26,10 @@ import { SparseEncodedTokens, MultilineTokens2 } from 'vs/editor/common/model/to import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ILogService, LogLevel } from 'vs/platform/log/common/log'; +export interface IEditorSemanticHighlightingOptions { + enabled?: boolean; +} + function MODEL_ID(resource: URI): string { return resource.toString(); } diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 5041c28367c..fbc5a8afb80 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -250,32 +250,31 @@ export enum EditorOption { selectionClipboard = 82, selectionHighlight = 83, selectOnLineNumbers = 84, - semanticHighlighting = 85, - showFoldingControls = 86, - showUnused = 87, - snippetSuggestions = 88, - smoothScrolling = 89, - stopRenderingLineAfter = 90, - suggest = 91, - suggestFontSize = 92, - suggestLineHeight = 93, - suggestOnTriggerCharacters = 94, - suggestSelection = 95, - tabCompletion = 96, - useTabStops = 97, - wordSeparators = 98, - wordWrap = 99, - wordWrapBreakAfterCharacters = 100, - wordWrapBreakBeforeCharacters = 101, - wordWrapColumn = 102, - wordWrapMinified = 103, - wrappingIndent = 104, - wrappingStrategy = 105, - editorClassName = 106, - pixelRatio = 107, - tabFocusMode = 108, - layoutInfo = 109, - wrappingInfo = 110 + showFoldingControls = 85, + showUnused = 86, + snippetSuggestions = 87, + smoothScrolling = 88, + stopRenderingLineAfter = 89, + suggest = 90, + suggestFontSize = 91, + suggestLineHeight = 92, + suggestOnTriggerCharacters = 93, + suggestSelection = 94, + tabCompletion = 95, + useTabStops = 96, + wordSeparators = 97, + wordWrap = 98, + wordWrapBreakAfterCharacters = 99, + wordWrapBreakBeforeCharacters = 100, + wordWrapColumn = 101, + wordWrapMinified = 102, + wrappingIndent = 103, + wrappingStrategy = 104, + editorClassName = 105, + pixelRatio = 106, + tabFocusMode = 107, + layoutInfo = 108, + wrappingInfo = 109 } /** diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index a5e4ed9546d..2290b759eb8 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3245,17 +3245,6 @@ declare namespace monaco.editor { export type EditorHoverOptions = Readonly>; - /** - * Configuration options for semantic highlighting - */ - export interface IEditorSemanticHighlightingOptions { - /** - * Enable semantic highlighting. - * Defaults to true. - */ - enabled?: boolean; - } - /** * A description for the overview ruler position. */ @@ -3797,32 +3786,31 @@ declare namespace monaco.editor { selectionClipboard = 82, selectionHighlight = 83, selectOnLineNumbers = 84, - semanticHighlighting = 85, - showFoldingControls = 86, - showUnused = 87, - snippetSuggestions = 88, - smoothScrolling = 89, - stopRenderingLineAfter = 90, - suggest = 91, - suggestFontSize = 92, - suggestLineHeight = 93, - suggestOnTriggerCharacters = 94, - suggestSelection = 95, - tabCompletion = 96, - useTabStops = 97, - wordSeparators = 98, - wordWrap = 99, - wordWrapBreakAfterCharacters = 100, - wordWrapBreakBeforeCharacters = 101, - wordWrapColumn = 102, - wordWrapMinified = 103, - wrappingIndent = 104, - wrappingStrategy = 105, - editorClassName = 106, - pixelRatio = 107, - tabFocusMode = 108, - layoutInfo = 109, - wrappingInfo = 110 + showFoldingControls = 85, + showUnused = 86, + snippetSuggestions = 87, + smoothScrolling = 88, + stopRenderingLineAfter = 89, + suggest = 90, + suggestFontSize = 91, + suggestLineHeight = 92, + suggestOnTriggerCharacters = 93, + suggestSelection = 94, + tabCompletion = 95, + useTabStops = 96, + wordSeparators = 97, + wordWrap = 98, + wordWrapBreakAfterCharacters = 99, + wordWrapBreakBeforeCharacters = 100, + wordWrapColumn = 101, + wordWrapMinified = 102, + wrappingIndent = 103, + wrappingStrategy = 104, + editorClassName = 105, + pixelRatio = 106, + tabFocusMode = 107, + layoutInfo = 108, + wrappingInfo = 109 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3910,7 +3898,6 @@ declare namespace monaco.editor { selectionClipboard: IEditorOption; selectionHighlight: IEditorOption; selectOnLineNumbers: IEditorOption; - semanticHighlighting: IEditorOption; showFoldingControls: IEditorOption; showUnused: IEditorOption; snippetSuggestions: IEditorOption; diff --git a/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts b/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts index 21dca4fae63..6868714c914 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts @@ -29,7 +29,10 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { ColorThemeData, TokenStyleDefinitions, TokenStyleDefinition } from 'vs/workbench/services/themes/common/colorThemeData'; import { TokenStylingRule, TokenStyleData } from 'vs/platform/theme/common/tokenClassificationRegistry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import type { IEditorSemanticHighlightingOptions } from 'vs/editor/common/config/editorOptions'; + +export interface IEditorSemanticHighlightingOptions { + enabled?: boolean; +} class InspectEditorTokensController extends Disposable implements IEditorContribution { From 05cf2fc09d8bae616a3b99fa508f22a5f5102276 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 3 Feb 2020 23:37:37 +0100 Subject: [PATCH 142/624] editor monaco.d.ts API tweaks --- src/vs/editor/common/model.ts | 1 + src/vs/editor/common/model/textModelEvents.ts | 1 + .../standalone/browser/standaloneLanguages.ts | 16 ++++++++ src/vs/monaco.d.ts | 41 +++++-------------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/vs/editor/common/model.ts b/src/vs/editor/common/model.ts index 8c7edd2e6f8..b150ede69bb 100644 --- a/src/vs/editor/common/model.ts +++ b/src/vs/editor/common/model.ts @@ -290,6 +290,7 @@ export const enum EndOfLineSequence { /** * An identifier for a single edit operation. + * @internal */ export interface ISingleEditOperationIdentifier { /** diff --git a/src/vs/editor/common/model/textModelEvents.ts b/src/vs/editor/common/model/textModelEvents.ts index fc84cb84f93..11fc0e4165f 100644 --- a/src/vs/editor/common/model/textModelEvents.ts +++ b/src/vs/editor/common/model/textModelEvents.ts @@ -80,6 +80,7 @@ export interface IModelDecorationsChangedEvent { /** * An event describing that some ranges of lines have been tokenized (their tokens have changed). + * @internal */ export interface IModelTokensChangedEvent { readonly tokenizationSupportChanged: boolean; diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 38ff152bdbb..56a723a309e 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -496,6 +496,20 @@ export function registerSelectionRangeProvider(languageId: string, provider: mod return modes.SelectionRangeRegistry.register(languageId, provider); } +/** + * Register a document semantic tokens provider + */ +export function registerDocumentSemanticTokensProvider(languageId: string, provider: modes.DocumentSemanticTokensProvider): IDisposable { + return modes.DocumentSemanticTokensProviderRegistry.register(languageId, provider); +} + +/** + * Register a document range semantic tokens provider + */ +export function registerDocumentRangeSemanticTokensProvider(languageId: string, provider: modes.DocumentRangeSemanticTokensProvider): IDisposable { + return modes.DocumentRangeSemanticTokensProviderRegistry.register(languageId, provider); +} + /** * Contains additional diagnostic information about the context in which * a [code action](#CodeActionProvider.provideCodeActions) is run. @@ -558,6 +572,8 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages { registerFoldingRangeProvider: registerFoldingRangeProvider, registerDeclarationProvider: registerDeclarationProvider, registerSelectionRangeProvider: registerSelectionRangeProvider, + registerDocumentSemanticTokensProvider: registerDocumentSemanticTokensProvider, + registerDocumentRangeSemanticTokensProvider: registerDocumentRangeSemanticTokensProvider, // enums DocumentHighlightKind: standaloneEnums.DocumentHighlightKind, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 2290b759eb8..c4aa3e03146 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1467,20 +1467,6 @@ declare namespace monaco.editor { CRLF = 1 } - /** - * An identifier for a single edit operation. - */ - export interface ISingleEditOperationIdentifier { - /** - * Identifier major - */ - major: number; - /** - * Identifier minor - */ - minor: number; - } - /** * A single edit operation, that acts as a simple replace. * i.e. Replace text at `range` with `text` in model. @@ -2379,23 +2365,6 @@ declare namespace monaco.editor { export interface IModelDecorationsChangedEvent { } - /** - * An event describing that some ranges of lines have been tokenized (their tokens have changed). - */ - export interface IModelTokensChangedEvent { - readonly tokenizationSupportChanged: boolean; - readonly ranges: { - /** - * The start of the range (inclusive) - */ - readonly fromLineNumber: number; - /** - * The end of the range (inclusive) - */ - readonly toLineNumber: number; - }[]; - } - export interface IModelOptionsChangedEvent { readonly tabSize: boolean; readonly indentSize: boolean; @@ -4907,6 +4876,16 @@ declare namespace monaco.languages { */ export function registerSelectionRangeProvider(languageId: string, provider: SelectionRangeProvider): IDisposable; + /** + * Register a document semantic tokens provider + */ + export function registerDocumentSemanticTokensProvider(languageId: string, provider: DocumentSemanticTokensProvider): IDisposable; + + /** + * Register a document range semantic tokens provider + */ + export function registerDocumentRangeSemanticTokensProvider(languageId: string, provider: DocumentRangeSemanticTokensProvider): IDisposable; + /** * Contains additional diagnostic information about the context in which * a [code action](#CodeActionProvider.provideCodeActions) is run. From 4f4e26aec864e324d48ba558de20d9029e93b405 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 4 Feb 2020 18:52:44 +0100 Subject: [PATCH 143/624] debt - move tests to correct layers --- .../test/{ => common}/commands.test.ts | 0 .../files/test/{ => common}/files.test.ts | 1 + .../workspacesMainService.test.ts | 83 ++++- .../electron-browser/backupRestorer.test.ts | 2 +- .../electron-browser/backupTracker.test.ts | 3 +- .../debug/test/browser/baseDebugView.test.ts | 2 +- .../test/browser/debugANSIHandling.test.ts | 2 +- .../debug/test/browser/linkDetector.test.ts | 2 +- .../contrib/debug/test/node/debugger.test.ts | 2 +- .../experimentService.test.ts | 2 +- .../experimentalPrompts.test.ts | 2 +- .../extensionsActions.test.ts | 3 +- .../extensionsTipsService.test.ts | 3 +- .../electron-browser/extensionsViews.test.ts | 3 +- .../extensionsWorkbenchService.test.ts | 3 +- .../files/test/browser/editorAutoSave.test.ts | 4 +- .../files/test/browser/explorerView.test.ts | 2 +- .../test/browser/fileEditorInput.test.ts | 2 +- .../test/browser/fileEditorTracker.test.ts | 2 +- .../fileOnDiskProvider.test.ts | 2 +- .../electron-browser/explorerModel.test.ts | 2 +- .../{ => browser}/outputLinkProvider.test.ts | 2 +- .../{common => browser}/queryBuilder.test.ts | 44 +-- .../search/test/browser/searchViewlet.test.ts | 2 +- .../electron-browser/queryBuilder.test.ts | 85 +++++ .../workspaceTags.test.ts | 0 .../url/test/browser}/linkProtection.test.ts | 0 .../backupFileService.test.ts | 2 +- .../configurationEditingService.test.ts | 3 +- .../configurationService.test.ts | 3 +- .../configurationResolverService.test.ts | 3 +- .../test/browser/editorGroupsService.test.ts | 2 +- .../editor/test/browser/editorService.test.ts | 2 +- .../test/browser/editorsObserver.test.ts | 2 +- .../extensionEnablementService.test.ts | 2 +- .../test/{ => browser}/history.test.ts | 2 +- .../browserKeyboardMapper.test.ts | 6 +- .../keybindingEditing.test.ts | 10 +- .../keybindingIO.test.ts | 0 .../keyboardMapperTestUtils.ts | 4 +- .../{ => electron-browser}/linux_de_ch.js | 0 .../{ => electron-browser}/linux_de_ch.txt | 0 .../{ => electron-browser}/linux_en_uk.js | 0 .../{ => electron-browser}/linux_en_uk.txt | 0 .../{ => electron-browser}/linux_en_us.js | 0 .../{ => electron-browser}/linux_en_us.txt | 0 .../test/{ => electron-browser}/linux_ru.js | 0 .../test/{ => electron-browser}/linux_ru.txt | 0 .../macLinuxFallbackKeyboardMapper.test.ts | 2 +- .../macLinuxKeyboardMapper.test.ts | 2 +- .../test/{ => electron-browser}/mac_de_ch.js | 0 .../test/{ => electron-browser}/mac_de_ch.txt | 0 .../test/{ => electron-browser}/mac_en_us.js | 0 .../test/{ => electron-browser}/mac_en_us.txt | 0 .../{ => electron-browser}/mac_zh_hant.js | 0 .../{ => electron-browser}/mac_zh_hant.txt | 0 .../test/{ => electron-browser}/win_de_ch.js | 0 .../test/{ => electron-browser}/win_de_ch.txt | 0 .../test/{ => electron-browser}/win_en_us.js | 0 .../test/{ => electron-browser}/win_en_us.txt | 0 .../{ => electron-browser}/win_por_ptb.js | 0 .../{ => electron-browser}/win_por_ptb.txt | 0 .../test/{ => electron-browser}/win_ru.js | 0 .../test/{ => electron-browser}/win_ru.txt | 0 .../windowsKeyboardMapper.test.ts | 2 +- .../label/test/{ => browser}/label.test.ts | 2 +- .../{ => browser}/progressIndicator.test.ts | 2 +- .../{ => browser}/textFileEditorModel.test.ts | 2 +- .../textFileEditorModelManager.test.ts | 2 +- .../{ => browser}/textFileService.test.ts | 4 +- .../{ => common}/saveSequenzializer.test.ts | 0 .../fixtures/binary.txt | Bin .../fixtures/index.html | 0 .../{ => electron-browser}/fixtures/lorem.txt | 0 .../fixtures/lorem_big5.txt | 0 .../fixtures/lorem_cp1252.txt | 0 .../fixtures/lorem_cp866.txt | 0 .../fixtures/lorem_gbk.txt | 0 .../fixtures/lorem_shiftjis.txt | 0 .../fixtures/lorem_utf16be.txt | Bin .../fixtures/lorem_utf16le.txt | Bin .../fixtures/lorem_utf8bom.txt | 0 .../{ => electron-browser}/fixtures/small.txt | 0 .../fixtures/small_umlaut.txt | 0 .../fixtures/some.utf16le | Bin .../fixtures/some_big5.txt | 0 .../fixtures/some_cp1252.txt | 0 .../fixtures/some_cyrillic.txt | 0 .../fixtures/some_gbk.txt | 0 .../fixtures/some_shiftjs.txt | 0 .../fixtures/some_small_cp1252.txt | 0 .../fixtures/some_utf16le.css | Bin .../fixtures/some_utf8_bom.txt | 0 .../fixtures/utf16_be_nobom.txt | Bin .../fixtures/utf16_le_nobom.txt | Bin .../textFileService.io.test.ts | 2 +- .../textModelResolverService.test.ts | 4 +- .../test/common/workingCopyService.test.ts | 2 +- src/vs/workbench/test/browser/part.test.ts | 2 +- .../browser/parts/editor/baseEditor.test.ts | 2 +- .../parts/editor/breadcrumbModel.test.ts | 2 +- .../parts}/editor/editor.test.ts | 2 +- .../parts}/editor/editorDiffModel.test.ts | 4 +- .../parts}/editor/editorGroups.test.ts | 2 +- .../parts}/editor/editorInput.test.ts | 0 .../parts}/editor/editorModel.test.ts | 2 +- .../parts/editor/rangeDecorations.test.ts | 2 +- .../parts}/editor/resourceEditorInput.test.ts | 2 +- .../parts}/editor/untitledTextEditor.test.ts | 2 +- .../test/browser/parts/views/views.test.ts | 2 +- .../{ => browser}/workbenchTestServices.ts | 327 ++---------------- src/vs/workbench/test/common/memento.test.ts | 4 +- .../test/common/workbenchTestServices.ts | 129 +++++++ .../api/mainThreadDocumentsAndEditors.test.ts | 2 +- .../api/mainThreadEditors.test.ts | 2 +- .../api/mainThreadSaveParticipant.test.ts | 2 +- .../api/mainThreadWorkspace.test.ts | 2 +- .../quickopen.perf.integrationTest.ts | 3 +- .../textsearch.perf.integrationTest.ts | 3 +- .../electron-browser/workbenchTestServices.ts | 188 ++++++++++ 120 files changed, 603 insertions(+), 410 deletions(-) rename src/vs/platform/commands/test/{ => common}/commands.test.ts (100%) rename src/vs/platform/files/test/{ => common}/files.test.ts (99%) rename src/vs/workbench/contrib/files/test/{common => browser}/fileOnDiskProvider.test.ts (97%) rename src/vs/workbench/contrib/output/test/{ => browser}/outputLinkProvider.test.ts (99%) rename src/vs/workbench/contrib/search/test/{common => browser}/queryBuilder.test.ts (95%) create mode 100644 src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts rename src/vs/workbench/contrib/tags/test/{ => electron-browser}/workspaceTags.test.ts (100%) rename src/vs/workbench/{test/contrib => contrib/url/test/browser}/linkProtection.test.ts (100%) rename src/vs/workbench/services/history/test/{ => browser}/history.test.ts (99%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/browserKeyboardMapper.test.ts (95%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/keybindingIO.test.ts (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/keyboardMapperTestUtils.ts (95%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_de_ch.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_de_ch.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_en_uk.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_en_uk.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_en_us.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_en_us.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_ru.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/linux_ru.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/macLinuxFallbackKeyboardMapper.test.ts (98%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/macLinuxKeyboardMapper.test.ts (99%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_de_ch.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_de_ch.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_en_us.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_en_us.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_zh_hant.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/mac_zh_hant.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_de_ch.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_de_ch.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_en_us.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_en_us.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_por_ptb.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_por_ptb.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_ru.js (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/win_ru.txt (100%) rename src/vs/workbench/services/keybinding/test/{ => electron-browser}/windowsKeyboardMapper.test.ts (99%) rename src/vs/workbench/services/label/test/{ => browser}/label.test.ts (99%) rename src/vs/workbench/services/progress/test/{ => browser}/progressIndicator.test.ts (99%) rename src/vs/workbench/services/textfile/test/{ => browser}/textFileEditorModel.test.ts (99%) rename src/vs/workbench/services/textfile/test/{ => browser}/textFileEditorModelManager.test.ts (99%) rename src/vs/workbench/services/textfile/test/{ => browser}/textFileService.test.ts (95%) rename src/vs/workbench/services/textfile/test/{ => common}/saveSequenzializer.test.ts (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/binary.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/index.html (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_big5.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_cp1252.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_cp866.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_gbk.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_shiftjis.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_utf16be.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_utf16le.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/lorem_utf8bom.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/small.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/small_umlaut.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some.utf16le (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_big5.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_cp1252.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_cyrillic.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_gbk.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_shiftjs.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_small_cp1252.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_utf16le.css (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/some_utf8_bom.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/utf16_be_nobom.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/fixtures/utf16_le_nobom.txt (100%) rename src/vs/workbench/services/textfile/test/{ => electron-browser}/textFileService.io.test.ts (99%) rename src/vs/workbench/services/textmodelResolver/test/{ => browser}/textModelResolverService.test.ts (97%) rename src/vs/workbench/test/{common => browser/parts}/editor/editor.test.ts (99%) rename src/vs/workbench/test/{common => browser/parts}/editor/editorDiffModel.test.ts (92%) rename src/vs/workbench/test/{common => browser/parts}/editor/editorGroups.test.ts (99%) rename src/vs/workbench/test/{common => browser/parts}/editor/editorInput.test.ts (100%) rename src/vs/workbench/test/{common => browser/parts}/editor/editorModel.test.ts (98%) rename src/vs/workbench/test/{common => browser/parts}/editor/resourceEditorInput.test.ts (98%) rename src/vs/workbench/test/{common => browser/parts}/editor/untitledTextEditor.test.ts (99%) rename src/vs/workbench/test/{ => browser}/workbenchTestServices.ts (78%) create mode 100644 src/vs/workbench/test/common/workbenchTestServices.ts create mode 100644 src/vs/workbench/test/electron-browser/workbenchTestServices.ts diff --git a/src/vs/platform/commands/test/commands.test.ts b/src/vs/platform/commands/test/common/commands.test.ts similarity index 100% rename from src/vs/platform/commands/test/commands.test.ts rename to src/vs/platform/commands/test/common/commands.test.ts diff --git a/src/vs/platform/files/test/files.test.ts b/src/vs/platform/files/test/common/files.test.ts similarity index 99% rename from src/vs/platform/files/test/files.test.ts rename to src/vs/platform/files/test/common/files.test.ts index 153d4201ba6..5956d293b4c 100644 --- a/src/vs/platform/files/test/files.test.ts +++ b/src/vs/platform/files/test/common/files.test.ts @@ -8,6 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { isEqual, isEqualOrParent } from 'vs/base/common/extpath'; import { FileChangeType, FileChangesEvent, isParent } from 'vs/platform/files/common/files'; import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; +// eslint-disable-next-line code-import-patterns import { toResource } from 'vs/base/test/common/utils'; suite('Files', () => { diff --git a/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts b/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts index e082679d700..f460432d840 100644 --- a/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts +++ b/src/vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts @@ -11,14 +11,93 @@ import * as pfs from 'vs/base/node/pfs'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; import { WorkspacesMainService, IStoredWorkspace } from 'vs/platform/workspaces/electron-main/workspacesMainService'; -import { WORKSPACE_EXTENSION, IRawFileWorkspaceFolder, IWorkspaceFolderCreationData, IRawUriWorkspaceFolder, rewriteWorkspaceFileForNewLocation } from 'vs/platform/workspaces/common/workspaces'; +import { WORKSPACE_EXTENSION, IRawFileWorkspaceFolder, IWorkspaceFolderCreationData, IRawUriWorkspaceFolder, rewriteWorkspaceFileForNewLocation, IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { NullLogService } from 'vs/platform/log/common/log'; import { URI } from 'vs/base/common/uri'; import { getRandomTestPath } from 'vs/base/test/node/testUtils'; import { isWindows } from 'vs/base/common/platform'; import { normalizeDriveLetter } from 'vs/base/common/labels'; import { dirname, joinPath } from 'vs/base/common/resources'; -import { TestBackupMainService, TestDialogMainService } from 'vs/workbench/test/workbenchTestServices'; +import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogs'; +import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs'; +import { IBackupMainService, IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup'; +import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; + +export class TestDialogMainService implements IDialogMainService { + _serviceBrand: undefined; + + pickFileFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + pickFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + pickFile(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + pickWorkspace(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + showMessageBox(options: Electron.MessageBoxOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + showSaveDialog(options: Electron.SaveDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } + + showOpenDialog(options: Electron.OpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { + throw new Error('Method not implemented.'); + } +} + +export class TestBackupMainService implements IBackupMainService { + _serviceBrand: undefined; + + isHotExitEnabled(): boolean { + throw new Error('Method not implemented.'); + } + + getWorkspaceBackups(): IWorkspaceBackupInfo[] { + throw new Error('Method not implemented.'); + } + + getFolderBackupPaths(): URI[] { + throw new Error('Method not implemented.'); + } + + getEmptyWindowBackupPaths(): IEmptyWindowBackupInfo[] { + throw new Error('Method not implemented.'); + } + + registerWorkspaceBackupSync(workspace: IWorkspaceBackupInfo, migrateFrom?: string | undefined): string { + throw new Error('Method not implemented.'); + } + + registerFolderBackupSync(folderUri: URI): string { + throw new Error('Method not implemented.'); + } + + registerEmptyWindowBackupSync(backupFolder?: string | undefined, remoteAuthority?: string | undefined): string { + throw new Error('Method not implemented.'); + } + + unregisterWorkspaceBackupSync(workspace: IWorkspaceIdentifier): void { + throw new Error('Method not implemented.'); + } + + unregisterFolderBackupSync(folderUri: URI): void { + throw new Error('Method not implemented.'); + } + + unregisterEmptyWindowBackupSync(backupFolder: string): void { + throw new Error('Method not implemented.'); + } +} suite('WorkspacesMainService', () => { const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'workspacesservice'); diff --git a/src/vs/workbench/contrib/backup/test/electron-browser/backupRestorer.test.ts b/src/vs/workbench/contrib/backup/test/electron-browser/backupRestorer.test.ts index ac8680aea3f..94b546b5a2f 100644 --- a/src/vs/workbench/contrib/backup/test/electron-browser/backupRestorer.test.ts +++ b/src/vs/workbench/contrib/backup/test/electron-browser/backupRestorer.test.ts @@ -15,7 +15,7 @@ import { DefaultEndOfLine } from 'vs/editor/common/model'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { hashPath } from 'vs/workbench/services/backup/node/backupFileService'; import { NativeBackupTracker } from 'vs/workbench/contrib/backup/electron-browser/backupTracker'; -import { TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { BackupRestorer } from 'vs/workbench/contrib/backup/common/backupRestorer'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/contrib/backup/test/electron-browser/backupTracker.test.ts b/src/vs/workbench/contrib/backup/test/electron-browser/backupTracker.test.ts index 4ae7f1e7421..07497c79a54 100644 --- a/src/vs/workbench/contrib/backup/test/electron-browser/backupTracker.test.ts +++ b/src/vs/workbench/contrib/backup/test/electron-browser/backupTracker.test.ts @@ -13,7 +13,7 @@ import { getRandomTestPath } from 'vs/base/test/node/testUtils'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { hashPath } from 'vs/workbench/services/backup/node/backupFileService'; import { NativeBackupTracker } from 'vs/workbench/contrib/backup/electron-browser/backupTracker'; -import { TestTextFileService, workbenchInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestContextService, TestFileService, TestElectronService, TestFileDialogService } from 'vs/workbench/test/workbenchTestServices'; +import { TestLifecycleService, TestFilesConfigurationService, TestContextService, TestFileService, TestFileDialogService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; @@ -42,6 +42,7 @@ import { IElectronService } from 'vs/platform/electron/node/electron'; import { BackupTracker } from 'vs/workbench/contrib/backup/common/backupTracker'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; +import { TestTextFileService, TestElectronService, workbenchInstantiationService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; const userdataDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'backuprestorer'); const backupHome = path.join(userdataDir, 'Backups'); diff --git a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts index 9ecd1023005..eb29ef3a07c 100644 --- a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts @@ -11,7 +11,7 @@ import { MockSession } from 'vs/workbench/contrib/debug/test/common/mockDebug'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { createMockSession } from 'vs/workbench/contrib/debug/test/browser/callStack.test'; import { isStatusbarInDebugMode } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider'; import { State } from 'vs/workbench/contrib/debug/common/debug'; diff --git a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts index dc333048571..6ba96158d52 100644 --- a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts @@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom'; import { generateUuid } from 'vs/base/common/uuid'; import { appendStylizedStringToContainer, handleANSIOutput, calcANSI8bitColor } from 'vs/workbench/contrib/debug/browser/debugANSIHandling'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; import { Color, RGBA } from 'vs/base/common/color'; import { IThemeService } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts b/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts index c98019c513a..b22d2044a9c 100644 --- a/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; import { isWindows } from 'vs/base/common/platform'; import { WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; diff --git a/src/vs/workbench/contrib/debug/test/node/debugger.test.ts b/src/vs/workbench/contrib/debug/test/node/debugger.test.ts index 5105121ce58..8524ab38a8f 100644 --- a/src/vs/workbench/contrib/debug/test/node/debugger.test.ts +++ b/src/vs/workbench/contrib/debug/test/node/debugger.test.ts @@ -11,7 +11,7 @@ import { Debugger } from 'vs/workbench/contrib/debug/common/debugger'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { URI } from 'vs/base/common/uri'; import { ExecutableDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; -import { TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; +import { TestTextResourcePropertiesService } from 'vs/editor/test/common/services/modelService.test'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; 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 d1760d86d52..c15f650b26f 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 @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { ExperimentActionType, ExperimentState, IExperiment, ExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; +import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IExtensionManagementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts index ff693a1f4e3..5c0e4f90a94 100644 --- a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts +++ b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts @@ -15,7 +15,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/browser/experimentalPrompt'; import { ExperimentActionType, ExperimentState, IExperiment, IExperimentActionPromptProperties, IExperimentService, LocalizedPromptText } from 'vs/workbench/contrib/experiments/common/experimentService'; import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; -import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; +import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; suite('Experimental Prompts', () => { let instantiationService: TestInstantiationService; 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 914359dcfca..8332aa9209c 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 @@ -27,7 +27,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestContextService, TestSharedProcessService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { URLService } from 'vs/platform/url/node/urlService'; 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 d89c8cd79ab..d9af9315a0d 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 @@ -22,7 +22,8 @@ import { Emitter } from 'vs/base/common/event'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestContextService, TestLifecycleService, TestSharedProcessService, productService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService, TestLifecycleService, productService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { URI } from 'vs/base/common/uri'; 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 b0c97c59d9d..89f4df2db7c 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 @@ -27,7 +27,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestContextService, TestSharedProcessService, TestMenuService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService, TestMenuService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { URLService } from 'vs/platform/url/node/urlService'; 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 57095928076..13655b0da65 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 @@ -27,7 +27,8 @@ import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestContextService, TestSharedProcessService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { IProgressService } from 'vs/platform/progress/common/progress'; diff --git a/src/vs/workbench/contrib/files/test/browser/editorAutoSave.test.ts b/src/vs/workbench/contrib/files/test/browser/editorAutoSave.test.ts index 7f8f47c2b25..93617ce7314 100644 --- a/src/vs/workbench/contrib/files/test/browser/editorAutoSave.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/editorAutoSave.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { Event } from 'vs/base/common/event'; import { toResource } from 'vs/base/test/common/utils'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { workbenchInstantiationService, TestTextFileService, TestFileService, TestFilesConfigurationService, TestEnvironmentService } from 'vs/workbench/test/workbenchTestServices'; +import { TestFileService, TestFilesConfigurationService, TestEnvironmentService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ITextFileService, IResolvedTextFileEditorModel, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; import { IFileService } from 'vs/platform/files/common/files'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; @@ -32,7 +32,7 @@ class ServiceAccessor { constructor( @IEditorService public editorService: IEditorService, @IEditorGroupsService public editorGroupService: IEditorGroupsService, - @ITextFileService public textFileService: TestTextFileService, + @ITextFileService public textFileService: ITextFileService, @IFileService public fileService: TestFileService, @IConfigurationService public configurationService: TestConfigurationService ) { diff --git a/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts b/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts index 7ad3da744ea..2c40a917185 100644 --- a/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { Emitter } from 'vs/base/common/event'; import { toResource } from 'vs/base/test/common/utils'; -import { TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestFileService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { getContext } from 'vs/workbench/contrib/files/browser/views/explorerView'; import { listInvalidItemForeground } from 'vs/platform/theme/common/colorRegistry'; diff --git a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts index 60d492ba393..3d987628e4f 100644 --- a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { toResource } from 'vs/base/test/common/utils'; import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { EncodingMode, Verbosity } from 'vs/workbench/common/editor'; import { ITextFileService, TextFileOperationError, TextFileOperationResult } from 'vs/workbench/services/textfile/common/textfiles'; diff --git a/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts index 54e1c76d0e0..e98ba327585 100644 --- a/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts @@ -8,7 +8,7 @@ import { Event } from 'vs/base/common/event'; import { FileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/fileEditorTracker'; import { toResource } from 'vs/base/test/common/utils'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { workbenchInstantiationService, TestTextFileService, TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestFileService, TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ITextFileService, IResolvedTextFileEditorModel, snapshotToString } from 'vs/workbench/services/textfile/common/textfiles'; import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/files/common/files'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; diff --git a/src/vs/workbench/contrib/files/test/common/fileOnDiskProvider.test.ts b/src/vs/workbench/contrib/files/test/browser/fileOnDiskProvider.test.ts similarity index 97% rename from src/vs/workbench/contrib/files/test/common/fileOnDiskProvider.test.ts rename to src/vs/workbench/contrib/files/test/browser/fileOnDiskProvider.test.ts index 9c2064028d2..18735013da0 100644 --- a/src/vs/workbench/contrib/files/test/common/fileOnDiskProvider.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileOnDiskProvider.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; -import { workbenchInstantiationService, TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestFileService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TextFileContentProvider } from 'vs/workbench/contrib/files/common/files'; import { snapshotToString } from 'vs/workbench/services/textfile/common/textfiles'; diff --git a/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts b/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts index 6966534a25b..743e1f939ea 100644 --- a/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts +++ b/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts @@ -10,7 +10,7 @@ import { join } from 'vs/base/common/path'; import { validateFileName } from 'vs/workbench/contrib/files/browser/fileActions'; import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { toResource } from 'vs/base/test/common/utils'; -import { TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestFileService } from 'vs/workbench/test/browser/workbenchTestServices'; const fileService = new TestFileService(); function createStat(this: any, path: string, name: string, isFolder: boolean, hasChildren: boolean, size: number, mtime: number): ExplorerItem { diff --git a/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts b/src/vs/workbench/contrib/output/test/browser/outputLinkProvider.test.ts similarity index 99% rename from src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts rename to src/vs/workbench/contrib/output/test/browser/outputLinkProvider.test.ts index 554e84456fe..ce131747b3c 100644 --- a/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts +++ b/src/vs/workbench/contrib/output/test/browser/outputLinkProvider.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { isMacintosh, isLinux, isWindows } from 'vs/base/common/platform'; import { OutputLinkComputer } from 'vs/workbench/contrib/output/common/outputLinkComputer'; -import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; function toOSPath(p: string): string { if (isMacintosh || isLinux) { diff --git a/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts similarity index 95% rename from src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts rename to src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts index ed8fd458877..26f6e129337 100644 --- a/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts @@ -13,7 +13,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IFolderQuery, IPatternInfo, QueryType, ITextQuery, IFileQuery } from 'vs/workbench/services/search/common/search'; import { IWorkspaceContextService, toWorkspaceFolder, Workspace, toWorkspaceFolders } from 'vs/platform/workspace/common/workspace'; import { ISearchPathsInfo, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder'; -import { TestContextService, TestEnvironmentService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices'; import { isWindows } from 'vs/base/common/platform'; const DEFAULT_EDITOR_CONFIG = {}; @@ -584,32 +584,6 @@ suite('QueryBuilder', () => { cases.forEach(testIncludesDataItem); }); - test('includes with tilde', () => { - const userHome = TestEnvironmentService.userHome; - const cases: [string, ISearchPathsInfo][] = [ - [ - '~/foo/bar', - { - searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }] - } - ], - [ - '~/foo/bar, a', - { - searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }], - pattern: patternsToIExpression(...globalGlob('a')) - } - ], - [ - fixPath('/foo/~/bar'), - { - searchPaths: [{ searchPath: getUri('/foo/~/bar') }] - } - ], - ]; - cases.forEach(testIncludesDataItem); - }); - test('relative includes w/single root folder', () => { const cases: [string, ISearchPathsInfo][] = [ [ @@ -949,7 +923,7 @@ function assertEqualTextQueries(actual: ITextQuery, expected: ITextQuery): void return assertEqualQueries(actual, expected); } -function assertEqualQueries(actual: ITextQuery | IFileQuery, expected: ITextQuery | IFileQuery): void { +export function assertEqualQueries(actual: ITextQuery | IFileQuery, expected: ITextQuery | IFileQuery): void { expected = { ...DEFAULT_QUERY_PROPS, ...expected @@ -985,7 +959,7 @@ function assertEqualQueries(actual: ITextQuery | IFileQuery, expected: ITextQuer assert.deepEqual(actual, expected); } -function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected: ISearchPathsInfo, message?: string): void { +export function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected: ISearchPathsInfo, message?: string): void { cleanUndefinedQueryValues(actual); assert.deepEqual(actual.pattern, expected.pattern, message); @@ -1003,7 +977,7 @@ function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected: ISearc * Recursively delete all undefined property values from the search query, to make it easier to * assert.deepEqual with some expected object. */ -function cleanUndefinedQueryValues(q: any): void { +export function cleanUndefinedQueryValues(q: any): void { for (const key in q) { if (q[key] === undefined) { delete q[key]; @@ -1015,24 +989,24 @@ function cleanUndefinedQueryValues(q: any): void { return q; } -function globalGlob(pattern: string): string[] { +export function globalGlob(pattern: string): string[] { return [ `**/${pattern}/**`, `**/${pattern}` ]; } -function patternsToIExpression(...patterns: string[]): IExpression { +export function patternsToIExpression(...patterns: string[]): IExpression { return patterns.length ? patterns.reduce((glob, cur) => { glob[cur] = true; return glob; }, Object.create(null)) : undefined; } -function getUri(...slashPathParts: string[]): uri { +export function getUri(...slashPathParts: string[]): uri { return uri.file(fixPath(...slashPathParts)); } -function fixPath(...slashPathParts: string[]): string { +export function fixPath(...slashPathParts: string[]): string { if (isWindows && slashPathParts.length && !slashPathParts[0].match(/^c:/i)) { slashPathParts.unshift('c:'); } @@ -1040,7 +1014,7 @@ function fixPath(...slashPathParts: string[]): string { return join(...slashPathParts); } -function normalizeExpression(expression: IExpression | undefined): IExpression | undefined { +export function normalizeExpression(expression: IExpression | undefined): IExpression | undefined { if (!expression) { return expression; } diff --git a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts index 7c1ea08b6e3..a1c96e21aa2 100644 --- a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts @@ -13,7 +13,7 @@ import { IFileMatch, ITextSearchMatch, OneLineRange, QueryType, SearchSortOrder import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { FileMatch, Match, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel'; -import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; import { isWindows } from 'vs/base/common/platform'; suite('Search - Viewlet', () => { diff --git a/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts new file mode 100644 index 00000000000..5222422e2b4 --- /dev/null +++ b/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { IWorkspaceContextService, toWorkspaceFolder, Workspace } from 'vs/platform/workspace/common/workspace'; +import { ISearchPathsInfo, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { assertEqualSearchPathResults, getUri, patternsToIExpression, globalGlob, fixPath } from 'vs/workbench/contrib/search/test/browser/queryBuilder.test'; + +const DEFAULT_EDITOR_CONFIG = {}; +const DEFAULT_USER_CONFIG = { useRipgrep: true, useIgnoreFiles: true, useGlobalIgnoreFiles: true }; + +suite('QueryBuilder', () => { + const ROOT_1 = fixPath('/foo/root1'); + const ROOT_1_URI = getUri(ROOT_1); + + let instantiationService: TestInstantiationService; + let queryBuilder: QueryBuilder; + let mockConfigService: TestConfigurationService; + let mockContextService: TestContextService; + let mockWorkspace: Workspace; + + setup(() => { + instantiationService = new TestInstantiationService(); + + mockConfigService = new TestConfigurationService(); + mockConfigService.setUserConfiguration('search', DEFAULT_USER_CONFIG); + mockConfigService.setUserConfiguration('editor', DEFAULT_EDITOR_CONFIG); + instantiationService.stub(IConfigurationService, mockConfigService); + + mockContextService = new TestContextService(); + mockWorkspace = new Workspace('workspace', [toWorkspaceFolder(ROOT_1_URI)]); + mockContextService.setWorkspace(mockWorkspace); + + instantiationService.stub(IWorkspaceContextService, mockContextService); + instantiationService.stub(IEnvironmentService, TestEnvironmentService); + + queryBuilder = instantiationService.createInstance(QueryBuilder); + }); + + suite('parseSearchPaths', () => { + + function testIncludes(includePattern: string, expectedResult: ISearchPathsInfo): void { + assertEqualSearchPathResults( + queryBuilder.parseSearchPaths(includePattern), + expectedResult, + includePattern); + } + + function testIncludesDataItem([includePattern, expectedResult]: [string, ISearchPathsInfo]): void { + testIncludes(includePattern, expectedResult); + } + + test('includes with tilde', () => { + const userHome = TestEnvironmentService.userHome; + const cases: [string, ISearchPathsInfo][] = [ + [ + '~/foo/bar', + { + searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }] + } + ], + [ + '~/foo/bar, a', + { + searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }], + pattern: patternsToIExpression(...globalGlob('a')) + } + ], + [ + fixPath('/foo/~/bar'), + { + searchPaths: [{ searchPath: getUri('/foo/~/bar') }] + } + ], + ]; + cases.forEach(testIncludesDataItem); + }); + }); +}); diff --git a/src/vs/workbench/contrib/tags/test/workspaceTags.test.ts b/src/vs/workbench/contrib/tags/test/electron-browser/workspaceTags.test.ts similarity index 100% rename from src/vs/workbench/contrib/tags/test/workspaceTags.test.ts rename to src/vs/workbench/contrib/tags/test/electron-browser/workspaceTags.test.ts diff --git a/src/vs/workbench/test/contrib/linkProtection.test.ts b/src/vs/workbench/contrib/url/test/browser/linkProtection.test.ts similarity index 100% rename from src/vs/workbench/test/contrib/linkProtection.test.ts rename to src/vs/workbench/contrib/url/test/browser/linkProtection.test.ts diff --git a/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts b/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts index ac020313462..77e239607a4 100644 --- a/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/electron-browser/backupFileService.test.ts @@ -26,7 +26,7 @@ import { hashPath, BackupFileService } from 'vs/workbench/services/backup/node/b import { BACKUPS } from 'vs/platform/environment/common/environment'; import { FileUserDataProvider } from 'vs/workbench/services/userData/common/fileUserDataProvider'; import { VSBuffer } from 'vs/base/common/buffer'; -import { TestWindowConfiguration } from 'vs/workbench/test/workbenchTestServices'; +import { TestWindowConfiguration } from 'vs/workbench/test/electron-browser/workbenchTestServices'; const userdataDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'backupfileservice'); const appSettingsHome = path.join(userdataDir, 'User'); diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts index 07a2bd32de9..606660daeac 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts @@ -12,7 +12,8 @@ import * as json from 'vs/base/common/json'; import { Registry } from 'vs/platform/registry/common/platform'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestTextFileService, workbenchInstantiationService, TestWindowConfiguration } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestWindowConfiguration, TestTextFileService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import * as uuid from 'vs/base/common/uuid'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService'; diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts index 086e6ef8b0a..613a0148272 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts @@ -20,7 +20,8 @@ import { ConfigurationEditingErrorCode } from 'vs/workbench/services/configurati import { IFileService } from 'vs/platform/files/common/files'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace'; import { ConfigurationTarget, IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; -import { workbenchInstantiationService, TestTextFileService, RemoteFileSystemProvider, TestWindowConfiguration } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, RemoteFileSystemProvider } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestWindowConfiguration, TestTextFileService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; diff --git a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts index b853c5ea658..f8ece9854b7 100644 --- a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts @@ -11,7 +11,8 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { TestEditorService, TestContextService, TestWindowConfiguration } from 'vs/workbench/test/workbenchTestServices'; +import { TestEditorService, TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestWindowConfiguration } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { Disposable } from 'vs/base/common/lifecycle'; import { IQuickInputService, IQuickPickItem, QuickPickInput, IPickOptions, Omit, IInputOptions, IQuickInputButton, IQuickPick, IInputBox, IQuickNavigateConfiguration } from 'vs/platform/quickinput/common/quickInput'; 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 014473bce7a..ffcd2cb6215 100644 --- a/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; -import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { GroupDirection, GroupsOrder, MergeGroupMode, GroupOrientation, GroupChangeKind, GroupLocation } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { EditorInput, IFileEditorInput, IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorExtensions, EditorOptions, CloseDirection, IEditorPartOptions, EditorsOrder } from 'vs/workbench/common/editor'; 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 ddec69f8f72..57307219e1e 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -8,7 +8,7 @@ import { EditorActivation, IEditorModel } from 'vs/platform/editor/common/editor import { URI } from 'vs/base/common/uri'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, IFileEditorInput, GroupIdentifier, ISaveOptions, IRevertOptions, EditorsOrder, IEditorInput } from 'vs/workbench/common/editor'; -import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { EditorService, DelegatingEditorService } from 'vs/workbench/services/editor/browser/editorService'; diff --git a/src/vs/workbench/services/editor/test/browser/editorsObserver.test.ts b/src/vs/workbench/services/editor/test/browser/editorsObserver.test.ts index 1dae9361931..b1129a2dc01 100644 --- a/src/vs/workbench/services/editor/test/browser/editorsObserver.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorsObserver.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { EditorOptions, EditorInput, IEditorInputFactoryRegistry, Extensions as EditorExtensions, IEditorInputFactory, IFileEditorInput } from 'vs/workbench/common/editor'; import { URI } from 'vs/base/common/uri'; -import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { IEditorRegistry, EditorDescriptor, Extensions } from 'vs/workbench/browser/editor'; 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 000a28dcee0..7a4ee7ed3cc 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 @@ -21,7 +21,7 @@ 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'; -import { productService } from 'vs/workbench/test/workbenchTestServices'; +import { productService } from 'vs/workbench/test/browser/workbenchTestServices'; import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService'; function createStorageService(instantiationService: TestInstantiationService): IStorageService { diff --git a/src/vs/workbench/services/history/test/history.test.ts b/src/vs/workbench/services/history/test/browser/history.test.ts similarity index 99% rename from src/vs/workbench/services/history/test/history.test.ts rename to src/vs/workbench/services/history/test/browser/history.test.ts index 0ccce7b7c28..6ea008debf7 100644 --- a/src/vs/workbench/services/history/test/history.test.ts +++ b/src/vs/workbench/services/history/test/browser/history.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { EditorOptions, EditorInput, IEditorInputFactoryRegistry, Extensions as EditorExtensions, IEditorInputFactory, IFileEditorInput } from 'vs/workbench/common/editor'; import { URI } from 'vs/base/common/uri'; -import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { IEditorRegistry, EditorDescriptor, Extensions } from 'vs/workbench/browser/editor'; diff --git a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/browserKeyboardMapper.test.ts similarity index 95% rename from src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/browserKeyboardMapper.test.ts index a01c00e3180..93aec7997a5 100644 --- a/src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/browserKeyboardMapper.test.ts @@ -6,13 +6,13 @@ import * as assert from 'assert'; import 'vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin'; // 15% import 'vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin'; import { KeyboardLayoutContribution } from 'vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution'; -import { BrowserKeyboardMapperFactoryBase } from '../browser/keymapService'; -import { KeymapInfo, IKeymapInfo } from '../common/keymapInfo'; +import { BrowserKeyboardMapperFactoryBase } from '../../browser/keymapService'; +import { KeymapInfo, IKeymapInfo } from '../../common/keymapInfo'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase { diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts index 339f4b3b4ce..924ac2bb3b1 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts @@ -38,7 +38,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; -import { TestBackupFileService, TestContextService, TestEditorGroupsService, TestEditorService, TestLifecycleService, TestTextFileService, TestTextResourcePropertiesService, TestWorkingCopyService, TestWindowConfiguration } from 'vs/workbench/test/workbenchTestServices'; +import { TestBackupFileService, TestContextService, TestEditorGroupsService, TestEditorService, TestLifecycleService, TestTextResourcePropertiesService, TestWorkingCopyService } from 'vs/workbench/test/browser/workbenchTestServices'; import { FileService } from 'vs/platform/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; @@ -47,6 +47,10 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; +import { TestWindowConfiguration, TestTextFileService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { LabelService } from 'vs/workbench/services/label/common/labelService'; +import { IFilesConfigurationService, FilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; class TestEnvironmentService extends NativeWorkbenchEnvironmentService { @@ -65,7 +69,7 @@ interface Modifiers { shiftKey?: boolean; } -suite.skip('KeybindingsEditing', () => { +suite('KeybindingsEditing', () => { let instantiationService: TestInstantiationService; let testObject: KeybindingsEditingService; @@ -95,6 +99,8 @@ suite.skip('KeybindingsEditing', () => { instantiationService.stub(ITelemetryService, NullTelemetryService); instantiationService.stub(IModeService, ModeServiceImpl); instantiationService.stub(ILogService, new NullLogService()); + instantiationService.stub(ILabelService, instantiationService.createInstance(LabelService)); + instantiationService.stub(IFilesConfigurationService, instantiationService.createInstance(FilesConfigurationService)); instantiationService.stub(ITextResourcePropertiesService, new TestTextResourcePropertiesService(instantiationService.get(IConfigurationService))); instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); const fileService = new FileService(new NullLogService()); diff --git a/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/keybindingIO.test.ts similarity index 100% rename from src/vs/workbench/services/keybinding/test/keybindingIO.test.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/keybindingIO.test.ts diff --git a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts b/src/vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils.ts similarity index 95% rename from src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils.ts index 7cc3b4be295..5e0f097b7e9 100644 --- a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils.ts @@ -50,7 +50,7 @@ export function assertResolveUserBinding(mapper: IKeyboardMapper, parts: (Simple } export function readRawMapping(file: string): Promise { - return readFile(getPathFromAmdModule(require, `vs/workbench/services/keybinding/test/${file}.js`)).then((buff) => { + return readFile(getPathFromAmdModule(require, `vs/workbench/services/keybinding/test/electron-browser/${file}.js`)).then((buff) => { let contents = buff.toString(); let func = new Function('define', contents); let rawMappings: T | null = null; @@ -62,7 +62,7 @@ export function readRawMapping(file: string): Promise { } export function assertMapping(writeFileIfDifferent: boolean, mapper: IKeyboardMapper, file: string): Promise { - const filePath = path.normalize(getPathFromAmdModule(require, `vs/workbench/services/keybinding/test/${file}`)); + const filePath = path.normalize(getPathFromAmdModule(require, `vs/workbench/services/keybinding/test/electron-browser/${file}`)); return readFile(filePath).then((buff) => { let expected = buff.toString(); diff --git a/src/vs/workbench/services/keybinding/test/linux_de_ch.js b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_de_ch.js rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.js diff --git a/src/vs/workbench/services/keybinding/test/linux_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_de_ch.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt diff --git a/src/vs/workbench/services/keybinding/test/linux_en_uk.js b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_en_uk.js rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.js diff --git a/src/vs/workbench/services/keybinding/test/linux_en_uk.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_en_uk.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt diff --git a/src/vs/workbench/services/keybinding/test/linux_en_us.js b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_us.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_en_us.js rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_en_us.js diff --git a/src/vs/workbench/services/keybinding/test/linux_en_us.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_us.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_en_us.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_en_us.txt diff --git a/src/vs/workbench/services/keybinding/test/linux_ru.js b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_ru.js rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.js diff --git a/src/vs/workbench/services/keybinding/test/linux_ru.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/linux_ru.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt diff --git a/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxFallbackKeyboardMapper.test.ts similarity index 98% rename from src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/macLinuxFallbackKeyboardMapper.test.ts index 410f0ac6644..c61fee376c9 100644 --- a/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxFallbackKeyboardMapper.test.ts @@ -7,7 +7,7 @@ import { KeyChord, KeyCode, KeyMod, SimpleKeybinding, createKeybinding } from 'v import { OperatingSystem } from 'vs/base/common/platform'; import { ScanCode, ScanCodeBinding } from 'vs/base/common/scanCode'; import { MacLinuxFallbackKeyboardMapper } from 'vs/workbench/services/keybinding/common/macLinuxFallbackKeyboardMapper'; -import { IResolvedKeybinding, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding } from 'vs/workbench/services/keybinding/test/keyboardMapperTestUtils'; +import { IResolvedKeybinding, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding } from 'vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils'; suite('keyboardMapper - MAC fallback', () => { diff --git a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts similarity index 99% rename from src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts index d2d22d10600..f4088abc61e 100644 --- a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts @@ -10,7 +10,7 @@ import { OperatingSystem } from 'vs/base/common/platform'; import { ScanCode, ScanCodeBinding, ScanCodeUtils } from 'vs/base/common/scanCode'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { IMacLinuxKeyboardMapping, MacLinuxKeyboardMapper } from 'vs/workbench/services/keybinding/common/macLinuxKeyboardMapper'; -import { IResolvedKeybinding, assertMapping, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding, readRawMapping } from 'vs/workbench/services/keybinding/test/keyboardMapperTestUtils'; +import { IResolvedKeybinding, assertMapping, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding, readRawMapping } from 'vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils'; const WRITE_FILE_IF_DIFFERENT = false; diff --git a/src/vs/workbench/services/keybinding/test/mac_de_ch.js b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_de_ch.js rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.js diff --git a/src/vs/workbench/services/keybinding/test/mac_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_de_ch.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt diff --git a/src/vs/workbench/services/keybinding/test/mac_en_us.js b/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_en_us.js rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.js diff --git a/src/vs/workbench/services/keybinding/test/mac_en_us.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_en_us.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt diff --git a/src/vs/workbench/services/keybinding/test/mac_zh_hant.js b/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_zh_hant.js rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.js diff --git a/src/vs/workbench/services/keybinding/test/mac_zh_hant.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/mac_zh_hant.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt diff --git a/src/vs/workbench/services/keybinding/test/win_de_ch.js b/src/vs/workbench/services/keybinding/test/electron-browser/win_de_ch.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_de_ch.js rename to src/vs/workbench/services/keybinding/test/electron-browser/win_de_ch.js diff --git a/src/vs/workbench/services/keybinding/test/win_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/win_de_ch.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_de_ch.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/win_de_ch.txt diff --git a/src/vs/workbench/services/keybinding/test/win_en_us.js b/src/vs/workbench/services/keybinding/test/electron-browser/win_en_us.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_en_us.js rename to src/vs/workbench/services/keybinding/test/electron-browser/win_en_us.js diff --git a/src/vs/workbench/services/keybinding/test/win_en_us.txt b/src/vs/workbench/services/keybinding/test/electron-browser/win_en_us.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_en_us.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/win_en_us.txt diff --git a/src/vs/workbench/services/keybinding/test/win_por_ptb.js b/src/vs/workbench/services/keybinding/test/electron-browser/win_por_ptb.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_por_ptb.js rename to src/vs/workbench/services/keybinding/test/electron-browser/win_por_ptb.js diff --git a/src/vs/workbench/services/keybinding/test/win_por_ptb.txt b/src/vs/workbench/services/keybinding/test/electron-browser/win_por_ptb.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_por_ptb.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/win_por_ptb.txt diff --git a/src/vs/workbench/services/keybinding/test/win_ru.js b/src/vs/workbench/services/keybinding/test/electron-browser/win_ru.js similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_ru.js rename to src/vs/workbench/services/keybinding/test/electron-browser/win_ru.js diff --git a/src/vs/workbench/services/keybinding/test/win_ru.txt b/src/vs/workbench/services/keybinding/test/electron-browser/win_ru.txt similarity index 100% rename from src/vs/workbench/services/keybinding/test/win_ru.txt rename to src/vs/workbench/services/keybinding/test/electron-browser/win_ru.txt diff --git a/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts similarity index 99% rename from src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts rename to src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts index 10e576b7bd7..5babd01552e 100644 --- a/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts @@ -7,7 +7,7 @@ import { KeyChord, KeyCode, KeyMod, SimpleKeybinding, createKeybinding } from 'v import { OperatingSystem } from 'vs/base/common/platform'; import { ScanCode, ScanCodeBinding } from 'vs/base/common/scanCode'; import { IWindowsKeyboardMapping, WindowsKeyboardMapper } from 'vs/workbench/services/keybinding/common/windowsKeyboardMapper'; -import { IResolvedKeybinding, assertMapping, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding, readRawMapping } from 'vs/workbench/services/keybinding/test/keyboardMapperTestUtils'; +import { IResolvedKeybinding, assertMapping, assertResolveKeybinding, assertResolveKeyboardEvent, assertResolveUserBinding, readRawMapping } from 'vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils'; const WRITE_FILE_IF_DIFFERENT = false; diff --git a/src/vs/workbench/services/label/test/label.test.ts b/src/vs/workbench/services/label/test/browser/label.test.ts similarity index 99% rename from src/vs/workbench/services/label/test/label.test.ts rename to src/vs/workbench/services/label/test/browser/label.test.ts index a0d8af36a20..b9afd8221e9 100644 --- a/src/vs/workbench/services/label/test/label.test.ts +++ b/src/vs/workbench/services/label/test/browser/label.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { TestEnvironmentService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestEnvironmentService, TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { URI } from 'vs/base/common/uri'; import { sep } from 'vs/base/common/path'; diff --git a/src/vs/workbench/services/progress/test/progressIndicator.test.ts b/src/vs/workbench/services/progress/test/browser/progressIndicator.test.ts similarity index 99% rename from src/vs/workbench/services/progress/test/progressIndicator.test.ts rename to src/vs/workbench/services/progress/test/browser/progressIndicator.test.ts index 79f25c0b909..f5f47990d29 100644 --- a/src/vs/workbench/services/progress/test/progressIndicator.test.ts +++ b/src/vs/workbench/services/progress/test/browser/progressIndicator.test.ts @@ -10,7 +10,7 @@ import { CompositeScope, CompositeProgressIndicator } from 'vs/workbench/service import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { TestViewletService, TestPanelService } from 'vs/workbench/test/workbenchTestServices'; +import { TestViewletService, TestPanelService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Event } from 'vs/base/common/event'; import { IView, IViewPaneContainer } from 'vs/workbench/common/views'; diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts b/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts similarity index 99% rename from src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts rename to src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts index 9d4d74cceb3..d6bc866bf8f 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts +++ b/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts @@ -8,7 +8,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { EncodingMode } from 'vs/workbench/common/editor'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { ITextFileService, ModelState, snapshotToString } from 'vs/workbench/services/textfile/common/textfiles'; -import { workbenchInstantiationService, TestTextFileService, createFileInput, TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { createFileInput, TestFileService, TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { FileOperationResult, FileOperationError, IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts b/src/vs/workbench/services/textfile/test/browser/textFileEditorModelManager.test.ts similarity index 99% rename from src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts rename to src/vs/workbench/services/textfile/test/browser/textFileEditorModelManager.test.ts index 8d32fd9113d..ac3289d69ca 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts +++ b/src/vs/workbench/services/textfile/test/browser/textFileEditorModelManager.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; -import { workbenchInstantiationService, TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestFileService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { IFileService, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files'; import { IModelService } from 'vs/editor/common/services/modelService'; diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/browser/textFileService.test.ts similarity index 95% rename from src/vs/workbench/services/textfile/test/textFileService.test.ts rename to src/vs/workbench/services/textfile/test/browser/textFileService.test.ts index ff656aaf791..93536008ec8 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/browser/textFileService.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { workbenchInstantiationService, TestLifecycleService, TestContextService, TestFileService, TestElectronService, TestFilesConfigurationService, TestFileDialogService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestLifecycleService, TestContextService, TestFileService, TestFilesConfigurationService, TestFileDialogService, TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; @@ -15,7 +15,6 @@ import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/commo import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; -import { IElectronService } from 'vs/platform/electron/node/electron'; import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; @@ -27,7 +26,6 @@ class ServiceAccessor { @IWorkspaceContextService public contextService: TestContextService, @IModelService public modelService: ModelServiceImpl, @IFileService public fileService: TestFileService, - @IElectronService public electronService: TestElectronService, @IFileDialogService public fileDialogService: TestFileDialogService ) { } diff --git a/src/vs/workbench/services/textfile/test/saveSequenzializer.test.ts b/src/vs/workbench/services/textfile/test/common/saveSequenzializer.test.ts similarity index 100% rename from src/vs/workbench/services/textfile/test/saveSequenzializer.test.ts rename to src/vs/workbench/services/textfile/test/common/saveSequenzializer.test.ts diff --git a/src/vs/workbench/services/textfile/test/fixtures/binary.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/binary.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/binary.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/binary.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/index.html b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/index.html similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/index.html rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/index.html diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_big5.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_big5.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_big5.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_big5.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_cp1252.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_cp1252.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_cp1252.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_cp1252.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_cp866.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_cp866.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_cp866.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_cp866.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_gbk.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_gbk.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_gbk.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_gbk.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_shiftjis.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_shiftjis.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_shiftjis.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_shiftjis.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_utf16be.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf16be.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_utf16be.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf16be.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_utf16le.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf16le.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_utf16le.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf16le.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/lorem_utf8bom.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf8bom.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/lorem_utf8bom.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/lorem_utf8bom.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/small.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/small.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/small.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/small.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/small_umlaut.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/small_umlaut.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/small_umlaut.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/small_umlaut.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some.utf16le b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some.utf16le similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some.utf16le rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some.utf16le diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_big5.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_big5.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_big5.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_big5.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_cp1252.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_cp1252.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_cp1252.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_cp1252.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_cyrillic.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_cyrillic.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_cyrillic.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_cyrillic.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_gbk.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_gbk.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_gbk.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_gbk.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_shiftjs.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_shiftjs.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_shiftjs.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_shiftjs.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_small_cp1252.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_small_cp1252.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_small_cp1252.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_small_cp1252.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_utf16le.css b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_utf16le.css similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_utf16le.css rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_utf16le.css diff --git a/src/vs/workbench/services/textfile/test/fixtures/some_utf8_bom.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_utf8_bom.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/some_utf8_bom.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/some_utf8_bom.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/utf16_be_nobom.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/utf16_be_nobom.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/utf16_be_nobom.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/utf16_be_nobom.txt diff --git a/src/vs/workbench/services/textfile/test/fixtures/utf16_le_nobom.txt b/src/vs/workbench/services/textfile/test/electron-browser/fixtures/utf16_le_nobom.txt similarity index 100% rename from src/vs/workbench/services/textfile/test/fixtures/utf16_le_nobom.txt rename to src/vs/workbench/services/textfile/test/electron-browser/fixtures/utf16_le_nobom.txt diff --git a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts b/src/vs/workbench/services/textfile/test/electron-browser/textFileService.io.test.ts similarity index 99% rename from src/vs/workbench/services/textfile/test/textFileService.io.test.ts rename to src/vs/workbench/services/textfile/test/electron-browser/textFileService.io.test.ts index 03402b14bf7..d50d6a3bf5e 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts +++ b/src/vs/workbench/services/textfile/test/electron-browser/textFileService.io.test.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { ITextFileService, snapshotToString, TextFileOperationResult, TextFileOperationError } from 'vs/workbench/services/textfile/common/textfiles'; import { IFileService } from 'vs/platform/files/common/files'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; @@ -27,6 +26,7 @@ import { TextModel } from 'vs/editor/common/model/textModel'; import { isWindows } from 'vs/base/common/platform'; import { readFileSync, statSync } from 'fs'; import { detectEncodingByBOM } from 'vs/base/test/node/encoding/encoding.test'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; class ServiceAccessor { constructor( diff --git a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts b/src/vs/workbench/services/textmodelResolver/test/browser/textModelResolverService.test.ts similarity index 97% rename from src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts rename to src/vs/workbench/services/textmodelResolver/test/browser/textModelResolverService.test.ts index eb928f7b836..05a21c0dcf4 100644 --- a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts +++ b/src/vs/workbench/services/textmodelResolver/test/browser/textModelResolverService.test.ts @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -26,7 +26,7 @@ class ServiceAccessor { @ITextModelService public textModelResolverService: ITextModelService, @IModelService public modelService: IModelService, @IModeService public modeService: IModeService, - @ITextFileService public textFileService: TestTextFileService, + @ITextFileService public textFileService: ITextFileService, @IUntitledTextEditorService public untitledTextEditorService: IUntitledTextEditorService ) { } diff --git a/src/vs/workbench/services/workingCopy/test/common/workingCopyService.test.ts b/src/vs/workbench/services/workingCopy/test/common/workingCopyService.test.ts index d20c91df91d..4e189be6867 100644 --- a/src/vs/workbench/services/workingCopy/test/common/workingCopyService.test.ts +++ b/src/vs/workbench/services/workingCopy/test/common/workingCopyService.test.ts @@ -8,7 +8,7 @@ import { IWorkingCopy, IWorkingCopyBackup } from 'vs/workbench/services/workingC import { URI } from 'vs/base/common/uri'; import { Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { TestWorkingCopyService } from 'vs/workbench/test/workbenchTestServices'; +import { TestWorkingCopyService } from 'vs/workbench/test/common/workbenchTestServices'; import { ISaveOptions, IRevertOptions } from 'vs/workbench/common/editor'; import { basename } from 'vs/base/common/resources'; diff --git a/src/vs/workbench/test/browser/part.test.ts b/src/vs/workbench/test/browser/part.test.ts index e0cefdd51c8..63946bb4257 100644 --- a/src/vs/workbench/test/browser/part.test.ts +++ b/src/vs/workbench/test/browser/part.test.ts @@ -8,7 +8,7 @@ import { Part } from 'vs/workbench/browser/part'; import * as Types from 'vs/base/common/types'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { append, $, hide } from 'vs/base/browser/dom'; -import { TestStorageService, TestLayoutService } from 'vs/workbench/test/workbenchTestServices'; +import { TestStorageService, TestLayoutService } from 'vs/workbench/test/browser/workbenchTestServices'; import { StorageScope } from 'vs/platform/storage/common/storage'; class SimplePart extends Part { 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 a2d778aeb88..2bee5d76faa 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -11,7 +11,7 @@ import * as Platform from 'vs/platform/registry/common/platform'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { workbenchInstantiationService, TestEditorGroupView, TestEditorGroupsService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestEditorGroupView, TestEditorGroupsService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { URI } from 'vs/base/common/uri'; diff --git a/src/vs/workbench/test/browser/parts/editor/breadcrumbModel.test.ts b/src/vs/workbench/test/browser/parts/editor/breadcrumbModel.test.ts index 7757b1e08b6..d74c28ef6c4 100644 --- a/src/vs/workbench/test/browser/parts/editor/breadcrumbModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/breadcrumbModel.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { Workspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { EditorBreadcrumbsModel, FileElement } from 'vs/workbench/browser/parts/editor/breadcrumbsModel'; -import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { FileKind } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/test/common/editor/editor.test.ts b/src/vs/workbench/test/browser/parts/editor/editor.test.ts similarity index 99% rename from src/vs/workbench/test/common/editor/editor.test.ts rename to src/vs/workbench/test/browser/parts/editor/editor.test.ts index bcf0f96e508..4f4348a4fc8 100644 --- a/src/vs/workbench/test/common/editor/editor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editor.test.ts @@ -10,7 +10,7 @@ import { IEditorModel } from 'vs/platform/editor/common/editor'; import { URI } from 'vs/base/common/uri'; import { IUntitledTextEditorService, UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Schemas } from 'vs/base/common/network'; class ServiceAccessor { diff --git a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts b/src/vs/workbench/test/browser/parts/editor/editorDiffModel.test.ts similarity index 92% rename from src/vs/workbench/test/common/editor/editorDiffModel.test.ts rename to src/vs/workbench/test/browser/parts/editor/editorDiffModel.test.ts index 662bd56d224..369db0b1abb 100644 --- a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorDiffModel.test.ts @@ -11,8 +11,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { URI } from 'vs/base/common/uri'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ITextModel } from 'vs/editor/common/model'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -21,7 +20,6 @@ class ServiceAccessor { @ITextModelService public textModelResolverService: ITextModelService, @IModelService public modelService: IModelService, @IModeService public modeService: IModeService, - @ITextFileService public textFileService: TestTextFileService ) { } } diff --git a/src/vs/workbench/test/common/editor/editorGroups.test.ts b/src/vs/workbench/test/browser/parts/editor/editorGroups.test.ts similarity index 99% rename from src/vs/workbench/test/common/editor/editorGroups.test.ts rename to src/vs/workbench/test/browser/parts/editor/editorGroups.test.ts index dea9b896e53..d70d7fc2709 100644 --- a/src/vs/workbench/test/common/editor/editorGroups.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorGroups.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { EditorGroup, ISerializedEditorGroup, EditorCloseEvent } from 'vs/workbench/common/editor/editorGroup'; import { Extensions as EditorExtensions, IEditorInputFactoryRegistry, EditorInput, IFileEditorInput, IEditorInputFactory, CloseDirection, EditorsOrder } from 'vs/workbench/common/editor'; import { URI } from 'vs/base/common/uri'; -import { TestLifecycleService, TestContextService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { TestLifecycleService, TestContextService, TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; diff --git a/src/vs/workbench/test/common/editor/editorInput.test.ts b/src/vs/workbench/test/browser/parts/editor/editorInput.test.ts similarity index 100% rename from src/vs/workbench/test/common/editor/editorInput.test.ts rename to src/vs/workbench/test/browser/parts/editor/editorInput.test.ts diff --git a/src/vs/workbench/test/common/editor/editorModel.test.ts b/src/vs/workbench/test/browser/parts/editor/editorModel.test.ts similarity index 98% rename from src/vs/workbench/test/common/editor/editorModel.test.ts rename to src/vs/workbench/test/browser/parts/editor/editorModel.test.ts index c442c63736b..a754831a0a1 100644 --- a/src/vs/workbench/test/common/editor/editorModel.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/editorModel.test.ts @@ -17,7 +17,7 @@ import { ITextBufferFactory } from 'vs/editor/common/model'; import { URI } from 'vs/base/common/uri'; import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; -import { TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; +import { TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices'; class MyEditorModel extends EditorModel { } class MyTextEditorModel extends BaseTextEditorModel { diff --git a/src/vs/workbench/test/browser/parts/editor/rangeDecorations.test.ts b/src/vs/workbench/test/browser/parts/editor/rangeDecorations.test.ts index 22b8c35cbce..c610a4ddbfb 100644 --- a/src/vs/workbench/test/browser/parts/editor/rangeDecorations.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/rangeDecorations.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { URI } from 'vs/base/common/uri'; -import { workbenchInstantiationService, TestEditorService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; diff --git a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts b/src/vs/workbench/test/browser/parts/editor/resourceEditorInput.test.ts similarity index 98% rename from src/vs/workbench/test/common/editor/resourceEditorInput.test.ts rename to src/vs/workbench/test/browser/parts/editor/resourceEditorInput.test.ts index 137ced3b7e4..2eaede4adbc 100644 --- a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/resourceEditorInput.test.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { snapshotToString } from 'vs/workbench/services/textfile/common/textfiles'; diff --git a/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/untitledTextEditor.test.ts similarity index 99% rename from src/vs/workbench/test/common/editor/untitledTextEditor.test.ts rename to src/vs/workbench/test/browser/parts/editor/untitledTextEditor.test.ts index 43c68b49e96..027de2efbe3 100644 --- a/src/vs/workbench/test/common/editor/untitledTextEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/untitledTextEditor.test.ts @@ -9,7 +9,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IUntitledTextEditorService, UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { workbenchInstantiationService, TestEditorService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { snapshotToString } from 'vs/workbench/services/textfile/common/textfiles'; diff --git a/src/vs/workbench/test/browser/parts/views/views.test.ts b/src/vs/workbench/test/browser/parts/views/views.test.ts index aa3aff7d4e7..016880ee782 100644 --- a/src/vs/workbench/test/browser/parts/views/views.test.ts +++ b/src/vs/workbench/test/browser/parts/views/views.test.ts @@ -9,7 +9,7 @@ import { IViewsRegistry, IViewDescriptor, IViewContainersRegistry, Extensions as import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { move } from 'vs/base/common/arrays'; import { Registry } from 'vs/platform/registry/common/platform'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts similarity index 78% rename from src/vs/workbench/test/workbenchTestServices.ts rename to src/vs/workbench/test/browser/workbenchTestServices.ts index df2d3423f2b..65a50f43c73 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -6,7 +6,6 @@ import 'vs/workbench/contrib/files/browser/files.contribution'; // load our contribution into the test import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { join } from 'vs/base/common/path'; import * as resources from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -22,26 +21,23 @@ import { TextModelResolverService } from 'vs/workbench/services/textmodelResolve import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; import { IUntitledTextEditorService, UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; -import { IWorkspaceContextService, IWorkspace as IWorkbenchWorkspace, WorkbenchState, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ILifecycleService, BeforeShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase, WillShutdownEvent } from 'vs/platform/lifecycle/common/lifecycle'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { FileOperationEvent, IFileService, FileOperationError, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, ICreateFileOptions, IFileSystemProvider, FileSystemProviderCapabilities, IFileChange, IWatchOptions, IStat, FileType, FileDeleteOptions, FileOverwriteOptions, FileWriteOptions, FileOpenOptions, IFileStatWithMetadata, IResolveMetadataFileOptions, IWriteFileOptions, IReadFileOptions, IFileContent, IFileStreamContent } from 'vs/platform/files/common/files'; +import { FileOperationEvent, IFileService, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, ICreateFileOptions, IFileSystemProvider, FileSystemProviderCapabilities, IFileChange, IWatchOptions, IStat, FileType, FileDeleteOptions, FileOverwriteOptions, FileWriteOptions, FileOpenOptions, IFileStatWithMetadata, IResolveMetadataFileOptions, IWriteFileOptions, IReadFileOptions, IFileContent, IFileStreamContent, FileOperationError } from 'vs/platform/files/common/files'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; -import { ITextFileStreamContent, ITextFileService, IResourceEncoding, IReadTextFileOptions } from 'vs/workbench/services/textfile/common/textfiles'; -import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; +import { IResourceEncoding, ITextFileService, IReadTextFileOptions, ITextFileStreamContent } from 'vs/workbench/services/textfile/common/textfiles'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { MenuBarVisibility, IWindowConfiguration, IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions, IOpenedWindow } from 'vs/platform/windows/common/windows'; +import { MenuBarVisibility, IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; -import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { ITextResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/position'; import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; @@ -63,145 +59,49 @@ import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; import { EditorGroup } from 'vs/workbench/common/editor/editorGroup'; import { Dimension } from 'vs/base/browser/dom'; -import { ILogService, NullLogService, LogLevel } from 'vs/platform/log/common/log'; +import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { ILabelService } from 'vs/platform/label/common/label'; import { timeout } from 'vs/base/common/async'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ViewletDescriptor, Viewlet } from 'vs/workbench/browser/viewlet'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { IStorageService, InMemoryStorageService, IWillSaveStateEvent } from 'vs/platform/storage/common/storage'; -import { isLinux, isMacintosh } from 'vs/base/common/platform'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { isLinux } from 'vs/base/common/platform'; import { LabelService } from 'vs/workbench/services/label/common/labelService'; import { IDimension } from 'vs/platform/layout/browser/layoutService'; import { Part } from 'vs/workbench/browser/part'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanel } from 'vs/workbench/common/panel'; import { IBadge } from 'vs/workbench/services/activity/common/activity'; -import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService'; import { VSBuffer, VSBufferReadable } from 'vs/base/common/buffer'; -import { NativeTextFileService } from 'vs/workbench/services/textfile/electron-browser/nativeTextFileService'; import { Schemas } from 'vs/base/common/network'; import { IProductService } from 'vs/platform/product/common/productService'; import product from 'vs/platform/product/common/product'; import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IElectronService } from 'vs/platform/electron/node/electron'; -import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs'; -import { IBackupMainService, IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup'; -import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogs'; import { find } from 'vs/base/common/arrays'; -import { WorkingCopyService, IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; +import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; import { IFilesConfigurationService, FilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; +import { BrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; +import { BrowserTextFileService } from 'vs/workbench/services/textfile/browser/browserTextFileService'; +import * as CommonWorkbenchTestServices from 'vs/workbench/test/common/workbenchTestServices'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel'; + +export import TestTextResourcePropertiesService = CommonWorkbenchTestServices.TestTextResourcePropertiesService; +export import TestContextService = CommonWorkbenchTestServices.TestContextService; +export import TestStorageService = CommonWorkbenchTestServices.TestStorageService; +export import TestWorkingCopyService = CommonWorkbenchTestServices.TestWorkingCopyService; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined); } -export const TestWindowConfiguration: IWindowConfiguration = { - windowId: 0, - sessionId: 'testSessionId', - logLevel: LogLevel.Error, - mainPid: 0, - appRoot: '', - userEnv: {}, - execPath: process.execPath, - perfEntries: [], - ...parseArgs(process.argv, OPTIONS) -}; - -export const TestEnvironmentService = new NativeWorkbenchEnvironmentService(TestWindowConfiguration, process.execPath, 0); - -export class TestContextService implements IWorkspaceContextService { - _serviceBrand: undefined; - - private workspace: Workspace; - private options: any; - - private readonly _onDidChangeWorkspaceName: Emitter; - private readonly _onDidChangeWorkspaceFolders: Emitter; - private readonly _onDidChangeWorkbenchState: Emitter; - - constructor(workspace: any = TestWorkspace, options: any = null) { - this.workspace = workspace; - this.options = options || Object.create(null); - this._onDidChangeWorkspaceName = new Emitter(); - this._onDidChangeWorkspaceFolders = new Emitter(); - this._onDidChangeWorkbenchState = new Emitter(); - } - - get onDidChangeWorkspaceName(): Event { - return this._onDidChangeWorkspaceName.event; - } - - get onDidChangeWorkspaceFolders(): Event { - return this._onDidChangeWorkspaceFolders.event; - } - - get onDidChangeWorkbenchState(): Event { - return this._onDidChangeWorkbenchState.event; - } - - getFolders(): IWorkspaceFolder[] { - return this.workspace ? this.workspace.folders : []; - } - - getWorkbenchState(): WorkbenchState { - if (this.workspace.configuration) { - return WorkbenchState.WORKSPACE; - } - - if (this.workspace.folders.length) { - return WorkbenchState.FOLDER; - } - - return WorkbenchState.EMPTY; - } - - getCompleteWorkspace(): Promise { - return Promise.resolve(this.getWorkspace()); - } - - getWorkspace(): IWorkbenchWorkspace { - return this.workspace; - } - - getWorkspaceFolder(resource: URI): IWorkspaceFolder | null { - return this.workspace.getFolder(resource); - } - - setWorkspace(workspace: any): void { - this.workspace = workspace; - } - - getOptions() { - return this.options; - } - - updateOptions() { - - } - - isInsideWorkspace(resource: URI): boolean { - if (resource && this.workspace) { - return resources.isEqualOrParent(resource, this.workspace.folders[0].uri); - } - - return false; - } - - toResource(workspaceRelativePath: string): URI { - return URI.file(join('C:\\', workspaceRelativePath)); - } - - isCurrentWorkspace(workspaceIdentifier: ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier): boolean { - return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && resources.isEqual(this.workspace.folders[0].uri, workspaceIdentifier); - } +export interface ITestInstantiationService extends IInstantiationService { + stub(service: ServiceIdentifier, ctor: any): T; } -export class TestTextFileService extends NativeTextFileService { +export class TestTextFileService extends BrowserTextFileService { private resolveTextContentError!: FileOperationError | null; constructor( @@ -230,7 +130,6 @@ export class TestTextFileService extends NativeTextFileService { dialogService, fileDialogService, textResourceConfigurationService, - productService, filesConfigurationService, textModelService, codeEditorService, @@ -264,12 +163,11 @@ export class TestTextFileService extends NativeTextFileService { } } -export interface ITestInstantiationService extends IInstantiationService { - stub(service: ServiceIdentifier, ctor: any): T; -} +export const TestEnvironmentService = new BrowserWorkbenchEnvironmentService(Object.create(null)); + +export function workbenchInstantiationService(overrides?: { textFileService?: (instantiationService: IInstantiationService) => ITextFileService }): ITestInstantiationService { + const instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()])); -export function workbenchInstantiationService(): ITestInstantiationService { - let instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()])); instantiationService.stub(IEnvironmentService, TestEnvironmentService); const contextKeyService = instantiationService.createInstance(MockContextKeyService); instantiationService.stub(IContextKeyService, contextKeyService); @@ -285,7 +183,6 @@ export function workbenchInstantiationService(): ITestInstantiationService { instantiationService.stub(IDialogService, new TestDialogService()); instantiationService.stub(IAccessibilityService, new TestAccessibilityService()); instantiationService.stub(IFileDialogService, new TestFileDialogService()); - instantiationService.stub(IElectronService, new TestElectronService()); instantiationService.stub(IModeService, instantiationService.createInstance(ModeServiceImpl)); instantiationService.stub(IHistoryService, new TestHistoryService()); instantiationService.stub(ITextResourcePropertiesService, new TestTextResourcePropertiesService(configService)); @@ -299,8 +196,8 @@ export function workbenchInstantiationService(): ITestInstantiationService { instantiationService.stub(IKeybindingService, new MockKeybindingService()); instantiationService.stub(IDecorationsService, new TestDecorationsService()); instantiationService.stub(IExtensionService, new TestExtensionService()); + instantiationService.stub(ITextFileService, overrides?.textFileService ? overrides.textFileService(instantiationService) : instantiationService.createInstance(TestTextFileService)); instantiationService.stub(IHostService, instantiationService.createInstance(TestHostService)); - instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); instantiationService.stub(ITextModelService, instantiationService.createInstance(TextModelResolverService)); instantiationService.stub(IThemeService, new TestThemeService()); instantiationService.stub(ILogService, new NullLogService()); @@ -667,11 +564,6 @@ export class TestPanelService implements IPanelService { } } -export class TestStorageService extends InMemoryStorageService { - readonly _onWillSaveState = this._register(new Emitter()); - readonly onWillSaveState = this._onWillSaveState.event; -} - export class TestEditorGroupsService implements IEditorGroupsService { _serviceBrand: undefined; @@ -1301,39 +1193,6 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig } } -export class TestTextResourcePropertiesService implements ITextResourcePropertiesService { - - _serviceBrand: undefined; - - constructor( - @IConfigurationService private readonly configurationService: IConfigurationService, - ) { - } - - getEOL(resource: URI, language?: string): string { - const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource }); - if (eol && eol !== 'auto') { - return eol; - } - return (isLinux || isMacintosh) ? '\n' : '\r\n'; - } -} - - -export class TestSharedProcessService implements ISharedProcessService { - - _serviceBrand: undefined; - - getChannel(channelName: string): any { - return undefined; - } - - registerChannel(channelName: string, channel: any): void { } - - async toggleSharedProcessWindow(): Promise { } - async whenSharedProcessReady(): Promise { } -} - export class RemoteFileSystemProvider implements IFileSystemProvider { constructor(private readonly diskFileSystemProvider: IFileSystemProvider, private readonly remoteAuthority: string) { } @@ -1387,140 +1246,6 @@ export class TestHostService implements IHostService { async toggleFullScreen(): Promise { } } -export class TestElectronService implements IElectronService { - _serviceBrand: undefined; - - onWindowOpen: Event = Event.None; - onWindowMaximize: Event = Event.None; - onWindowUnmaximize: Event = Event.None; - onWindowFocus: Event = Event.None; - onWindowBlur: Event = Event.None; - - windowCount = Promise.resolve(1); - getWindowCount(): Promise { return this.windowCount; } - - async getWindows(): Promise { return []; } - async getActiveWindowId(): Promise { return undefined; } - - openWindow(options?: IOpenEmptyWindowOptions): Promise; - openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; - openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { - throw new Error('Method not implemented.'); - } - - async toggleFullScreen(): Promise { } - async handleTitleDoubleClick(): Promise { } - async isMaximized(): Promise { return true; } - async maximizeWindow(): Promise { } - async unmaximizeWindow(): Promise { } - async minimizeWindow(): Promise { } - async focusWindow(options?: { windowId?: number | undefined; } | undefined): Promise { } - async showMessageBox(options: Electron.MessageBoxOptions): Promise { throw new Error('Method not implemented.'); } - async showSaveDialog(options: Electron.SaveDialogOptions): Promise { throw new Error('Method not implemented.'); } - async showOpenDialog(options: Electron.OpenDialogOptions): Promise { throw new Error('Method not implemented.'); } - async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickFileAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise { } - async showItemInFolder(path: string): Promise { } - async setRepresentedFilename(path: string): Promise { } - async setDocumentEdited(edited: boolean): Promise { } - async openExternal(url: string): Promise { return false; } - async updateTouchBar(): Promise { } - async newWindowTab(): Promise { } - async showPreviousWindowTab(): Promise { } - async showNextWindowTab(): Promise { } - async moveWindowTabToNewWindow(): Promise { } - async mergeAllWindowTabs(): Promise { } - async toggleWindowTabsBar(): Promise { } - async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined; } | undefined): Promise { } - async reload(): Promise { } - async closeWindow(): Promise { } - async quit(): Promise { } - async openDevTools(options?: Electron.OpenDevToolsOptions | undefined): Promise { } - async toggleDevTools(): Promise { } - async startCrashReporter(options: Electron.CrashReporterStartOptions): Promise { } - async resolveProxy(url: string): Promise { return undefined; } -} - -export class TestBackupMainService implements IBackupMainService { - _serviceBrand: undefined; - - isHotExitEnabled(): boolean { - throw new Error('Method not implemented.'); - } - - getWorkspaceBackups(): IWorkspaceBackupInfo[] { - throw new Error('Method not implemented.'); - } - - getFolderBackupPaths(): URI[] { - throw new Error('Method not implemented.'); - } - - getEmptyWindowBackupPaths(): IEmptyWindowBackupInfo[] { - throw new Error('Method not implemented.'); - } - - registerWorkspaceBackupSync(workspace: IWorkspaceBackupInfo, migrateFrom?: string | undefined): string { - throw new Error('Method not implemented.'); - } - - registerFolderBackupSync(folderUri: URI): string { - throw new Error('Method not implemented.'); - } - - registerEmptyWindowBackupSync(backupFolder?: string | undefined, remoteAuthority?: string | undefined): string { - throw new Error('Method not implemented.'); - } - - unregisterWorkspaceBackupSync(workspace: IWorkspaceIdentifier): void { - throw new Error('Method not implemented.'); - } - - unregisterFolderBackupSync(folderUri: URI): void { - throw new Error('Method not implemented.'); - } - - unregisterEmptyWindowBackupSync(backupFolder: string): void { - throw new Error('Method not implemented.'); - } -} - -export class TestDialogMainService implements IDialogMainService { - _serviceBrand: undefined; - - pickFileFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - pickFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - pickFile(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - pickWorkspace(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - showMessageBox(options: Electron.MessageBoxOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - showSaveDialog(options: Electron.SaveDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } - - showOpenDialog(options: Electron.OpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise { - throw new Error('Method not implemented.'); - } -} - -export class TestWorkingCopyService extends WorkingCopyService { } - export class TestFilesConfigurationService extends FilesConfigurationService { onFilesConfigurationChange(configuration: any): void { diff --git a/src/vs/workbench/test/common/memento.test.ts b/src/vs/workbench/test/common/memento.test.ts index b6179a6506a..3f63c1c2948 100644 --- a/src/vs/workbench/test/common/memento.test.ts +++ b/src/vs/workbench/test/common/memento.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage'; import { Memento } from 'vs/workbench/common/memento'; -import { TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices'; suite('Memento', () => { let context: StorageScope | undefined = undefined; @@ -177,4 +177,4 @@ suite('Memento', () => { memento = myMemento2.getMemento(StorageScope.WORKSPACE); assert.deepEqual(memento, { foo: 'Hello World', bar: 'Hello World' }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/common/workbenchTestServices.ts b/src/vs/workbench/test/common/workbenchTestServices.ts new file mode 100644 index 00000000000..0ab76f0644e --- /dev/null +++ b/src/vs/workbench/test/common/workbenchTestServices.ts @@ -0,0 +1,129 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { join } from 'vs/base/common/path'; +import * as resources from 'vs/base/common/resources'; +import { URI } from 'vs/base/common/uri'; +import { Event, Emitter } from 'vs/base/common/event'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IWorkspaceContextService, IWorkspace as IWorkbenchWorkspace, WorkbenchState, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, Workspace } from 'vs/platform/workspace/common/workspace'; +import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; +import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; +import { isLinux, isMacintosh } from 'vs/base/common/platform'; +import { InMemoryStorageService, IWillSaveStateEvent } from 'vs/platform/storage/common/storage'; +import { WorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; + +export class TestTextResourcePropertiesService implements ITextResourcePropertiesService { + + _serviceBrand: undefined; + + constructor( + @IConfigurationService private readonly configurationService: IConfigurationService, + ) { + } + + getEOL(resource: URI, language?: string): string { + const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource }); + if (eol && eol !== 'auto') { + return eol; + } + return (isLinux || isMacintosh) ? '\n' : '\r\n'; + } +} + +export class TestContextService implements IWorkspaceContextService { + _serviceBrand: undefined; + + private workspace: Workspace; + private options: any; + + private readonly _onDidChangeWorkspaceName: Emitter; + private readonly _onDidChangeWorkspaceFolders: Emitter; + private readonly _onDidChangeWorkbenchState: Emitter; + + constructor(workspace: any = TestWorkspace, options: any = null) { + this.workspace = workspace; + this.options = options || Object.create(null); + this._onDidChangeWorkspaceName = new Emitter(); + this._onDidChangeWorkspaceFolders = new Emitter(); + this._onDidChangeWorkbenchState = new Emitter(); + } + + get onDidChangeWorkspaceName(): Event { + return this._onDidChangeWorkspaceName.event; + } + + get onDidChangeWorkspaceFolders(): Event { + return this._onDidChangeWorkspaceFolders.event; + } + + get onDidChangeWorkbenchState(): Event { + return this._onDidChangeWorkbenchState.event; + } + + getFolders(): IWorkspaceFolder[] { + return this.workspace ? this.workspace.folders : []; + } + + getWorkbenchState(): WorkbenchState { + if (this.workspace.configuration) { + return WorkbenchState.WORKSPACE; + } + + if (this.workspace.folders.length) { + return WorkbenchState.FOLDER; + } + + return WorkbenchState.EMPTY; + } + + getCompleteWorkspace(): Promise { + return Promise.resolve(this.getWorkspace()); + } + + getWorkspace(): IWorkbenchWorkspace { + return this.workspace; + } + + getWorkspaceFolder(resource: URI): IWorkspaceFolder | null { + return this.workspace.getFolder(resource); + } + + setWorkspace(workspace: any): void { + this.workspace = workspace; + } + + getOptions() { + return this.options; + } + + updateOptions() { + + } + + isInsideWorkspace(resource: URI): boolean { + if (resource && this.workspace) { + return resources.isEqualOrParent(resource, this.workspace.folders[0].uri); + } + + return false; + } + + toResource(workspaceRelativePath: string): URI { + return URI.file(join('C:\\', workspaceRelativePath)); + } + + isCurrentWorkspace(workspaceIdentifier: ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier): boolean { + return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && resources.isEqual(this.workspace.folders[0].uri, workspaceIdentifier); + } +} + +export class TestStorageService extends InMemoryStorageService { + readonly _onWillSaveState = this._register(new Emitter()); + readonly onWillSaveState = this._onWillSaveState.event; +} + +export class TestWorkingCopyService extends WorkingCopyService { } diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index b4d4ea7e610..04fc91a7a76 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -13,7 +13,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta } from 'vs/workbench/api/common/extHost.protocol'; import { createTestCodeEditor, TestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; -import { TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService, TestEnvironmentService } from 'vs/workbench/test/workbenchTestServices'; +import { TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Event } from 'vs/base/common/event'; import { ITextModel } from 'vs/editor/common/model'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts index d44bb6189c0..27d399d79da 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts @@ -19,7 +19,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; import { IModelService } from 'vs/editor/common/services/modelService'; import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; +import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices'; import { BulkEditService } from 'vs/workbench/services/bulkEdit/browser/bulkEditService'; import { NullLogService, ILogService } from 'vs/platform/log/common/log'; import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts index 70efc25cece..e9c8770111e 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { FinalNewLineParticipant, TrimFinalNewLinesParticipant } from 'vs/workbench/api/browser/mainThreadSaveParticipant'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { IModelService } from 'vs/editor/common/services/modelService'; import { Range } from 'vs/editor/common/core/range'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts index 50f8a7aa045..62188e87d43 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { ISearchService, IFileQuery } from 'vs/workbench/services/search/common/search'; import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspace'; diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index 5c3e43ffb5b..10560e35590 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -28,7 +28,8 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { LocalSearchService } from 'vs/workbench/services/search/node/searchService'; import { IUntitledTextEditorService, UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; -import { TestContextService, TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService, TestEditorGroupsService, TestEditorService, TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { NullLogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts index e79af8a3d3d..ac995be33b1 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts @@ -17,7 +17,8 @@ import * as minimist from 'vscode-minimist'; import * as path from 'vs/base/common/path'; import { LocalSearchService } from 'vs/workbench/services/search/node/searchService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestEnvironmentService, TestContextService, TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; +import { TestContextService, TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { URI } from 'vs/base/common/uri'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts new file mode 100644 index 00000000000..a5705d198a9 --- /dev/null +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -0,0 +1,188 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { Event } from 'vs/base/common/event'; +import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService'; +import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService'; +import { NativeTextFileService } from 'vs/workbench/services/textfile/electron-browser/nativeTextFileService'; +import { IElectronService } from 'vs/platform/electron/node/electron'; +import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs'; +import { FileOperationError, IFileService } from 'vs/platform/files/common/files'; +import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; +import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IModelService } from 'vs/editor/common/services/modelService'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { IDialogService, IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService'; +import { IProductService } from 'vs/platform/product/common/productService'; +import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; +import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; +import { INotificationService } from 'vs/platform/notification/common/notification'; +import { URI } from 'vs/base/common/uri'; +import { IReadTextFileOptions, ITextFileStreamContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel'; +import { IOpenedWindow, IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IWindowConfiguration } from 'vs/platform/windows/common/windows'; +import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; +import { LogLevel } from 'vs/platform/log/common/log'; + +export const TestWindowConfiguration: IWindowConfiguration = { + windowId: 0, + sessionId: 'testSessionId', + logLevel: LogLevel.Error, + mainPid: 0, + appRoot: '', + userEnv: {}, + execPath: process.execPath, + perfEntries: [], + ...parseArgs(process.argv, OPTIONS) +}; + +export const TestEnvironmentService = new NativeWorkbenchEnvironmentService(TestWindowConfiguration, process.execPath, 0); + +export class TestTextFileService extends NativeTextFileService { + private resolveTextContentError!: FileOperationError | null; + + constructor( + @IFileService protected fileService: IFileService, + @IUntitledTextEditorService untitledTextEditorService: IUntitledTextEditorService, + @ILifecycleService lifecycleService: ILifecycleService, + @IInstantiationService instantiationService: IInstantiationService, + @IModelService modelService: IModelService, + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, + @IDialogService dialogService: IDialogService, + @IFileDialogService fileDialogService: IFileDialogService, + @ITextResourceConfigurationService textResourceConfigurationService: ITextResourceConfigurationService, + @IProductService productService: IProductService, + @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService, + @ITextModelService textModelService: ITextModelService, + @ICodeEditorService codeEditorService: ICodeEditorService, + @INotificationService notificationService: INotificationService + ) { + super( + fileService, + untitledTextEditorService, + lifecycleService, + instantiationService, + modelService, + environmentService, + dialogService, + fileDialogService, + textResourceConfigurationService, + productService, + filesConfigurationService, + textModelService, + codeEditorService, + notificationService + ); + } + + setResolveTextContentErrorOnce(error: FileOperationError): void { + this.resolveTextContentError = error; + } + + async readStream(resource: URI, options?: IReadTextFileOptions): Promise { + if (this.resolveTextContentError) { + const error = this.resolveTextContentError; + this.resolveTextContentError = null; + + throw error; + } + + const content = await this.fileService.readFileStream(resource, options); + return { + resource: content.resource, + name: content.name, + mtime: content.mtime, + ctime: content.ctime, + etag: content.etag, + encoding: 'utf8', + value: await createTextBufferFactoryFromStream(content.value), + size: 10 + }; + } +} + +export class TestSharedProcessService implements ISharedProcessService { + + _serviceBrand: undefined; + + getChannel(channelName: string): any { + return undefined; + } + + registerChannel(channelName: string, channel: any): void { } + + async toggleSharedProcessWindow(): Promise { } + async whenSharedProcessReady(): Promise { } +} + +export class TestElectronService implements IElectronService { + _serviceBrand: undefined; + + onWindowOpen: Event = Event.None; + onWindowMaximize: Event = Event.None; + onWindowUnmaximize: Event = Event.None; + onWindowFocus: Event = Event.None; + onWindowBlur: Event = Event.None; + + windowCount = Promise.resolve(1); + getWindowCount(): Promise { return this.windowCount; } + + async getWindows(): Promise { return []; } + async getActiveWindowId(): Promise { return undefined; } + + openWindow(options?: IOpenEmptyWindowOptions): Promise; + openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; + openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { + throw new Error('Method not implemented.'); + } + + async toggleFullScreen(): Promise { } + async handleTitleDoubleClick(): Promise { } + async isMaximized(): Promise { return true; } + async maximizeWindow(): Promise { } + async unmaximizeWindow(): Promise { } + async minimizeWindow(): Promise { } + async focusWindow(options?: { windowId?: number | undefined; } | undefined): Promise { } + async showMessageBox(options: Electron.MessageBoxOptions): Promise { throw new Error('Method not implemented.'); } + async showSaveDialog(options: Electron.SaveDialogOptions): Promise { throw new Error('Method not implemented.'); } + async showOpenDialog(options: Electron.OpenDialogOptions): Promise { throw new Error('Method not implemented.'); } + async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickFileAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise { } + async showItemInFolder(path: string): Promise { } + async setRepresentedFilename(path: string): Promise { } + async setDocumentEdited(edited: boolean): Promise { } + async openExternal(url: string): Promise { return false; } + async updateTouchBar(): Promise { } + async newWindowTab(): Promise { } + async showPreviousWindowTab(): Promise { } + async showNextWindowTab(): Promise { } + async moveWindowTabToNewWindow(): Promise { } + async mergeAllWindowTabs(): Promise { } + async toggleWindowTabsBar(): Promise { } + async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined; } | undefined): Promise { } + async reload(): Promise { } + async closeWindow(): Promise { } + async quit(): Promise { } + async openDevTools(options?: Electron.OpenDevToolsOptions | undefined): Promise { } + async toggleDevTools(): Promise { } + async startCrashReporter(options: Electron.CrashReporterStartOptions): Promise { } + async resolveProxy(url: string): Promise { return undefined; } +} + +export function workbenchInstantiationService(): ITestInstantiationService { + const instantiationService = browserWorkbenchInstantiationService({ + textFileService: insta => insta.createInstance(TestTextFileService) + }); + + instantiationService.stub(IElectronService, new TestElectronService()); + + return instantiationService; +} From b1c5e2f19b7c905f830388e823c9e12f33aab2ad Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 11:08:22 -0800 Subject: [PATCH 144/624] Don't include dom typings in extensions (#89942) **Problem** All of our extensions currently are built using the dom typings. This can lead to runtime errors if you mistakenly use `window` or similar **Fix** Exclude the dom typings from compile. Then explicitly import the node types for `URL` and `TextEncoder` --- extensions/git/src/fileSystemProvider.ts | 1 + .../markdown-language-features/preview-src/tsconfig.json | 7 ++++++- extensions/shared.tsconfig.json | 5 ++++- extensions/vscode-api-tests/src/extension.ts | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/extensions/git/src/fileSystemProvider.ts b/extensions/git/src/fileSystemProvider.ts index 1168906dc30..888070554e7 100644 --- a/extensions/git/src/fileSystemProvider.ts +++ b/extensions/git/src/fileSystemProvider.ts @@ -9,6 +9,7 @@ import { fromGitUri, toGitUri } from './uri'; import { Model, ModelChangeEvent, OriginalResourceChangeEvent } from './model'; import { filterEvent, eventToPromise, isDescendant, pathEquals, EmptyDisposable } from './util'; import { Repository } from './repository'; +import { TextEncoder } from 'util'; interface CacheRow { uri: Uri; diff --git a/extensions/markdown-language-features/preview-src/tsconfig.json b/extensions/markdown-language-features/preview-src/tsconfig.json index 85159a000d9..e19cd4a675d 100644 --- a/extensions/markdown-language-features/preview-src/tsconfig.json +++ b/extensions/markdown-language-features/preview-src/tsconfig.json @@ -2,6 +2,11 @@ "extends": "../../shared.tsconfig.json", "compilerOptions": { "outDir": "./dist/", - "jsx": "react" + "jsx": "react", + "lib": [ + "es2018", + "DOM", + "DOM.Iterable" + ] } } diff --git a/extensions/shared.tsconfig.json b/extensions/shared.tsconfig.json index bb42dd479cf..a84d7a1cc03 100644 --- a/extensions/shared.tsconfig.json +++ b/extensions/shared.tsconfig.json @@ -1,6 +1,9 @@ { "compilerOptions": { "target": "es2018", + "lib": [ + "es2018" + ], "module": "commonjs", "strict": true, "alwaysStrict": true, @@ -9,4 +12,4 @@ "noUnusedLocals": true, "noUnusedParameters": true } -} \ No newline at end of file +} diff --git a/extensions/vscode-api-tests/src/extension.ts b/extensions/vscode-api-tests/src/extension.ts index 279833c2391..15a15a59607 100644 --- a/extensions/vscode-api-tests/src/extension.ts +++ b/extensions/vscode-api-tests/src/extension.ts @@ -13,10 +13,14 @@ // import * as vscode from 'vscode'; +import { URL } from 'url'; +import { TextEncoder, TextDecoder } from 'util'; const textEncoder = new TextEncoder(); const SCHEME = 'memfs'; +declare const window: unknown; + export function activate(context: vscode.ExtensionContext) { if (typeof window !== 'undefined') { // do not run under node.js const memFs = enableFs(context); From 54007fa545faab402022ce4de7d0079ae62a6a76 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 20:26:12 +0100 Subject: [PATCH 145/624] fix git smoketests --- extensions/git/src/test/smoke.test.ts | 4 ++-- scripts/test-integration.bat | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index c7450780cef..47031bbb1fd 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -13,7 +13,7 @@ import { GitExtension, API, Repository, Status } from '../api/git'; import { eventToPromise } from '../util'; suite('git smoke test', function () { - const cwd = workspace.workspaceFolders![0].uri.path; + const cwd = fs.realpathSync(workspace.workspaceFolders![0].uri.fsPath); const file = (relativePath: string) => path.join(cwd, relativePath); const uri = (relativePath: string) => Uri.file(file(relativePath)); const open = async (relativePath: string) => { @@ -47,7 +47,7 @@ suite('git smoke test', function () { } assert.equal(git.repositories.length, 1); - assert.equal(git.repositories[0].rootUri.path, cwd); + assert.equal(git.repositories[0].rootUri.fsPath, cwd); repository = git.repositories[0]; }); diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 9d439a2d191..bc79961a6d7 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -3,7 +3,7 @@ setlocal pushd %~dp0\.. -set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5% +set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2% :: Figure out which Electron to use for running tests if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( @@ -12,7 +12,7 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1 - echo "Running integration tests out of sources." + echo Running integration tests out of sources. ) else ( :: Run from a built: need to compile all test extensions call yarn gulp compile-extension:vscode-api-tests @@ -29,7 +29,7 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( set ELECTRON_ENABLE_LOGGING=1 set ELECTRON_ENABLE_STACK_DUMPING=1 - echo "Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build." + echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build. ) :: Integration & performance tests in AMD @@ -50,7 +50,9 @@ if %errorlevel% neq 0 exit /b %errorlevel% call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . if %errorlevel% neq 0 exit /b %errorlevel% -call "%INTEGRATION_TEST_ELECTRON_PATH%" %TMP%\git-%RANDOM%-%TIME:~6,5% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . +set GITWORKSPACE=%TMP%\git-%RANDOM% +mkdir %GITWORKSPACE% +call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% if %errorlevel% neq 0 exit /b %errorlevel% :: Tests in commonJS (HTML, CSS, JSON language server tests...) From 9eddf7d3165cae6482f2612c777b59c1bff48861 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 11:46:39 -0800 Subject: [PATCH 146/624] xterm@4.4.0 --- package.json | 2 +- remote/package.json | 2 +- remote/web/package.json | 2 +- remote/web/yarn.lock | 8 ++++---- remote/yarn.lock | 8 ++++---- yarn.lock | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 4c94e8b0512..e9f3fa1dfb6 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "vscode-ripgrep": "^1.5.7", "vscode-sqlite3": "4.0.9", "vscode-textmate": "4.4.0", - "xterm": "4.4.0-beta.15", + "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0-beta.7", diff --git a/remote/package.json b/remote/package.json index 532e0f49835..9a2b99a87ac 100644 --- a/remote/package.json +++ b/remote/package.json @@ -20,7 +20,7 @@ "vscode-proxy-agent": "^0.5.2", "vscode-ripgrep": "^1.5.7", "vscode-textmate": "4.4.0", - "xterm": "4.4.0-beta.15", + "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0-beta.7", diff --git a/remote/web/package.json b/remote/web/package.json index 5bf2c6c7d9c..240236c4673 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -5,7 +5,7 @@ "onigasm-umd": "2.2.5", "semver-umd": "^5.5.5", "vscode-textmate": "4.4.0", - "xterm": "4.4.0-beta.15", + "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0-beta.7" diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 12afd3c3d84..d5a6b2e7372 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -46,7 +46,7 @@ xterm-addon-webgl@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== -xterm@4.4.0-beta.15: - version "4.4.0-beta.15" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0-beta.15.tgz#5897bf79d29d1a2496ccd54665aded28c341b1cc" - integrity sha512-Dvz1CMCYKeoxPF7uIDznbRgUA2Mct49Bq93K2nnrDU0pDMM3Sf1t9fkEyz59wxSx5XEHVdLS80jywsz4sjXBjQ== +xterm@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0.tgz#5915d3c4c8800fadbcf555a0a603c672ab9df589" + integrity sha512-JGIpigWM3EBWvnS3rtBuefkiToIILSK1HYMXy4BCsUpO+O4UeeV+/U1AdAXgCB6qJrnPNb7yLgBsVCQUNMteig== diff --git a/remote/yarn.lock b/remote/yarn.lock index 9bafc208dab..fb3019be687 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -428,10 +428,10 @@ xterm-addon-webgl@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== -xterm@4.4.0-beta.15: - version "4.4.0-beta.15" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0-beta.15.tgz#5897bf79d29d1a2496ccd54665aded28c341b1cc" - integrity sha512-Dvz1CMCYKeoxPF7uIDznbRgUA2Mct49Bq93K2nnrDU0pDMM3Sf1t9fkEyz59wxSx5XEHVdLS80jywsz4sjXBjQ== +xterm@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0.tgz#5915d3c4c8800fadbcf555a0a603c672ab9df589" + integrity sha512-JGIpigWM3EBWvnS3rtBuefkiToIILSK1HYMXy4BCsUpO+O4UeeV+/U1AdAXgCB6qJrnPNb7yLgBsVCQUNMteig== yauzl@^2.9.2: version "2.10.0" diff --git a/yarn.lock b/yarn.lock index bc18150bc92..d43bbe8d820 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10035,10 +10035,10 @@ xterm-addon-webgl@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== -xterm@4.4.0-beta.15: - version "4.4.0-beta.15" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0-beta.15.tgz#5897bf79d29d1a2496ccd54665aded28c341b1cc" - integrity sha512-Dvz1CMCYKeoxPF7uIDznbRgUA2Mct49Bq93K2nnrDU0pDMM3Sf1t9fkEyz59wxSx5XEHVdLS80jywsz4sjXBjQ== +xterm@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0.tgz#5915d3c4c8800fadbcf555a0a603c672ab9df589" + integrity sha512-JGIpigWM3EBWvnS3rtBuefkiToIILSK1HYMXy4BCsUpO+O4UeeV+/U1AdAXgCB6qJrnPNb7yLgBsVCQUNMteig== y18n@^3.2.1: version "3.2.1" From 5a45ffc13ed2316447648e51a4efcdced07046d1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 11:48:54 -0800 Subject: [PATCH 147/624] xterm-addon-webgl@0.5.0 --- package.json | 2 +- remote/package.json | 2 +- remote/web/package.json | 2 +- remote/web/yarn.lock | 8 ++++---- remote/yarn.lock | 8 ++++---- yarn.lock | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index e9f3fa1dfb6..46727e0128c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", - "xterm-addon-webgl": "0.5.0-beta.7", + "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, diff --git a/remote/package.json b/remote/package.json index 9a2b99a87ac..85567b59c65 100644 --- a/remote/package.json +++ b/remote/package.json @@ -23,7 +23,7 @@ "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", - "xterm-addon-webgl": "0.5.0-beta.7", + "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, diff --git a/remote/web/package.json b/remote/web/package.json index 240236c4673..90f8dfdf6da 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -8,6 +8,6 @@ "xterm": "4.4.0", "xterm-addon-search": "0.4.0-beta4", "xterm-addon-web-links": "0.2.1", - "xterm-addon-webgl": "0.5.0-beta.7" + "xterm-addon-webgl": "0.5.0" } } diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index d5a6b2e7372..06ad1df1236 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -41,10 +41,10 @@ xterm-addon-web-links@0.2.1: resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" integrity sha512-2KnHtiq0IG7hfwv3jw2/jQeH1RBk2d5CH4zvgwQe00rLofSJqSfgnJ7gwowxxpGHrpbPr6Lv4AmH/joaNw2+HQ== -xterm-addon-webgl@0.5.0-beta.7: - version "0.5.0-beta.7" - resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" - integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== +xterm-addon-webgl@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0.tgz#c1031dc7599cce3509824643ab5f15361c928e3e" + integrity sha512-hQrvabKCnwXFaEZ+YtoJM9Pm0CIBXL5KSwoU+RiGStU3KYTAcqYP2GsH3dWdvKX6kTWhWLS81dtDsGkfbOciuA== xterm@4.4.0: version "4.4.0" diff --git a/remote/yarn.lock b/remote/yarn.lock index fb3019be687..edbad1d58bd 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -423,10 +423,10 @@ xterm-addon-web-links@0.2.1: resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" integrity sha512-2KnHtiq0IG7hfwv3jw2/jQeH1RBk2d5CH4zvgwQe00rLofSJqSfgnJ7gwowxxpGHrpbPr6Lv4AmH/joaNw2+HQ== -xterm-addon-webgl@0.5.0-beta.7: - version "0.5.0-beta.7" - resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" - integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== +xterm-addon-webgl@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0.tgz#c1031dc7599cce3509824643ab5f15361c928e3e" + integrity sha512-hQrvabKCnwXFaEZ+YtoJM9Pm0CIBXL5KSwoU+RiGStU3KYTAcqYP2GsH3dWdvKX6kTWhWLS81dtDsGkfbOciuA== xterm@4.4.0: version "4.4.0" diff --git a/yarn.lock b/yarn.lock index d43bbe8d820..ccdee04233a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10030,10 +10030,10 @@ xterm-addon-web-links@0.2.1: resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" integrity sha512-2KnHtiq0IG7hfwv3jw2/jQeH1RBk2d5CH4zvgwQe00rLofSJqSfgnJ7gwowxxpGHrpbPr6Lv4AmH/joaNw2+HQ== -xterm-addon-webgl@0.5.0-beta.7: - version "0.5.0-beta.7" - resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" - integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== +xterm-addon-webgl@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0.tgz#c1031dc7599cce3509824643ab5f15361c928e3e" + integrity sha512-hQrvabKCnwXFaEZ+YtoJM9Pm0CIBXL5KSwoU+RiGStU3KYTAcqYP2GsH3dWdvKX6kTWhWLS81dtDsGkfbOciuA== xterm@4.4.0: version "4.4.0" From 542a89a965af0e1a2772c11343c608be2f0e9b10 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 11:50:06 -0800 Subject: [PATCH 148/624] xterm-addon-search@0.4.0 --- package.json | 2 +- remote/package.json | 2 +- remote/web/package.json | 2 +- remote/web/yarn.lock | 8 ++++---- remote/yarn.lock | 8 ++++---- yarn.lock | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 46727e0128c..2ec281d3f0f 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "vscode-sqlite3": "4.0.9", "vscode-textmate": "4.4.0", "xterm": "4.4.0", - "xterm-addon-search": "0.4.0-beta4", + "xterm-addon-search": "0.4.0", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", diff --git a/remote/package.json b/remote/package.json index 85567b59c65..27a6f5f6ffd 100644 --- a/remote/package.json +++ b/remote/package.json @@ -21,7 +21,7 @@ "vscode-ripgrep": "^1.5.7", "vscode-textmate": "4.4.0", "xterm": "4.4.0", - "xterm-addon-search": "0.4.0-beta4", + "xterm-addon-search": "0.4.0", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", diff --git a/remote/web/package.json b/remote/web/package.json index 90f8dfdf6da..bf2772093f5 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -6,7 +6,7 @@ "semver-umd": "^5.5.5", "vscode-textmate": "4.4.0", "xterm": "4.4.0", - "xterm-addon-search": "0.4.0-beta4", + "xterm-addon-search": "0.4.0", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0" } diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 06ad1df1236..9424e0433c1 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -31,10 +31,10 @@ vscode-textmate@4.4.0: dependencies: oniguruma "^7.2.0" -xterm-addon-search@0.4.0-beta4: - version "0.4.0-beta4" - resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0-beta4.tgz#7762ea342c6b4f5e824d83466bd93793c9d7d779" - integrity sha512-TIbEBVhydGIxcyu/CfKJbD+BKHisMGbkAfaWlCPaWis2Xmw8yE7CKrCPn+lhZYl1MdjDVEmb8lQI6WetbC2OZA== +xterm-addon-search@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" + integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== xterm-addon-web-links@0.2.1: version "0.2.1" diff --git a/remote/yarn.lock b/remote/yarn.lock index edbad1d58bd..7d4351dff72 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -413,10 +413,10 @@ vscode-windows-registry@1.0.2: resolved "https://registry.yarnpkg.com/vscode-windows-registry/-/vscode-windows-registry-1.0.2.tgz#b863e704a6a69c50b3098a55fbddbe595b0c124a" integrity sha512-/CLLvuOSM2Vme2z6aNyB+4Omd7hDxpf4Thrt8ImxnXeQtxzel2bClJpFQvQqK/s4oaXlkBKS7LqVLeZM+uSVIA== -xterm-addon-search@0.4.0-beta4: - version "0.4.0-beta4" - resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0-beta4.tgz#7762ea342c6b4f5e824d83466bd93793c9d7d779" - integrity sha512-TIbEBVhydGIxcyu/CfKJbD+BKHisMGbkAfaWlCPaWis2Xmw8yE7CKrCPn+lhZYl1MdjDVEmb8lQI6WetbC2OZA== +xterm-addon-search@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" + integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== xterm-addon-web-links@0.2.1: version "0.2.1" diff --git a/yarn.lock b/yarn.lock index ccdee04233a..057492738cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10020,10 +10020,10 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" -xterm-addon-search@0.4.0-beta4: - version "0.4.0-beta4" - resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0-beta4.tgz#7762ea342c6b4f5e824d83466bd93793c9d7d779" - integrity sha512-TIbEBVhydGIxcyu/CfKJbD+BKHisMGbkAfaWlCPaWis2Xmw8yE7CKrCPn+lhZYl1MdjDVEmb8lQI6WetbC2OZA== +xterm-addon-search@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" + integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== xterm-addon-web-links@0.2.1: version "0.2.1" From d3913daf002b947b172c3947b89f927ac9a8bc7e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 11:51:05 -0800 Subject: [PATCH 149/624] Fix usage of xterm parser API --- src/vs/workbench/contrib/terminal/browser/terminalInstance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 9f38129fc14..11b1ad6f68b 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -511,7 +511,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // Force line data to be sent when the cursor is moved, the main purpose for // this is because ConPTY will often not do a line feed but instead move the // cursor, in which case we still want to send the current line's data to tasks. - xterm.parser.addCsiHandler({ final: 'H' }, () => { + xterm.parser.registerCsiHandler({ final: 'H' }, () => { this._onCursorMove(); return false; }); From 24081e08f5263968e860a279e683c072397afad7 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 11:53:59 -0800 Subject: [PATCH 150/624] Move onto non-deprecated marker API --- .../terminal/browser/addons/commandTrackerAddon.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon.ts b/src/vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon.ts index a0b892a1fc0..e90310145c6 100644 --- a/src/vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon.ts @@ -51,7 +51,7 @@ export class CommandTrackerAddon implements ICommandTracker, ITerminalAddon { return; } if (this._terminal.buffer.cursorX >= MINIMUM_PROMPT_LENGTH) { - this._terminal.addMarker(0); + this._terminal.registerMarker(0); } } @@ -233,13 +233,13 @@ export class CommandTrackerAddon implements ICommandTracker, ITerminalAddon { } if (this._currentMarker === Boundary.Bottom) { - this._currentMarker = xterm.addMarker(this._getOffset(xterm) - 1); + this._currentMarker = xterm.registerMarker(this._getOffset(xterm) - 1); } else { const offset = this._getOffset(xterm); if (this._isDisposable) { this._currentMarker.dispose(); } - this._currentMarker = xterm.addMarker(offset - 1); + this._currentMarker = xterm.registerMarker(offset - 1); } this._isDisposable = true; this._scrollToMarker(this._currentMarker, scrollPosition); @@ -256,13 +256,13 @@ export class CommandTrackerAddon implements ICommandTracker, ITerminalAddon { } if (this._currentMarker === Boundary.Top) { - this._currentMarker = xterm.addMarker(this._getOffset(xterm) + 1); + this._currentMarker = xterm.registerMarker(this._getOffset(xterm) + 1); } else { const offset = this._getOffset(xterm); if (this._isDisposable) { this._currentMarker.dispose(); } - this._currentMarker = xterm.addMarker(offset + 1); + this._currentMarker = xterm.registerMarker(offset + 1); } this._isDisposable = true; this._scrollToMarker(this._currentMarker, scrollPosition); From d2f9126da3d9b39e2e75d3af4010ee7f15f7aaa5 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 20:54:35 +0100 Subject: [PATCH 151/624] git tests: windows is pain --- extensions/git/src/test/smoke.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index 47031bbb1fd..5430ca5f1d8 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -47,7 +47,7 @@ suite('git smoke test', function () { } assert.equal(git.repositories.length, 1); - assert.equal(git.repositories[0].rootUri.fsPath, cwd); + assert.equal(fs.realpathSync(git.repositories[0].rootUri.fsPath), cwd); repository = git.repositories[0]; }); From fc3ff960f57b3a9c34205e7853ee63232a995896 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 4 Feb 2020 21:15:42 +0100 Subject: [PATCH 152/624] :facepalm: --- scripts/test-integration.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index bc79961a6d7..b7a236bc0e4 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -50,10 +50,10 @@ if %errorlevel% neq 0 exit /b %errorlevel% call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . if %errorlevel% neq 0 exit /b %errorlevel% -set GITWORKSPACE=%TMP%\git-%RANDOM% -mkdir %GITWORKSPACE% -call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% -if %errorlevel% neq 0 exit /b %errorlevel% +REM set GITWORKSPACE=%TMP%\git-%RANDOM% +REM mkdir %GITWORKSPACE% +REM call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% +REM if %errorlevel% neq 0 exit /b %errorlevel% :: Tests in commonJS (HTML, CSS, JSON language server tests...) call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js From cb486e930ff97dcde5df5e78803b4af39ce34b15 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 12:29:37 -0800 Subject: [PATCH 153/624] Terminal unicode 11 support Fixes #90029 --- package.json | 1 + remote/package.json | 1 + remote/web/package.json | 1 + remote/web/yarn.lock | 5 ++++ remote/yarn.lock | 5 ++++ .../code/browser/workbench/workbench-dev.html | 1 + src/vs/code/browser/workbench/workbench.html | 1 + .../terminal/browser/terminal.contribution.ts | 10 +++++++ .../contrib/terminal/browser/terminal.ts | 6 +++-- .../terminal/browser/terminalInstance.ts | 18 +++++++++++++ .../browser/terminalInstanceService.ts | 27 ++++++++++++------- .../contrib/terminal/common/terminal.ts | 1 + .../terminalInstanceService.ts | 13 +++++++-- .../terminalLinkHandler.test.ts | 9 ++++--- yarn.lock | 5 ++++ 15 files changed, 88 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 2ec281d3f0f..a5ee2a45350 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "vscode-textmate": "4.4.0", "xterm": "4.4.0", "xterm-addon-search": "0.4.0", + "xterm-addon-unicode11": "0.1.1", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", diff --git a/remote/package.json b/remote/package.json index 27a6f5f6ffd..3481542d70f 100644 --- a/remote/package.json +++ b/remote/package.json @@ -22,6 +22,7 @@ "vscode-textmate": "4.4.0", "xterm": "4.4.0", "xterm-addon-search": "0.4.0", + "xterm-addon-unicode11": "0.1.1", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0", "yauzl": "^2.9.2", diff --git a/remote/web/package.json b/remote/web/package.json index bf2772093f5..70a55a9074f 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -7,6 +7,7 @@ "vscode-textmate": "4.4.0", "xterm": "4.4.0", "xterm-addon-search": "0.4.0", + "xterm-addon-unicode11": "0.1.1", "xterm-addon-web-links": "0.2.1", "xterm-addon-webgl": "0.5.0" } diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 9424e0433c1..b4c1b7d0b6c 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -36,6 +36,11 @@ xterm-addon-search@0.4.0: resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== +xterm-addon-unicode11@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.1.1.tgz#b209ef137db38096f68636af4ef4d0c0acba85ad" + integrity sha512-z6vJTL+dpNljwAYzYoyDjJP8A2XjZuEosl0sRa+FGRf3jEyEVWquDM53MfUd1ztVdAPQ839qR6eYK1BXV04Bhw== + xterm-addon-web-links@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" diff --git a/remote/yarn.lock b/remote/yarn.lock index 7d4351dff72..bc865255b62 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -418,6 +418,11 @@ xterm-addon-search@0.4.0: resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== +xterm-addon-unicode11@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.1.1.tgz#b209ef137db38096f68636af4ef4d0c0acba85ad" + integrity sha512-z6vJTL+dpNljwAYzYoyDjJP8A2XjZuEosl0sRa+FGRf3jEyEVWquDM53MfUd1ztVdAPQ839qR6eYK1BXV04Bhw== + xterm-addon-web-links@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" diff --git a/src/vs/code/browser/workbench/workbench-dev.html b/src/vs/code/browser/workbench/workbench-dev.html index af6317d035f..7355cabbb7c 100644 --- a/src/vs/code/browser/workbench/workbench-dev.html +++ b/src/vs/code/browser/workbench/workbench-dev.html @@ -31,6 +31,7 @@ 'onigasm-umd': `${window.location.origin}/static/remote/web/node_modules/onigasm-umd/release/main`, 'xterm': `${window.location.origin}/static/remote/web/node_modules/xterm/lib/xterm.js`, 'xterm-addon-search': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-search/lib/xterm-addon-search.js`, + 'xterm-addon-unicode11': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`, 'xterm-addon-web-links': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`, 'xterm-addon-webgl': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`, 'semver-umd': `${window.location.origin}/static/remote/web/node_modules/semver-umd/lib/semver-umd.js`, diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 8a6a9f54e67..db616831643 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -35,6 +35,7 @@ 'onigasm-umd': `${window.location.origin}/static/node_modules/onigasm-umd/release/main`, 'xterm': `${window.location.origin}/static/node_modules/xterm/lib/xterm.js`, 'xterm-addon-search': `${window.location.origin}/static/node_modules/xterm-addon-search/lib/xterm-addon-search.js`, + 'xterm-addon-unicode11': `${window.location.origin}/static/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`, 'xterm-addon-web-links': `${window.location.origin}/static/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`, 'xterm-addon-webgl': `${window.location.origin}/static/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`, 'semver-umd': `${window.location.origin}/static/node_modules/semver-umd/lib/semver-umd.js`, diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index 1623b352c9f..c21eb0a4e61 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -343,6 +343,16 @@ configurationRegistry.registerConfiguration({ description: nls.localize('terminal.integrated.enableFileLinks', "Whether to enable file links in the terminal. Links can be slow when working on a network drive in particular because each file link is verified against the file system."), type: 'boolean', default: true + }, + 'terminal.integrated.unicodeVersion': { + type: 'string', + enum: ['6', '11'], + enumDescriptions: [ + nls.localize('terminal.integrated.unicodeVersion.six', "Version 6 of unicode, this is an older version which should work better on older systems."), + nls.localize('terminal.integrated.unicodeVersion.eleven', "Version 11 of unicode, this version provides better support for emoji on modern systems.") + ], + default: '11', + description: nls.localize('terminal.integrated.unicodeVersion', "Controls what version of unicode to use when evaluating the width of characters in the terminal. If you experience emoji not taking up the right amount of space or being able to backspace beyond your prompt character then you may want to try tweaking this setting.") } } }); diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts index 1591ec7f6f7..bf5916960b9 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts @@ -4,8 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { Terminal as XTermTerminal } from 'xterm'; -import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { SearchAddon as XTermSearchAddon } from 'xterm-addon-search'; +import { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11'; +import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { WebglAddon as XTermWebglAddon } from 'xterm-addon-webgl'; import { IWindowsShellHelper, ITerminalConfigHelper, ITerminalChildProcess, IShellLaunchConfig, IDefaultShellAndArgsRequest, ISpawnExtHostProcessRequest, IStartExtensionTerminalRequest, IAvailableShellsRequest, ITerminalProcessExtHostProxy, ICommandTracker, INavigationMode, TitleEventSource, ITerminalDimensions } from 'vs/workbench/contrib/terminal/common/terminal'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -30,8 +31,9 @@ export interface ITerminalInstanceService { onRequestDefaultShellAndArgs?: Event; getXtermConstructor(): Promise; - getXtermWebLinksConstructor(): Promise; getXtermSearchConstructor(): Promise; + getXtermUnicode11Constructor(): Promise; + getXtermWebLinksConstructor(): Promise; getXtermWebglConstructor(): Promise; createWindowsShellHelper(shellProcessId: number, instance: ITerminalInstance, xterm: XTermTerminal): IWindowsShellHelper; createTerminalProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, windowsEnableConpty: boolean): ITerminalChildProcess; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 11b1ad6f68b..b41879ccedc 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -35,6 +35,7 @@ import { ITerminalInstanceService, ITerminalInstance, TerminalShellType } from ' import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager'; import { Terminal as XTermTerminal, IBuffer, ITerminalAddon } from 'xterm'; import { SearchAddon, ISearchOptions } from 'xterm-addon-search'; +import { Unicode11Addon } from 'xterm-addon-unicode11'; import { CommandTrackerAddon } from 'vs/workbench/contrib/terminal/browser/addons/commandTrackerAddon'; import { NavigationModeAddon } from 'vs/workbench/contrib/terminal/browser/addons/navigationModeAddon'; import { XTermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private'; @@ -200,6 +201,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { private _xterm: XTermTerminal | undefined; private _xtermCore: XTermCore | undefined; private _xtermSearch: SearchAddon | undefined; + private _xtermUnicode11: Unicode11Addon | undefined; private _xtermElement: HTMLDivElement | undefined; private _terminalHasTextContextKey: IContextKey; private _terminalA11yTreeFocusContextKey: IContextKey; @@ -328,6 +330,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // supported. this.setVisible(this._isVisible); } + if (e.affectsConfiguration('terminal.integrated.unicodeVersion')) { + this._updateUnicodeVersion(); + } if (e.affectsConfiguration('editor.accessibilitySupport')) { this.updateAccessibilitySupport(); } @@ -484,6 +489,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { }); this._xterm = xterm; this._xtermCore = (xterm as any)._core as XTermCore; + this._updateUnicodeVersion(); this.updateAccessibilitySupport(); this._terminalInstanceService.getXtermSearchConstructor().then(Addon => { this._xtermSearch = new Addon(); @@ -1242,6 +1248,18 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } } + private async _updateUnicodeVersion(): Promise { + if (!this._xterm) { + throw new Error('Cannot update unicode version before xterm has been initialized'); + } + if (!this._xtermUnicode11 && this._configHelper.config.unicodeVersion === '11') { + const Addon = await this._terminalInstanceService.getXtermUnicode11Constructor(); + this._xtermUnicode11 = new Addon(); + this._xterm.loadAddon(this._xtermUnicode11); + } + this._xterm.unicode.activeVersion = this._configHelper.config.unicodeVersion; + } + public updateAccessibilitySupport(): void { const isEnabled = this._accessibilityService.isScreenReaderOptimized(); if (isEnabled) { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts index 5fa453db273..df405001f97 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts @@ -6,16 +6,18 @@ import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { IWindowsShellHelper, ITerminalChildProcess, IDefaultShellAndArgsRequest } from 'vs/workbench/contrib/terminal/common/terminal'; import { Terminal as XTermTerminal } from 'xterm'; -import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { SearchAddon as XTermSearchAddon } from 'xterm-addon-search'; +import { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11'; +import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { WebglAddon as XTermWebglAddon } from 'xterm-addon-webgl'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { Emitter, Event } from 'vs/base/common/event'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; let Terminal: typeof XTermTerminal; -let WebLinksAddon: typeof XTermWebLinksAddon; let SearchAddon: typeof XTermSearchAddon; +let Unicode11Addon: typeof XTermUnicode11Addon; +let WebLinksAddon: typeof XTermWebLinksAddon; let WebglAddon: typeof XTermWebglAddon; export class TerminalInstanceService implements ITerminalInstanceService { @@ -31,13 +33,6 @@ export class TerminalInstanceService implements ITerminalInstanceService { return Terminal; } - public async getXtermWebLinksConstructor(): Promise { - if (!WebLinksAddon) { - WebLinksAddon = (await import('xterm-addon-web-links')).WebLinksAddon; - } - return WebLinksAddon; - } - public async getXtermSearchConstructor(): Promise { if (!SearchAddon) { SearchAddon = (await import('xterm-addon-search')).SearchAddon; @@ -45,6 +40,20 @@ export class TerminalInstanceService implements ITerminalInstanceService { return SearchAddon; } + public async getXtermUnicode11Constructor(): Promise { + if (!Unicode11Addon) { + Unicode11Addon = (await import('xterm-addon-unicode11')).Unicode11Addon; + } + return Unicode11Addon; + } + + public async getXtermWebLinksConstructor(): Promise { + if (!WebLinksAddon) { + WebLinksAddon = (await import('xterm-addon-web-links')).WebLinksAddon; + } + return WebLinksAddon; + } + public async getXtermWebglConstructor(): Promise { if (!WebglAddon) { WebglAddon = (await import('xterm-addon-webgl')).WebglAddon; diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index 563313aeca8..21522a35bd5 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 ITerminalConfiguration { experimentalRefreshOnResume: boolean; experimentalUseTitleEvent: boolean; enableFileLinks: boolean; + unicodeVersion: '6' | '11'; } export interface ITerminalConfigHelper { diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts index a825775d8d2..b3632da5988 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts @@ -11,8 +11,9 @@ import { IProcessEnvironment, platform, Platform } from 'vs/base/common/platform import { TerminalProcess } from 'vs/workbench/contrib/terminal/node/terminalProcess'; import { getSystemShell } from 'vs/workbench/contrib/terminal/node/terminal'; import { Terminal as XTermTerminal } from 'xterm'; -import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { SearchAddon as XTermSearchAddon } from 'xterm-addon-search'; +import { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11'; +import { WebLinksAddon as XTermWebLinksAddon } from 'xterm-addon-web-links'; import { WebglAddon as XTermWebglAddon } from 'xterm-addon-webgl'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { getDefaultShell, getDefaultShellArgs } from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; @@ -24,8 +25,9 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { ILogService } from 'vs/platform/log/common/log'; let Terminal: typeof XTermTerminal; -let WebLinksAddon: typeof XTermWebLinksAddon; let SearchAddon: typeof XTermSearchAddon; +let Unicode11Addon: typeof XTermUnicode11Addon; +let WebLinksAddon: typeof XTermWebLinksAddon; let WebglAddon: typeof XTermWebglAddon; export class TerminalInstanceService implements ITerminalInstanceService { @@ -63,6 +65,13 @@ export class TerminalInstanceService implements ITerminalInstanceService { return SearchAddon; } + public async getXtermUnicode11Constructor(): Promise { + if (!Unicode11Addon) { + Unicode11Addon = (await import('xterm-addon-unicode11')).Unicode11Addon; + } + return Unicode11Addon; + } + public async getXtermWebglConstructor(): Promise { if (!WebglAddon) { WebglAddon = (await import('xterm-addon-webgl')).WebglAddon; diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts index a8c87781724..dcfcf378d02 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -40,12 +40,15 @@ class MockTerminalInstanceService implements ITerminalInstanceService { getXtermConstructor(): Promise { throw new Error('Method not implemented.'); } - async getXtermWebLinksConstructor(): Promise { - return (await import('xterm-addon-web-links')).WebLinksAddon; - } getXtermSearchConstructor(): Promise { throw new Error('Method not implemented.'); } + getXtermUnicode11Constructor(): Promise { + throw new Error('Method not implemented.'); + } + async getXtermWebLinksConstructor(): Promise { + return (await import('xterm-addon-web-links')).WebLinksAddon; + } getXtermWebglConstructor(): Promise { throw new Error('Method not implemented.'); } diff --git a/yarn.lock b/yarn.lock index 057492738cc..63a7c96fd5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10025,6 +10025,11 @@ xterm-addon-search@0.4.0: resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== +xterm-addon-unicode11@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.1.1.tgz#b209ef137db38096f68636af4ef4d0c0acba85ad" + integrity sha512-z6vJTL+dpNljwAYzYoyDjJP8A2XjZuEosl0sRa+FGRf3jEyEVWquDM53MfUd1ztVdAPQ839qR6eYK1BXV04Bhw== + xterm-addon-web-links@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2" From de0654882c3dc2ea0d631b5c79a35580053d0610 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 12:36:44 -0800 Subject: [PATCH 154/624] Improve unicode wording --- .../contrib/terminal/browser/terminal.contribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index c21eb0a4e61..233193db124 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -349,10 +349,10 @@ configurationRegistry.registerConfiguration({ enum: ['6', '11'], enumDescriptions: [ nls.localize('terminal.integrated.unicodeVersion.six', "Version 6 of unicode, this is an older version which should work better on older systems."), - nls.localize('terminal.integrated.unicodeVersion.eleven', "Version 11 of unicode, this version provides better support for emoji on modern systems.") + nls.localize('terminal.integrated.unicodeVersion.eleven', "Version 11 of unicode, this version provides better support on modern systems that use modern versions of unicode.") ], default: '11', - description: nls.localize('terminal.integrated.unicodeVersion', "Controls what version of unicode to use when evaluating the width of characters in the terminal. If you experience emoji not taking up the right amount of space or being able to backspace beyond your prompt character then you may want to try tweaking this setting.") + description: nls.localize('terminal.integrated.unicodeVersion', "Controls what version of unicode to use when evaluating the width of characters in the terminal. If you experience emoji or other wide characters not taking up the right amount of space or backspace either deleting too much or too little then you may want to try tweaking this setting.") } } }); From 01989df7c976414512b5059344d0565795edb9d9 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 4 Feb 2020 12:56:23 -0800 Subject: [PATCH 155/624] chore: update to electron 7 (#89260) * Revert "revert back to electron 6 (#89245)" This reverts commit 5d498736f42841b46b53cda82f23178a3f05070c. * chore: update electron@7.1.11 --- .yarnrc | 2 +- cgmanifest.json | 12 +- .../src/singlefolder-tests/commands.test.ts | 2 +- .../src/singlefolder-tests/webview.test.ts | 3 +- package.json | 2 +- src/vs/code/electron-main/app.ts | 35 +- src/vs/code/electron-main/window.ts | 18 +- .../platform/dialogs/electron-main/dialogs.ts | 2 +- .../platform/driver/electron-main/driver.ts | 3 +- .../electron-main/electronMainService.ts | 16 +- .../theme/electron-main/themeMainService.ts | 6 +- .../electron-main/windowsMainService.ts | 11 +- .../browser/workbench.contribution.ts | 3 +- .../electron-browser/webviewElement.ts | 6 +- src/vs/workbench/electron-browser/window.ts | 6 +- yarn.lock | 537 ++++++++++-------- 16 files changed, 374 insertions(+), 290 deletions(-) diff --git a/.yarnrc b/.yarnrc index 85baaa63a78..7808166004a 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://atom.io/download/electron" -target "6.1.6" +target "7.1.11" runtime "electron" diff --git a/cgmanifest.json b/cgmanifest.json index 7cec04cef09..40d6e42aa78 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "chromium", "repositoryUrl": "https://chromium.googlesource.com/chromium/src", - "commitHash": "91f08db83c2ce8c722ddf0911ead8f7c473bedfa" + "commitHash": "e4745133a1d3745f066e068b8033c6a269b59caf" } }, "licenseDetail": [ @@ -40,7 +40,7 @@ "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ], "isOnlyProductionDependency": true, - "version": "76.0.3809.146" + "version": "78.0.3904.130" }, { "component": { @@ -48,11 +48,11 @@ "git": { "name": "nodejs", "repositoryUrl": "https://github.com/nodejs/node", - "commitHash": "64219741218aa87e259cf8257596073b8e747f0a" + "commitHash": "787378879acfb212ed4ff824bf9f767a24a5cb43a" } }, "isOnlyProductionDependency": true, - "version": "12.4.0" + "version": "12.8.1" }, { "component": { @@ -60,12 +60,12 @@ "git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", - "commitHash": "19c705ab80cd6fdccca3d65803ec2c4addb9540a" + "commitHash": "d17dfabfcba7bd0bc994b8dac5f5d2000bef572c" } }, "isOnlyProductionDependency": true, "license": "MIT", - "version": "6.1.6" + "version": "7.1.11" }, { "component": { diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts index fba9348435c..739ce386371 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts @@ -105,7 +105,7 @@ suite('commands namespace tests', () => { }); test('api-command: vscode.open', function () { - let uri = Uri.parse(workspace.workspaceFolders![0].uri.toString() + '/image.png'); + let uri = Uri.parse(workspace.workspaceFolders![0].uri.toString() + '/far.js'); let a = commands.executeCommand('vscode.open', uri).then(() => assert.ok(true), () => assert.ok(false)); let b = commands.executeCommand('vscode.open', uri, ViewColumn.Two).then(() => assert.ok(true), () => assert.ok(false)); let c = commands.executeCommand('vscode.open').then(() => assert.ok(false), () => assert.ok(true)); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/webview.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/webview.test.ts index e785f1d4afb..b59d91ff380 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/webview.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/webview.test.ts @@ -13,7 +13,8 @@ const webviewId = 'myWebview'; const testDocument = join(vscode.workspace.rootPath || '', './bower.json'); -suite('Webview tests', () => { +// TODO: Re-enable after https://github.com/microsoft/vscode/issues/88415 +suite.skip('Webview tests', () => { const disposables: vscode.Disposable[] = []; function _register(disposable: T) { diff --git a/package.json b/package.json index a5ee2a45350..f0d577ef187 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "coveralls": "^2.11.11", "cson-parser": "^1.3.3", "debounce": "^1.0.0", - "electron": "6.1.6", + "electron": "7.1.11", "eslint": "6.8.0", "eslint-plugin-jsdoc": "^19.1.0", "event-stream": "3.3.4", diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 4d544450cc8..712d6f05c5b 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -171,7 +171,7 @@ export class CodeApplication extends Disposable { app.on('web-contents-created', (_event: Event, contents) => { contents.on('will-attach-webview', (event: Event, webPreferences, params) => { - const isValidWebviewSource = (source: string): boolean => { + const isValidWebviewSource = (source: string | undefined): boolean => { if (!source) { return false; } @@ -191,11 +191,12 @@ export class CodeApplication extends Disposable { webPreferences.nodeIntegration = false; // Verify URLs being loaded - if (isValidWebviewSource(params.src) && isValidWebviewSource(webPreferences.preloadURL)) { + // https://github.com/electron/electron/issues/21553 + if (isValidWebviewSource(params.src) && isValidWebviewSource((webPreferences as { preloadURL: string }).preloadURL)) { return; } - delete webPreferences.preloadUrl; + delete (webPreferences as { preloadURL: string }).preloadURL; // https://github.com/electron/electron/issues/21553 // Otherwise prevent loading this.logService.error('webContents#web-contents-created: Prevented webview attach'); @@ -497,27 +498,27 @@ export class CodeApplication extends Disposable { this.logService.info(`Tracing: waiting for windows to get ready...`); let recordingStopped = false; - const stopRecording = (timeout: boolean) => { + const stopRecording = async (timeout: boolean) => { if (recordingStopped) { return; } recordingStopped = true; // only once - contentTracing.stopRecording(join(homedir(), `${product.applicationName}-${Math.random().toString(16).slice(-4)}.trace.txt`), path => { - if (!timeout) { - if (this.dialogMainService) { - this.dialogMainService.showMessageBox({ - type: 'info', - message: localize('trace.message', "Successfully created trace."), - detail: localize('trace.detail', "Please create an issue and manually attach the following file:\n{0}", path), - buttons: [localize('trace.ok', "Ok")] - }, withNullAsUndefined(BrowserWindow.getFocusedWindow())); - } - } else { - this.logService.info(`Tracing: data recorded (after 30s timeout) to ${path}`); + const path = await contentTracing.stopRecording(join(homedir(), `${product.applicationName}-${Math.random().toString(16).slice(-4)}.trace.txt`)); + + if (!timeout) { + if (this.dialogMainService) { + this.dialogMainService.showMessageBox({ + type: 'info', + message: localize('trace.message', "Successfully created trace."), + detail: localize('trace.detail', "Please create an issue and manually attach the following file:\n{0}", path), + buttons: [localize('trace.ok', "Ok")] + }, withNullAsUndefined(BrowserWindow.getFocusedWindow())); } - }); + } else { + this.logService.info(`Tracing: data recorded (after 30s timeout) to ${path}`); + } }; // Wait up to 30s before creating the trace anyways diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index d0ea8752aae..1f1c08a58f1 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -8,7 +8,7 @@ import * as objects from 'vs/base/common/objects'; import * as nls from 'vs/nls'; import { Event as CommonEvent, Emitter } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; -import { screen, BrowserWindow, systemPreferences, app, TouchBar, nativeImage, Rectangle, Display, TouchBarSegmentedControl, NativeImage, BrowserWindowConstructorOptions, SegmentedControlSegment } from 'electron'; +import { screen, BrowserWindow, systemPreferences, app, TouchBar, nativeImage, Rectangle, Display, TouchBarSegmentedControl, NativeImage, BrowserWindowConstructorOptions, SegmentedControlSegment, nativeTheme } from 'electron'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -347,9 +347,9 @@ export class CodeWindow extends Disposable implements ICodeWindow { }); this._win.webContents.session.webRequest.onHeadersReceived(null!, (details, callback) => { - const responseHeaders = details.responseHeaders as { [key: string]: string[] }; + const responseHeaders = details.responseHeaders as Record; - const contentType: string[] = (responseHeaders['content-type'] || responseHeaders['Content-Type']); + const contentType = (responseHeaders['content-type'] || responseHeaders['Content-Type']); if (contentType && Array.isArray(contentType) && contentType.some(x => x.toLowerCase().indexOf('image/svg') >= 0)) { return callback({ cancel: true }); } @@ -441,7 +441,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { // Inject headers when requests are incoming const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*']; this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) => - this.marketplaceHeadersPromise.then(headers => cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) as { [key: string]: string | undefined } }))); + this.marketplaceHeadersPromise.then(headers => cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) as Record }))); } private onWindowError(error: WindowError): void { @@ -648,7 +648,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { if (windowConfig?.autoDetectHighContrast === false) { autoDetectHighContrast = false; } - windowConfiguration.highContrast = isWindows && autoDetectHighContrast && systemPreferences.isInvertedColorScheme(); + windowConfiguration.highContrast = isWindows && autoDetectHighContrast && nativeTheme.shouldUseInvertedColorScheme; windowConfiguration.accessibilitySupport = app.accessibilitySupportEnabled; // Title style related @@ -1007,22 +1007,22 @@ export class CodeWindow extends Disposable implements ICodeWindow { switch (visibility) { case ('default'): this._win.setMenuBarVisibility(!isFullscreen); - this._win.setAutoHideMenuBar(isFullscreen); + this._win.autoHideMenuBar = isFullscreen; break; case ('visible'): this._win.setMenuBarVisibility(true); - this._win.setAutoHideMenuBar(false); + this._win.autoHideMenuBar = false; break; case ('toggle'): this._win.setMenuBarVisibility(false); - this._win.setAutoHideMenuBar(true); + this._win.autoHideMenuBar = true; break; case ('hidden'): this._win.setMenuBarVisibility(false); - this._win.setAutoHideMenuBar(false); + this._win.autoHideMenuBar = false; break; } } diff --git a/src/vs/platform/dialogs/electron-main/dialogs.ts b/src/vs/platform/dialogs/electron-main/dialogs.ts index 7b49ca50c2e..c694c003e9b 100644 --- a/src/vs/platform/dialogs/electron-main/dialogs.ts +++ b/src/vs/platform/dialogs/electron-main/dialogs.ts @@ -173,7 +173,7 @@ export class DialogMainService implements IDialogMainService { showOpenDialog(options: OpenDialogOptions, window?: BrowserWindow): Promise { - function normalizePaths(paths: string[] | undefined): string[] | undefined { + function normalizePaths(paths: string[]): string[] { if (paths && paths.length > 0 && isMacintosh) { paths = paths.map(path => normalizeNFC(path)); // normalize paths returned from the OS } diff --git a/src/vs/platform/driver/electron-main/driver.ts b/src/vs/platform/driver/electron-main/driver.ts index e0beffc55ed..bae55607623 100644 --- a/src/vs/platform/driver/electron-main/driver.ts +++ b/src/vs/platform/driver/electron-main/driver.ts @@ -18,7 +18,6 @@ import { ScanCodeBinding } from 'vs/base/common/scanCode'; import { KeybindingParser } from 'vs/base/common/keybindingParser'; import { timeout } from 'vs/base/common/async'; import { IDriver, IElement, IWindowDriver } from 'vs/platform/driver/common/driver'; -import { NativeImage } from 'electron'; import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; import { IElectronMainService } from 'vs/platform/electron/electron-main/electronMainService'; @@ -67,7 +66,7 @@ export class Driver implements IDriver, IWindowDriverRegistry { throw new Error('Invalid window'); } const webContents = window.win.webContents; - const image = await new Promise(c => webContents.capturePage(c)); + const image = await webContents.capturePage(); return image.toPNG().toString('base64'); } diff --git a/src/vs/platform/electron/electron-main/electronMainService.ts b/src/vs/platform/electron/electron-main/electronMainService.ts index abc0ed6e402..6a7310f2dc7 100644 --- a/src/vs/platform/electron/electron-main/electronMainService.ts +++ b/src/vs/platform/electron/electron-main/electronMainService.ts @@ -358,15 +358,13 @@ export class ElectronMainService implements IElectronMainService { //#region Connectivity async resolveProxy(windowId: number | undefined, url: string): Promise { - return new Promise(resolve => { - const window = this.windowById(windowId); - const session = window?.win?.webContents?.session; - if (session) { - session.resolveProxy(url, proxy => resolve(proxy)); - } else { - resolve(); - } - }); + const window = this.windowById(windowId); + const session = window?.win?.webContents?.session; + if (session) { + return session.resolveProxy(url); + } else { + return undefined; + } } //#endregion diff --git a/src/vs/platform/theme/electron-main/themeMainService.ts b/src/vs/platform/theme/electron-main/themeMainService.ts index 8cd6ecdcaa7..6787d57bc27 100644 --- a/src/vs/platform/theme/electron-main/themeMainService.ts +++ b/src/vs/platform/theme/electron-main/themeMainService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { isWindows, isMacintosh } from 'vs/base/common/platform'; -import { systemPreferences, ipcMain as ipc } from 'electron'; +import { ipcMain as ipc, nativeTheme } from 'electron'; import { IStateService } from 'vs/platform/state/node/state'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -42,14 +42,14 @@ export class ThemeMainService implements IThemeMainService { } getBackgroundColor(): string { - if (isWindows && systemPreferences.isInvertedColorScheme()) { + if (isWindows && nativeTheme.shouldUseInvertedColorScheme) { return DEFAULT_BG_HC_BLACK; } let background = this.stateService.getItem(THEME_BG_STORAGE_KEY, null); if (!background) { let baseTheme: string; - if (isWindows && systemPreferences.isInvertedColorScheme()) { + if (isWindows && nativeTheme.shouldUseInvertedColorScheme) { baseTheme = 'hc-black'; } else { baseTheme = this.stateService.getItem(THEME_STORAGE_KEY, 'vs-dark').split(' ')[0]; diff --git a/src/vs/platform/windows/electron-main/windowsMainService.ts b/src/vs/platform/windows/electron-main/windowsMainService.ts index f396efb4e1c..2d238b3bcc7 100644 --- a/src/vs/platform/windows/electron-main/windowsMainService.ts +++ b/src/vs/platform/windows/electron-main/windowsMainService.ts @@ -13,7 +13,7 @@ import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; import { IStateService } from 'vs/platform/state/node/state'; import { CodeWindow, defaultWindowState } from 'vs/code/electron-main/window'; -import { ipcMain as ipc, screen, BrowserWindow, systemPreferences, MessageBoxOptions, Display, app } from 'electron'; +import { ipcMain as ipc, screen, BrowserWindow, MessageBoxOptions, Display, app, nativeTheme } from 'electron'; import { parseLineAndColumnAware } from 'vs/code/node/paths'; import { ILifecycleMainService, UnloadReason, LifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -226,16 +226,13 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic // React to HC color scheme changes (Windows) if (isWindows) { - const onHighContrastChange = () => { - if (systemPreferences.isInvertedColorScheme() || systemPreferences.isHighContrastColorScheme()) { + nativeTheme.on('updated', () => { + if (nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors) { this.sendToAll('vscode:enterHighContrast'); } else { this.sendToAll('vscode:leaveHighContrast'); } - }; - - systemPreferences.on('inverted-color-scheme-changed', () => onHighContrastChange()); - systemPreferences.on('high-contrast-color-scheme-changed', () => onHighContrastChange()); + }); } // When a window looses focus, save all windows state. This allows to diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 83d6b8821a7..12de454be62 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -118,8 +118,7 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio 'workbench.editor.mouseBackForwardToNavigate': { 'type': 'boolean', 'description': nls.localize('mouseBackForwardToNavigate', "Navigate between open files using mouse buttons four and five if provided."), - 'default': true, - 'included': !isMacintosh + 'default': true }, 'workbench.editor.restoreViewState': { 'type': 'boolean', diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 929b367097b..00aa8576189 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FindInPageOptions, OnBeforeRequestDetails, OnHeadersReceivedDetails, Response, WebContents, WebviewTag } from 'electron'; +import { FindInPageOptions, OnBeforeRequestListenerDetails, OnHeadersReceivedListenerDetails, Response, WebContents, WebviewTag } from 'electron'; import { addDisposableListener } from 'vs/base/browser/dom'; import { Emitter, Event } from 'vs/base/common/event'; import { once } from 'vs/base/common/functional'; @@ -65,8 +65,8 @@ class WebviewTagHandle extends Disposable { } } -type OnBeforeRequestDelegate = (details: OnBeforeRequestDetails) => Promise; -type OnHeadersReceivedDelegate = (details: OnHeadersReceivedDetails) => { cancel: boolean; } | undefined; +type OnBeforeRequestDelegate = (details: OnBeforeRequestListenerDetails) => Promise; +type OnHeadersReceivedDelegate = (details: OnHeadersReceivedListenerDetails) => { cancel: boolean; } | undefined; class WebviewSession extends Disposable { diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index 782483ff9c5..fdac09565c0 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -21,7 +21,7 @@ import * as browser from 'vs/base/browser/browser'; import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IResourceInput } from 'vs/platform/editor/common/editor'; import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/nativeKeymapService'; -import { ipcRenderer as ipc, webFrame, crashReporter, Event as IpcEvent } from 'electron'; +import { ipcRenderer as ipc, webFrame, crashReporter, CrashReporterStartOptions, Event as IpcEvent } from 'electron'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; import { IMenuService, MenuId, IMenu, MenuItemAction, ICommandAction, SubmenuItemAction, MenuRegistry } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -543,13 +543,13 @@ export class ElectronWindow extends Disposable { } // base options with product info - const options = { + const options: CrashReporterStartOptions = { companyName, productName, submitURL: isWindows ? hockeyAppConfig[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? hockeyAppConfig[`linux-x64`] : hockeyAppConfig.darwin, extra: { vscode_version: product.version, - vscode_commit: product.commit + vscode_commit: product.commit || '' } }; diff --git a/yarn.lock b/yarn.lock index 63a7c96fd5d..9762b0f4c6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -140,11 +140,38 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@electron/get@^1.0.1": + version "1.7.2" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.7.2.tgz#286436a9fb56ff1a1fcdf0e80131fd65f4d1e0fd" + integrity sha512-LSE4LZGMjGS9TloDx0yO44D2UTbaeKRk+QjlhWLiQlikV6J4spgDCjb6z4YIcqmPAwNzlNCnWF4dubytwI+ATA== + dependencies: + debug "^4.1.1" + env-paths "^2.2.0" + fs-extra "^8.1.0" + got "^9.6.0" + sanitize-filename "^1.6.2" + sumchecker "^3.0.1" + optionalDependencies: + global-agent "^2.0.2" + global-tunnel-ng "^2.7.1" + "@istanbuljs/schema@^0.1.2": version "0.1.2" resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + "@types/applicationinsights@0.20.0": version "0.20.0" resolved "https://registry.yarnpkg.com/@types/applicationinsights/-/applicationinsights-0.20.0.tgz#fa7b36dc954f635fa9037cad27c378446b1048fb" @@ -222,10 +249,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== -"@types/node@^10.12.18": - version "10.17.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" - integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== +"@types/node@^12.0.12": + version "12.12.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.24.tgz#d4606afd8cf6c609036b854360367d1b2c78931f" + integrity sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug== "@types/node@^12.11.7": version "12.12.14" @@ -875,11 +902,6 @@ array-each@^1.0.0, array-each@^1.0.1: resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= - array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -1250,6 +1272,11 @@ boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +boolean@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.0.0.tgz#fab78d5907dbae6216ab46d32733bb7b76b99e76" + integrity sha512-OElxJ1lUSinuoUnkpOgLmxp0DC4ytEhODEL6QJU0NpxE/mI4rUSh8h1P1Wkvfi3xQEBcxXR2gBIPNYNuaFcAbQ== + boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -1494,24 +1521,24 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + callsites@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" @@ -1770,6 +1797,13 @@ clone-buffer@^1.0.0: resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" @@ -1992,7 +2026,7 @@ concat-with-sourcemaps@^1.0.0: dependencies: source-map "^0.5.1" -config-chain@^1.1.12: +config-chain@^1.1.11, config-chain@^1.1.12: version "1.1.12" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== @@ -2103,6 +2137,11 @@ copy-webpack-plugin@^4.5.2: p-limit "^1.0.0" serialize-javascript "^1.4.0" +core-js@^3.4.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.1.tgz#39d5e2e346258cc01eb7d44345b1c3c014ca3f05" + integrity sha512-186WjSik2iTGfDjfdCZAxv2ormxtKgemjC3SI6PL31qOA0j5LhTDVjHChccoc7brwLvpvLPiMyRlcO88C4l1QQ== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -2287,13 +2326,6 @@ cuint@^0.2.1: resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" integrity sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs= -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= - dependencies: - array-find-index "^1.0.1" - cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" @@ -2330,7 +2362,7 @@ debug@2.2.0: dependencies: ms "0.7.1" -debug@2.6.9, debug@^2.1.2, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -2344,7 +2376,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^3.0.0, debug@^3.1.0: +debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -2415,7 +2447,12 @@ default-resolution@^2.0.0: resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= -define-properties@^1.1.2: +defer-to-connect@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.1.tgz#88ae694b93f67b81815a2c8c769aef6574ac8f2f" + integrity sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ== + +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -2515,6 +2552,11 @@ detect-libc@^1.0.2, detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-node@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" + integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== + diagnostic-channel-publishers@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3" @@ -2614,6 +2656,11 @@ domutils@^1.5.1: dom-serializer "0" domelementtype "1" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + duplexer@^0.1.1, duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -2683,33 +2730,18 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-download@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8" - integrity sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg== - dependencies: - debug "^3.0.0" - env-paths "^1.0.0" - fs-extra "^4.0.1" - minimist "^1.2.0" - nugget "^2.0.1" - path-exists "^3.0.0" - rc "^1.2.1" - semver "^5.4.1" - sumchecker "^2.0.2" - electron-to-chromium@^1.2.7: version "1.3.27" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz#78ecb8a399066187bb374eede35d9c70565a803d" integrity sha1-eOy4o5kGYYe7N07t412ccFZagD0= -electron@6.1.6: - version "6.1.6" - resolved "https://registry.yarnpkg.com/electron/-/electron-6.1.6.tgz#d63ea9c89b85b981a29eb3088bf391bf52bd8d73" - integrity sha512-4c4GiFTbWY2Mgv20HB4Bfhf1hDKb0MWgC35wkwNepNom1ioWfumocPHZrSs1xNAEe+tOmezY6lq74n3LbwTnVQ== +electron@7.1.11: + version "7.1.11" + resolved "https://registry.yarnpkg.com/electron/-/electron-7.1.11.tgz#3a95e35804af083d58b590513afea5e2290c4b66" + integrity sha512-YDXfnovKY+8iZ5ISQh1kRqYIRKbpOSxGXCx2WVxPFPutEQ7Q/Xzr3h4GePEY25/NXMytMfhKaAZAYjtWUm3r9Q== dependencies: - "@types/node" "^10.12.18" - electron-download "^4.1.0" + "@electron/get" "^1.0.1" + "@types/node" "^12.0.12" extract-zip "^1.0.3" elliptic@^6.0.0: @@ -2747,6 +2779,11 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= +encodeurl@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + encodeurl@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" @@ -2773,10 +2810,10 @@ entities@^1.1.1, entities@~1.1.1: resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" integrity sha1-blwtClYhtdra7O+AuQ7ftc13cvA= -env-paths@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" - integrity sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA= +env-paths@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" + integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== errno@^0.1.3, errno@~0.1.7: version "0.1.7" @@ -2800,6 +2837,11 @@ es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: es6-iterator "~2.0.1" es6-symbol "~3.1.1" +es6-error@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" + integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== + es6-iterator@^2.0.1, es6-iterator@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" @@ -2854,6 +2896,11 @@ 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= +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + eslint-plugin-jsdoc@^19.1.0: version "19.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-19.1.0.tgz#fcc17f0378fdd6ee1c847a79b7211745cb05d014" @@ -3614,15 +3661,6 @@ fs-extra@0.26.7: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -3632,6 +3670,15 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +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-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -3744,18 +3791,20 @@ get-caller-file@^2.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= - -get-stream@^4.0.0: +get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== dependencies: pump "^3.0.0" +get-stream@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -3921,6 +3970,19 @@ glob@^7.1.4, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +global-agent@^2.0.2: + version "2.1.7" + resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-2.1.7.tgz#12d7bc2b07cd862d0fa76b0f1b2c48cd5ffcf150" + integrity sha512-ooK7eqGYZku+LgnbfH/Iv0RJ74XfhrBZDlke1QSzcBt0bw1PmJcnRADPAQuFE+R45pKKDTynAr25SBasY2kvow== + dependencies: + boolean "^3.0.0" + core-js "^3.4.1" + es6-error "^4.1.1" + matcher "^2.0.0" + roarr "^2.14.5" + semver "^6.3.0" + serialize-error "^5.0.0" + global-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" @@ -3957,6 +4019,16 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" +global-tunnel-ng@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz#d03b5102dfde3a69914f5ee7d86761ca35d57d8f" + integrity sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg== + dependencies: + encodeurl "^1.0.2" + lodash "^4.17.10" + npm-conf "^1.1.3" + tunnel "^0.0.6" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -3974,6 +4046,13 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globalthis@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.1.tgz#40116f5d9c071f9e8fb0037654df1ab3a83b7ef9" + integrity sha512-mJPRTc/P39NH/iNG4mXa9aIhNymaQikTrnspeCa2ZuJ+mH2QN/rXwtX3XwKrHqWgUQFbNZKtHM105aHzJalElw== + dependencies: + define-properties "^1.1.3" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -4005,7 +4084,24 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -graceful-fs@4.2.3: +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +graceful-fs@4.2.3, graceful-fs@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -4477,6 +4573,11 @@ html-escaper@^2.0.0: inherits "^2.0.1" readable-stream "^2.0.2" +http-cache-semantics@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5" + integrity sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew== + http-errors@1.6.2, http-errors@~1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" @@ -4610,13 +4711,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= - dependencies: - repeating "^2.0.0" - indexes-of@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" @@ -4872,13 +4966,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -5274,6 +5361,11 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + 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" @@ -5313,7 +5405,7 @@ json-stable-stringify@^1.0.0: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= @@ -5389,6 +5481,13 @@ keytar@^4.11.0: nan "2.14.0" prebuild-install "5.3.0" +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + kind-of@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" @@ -5662,13 +5761,15 @@ long@^3.2.0: resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== lru-cache@2: version "2.7.3" @@ -5734,11 +5835,6 @@ map-cache@^0.2.0, map-cache@^0.2.2: resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - map-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.0.7.tgz#8a1f07896d82b10926bd3744a2420009f88974a8" @@ -5777,6 +5873,13 @@ matchdep@^2.0.0: resolve "^1.4.0" stack-trace "0.0.10" +matcher@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/matcher/-/matcher-2.1.0.tgz#64e1041c15b993e23b786f93320a7474bf833c28" + integrity sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ== + dependencies: + escape-string-regexp "^2.0.0" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" @@ -5826,22 +5929,6 @@ memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.1.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" @@ -5961,6 +6048,11 @@ mimic-response@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" integrity sha1-3z02Uqc/3ta5sLJBRub9BSNTRY4= +mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -5991,7 +6083,7 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= @@ -6330,16 +6422,6 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-package-data@^2.3.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" @@ -6377,6 +6459,11 @@ normalize-url@^1.4.0: query-string "^4.1.0" sort-keys "^1.0.0" +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + now-and-later@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.0.tgz#bc61cbb456d79cb32207ce47ca05136ff2e7d6ee" @@ -6389,6 +6476,14 @@ npm-bundled@^1.0.1: resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" integrity sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow== +npm-conf@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/npm-conf/-/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9" + integrity sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw== + dependencies: + config-chain "^1.1.11" + pify "^3.0.0" + npm-packlist@^1.1.6: version "1.1.11" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" @@ -6421,19 +6516,6 @@ nth-check@~1.0.1: dependencies: boolbase "~1.0.0" -nugget@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0" - integrity sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA= - dependencies: - debug "^2.1.3" - minimist "^1.1.0" - pretty-bytes "^1.0.2" - progress-stream "^1.1.0" - request "^2.45.0" - single-line-log "^1.1.2" - throttleit "0.0.2" - num2fraction@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" @@ -6701,6 +6783,11 @@ p-all@^1.0.0: dependencies: p-map "^1.0.0" +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" @@ -7319,19 +7406,16 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= -pretty-bytes@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" - integrity sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ= - dependencies: - get-stdin "^4.0.1" - meow "^3.1.0" - pretty-hrtime@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -7360,14 +7444,6 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress-stream@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-1.2.0.tgz#2cd3cfea33ba3a89c9c121ec3347abe9ab125f77" - integrity sha1-LNPP6jO6OonJwSHsM0er6asSX3c= - dependencies: - speedometer "~0.1.2" - through2 "~0.2.3" - progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" @@ -7575,7 +7651,7 @@ raw-body@2.3.2: iconv-lite "0.4.19" unpipe "1.0.0" -rc@^1.2.1, rc@^1.2.7: +rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -7651,7 +7727,7 @@ read@^1.0.7: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^1.1.8, readable-stream@~1.1.9: +readable-stream@^1.1.8: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= @@ -7719,14 +7795,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - reduce-css-calc@^1.2.6: version "1.3.0" resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" @@ -7806,13 +7874,6 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" @@ -7895,7 +7956,7 @@ request@2.79.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -request@^2.45.0, request@^2.86.0, request@^2.88.0: +request@^2.86.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -7989,13 +8050,6 @@ resolve@^1.1.6, resolve@^1.1.7: dependencies: path-parse "^1.0.5" -resolve@^1.10.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.0.tgz#1b7ca96073ebb52e741ffd799f6b39ea462c67f5" - integrity sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw== - dependencies: - path-parse "^1.0.6" - resolve@^1.3.2: version "1.14.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2" @@ -8010,6 +8064,13 @@ resolve@^1.4.0: dependencies: path-parse "^1.0.6" +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -8065,6 +8126,18 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +roarr@^2.14.5: + version "2.14.6" + resolved "https://registry.yarnpkg.com/roarr/-/roarr-2.14.6.tgz#cebe8ad7ecbfd15bfa37b02dacf00809dd633912" + integrity sha512-qjbw0BEesKA+3XFBPt+KVe1PC/Z6ShfJ4wPlx2XifqH5h2Lj8/KQT5XJTsy3n1Es5kai+BwKALaECW3F70B1cg== + dependencies: + boolean "^3.0.0" + detect-node "^2.0.4" + globalthis "^1.0.0" + json-stringify-safe "^5.0.1" + semver-compare "^1.0.0" + sprintf-js "^1.1.2" + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -8125,6 +8198,13 @@ samsam@~1.1: resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621" integrity sha1-n1CHQZtNCR8jJXHn+lLpCw9VJiE= +sanitize-filename@^1.6.2: + version "1.6.3" + resolved "https://registry.yarnpkg.com/sanitize-filename/-/sanitize-filename-1.6.3.tgz#755ebd752045931977e30b2025d340d7c9090378" + integrity sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg== + dependencies: + truncate-utf8-bytes "^1.0.0" + sax@0.5.x: version "0.5.8" resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" @@ -8143,6 +8223,11 @@ schema-utils@^0.4.4, schema-utils@^0.4.5: ajv "^6.1.0" ajv-keywords "^3.1.0" +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + semver-greatest-satisfied-range@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" @@ -8204,6 +8289,13 @@ send@0.16.1: range-parser "~1.2.0" statuses "~1.3.1" +serialize-error@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-5.0.0.tgz#a7ebbcdb03a5d71a6ed8461ffe0fc1a1afed62ac" + integrity sha512-/VtpuyzYf82mHYTtI4QKtwHa79vAdU5OQpNPAmE/0UDdlGT0ZxHwC+J6gXkw29wwoVI8fMPsfcVHOwXtUQYYQA== + dependencies: + type-fest "^0.8.0" + serialize-javascript@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" @@ -8313,13 +8405,6 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" -single-line-log@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-1.1.2.tgz#c2f83f273a3e1a16edb0995661da0ed5ef033364" - integrity sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q= - dependencies: - string-width "^1.0.1" - sinon@^1.17.2: version "1.17.7" resolved "https://registry.yarnpkg.com/sinon/-/sinon-1.17.7.tgz#4542a4f49ba0c45c05eb2e9dd9d203e2b8efe0bf" @@ -8503,11 +8588,6 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== -speedometer@~0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/speedometer/-/speedometer-0.1.4.tgz#9876dbd2a169d3115402d48e6ea6329c8816a50d" - integrity sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0= - split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -8529,6 +8609,11 @@ split@^1.0.1: dependencies: through "2" +sprintf-js@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" + integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -8774,13 +8859,6 @@ strip-eof@^1.0.0: resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= - dependencies: - get-stdin "^4.0.1" - strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -8796,12 +8874,12 @@ sudo-prompt@9.1.1: resolved "https://registry.yarnpkg.com/sudo-prompt/-/sudo-prompt-9.1.1.tgz#73853d729770392caec029e2470db9c221754db0" integrity sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA== -sumchecker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e" - integrity sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4= +sumchecker@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-3.0.1.tgz#6377e996795abb0b6d348e9b3e1dfb24345a8e42" + integrity sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg== dependencies: - debug "^2.2.0" + debug "^4.1.0" supports-color@1.2.0: version "1.2.0" @@ -8957,11 +9035,6 @@ textextensions@~1.0.0: resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-1.0.2.tgz#65486393ee1f2bb039a60cbba05b0b68bd9501d2" integrity sha1-ZUhjk+4fK7A5pgy7oFsLaL2VAdI= -throttleit@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-0.0.2.tgz#cfedf88e60c00dd9697b61fdd2a8343a9b680eaf" - integrity sha1-z+34jmDADdlpe2H90qg0OptoDq8= - through2-filter@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" @@ -8994,14 +9067,6 @@ through2@^3.0.0: 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" - integrity sha1-6zKE2k6jEbbMis42U3SKUqvyWj8= - dependencies: - readable-stream "~1.1.9" - xtend "~2.1.1" - through2@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" @@ -9090,6 +9155,11 @@ to-object-path@^0.3.0: dependencies: kind-of "^3.0.2" +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" @@ -9149,10 +9219,12 @@ tough-cookie@~2.4.3: resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk= -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= +truncate-utf8-bytes@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz#405923909592d56f78a5818434b0b78489ca5f2b" + integrity sha1-QFkjkJWS1W94pYGENLC3hInKXys= + dependencies: + utf8-byte-length "^1.0.1" ts-loader@^4.4.2: version "4.4.2" @@ -9199,6 +9271,11 @@ tunnel@0.0.4: resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.4.tgz#2d3785a158c174c9a16dc2c046ec5fc5f1742213" integrity sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM= +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" @@ -9211,7 +9288,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-fest@^0.8.1: +type-fest@^0.8.0, type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== @@ -9406,6 +9483,13 @@ url-join@^1.1.0: resolved "https://registry.yarnpkg.com/url-join/-/url-join-1.1.0.tgz#741c6c2f4596c4830d6718460920d0c92202dc78" integrity sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg= +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -9419,6 +9503,11 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +utf8-byte-length@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61" + integrity sha1-9F8VDExm7uloGGUFq5P8u4rWv2E= + util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" From e95476a2c12f1218ca48ff0d1d7b85996976f747 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 4 Feb 2020 21:39:14 +0100 Subject: [PATCH 156/624] JSON validation debounced too much. Fixes #89524 --- .../json-language-features/server/src/jsonServerMain.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index fb8a93aab2b..f700170b41d 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -329,7 +329,7 @@ documents.onDidClose(event => { }); const pendingValidationRequests: { [uri: string]: NodeJS.Timer; } = {}; -const validationDelayMs = 500; +const validationDelayMs = 300; function cleanPendingValidation(textDocument: TextDocument): void { const request = pendingValidationRequests[textDocument.uri]; @@ -363,12 +363,12 @@ function validateTextDocument(textDocument: TextDocument, callback?: (diagnostic const documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'warning' } : { comments: 'error', trailingCommas: 'error' }; languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => { - setTimeout(() => { + setImmediate(() => { const currDocument = documents.get(textDocument.uri); if (currDocument && currDocument.version === version) { respond(diagnostics); // Send the computed diagnostics to VSCode. } - }, 100); + }); }, error => { connection.console.error(formatError(`Error while validating ${textDocument.uri}`, error)); }); From 5bcfb8e897669f0069c73c69506d6371dd7ae3d8 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 22:05:52 +0100 Subject: [PATCH 157/624] Fixes #67022: Do not terminate at space when in square brackets --- src/vs/editor/common/modes/linkComputer.ts | 7 +++++++ src/vs/editor/test/common/modes/linkComputer.test.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/vs/editor/common/modes/linkComputer.ts b/src/vs/editor/common/modes/linkComputer.ts index 0b70ffe5ef4..f3097d5f6f4 100644 --- a/src/vs/editor/common/modes/linkComputer.ts +++ b/src/vs/editor/common/modes/linkComputer.ts @@ -223,6 +223,7 @@ export class LinkComputer { let state = State.Start; let hasOpenParens = false; let hasOpenSquareBracket = false; + let inSquareBrackets = false; let hasOpenCurlyBracket = false; while (j < len) { @@ -241,10 +242,12 @@ export class LinkComputer { chClass = (hasOpenParens ? CharacterClass.None : CharacterClass.ForceTermination); break; case CharCode.OpenSquareBracket: + inSquareBrackets = true; hasOpenSquareBracket = true; chClass = CharacterClass.None; break; case CharCode.CloseSquareBracket: + inSquareBrackets = false; chClass = (hasOpenSquareBracket ? CharacterClass.None : CharacterClass.ForceTermination); break; case CharCode.OpenCurlyBrace: @@ -272,6 +275,10 @@ export class LinkComputer { // `|` terminates a link if the link began with `|` chClass = (linkBeginChCode === CharCode.Pipe) ? CharacterClass.ForceTermination : CharacterClass.None; break; + case CharCode.Space: + // ` ` allow space in between [ and ] + chClass = (inSquareBrackets ? CharacterClass.None : CharacterClass.ForceTermination); + break; default: chClass = classifier.get(chCode); } diff --git a/src/vs/editor/test/common/modes/linkComputer.test.ts b/src/vs/editor/test/common/modes/linkComputer.test.ts index 1e07c4e310a..9ed515c2a2e 100644 --- a/src/vs/editor/test/common/modes/linkComputer.test.ts +++ b/src/vs/editor/test/common/modes/linkComputer.test.ts @@ -216,4 +216,11 @@ suite('Editor Modes - Link Computer', () => { ' https://portal.azure.com ' ); }); + + test('issue #67022: Space as end of hyperlink isn\'t always good idea', () => { + assertLink( + 'aa https://foo.bar/[this is foo site] aa', + ' https://foo.bar/[this is foo site] ' + ); + }); }); From 0ad02f89b60117f5ebd87bb083d3975b9ba39453 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 4 Feb 2020 22:46:43 +0100 Subject: [PATCH 158/624] Fixes #73700: Use `font-variant-numeric: tabular-nums` for line numbers --- src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css index 7aa1de0dddb..02def4da31f 100644 --- a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css +++ b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ .monaco-editor .margin-view-overlays .line-numbers { + font-variant-numeric: tabular-nums; position: absolute; text-align: right; display: inline-block; From a64179ac3afb0deec41841dd30f55e4547f7ea3b Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 4 Feb 2020 14:12:53 -0800 Subject: [PATCH 159/624] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0d577ef187..0c300c39400 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.43.0", - "distro": "466c88f52cc67d1bc57378639bc2f32e93dfa572", + "distro": "96df0648d477ca7b7a3d26028519c1dfe02dee33", "author": { "name": "Microsoft Corporation" }, From 6b5495035971f6114b3902f91d102f25ba9137a3 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 4 Feb 2020 23:25:57 +0100 Subject: [PATCH 160/624] Fix #89993 --- .../api/browser/mainThreadOutputService.ts | 24 +-- .../browser/parts/views/viewPaneContainer.ts | 3 +- src/vs/workbench/browser/parts/views/views.ts | 67 +++++-- src/vs/workbench/common/views.ts | 10 +- .../output/browser/output.contribution.ts | 37 ++-- .../contrib/output/browser/outputActions.ts | 6 +- .../contrib/output/browser/outputServices.ts | 108 +++-------- .../browser/{outputPanel.ts => outputView.ts} | 179 +++++++++++++----- .../workbench/contrib/output/common/output.ts | 15 +- src/vs/workbench/workbench.common.main.ts | 4 +- 10 files changed, 270 insertions(+), 183 deletions(-) rename src/vs/workbench/contrib/output/browser/{outputPanel.ts => outputView.ts} (54%) diff --git a/src/vs/workbench/api/browser/mainThreadOutputService.ts b/src/vs/workbench/api/browser/mainThreadOutputService.ts index 57930adeddc..0fea93e426d 100644 --- a/src/vs/workbench/api/browser/mainThreadOutputService.ts +++ b/src/vs/workbench/api/browser/mainThreadOutputService.ts @@ -4,15 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import { Registry } from 'vs/platform/registry/common/platform'; -import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID } from 'vs/workbench/contrib/output/common/output'; +import { IOutputService, IOutputChannel, OUTPUT_VIEW_ID } from 'vs/workbench/contrib/output/common/output'; import { Extensions, IOutputChannelRegistry } from 'vs/workbench/services/output/common/output'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { MainThreadOutputServiceShape, MainContext, IExtHostContext, ExtHostOutputServiceShape, ExtHostContext } from '../common/extHost.protocol'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; import { UriComponents, URI } from 'vs/base/common/uri'; import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { Event } from 'vs/base/common/event'; +import { IViewsService } from 'vs/workbench/common/views'; @extHostNamedCustomer(MainContext.MainThreadOutputService) export class MainThreadOutputService extends Disposable implements MainThreadOutputServiceShape { @@ -21,28 +20,24 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut private readonly _proxy: ExtHostOutputServiceShape; private readonly _outputService: IOutputService; - private readonly _layoutService: IWorkbenchLayoutService; - private readonly _panelService: IPanelService; + private readonly _viewsService: IViewsService; constructor( extHostContext: IExtHostContext, @IOutputService outputService: IOutputService, - @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, - @IPanelService panelService: IPanelService + @IViewsService viewsService: IViewsService ) { super(); this._outputService = outputService; - this._layoutService = layoutService; - this._panelService = panelService; + this._viewsService = viewsService; this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostOutputService); const setVisibleChannel = () => { - const panel = this._panelService.getActivePanel(); - const visibleChannel = panel && panel.getId() === OUTPUT_PANEL_ID ? this._outputService.getActiveChannel() : undefined; + const visibleChannel = this._viewsService.isViewVisible(OUTPUT_VIEW_ID) ? this._outputService.getActiveChannel() : undefined; this._proxy.$setVisibleChannel(visibleChannel ? visibleChannel.id : null); }; - this._register(Event.any(this._outputService.onActiveOutputChannel, this._panelService.onDidPanelOpen, this._panelService.onDidPanelClose)(() => setVisibleChannel())); + this._register(Event.any(this._outputService.onActiveOutputChannel, Event.filter(this._viewsService.onDidChangeViewVisibility, ({ id }) => id === OUTPUT_VIEW_ID))(() => setVisibleChannel())); setVisibleChannel(); } @@ -86,11 +81,10 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut } public $close(channelId: string): Promise | undefined { - const panel = this._panelService.getActivePanel(); - if (panel && panel.getId() === OUTPUT_PANEL_ID) { + if (this._viewsService.isViewVisible(OUTPUT_VIEW_ID)) { const activeChannel = this._outputService.getActiveChannel(); if (activeChannel && channelId === activeChannel.id) { - this._layoutService.setPanelHidden(true); + this._viewsService.closeView(OUTPUT_VIEW_ID); } } diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts index c314a406254..ff494235a74 100644 --- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts +++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts @@ -310,7 +310,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { return this.paneItems.map(i => i.pane); } - protected get length(): number { + get length(): number { return this.paneItems.length; } @@ -532,7 +532,6 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { protected updateTitleArea(): void { this._onTitleAreaUpdate.fire(); - } protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane { diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 9945355961e..adb04d7aa25 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/views'; import { Disposable, IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainersRegistry, Extensions as ViewExtensions, IView, ViewContainerLocation, IViewsService } from 'vs/workbench/common/views'; +import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainersRegistry, Extensions as ViewExtensions, IView, ViewContainerLocation, IViewsService, IViewPaneContainer } from 'vs/workbench/common/views'; import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -590,28 +590,23 @@ export class ViewsService extends Disposable implements IViewsService { return undefined; } + isViewVisible(id: string): boolean { + const activeView = this.getActiveViewWithId(id); + return activeView?.isBodyVisible() || false; + } + getActiveViewWithId(id: string): T | null { const viewContainer = this.viewDescriptorService.getViewContainer(id); if (viewContainer) { - const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); - - if (location === ViewContainerLocation.Sidebar) { - const activeViewlet = this.viewletService.getActiveViewlet(); - if (activeViewlet?.getId() === viewContainer.id) { - return activeViewlet.getViewPaneContainer().getView(id) as T ?? null; - } - } else if (location === ViewContainerLocation.Panel) { - const activePanel = this.panelService.getActivePanel(); - if (activePanel?.getId() === viewContainer.id) { - return (activePanel as IPaneComposite).getViewPaneContainer().getView(id) as T ?? null; - } + const activeViewPaneContainer = this.getActiveViewPaneContainer(viewContainer); + if (activeViewPaneContainer) { + return activeViewPaneContainer.getView(id) as T; } } - return null; } - async openView(id: string, focus: boolean): Promise { + async openView(id: string, focus: boolean): Promise { const viewContainer = this.viewDescriptorService.getViewContainer(id); if (viewContainer) { const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); @@ -619,7 +614,7 @@ export class ViewsService extends Disposable implements IViewsService { if (compositeDescriptor) { const paneComposite = await this.openComposite(compositeDescriptor.id, location!, focus) as IPaneComposite | undefined; if (paneComposite && paneComposite.openView) { - return paneComposite.openView(id, focus); + return paneComposite.openView(id, focus) as T; } } } @@ -627,6 +622,46 @@ export class ViewsService extends Disposable implements IViewsService { return null; } + closeView(id: string): void { + const viewContainer = this.viewDescriptorService.getViewContainer(id); + if (viewContainer) { + const activeViewPaneContainer = this.getActiveViewPaneContainer(viewContainer); + if (activeViewPaneContainer) { + const view = activeViewPaneContainer.getView(id); + if (view) { + if (activeViewPaneContainer.length === 1) { + const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); + if (location === ViewContainerLocation.Sidebar) { + this.viewletService.hideActiveViewlet(); + } else if (location === ViewContainerLocation.Panel) { + this.panelService.hideActivePanel(); + } + } else { + view.setExpanded(false); + } + } + } + } + } + + private getActiveViewPaneContainer(viewContainer: ViewContainer): IViewPaneContainer | null { + const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); + + if (location === ViewContainerLocation.Sidebar) { + const activeViewlet = this.viewletService.getActiveViewlet(); + if (activeViewlet?.getId() === viewContainer.id) { + return activeViewlet.getViewPaneContainer() || null; + } + } else if (location === ViewContainerLocation.Panel) { + const activePanel = this.panelService.getActivePanel(); + if (activePanel?.getId() === viewContainer.id) { + return (activePanel as IPaneComposite).getViewPaneContainer() || null; + } + } + + return null; + } + registerViewPaneContainer(viewPaneContainer: ViewPaneContainer): ViewPaneContainer { this._register(viewPaneContainer.onDidAddViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() })))); this._register(viewPaneContainer.onDidChangeViewVisibility(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() }))); diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index fbede54b565..59bfebf08c8 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -345,6 +345,8 @@ export interface IView { isBodyVisible(): boolean; + setExpanded(expanded: boolean): boolean; + } export interface IViewsViewlet extends IViewlet { @@ -360,9 +362,13 @@ export interface IViewsService { readonly onDidChangeViewVisibility: Event<{ id: string, visible: boolean }>; + isViewVisible(id: string): boolean; + getActiveViewWithId(id: string): T | null; - openView(id: string, focus?: boolean): Promise; + openView(id: string, focus?: boolean): Promise; + + closeView(id: string): void; } @@ -523,6 +529,8 @@ export interface IViewPaneContainer { onDidRemoveViews: Event; onDidChangeViewVisibility: Event; + readonly length: number; + setVisible(visible: boolean): void; isVisible(): boolean; focus(): void; diff --git a/src/vs/workbench/contrib/output/browser/output.contribution.ts b/src/vs/workbench/contrib/output/browser/output.contribution.ts index 5bff7445b91..90a0493c1e3 100644 --- a/src/vs/workbench/contrib/output/browser/output.contribution.ts +++ b/src/vs/workbench/contrib/output/browser/output.contribution.ts @@ -12,9 +12,8 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { OutputService, LogContentProvider } from 'vs/workbench/contrib/output/browser/outputServices'; import { ToggleOutputAction, ClearOutputAction, OpenLogOutputFile, ShowLogsOutputChannelAction, OpenOutputLogFileAction } from 'vs/workbench/contrib/output/browser/outputActions'; -import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_SCHEME, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT } from 'vs/workbench/contrib/output/common/output'; -import { PanelRegistry, Extensions, PanelDescriptor } from 'vs/workbench/browser/panel'; -import { OutputPanel } from 'vs/workbench/contrib/output/browser/outputPanel'; +import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_SCHEME, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT } from 'vs/workbench/contrib/output/common/output'; +import { OutputViewPane } from 'vs/workbench/contrib/output/browser/outputView'; import { IEditorRegistry, Extensions as EditorExtensions, EditorDescriptor } from 'vs/workbench/browser/editor'; import { LogViewer, LogViewerInput } from 'vs/workbench/contrib/output/browser/logViewer'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; @@ -22,6 +21,8 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWo import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; +import { ViewContainer, IViewContainersRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions, IViewsRegistry } from 'vs/workbench/common/views'; +import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; // Register Service registerSingleton(IOutputService, OutputService); @@ -40,15 +41,27 @@ ModesRegistry.registerLanguage({ mimetypes: [LOG_MIME] }); -// Register Output Panel -Registry.as(Extensions.Panels).registerPanel(PanelDescriptor.create( - OutputPanel, - OUTPUT_PANEL_ID, - nls.localize('output', "Output"), - 'output', - 20, - ToggleOutputAction.ID -)); +// register output container +const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ + id: OUTPUT_VIEW_ID, + name: nls.localize('output', "Output"), + ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [OUTPUT_VIEW_ID, OUTPUT_VIEW_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]), + focusCommand: { + id: ToggleOutputAction.ID, keybindings: { + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_U, + linux: { + primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_H) // On Ubuntu Ctrl+Shift+U is taken by some global OS command + } + } + } +}, ViewContainerLocation.Panel); + +Registry.as(ViewContainerExtensions.ViewsRegistry).registerViews([{ + id: OUTPUT_VIEW_ID, + name: nls.localize('output', "Output"), + canToggleVisibility: false, + ctorDescriptor: new SyncDescriptor(OutputViewPane), +}], VIEW_CONTAINER); Registry.as(EditorExtensions.Editors).registerEditor( EditorDescriptor.create( diff --git a/src/vs/workbench/contrib/output/browser/outputActions.ts b/src/vs/workbench/contrib/output/browser/outputActions.ts index 0326a605282..db610d418d1 100644 --- a/src/vs/workbench/contrib/output/browser/outputActions.ts +++ b/src/vs/workbench/contrib/output/browser/outputActions.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { IAction, Action } from 'vs/base/common/actions'; import { IOutputChannelRegistry, Extensions as OutputExt, IOutputChannelDescriptor, IFileOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; -import { IOutputService, OUTPUT_PANEL_ID } from 'vs/workbench/contrib/output/common/output'; +import { IOutputService, OUTPUT_VIEW_ID } from 'vs/workbench/contrib/output/common/output'; import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; @@ -34,7 +34,7 @@ export class ToggleOutputAction extends TogglePanelAction { @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @IPanelService panelService: IPanelService, ) { - super(id, label, OUTPUT_PANEL_ID, panelService, layoutService); + super(id, label, OUTPUT_VIEW_ID, panelService, layoutService); } } @@ -62,7 +62,7 @@ export class ClearOutputAction extends Action { // this action can be triggered in two ways: // 1. user clicks the action icon, In which case the action toggles the lock state -// 2. user clicks inside the output panel, which sets the lock, Or unsets it if they click the last line. +// 2. user clicks inside the output view, which sets the lock, Or unsets it if they click the last line. export class ToggleOrSetOutputScrollLockAction extends Action { static readonly ID = 'workbench.output.action.toggleOutputScrollLock'; diff --git a/src/vs/workbench/contrib/output/browser/outputServices.ts b/src/vs/workbench/contrib/output/browser/outputServices.ts index 16d49998734..cefd280206f 100644 --- a/src/vs/workbench/contrib/output/browser/outputServices.ts +++ b/src/vs/workbench/contrib/output/browser/outputServices.ts @@ -3,28 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; import { Event, Emitter } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { Registry } from 'vs/platform/registry/common/platform'; -import { EditorOptions } from 'vs/workbench/common/editor'; -import { IOutputChannel, IOutputService, OUTPUT_PANEL_ID, OUTPUT_SCHEME, LOG_SCHEME, CONTEXT_ACTIVE_LOG_OUTPUT, LOG_MIME, OUTPUT_MIME } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannel, IOutputService, OUTPUT_VIEW_ID, OUTPUT_SCHEME, LOG_SCHEME, LOG_MIME, OUTPUT_MIME } from 'vs/workbench/contrib/output/common/output'; import { IOutputChannelDescriptor, Extensions, IOutputChannelRegistry } from 'vs/workbench/services/output/common/output'; -import { OutputPanel } from 'vs/workbench/contrib/output/browser/outputPanel'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { OutputLinkProvider } from 'vs/workbench/contrib/output/common/outputLinkProvider'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { ITextModel } from 'vs/editor/common/model'; -import { IPanel } from 'vs/workbench/common/panel'; -import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { ILogService } from 'vs/platform/log/common/log'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { CancellationToken } from 'vs/base/common/cancellation'; import { IOutputChannelModel, IOutputChannelModelService } from 'vs/workbench/services/output/common/outputChannelModel'; +import { IViewsService } from 'vs/workbench/common/views'; +import { OutputViewPane } from 'vs/workbench/contrib/output/browser/outputView'; const OUTPUT_ACTIVE_CHANNEL_KEY = 'output.activechannel'; @@ -34,6 +28,7 @@ class OutputChannel extends Disposable implements IOutputChannel { readonly model: IOutputChannelModel; readonly id: string; readonly label: string; + readonly uri: URI; constructor( readonly outputChannelDescriptor: IOutputChannelDescriptor, @@ -42,7 +37,8 @@ class OutputChannel extends Disposable implements IOutputChannel { super(); this.id = outputChannelDescriptor.id; this.label = outputChannelDescriptor.label; - this.model = this._register(outputChannelModelService.createOutputChannelModel(this.id, URI.from({ scheme: OUTPUT_SCHEME, path: this.id }), outputChannelDescriptor.log ? LOG_MIME : OUTPUT_MIME, outputChannelDescriptor.file)); + this.uri = URI.from({ scheme: OUTPUT_SCHEME, path: this.id }); + this.model = this._register(outputChannelModelService.createOutputChannelModel(this.id, this.uri, outputChannelDescriptor.log ? LOG_MIME : OUTPUT_MIME, outputChannelDescriptor.file)); } append(output: string): void { @@ -69,16 +65,13 @@ export class OutputService extends Disposable implements IOutputService, ITextMo private readonly _onActiveOutputChannel = this._register(new Emitter()); readonly onActiveOutputChannel: Event = this._onActiveOutputChannel.event; - private _outputPanel: OutputPanel | undefined; - constructor( @IStorageService private readonly storageService: IStorageService, @IInstantiationService private readonly instantiationService: IInstantiationService, - @IPanelService private readonly panelService: IPanelService, @ITextModelService textModelResolverService: ITextModelService, @ILogService private readonly logService: ILogService, @ILifecycleService private readonly lifecycleService: ILifecycleService, - @IContextKeyService private readonly contextKeyService: IContextKeyService, + @IViewsService private readonly viewsService: IViewsService, ) { super(); this.activeChannelIdInStorage = this.storageService.get(OUTPUT_ACTIVE_CHANNEL_KEY, StorageScope.WORKSPACE, ''); @@ -94,9 +87,6 @@ export class OutputService extends Disposable implements IOutputService, ITextMo } this._register(registry.onDidRegisterChannel(this.onDidRegisterChannel, this)); - this._register(panelService.onDidPanelOpen(({ panel, focus }) => this.onDidPanelOpen(panel, !focus), this)); - this._register(panelService.onDidPanelClose(this.onDidPanelClose, this)); - // Set active channel to first channel if not set if (!this.activeChannel) { const channels = this.getChannelDescriptors(); @@ -116,25 +106,24 @@ export class OutputService extends Disposable implements IOutputService, ITextMo async showChannel(id: string, preserveFocus?: boolean): Promise { const channel = this.getChannel(id); - if (!channel || this.isChannelShown(channel)) { - if (this._outputPanel && !preserveFocus) { - this._outputPanel.focus(); - } - return; + if (this.activeChannel?.id !== channel?.id) { + this.setActiveChannel(channel); + this._onActiveOutputChannel.fire(id); } - - this.setActiveChannel(channel); - if (!this.isPanelShown()) { - this.panelService.openPanel(OUTPUT_PANEL_ID); + const outputView = await this.viewsService.openView(OUTPUT_VIEW_ID, !preserveFocus); + if (outputView && channel) { + outputView!.showChannel(channel, !!preserveFocus); } - await this.doShowChannel(channel, !!preserveFocus); - this._onActiveOutputChannel.fire(id); } getChannel(id: string): OutputChannel | undefined { return this.channels.get(id); } + getChannelDescriptor(id: string): IOutputChannelDescriptor | undefined { + return Registry.as(Extensions.OutputChannels).getChannel(id); + } + getChannelDescriptors(): IOutputChannelDescriptor[] { return Registry.as(Extensions.OutputChannels).getChannels(); } @@ -148,51 +137,24 @@ export class OutputService extends Disposable implements IOutputService, ITextMo this.channels.set(channelId, channel); if (!this.activeChannel || this.activeChannelIdInStorage === channelId) { this.setActiveChannel(channel); - await this.onDidPanelOpen(this.panelService.getActivePanel(), true); this._onActiveOutputChannel.fire(channelId); - } - } - - private onDidPanelOpen(panel: IPanel | undefined, preserveFocus: boolean): Promise { - if (panel && panel.getId() === OUTPUT_PANEL_ID) { - this._outputPanel = this.panelService.getActivePanel(); - if (this.activeChannel) { - return this.doShowChannel(this.activeChannel, preserveFocus); + const outputView = this.viewsService.getActiveViewWithId(OUTPUT_VIEW_ID); + if (outputView) { + outputView.showChannel(channel, true); } } - return Promise.resolve(undefined); - } - - private onDidPanelClose(panel: IPanel): void { - if (this._outputPanel && panel.getId() === OUTPUT_PANEL_ID) { - CONTEXT_ACTIVE_LOG_OUTPUT.bindTo(this.contextKeyService).set(false); - this._outputPanel.clearInput(); - } } private createChannel(id: string): OutputChannel { const channelDisposables: IDisposable[] = []; const channel = this.instantiateChannel(id); - channel.model.onDidAppendedContent(() => { - if (!channel.scrollLock) { - const panel = this.panelService.getActivePanel(); - if (panel && panel.getId() === OUTPUT_PANEL_ID && this.isChannelShown(channel)) { - let outputPanel = panel; - outputPanel.revealLastLine(); - } - } - }, channelDisposables); channel.model.onDispose(() => { if (this.activeChannel === channel) { const channels = this.getChannelDescriptors(); const channel = channels.length ? this.getChannel(channels[0].id) : undefined; - if (channel && this.isPanelShown()) { - this.showChannel(channel.id, true); - } else { - this.setActiveChannel(channel); - if (this.activeChannel) { - this._onActiveOutputChannel.fire(this.activeChannel.id); - } + this.setActiveChannel(channel); + if (this.activeChannel) { + this._onActiveOutputChannel.fire(this.activeChannel.id); } } Registry.as(Extensions.OutputChannels).removeChannel(id); @@ -211,30 +173,6 @@ export class OutputService extends Disposable implements IOutputService, ITextMo return this.instantiationService.createInstance(OutputChannel, channelData); } - private async doShowChannel(channel: OutputChannel, preserveFocus: boolean): Promise { - if (this._outputPanel) { - CONTEXT_ACTIVE_LOG_OUTPUT.bindTo(this.contextKeyService).set(!!channel.outputChannelDescriptor.file && channel.outputChannelDescriptor.log); - await this._outputPanel.setInput(this.createInput(channel), EditorOptions.create({ preserveFocus }), CancellationToken.None); - if (!preserveFocus && this._outputPanel) { - this._outputPanel.focus(); - } - } - } - - private isChannelShown(channel: IOutputChannel): boolean { - return this.isPanelShown() && this.activeChannel === channel; - } - - private isPanelShown(): boolean { - const panel = this.panelService.getActivePanel(); - return !!panel && panel.getId() === OUTPUT_PANEL_ID; - } - - private createInput(channel: IOutputChannel): ResourceEditorInput { - const resource = URI.from({ scheme: OUTPUT_SCHEME, path: channel.id }); - return this.instantiationService.createInstance(ResourceEditorInput, nls.localize('output', "{0} - Output", channel.label), nls.localize('channel', "Output channel for '{0}'", channel.label), resource, undefined); - } - private setActiveChannel(channel: OutputChannel | undefined): void { this.activeChannel = channel; diff --git a/src/vs/workbench/contrib/output/browser/outputPanel.ts b/src/vs/workbench/contrib/output/browser/outputView.ts similarity index 54% rename from src/vs/workbench/contrib/output/browser/outputPanel.ts rename to src/vs/workbench/contrib/output/browser/outputView.ts index 378f789fc69..484b3d30120 100644 --- a/src/vs/workbench/contrib/output/browser/outputPanel.ts +++ b/src/vs/workbench/contrib/output/browser/outputView.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import { Action, IAction } from 'vs/base/common/actions'; +import { IAction } from 'vs/base/common/actions'; import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; @@ -16,7 +16,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { EditorInput, EditorOptions } from 'vs/workbench/common/editor'; import { AbstractTextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; -import { OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/contrib/output/common/output'; +import { OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, IOutputChannel, CONTEXT_ACTIVE_LOG_OUTPUT } from 'vs/workbench/contrib/output/common/output'; import { SwitchOutputAction, SwitchOutputActionViewItem, ClearOutputAction, ToggleOrSetOutputScrollLockAction, OpenLogOutputFile } from 'vs/workbench/contrib/output/browser/outputActions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -24,11 +24,139 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { CancellationToken } from 'vs/base/common/cancellation'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; +import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IViewDescriptorService } from 'vs/workbench/common/views'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; -export class OutputPanel extends AbstractTextResourceEditor { +export class OutputViewPane extends ViewPane { + private readonly editor: OutputEditor; + private channelId: string | undefined; + private editorPromise: Promise | null = null; private actions: IAction[] | undefined; + constructor( + options: IViewPaneOptions, + @IKeybindingService keybindingService: IKeybindingService, + @IContextMenuService contextMenuService: IContextMenuService, + @IConfigurationService configurationService: IConfigurationService, + @IContextKeyService private readonly contextKeyService: IContextKeyService, + @IViewDescriptorService viewDescriptorService: IViewDescriptorService, + @IInstantiationService instantiationService: IInstantiationService, + @IOutputService private readonly outputService: IOutputService, + ) { + super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService); + this.editor = instantiationService.createInstance(OutputEditor); + this._register(this.editor.onTitleAreaUpdate(() => { + this.updateTitle(this.editor.getTitle()); + this.updateActions(); + })); + this._register(this.onDidChangeBodyVisibility(() => this.onDidChangeVisibility(this.isBodyVisible()))); + } + + showChannel(channel: IOutputChannel, preserveFocus: boolean): void { + if (this.channelId !== channel.id) { + this.setInput(channel); + } + if (!preserveFocus) { + this.focus(); + } + } + + focus(): void { + super.focus(); + if (this.editorPromise) { + this.editorPromise.then(() => this.editor.focus()); + } + } + + renderBody(container: HTMLElement): void { + this.editor.create(container); + const codeEditor = this.editor.getControl(); + this._register(codeEditor.onDidChangeModelContent(() => { + const activeChannel = this.outputService.getActiveChannel(); + if (activeChannel && !activeChannel.scrollLock) { + this.editor.revealLastLine(); + } + })); + this._register(codeEditor.onDidChangeCursorPosition((e) => { + if (e.reason !== CursorChangeReason.Explicit) { + return; + } + + const model = codeEditor.getModel(); + if (model && this.actions) { + const newPositionLine = e.position.lineNumber; + const lastLine = model.getLineCount(); + const newLockState = lastLine !== newPositionLine; + const lockAction = this.actions.filter((action) => action.id === ToggleOrSetOutputScrollLockAction.ID)[0]; + lockAction.run(newLockState); + } + })); + } + + layoutBody(height: number, width: number): void { + this.editor.layout({ height, width }); + } + + getActions(): IAction[] { + if (!this.actions) { + this.actions = [ + this._register(this.instantiationService.createInstance(SwitchOutputAction)), + this._register(this.instantiationService.createInstance(ClearOutputAction, ClearOutputAction.ID, ClearOutputAction.LABEL)), + this._register(this.instantiationService.createInstance(ToggleOrSetOutputScrollLockAction, ToggleOrSetOutputScrollLockAction.ID, ToggleOrSetOutputScrollLockAction.LABEL)), + this._register(this.instantiationService.createInstance(OpenLogOutputFile)) + ]; + } + return [...super.getActions(), ...this.actions]; + } + + getSecondaryActions(): IAction[] { + return [...super.getSecondaryActions(), ...this.editor.getSecondaryActions()]; + } + + getActionViewItem(action: IAction): IActionViewItem | undefined { + if (action.id === SwitchOutputAction.ID) { + return this.instantiationService.createInstance(SwitchOutputActionViewItem, action); + } + return super.getActionViewItem(action); + } + + + private onDidChangeVisibility(visible: boolean): void { + this.editor.setVisible(visible); + const channel = this.channelId ? this.outputService.getChannel(this.channelId) : undefined; + if (visible && channel) { + this.setInput(channel); + } else { + this.clearInput(); + } + } + + private setInput(channel: IOutputChannel): void { + this.channelId = channel.id; + const descriptor = this.outputService.getChannelDescriptor(channel.id)!; + CONTEXT_ACTIVE_LOG_OUTPUT.bindTo(this.contextKeyService).set(!!descriptor.file && descriptor.log); + this.editorPromise = this.editor.setInput(this.createInput(channel), EditorOptions.create({ preserveFocus: true }), CancellationToken.None) + .then(() => this.editor); + } + + private clearInput(): void { + CONTEXT_ACTIVE_LOG_OUTPUT.bindTo(this.contextKeyService).set(false); + this.editor.clearInput(); + this.editorPromise = null; + } + + private createInput(channel: IOutputChannel): ResourceEditorInput { + return this.instantiationService.createInstance(ResourceEditorInput, nls.localize('output model title', "{0} - Output", channel.label), nls.localize('channel', "Output channel for '{0}'", channel.label), channel.uri, undefined); + } + +} + +export class OutputEditor extends AbstractTextResourceEditor { + // Override the instantiation service to use to be the scoped one private scopedInstantiationService: IInstantiationService; protected get instantiationService(): IInstantiationService { return this.scopedInstantiationService; } @@ -46,7 +174,7 @@ export class OutputPanel extends AbstractTextResourceEditor { @IEditorGroupsService editorGroupService: IEditorGroupsService, @IEditorService editorService: IEditorService ) { - super(OUTPUT_PANEL_ID, telemetryService, instantiationService, storageService, textResourceConfigurationService, themeService, editorGroupService, editorService); + super(OUTPUT_VIEW_ID, telemetryService, instantiationService, storageService, textResourceConfigurationService, themeService, editorGroupService, editorService); // Initially, the scoped instantiation service is the global // one until the editor is created later on @@ -54,36 +182,13 @@ export class OutputPanel extends AbstractTextResourceEditor { } getId(): string { - return OUTPUT_PANEL_ID; + return OUTPUT_VIEW_ID; } getTitle(): string { return nls.localize('output', "Output"); } - getActions(): IAction[] { - if (!this.actions) { - this.actions = [ - this.scopedInstantiationService.createInstance(SwitchOutputAction), - this.scopedInstantiationService.createInstance(ClearOutputAction, ClearOutputAction.ID, ClearOutputAction.LABEL), - this.scopedInstantiationService.createInstance(ToggleOrSetOutputScrollLockAction, ToggleOrSetOutputScrollLockAction.ID, ToggleOrSetOutputScrollLockAction.LABEL), - this.scopedInstantiationService.createInstance(OpenLogOutputFile) - ]; - - this.actions.forEach(a => this._register(a)); - } - - return this.actions; - } - - getActionViewItem(action: Action): IActionViewItem | undefined { - if (action.id === SwitchOutputAction.ID) { - return this.scopedInstantiationService.createInstance(SwitchOutputActionViewItem, action); - } - - return super.getActionViewItem(action); - } - protected getConfigurationOverrides(): IEditorOptions { const options = super.getConfigurationOverrides(); options.wordWrap = 'on'; // all output editors wrap @@ -113,7 +218,7 @@ export class OutputPanel extends AbstractTextResourceEditor { protected getAriaLabel(): string { const channel = this.outputService.getActiveChannel(); - return channel ? nls.localize('outputPanelWithInputAriaLabel', "{0}, Output panel", channel.label) : nls.localize('outputPanelAriaLabel', "Output panel"); + return channel ? nls.localize('outputViewWithInputAriaLabel', "{0}, Output panel", channel.label) : nls.localize('outputViewAriaLabel', "Output panel"); } async setInput(input: EditorInput, options: EditorOptions | undefined, token: CancellationToken): Promise { @@ -150,21 +255,5 @@ export class OutputPanel extends AbstractTextResourceEditor { super.createEditor(parent); CONTEXT_IN_OUTPUT.bindTo(scopedContextKeyService).set(true); - - const codeEditor = this.getControl(); - this._register(codeEditor.onDidChangeCursorPosition((e) => { - if (e.reason !== CursorChangeReason.Explicit) { - return; - } - - const model = codeEditor.getModel(); - if (model && this.actions) { - const newPositionLine = e.position.lineNumber; - const lastLine = model.getLineCount(); - const newLockState = lastLine !== newPositionLine; - const lockAction = this.actions.filter((action) => action.id === ToggleOrSetOutputScrollLockAction.ID)[0]; - lockAction.run(newLockState); - } - })); } } diff --git a/src/vs/workbench/contrib/output/common/output.ts b/src/vs/workbench/contrib/output/common/output.ts index d90dcb9908f..238e2b7758f 100644 --- a/src/vs/workbench/contrib/output/common/output.ts +++ b/src/vs/workbench/contrib/output/common/output.ts @@ -7,6 +7,7 @@ import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; +import { URI } from 'vs/base/common/uri'; /** * Mime type used by the output editor. @@ -39,9 +40,9 @@ export const LOG_SCHEME = 'log'; export const LOG_MODE_ID = 'log'; /** - * Output panel id + * Output view id */ -export const OUTPUT_PANEL_ID = 'workbench.panel.output'; +export const OUTPUT_VIEW_ID = 'workbench.panel.output'; export const OUTPUT_SERVICE_ID = 'outputService'; @@ -65,6 +66,11 @@ export interface IOutputService { */ getChannel(id: string): IOutputChannel | undefined; + /** + * Given the channel id returns the registered output channel descriptor. + */ + getChannelDescriptor(id: string): IOutputChannelDescriptor | undefined; + /** * Returns an array of all known output channels descriptors. */ @@ -104,6 +110,11 @@ export interface IOutputChannel { */ scrollLock: boolean; + /** + * URI of the output channel. + */ + uri: URI; + /** * Appends output to the channel. */ diff --git a/src/vs/workbench/workbench.common.main.ts b/src/vs/workbench/workbench.common.main.ts index 04880d14542..83a7e09f4ba 100644 --- a/src/vs/workbench/workbench.common.main.ts +++ b/src/vs/workbench/workbench.common.main.ts @@ -192,9 +192,9 @@ import 'vs/workbench/contrib/extensions/browser/extensions.contribution'; import 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; import 'vs/workbench/contrib/extensions/browser/extensionsViewlet'; -// Output Panel +// Output View import 'vs/workbench/contrib/output/browser/output.contribution'; -import 'vs/workbench/contrib/output/browser/outputPanel'; +import 'vs/workbench/contrib/output/browser/outputView'; // Terminal import 'vs/workbench/contrib/terminal/browser/terminal.contribution'; From 967aab81566aaf1ddc8f63e6d12af3d7c14c490f Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Tue, 4 Feb 2020 15:51:17 -0800 Subject: [PATCH 161/624] Add telemetry event for settings sync auth --- extensions/vscode-account/src/AADHelper.ts | 3 ++- .../userDataSync/browser/userDataSync.ts | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/extensions/vscode-account/src/AADHelper.ts b/extensions/vscode-account/src/AADHelper.ts index 10578bd60b4..44605a504be 100644 --- a/extensions/vscode-account/src/AADHelper.ts +++ b/extensions/vscode-account/src/AADHelper.ts @@ -33,6 +33,7 @@ interface ITokenClaims { unique_name?: string; oid?: string; altsecid?: string; + ipd?: string; scp: string; } @@ -360,7 +361,7 @@ export class AzureActiveDirectoryService { accessToken: json.access_token, refreshToken: json.refresh_token, scope, - sessionId: claims.tid + (claims.oid || claims.altsecid) + scope, + sessionId: `${claims.tid}/${(claims.oid || (claims.altsecid || '' + claims.ipd || ''))}/${scope}`, displayName: claims.email || claims.unique_name || 'user@example.com' }; } diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index fbdfed7cd26..06bb75cbc76 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -143,6 +143,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo } if (sessions.length === 1) { + this.logAuthenticatedEvent(sessions[0]); this.activeAccount = sessions[0]; return; } @@ -155,10 +156,25 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo }), { canPickMany: false }); if (selectedAccount) { - this.activeAccount = sessions.filter(account => selectedAccount.id === account.id)[0]; + const selected = sessions.filter(account => selectedAccount.id === account.id)[0]; + this.logAuthenticatedEvent(selected); + this.activeAccount = selected; } } + private logAuthenticatedEvent(session: AuthenticationSession): void { + type UserAuthenticatedClassification = { + id: { classification: 'EndUserPseudonymizedInformation', purpose: 'BusinessInsight' }; + }; + + type UserAuthenticatedEvent = { + id: string; + }; + + const id = session.id.split('/')[1]; + this.telemetryService.publicLog2('user.authenticated', { id }); + } + get activeAccount(): AuthenticationSession | undefined { return this._activeAccount; } From 34f257986390197e25126c743d186ebc3f7b6ba6 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 4 Feb 2020 16:05:42 -0800 Subject: [PATCH 162/624] resolves #89723 fyi @sandy081 @isidorn --- .../browser/actions/navigationActions.ts | 8 ++--- src/vs/workbench/browser/panel.ts | 6 ++-- .../browser/parts/panel/panelActions.ts | 12 +++---- .../browser/parts/panel/panelPart.ts | 10 +++--- src/vs/workbench/browser/parts/views/views.ts | 2 +- src/vs/workbench/browser/workbench.ts | 4 +-- .../bulkEdit/browser/bulkEdit.contribution.ts | 36 +++++++++---------- .../contrib/comments/browser/commentsPanel.ts | 4 +-- .../contrib/debug/browser/debugTaskRunner.ts | 4 +-- .../markers/browser/markers.contribution.ts | 8 ++--- .../markers/browser/markersViewActions.ts | 3 +- .../tasks/browser/abstractTaskService.ts | 4 +-- .../terminal/browser/terminalService.ts | 4 +-- .../services/panel/common/panelService.ts | 7 +--- .../test/browser/workbenchTestServices.ts | 6 +--- 15 files changed, 52 insertions(+), 66 deletions(-) diff --git a/src/vs/workbench/browser/actions/navigationActions.ts b/src/vs/workbench/browser/actions/navigationActions.ts index 538edac8a28..8a5049a83eb 100644 --- a/src/vs/workbench/browser/actions/navigationActions.ts +++ b/src/vs/workbench/browser/actions/navigationActions.ts @@ -63,7 +63,7 @@ abstract class BaseNavigationAction extends Action { return true; } - protected navigateToPanel(): IPanel | boolean { + protected async navigateToPanel(): Promise { if (!this.layoutService.isVisible(Parts.PANEL_PART)) { return false; } @@ -75,7 +75,7 @@ abstract class BaseNavigationAction extends Action { const activePanelId = activePanel.getId(); - const res = this.panelService.openPanel(activePanelId, true); + const res = await this.panelService.openPanel(activePanelId, true); if (!res) { return false; } @@ -191,7 +191,7 @@ class NavigateRightAction extends BaseNavigationAction { } if (!isPanelPositionDown) { - return Promise.resolve(this.navigateToPanel()); + return this.navigateToPanel(); } if (!isSidebarPositionLeft) { @@ -270,7 +270,7 @@ class NavigateDownAction extends BaseNavigationAction { } if (isPanelPositionDown) { - return Promise.resolve(this.navigateToPanel()); + return this.navigateToPanel(); } return Promise.resolve(false); diff --git a/src/vs/workbench/browser/panel.ts b/src/vs/workbench/browser/panel.ts index 1f83af0e2db..f9ff5312187 100644 --- a/src/vs/workbench/browser/panel.ts +++ b/src/vs/workbench/browser/panel.ts @@ -101,14 +101,12 @@ export abstract class TogglePanelAction extends Action { super(id, label, cssClass); } - run(): Promise { + async run(): Promise { if (this.isPanelFocused()) { this.layoutService.setPanelHidden(true); } else { - this.panelService.openPanel(this.panelId, true); + await this.panelService.openPanel(this.panelId, true); } - - return Promise.resolve(); } private isPanelActive(): boolean { diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index 1293a2149e8..5dc445a3e10 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -182,10 +182,9 @@ export class PanelActivityAction extends ActivityAction { super(activity); } - run(event: any): Promise { - this.panelService.openPanel(this.activity.id, true); + async run(event: any): Promise { + await this.panelService.openPanel(this.activity.id, true); this.activate(); - return Promise.resolve(); } setActivity(activity: IActivity): void { @@ -225,11 +224,11 @@ export class SwitchPanelViewAction extends Action { super(id, name); } - run(offset: number): Promise { + async run(offset: number): Promise { const pinnedPanels = this.panelService.getPinnedPanels(); const activePanel = this.panelService.getActivePanel(); if (!activePanel) { - return Promise.resolve(); + return; } let targetPanelId: string | undefined; for (let i = 0; i < pinnedPanels.length; i++) { @@ -239,9 +238,8 @@ export class SwitchPanelViewAction extends Action { } } if (typeof targetPanelId === 'string') { - this.panelService.openPanel(targetPanelId, true); + await this.panelService.openPanel(targetPanelId, true); } - return Promise.resolve(); } } diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 2ba152c7a74..b1cdfc6f4eb 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -128,7 +128,7 @@ export class PanelPart extends CompositePart implements IPanelService { this.compositeBar = this._register(this.instantiationService.createInstance(CompositeBar, this.getCachedPanels(), { icon: false, orientation: ActionsOrientation.HORIZONTAL, - openComposite: (compositeId: string) => Promise.resolve(this.openPanel(compositeId, true)), + openComposite: (compositeId: string) => this.openPanel(compositeId, true), getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction, getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction, getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(PanelActivityAction, assertIsDefined(this.getPanel(compositeId))), @@ -355,7 +355,7 @@ export class PanelPart extends CompositePart implements IPanelService { } } - openPanel(id: string, focus?: boolean): Panel | undefined { + doOpenPanel(id: string, focus?: boolean): Panel | undefined { if (this.blockOpeningPanel) { return undefined; // Workaround against a potential race condition } @@ -373,15 +373,15 @@ export class PanelPart extends CompositePart implements IPanelService { return this.openComposite(id, focus); } - async openPanelAsync(id?: string, focus?: boolean): Promise { + async openPanel(id?: string, focus?: boolean): Promise { if (typeof id === 'string' && this.getPanel(id)) { - return this.openPanel(id, focus); + return this.doOpenPanel(id, focus); } await this.extensionService.whenInstalledExtensionsRegistered(); if (typeof id === 'string' && this.getPanel(id)) { - return this.openPanel(id, focus); + return this.doOpenPanel(id, focus); } return undefined; diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index adb04d7aa25..566e186ca84 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -575,7 +575,7 @@ export class ViewsService extends Disposable implements IViewsService { if (location === ViewContainerLocation.Sidebar) { return this.viewletService.openViewlet(compositeId, focus); } else if (location === ViewContainerLocation.Panel) { - return this.panelService.openPanel(compositeId, focus) as IPaneComposite; + return this.panelService.openPanel(compositeId, focus) as Promise; } return undefined; } diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index 1e51d2ac3d8..604e4d1e914 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -443,9 +443,9 @@ export class Workbench extends Layout { restorePromises.push((async () => { mark('willRestorePanel'); - const panel = await panelService.openPanelAsync(this.state.panel.panelToRestore); + const panel = await panelService.openPanel(this.state.panel.panelToRestore!); if (!panel) { - panelService.openPanel(Registry.as(PanelExtensions.Panels).getDefaultPanelId()); // fallback to default panel as needed + await panelService.openPanel(Registry.as(PanelExtensions.Panels).getDefaultPanelId()); // fallback to default panel as needed } mark('didRestorePanel'); diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts index 660b56fd9b4..9b9c46fa78c 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts @@ -28,9 +28,9 @@ import { IEditorInput } from 'vs/workbench/common/editor'; import type { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; -function getBulkEditPane(panelService: IPanelService): BulkEditPane | undefined { +async function getBulkEditPane(panelService: IPanelService): Promise { let view: ViewPane | undefined; - const activePanel = panelService.openPanel(BulkEditPane.ID, true); + const activePanel = await panelService.openPanel(BulkEditPane.ID, true); if (activePanel instanceof PaneCompositePanel) { view = activePanel.getViewPaneContainer().getView(BulkEditPane.ID); } @@ -51,11 +51,11 @@ class UXState { this._activePanel = _panelService.getActivePanel()?.getId(); } - restore(): void { + async restore(): Promise { // (1) restore previous panel if (typeof this._activePanel === 'string') { - this._panelService.openPanel(this._activePanel); + await this._panelService.openPanel(this._activePanel); } else { this._panelService.hideActivePanel(); } @@ -124,7 +124,7 @@ class BulkEditPreviewContribution { // the actual work... try { - const view = getBulkEditPane(this._panelService); + const view = await getBulkEditPane(this._panelService); if (!view) { return edit; } @@ -139,7 +139,7 @@ class BulkEditPreviewContribution { } finally { // restore UX state if (this._activeSession === session) { - this._activeSession.uxState.restore(); + await this._activeSession.uxState.restore(); this._activeSession.cts.dispose(); this._ctxEnabled.set(false); this._activeSession = undefined; @@ -174,9 +174,9 @@ registerAction2(class ApplyAction extends Action2 { }); } - run(accessor: ServicesAccessor): any { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.accept(); } @@ -203,9 +203,9 @@ registerAction2(class DiscardAction extends Action2 { }); } - run(accessor: ServicesAccessor): void | Promise { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.discard(); } @@ -234,9 +234,9 @@ registerAction2(class ToggleAction extends Action2 { }); } - run(accessor: ServicesAccessor): void | Promise { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.toggleChecked(); } @@ -263,9 +263,9 @@ registerAction2(class GroupByFile extends Action2 { }); } - run(accessor: ServicesAccessor): void | Promise { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.groupByFile(); } @@ -290,9 +290,9 @@ registerAction2(class GroupByType extends Action2 { }); } - run(accessor: ServicesAccessor): void | Promise { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.groupByType(); } @@ -316,9 +316,9 @@ registerAction2(class ToggleGrouping extends Action2 { }); } - run(accessor: ServicesAccessor): void | Promise { + async run(accessor: ServicesAccessor): Promise { const panelService = accessor.get(IPanelService); - const view = getBulkEditPane(panelService); + const view = await getBulkEditPane(panelService); if (view) { view.toggleGrouping(); } diff --git a/src/vs/workbench/contrib/comments/browser/commentsPanel.ts b/src/vs/workbench/contrib/comments/browser/commentsPanel.ts index 407d0a92dcc..923fb4dcd0b 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsPanel.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsPanel.ts @@ -223,11 +223,11 @@ export class CommentsPanel extends Panel { CommandsRegistry.registerCommand({ id: 'workbench.action.focusCommentsPanel', - handler: (accessor) => { + handler: async (accessor) => { const panelService = accessor.get(IPanelService); const panels = panelService.getPanels(); if (panels.some(panelIdentifier => panelIdentifier.id === COMMENTS_PANEL_ID)) { - panelService.openPanel(COMMENTS_PANEL_ID, true); + await panelService.openPanel(COMMENTS_PANEL_ID, true); } } }); diff --git a/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts b/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts index f4e6bad2774..ce8d83b187b 100644 --- a/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts +++ b/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts @@ -68,7 +68,7 @@ export class DebugTaskRunner { return TaskRunResult.Success; } if (onTaskErrors === 'showErrors') { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + await this.panelService.openPanel(Constants.MARKERS_PANEL_ID); return Promise.resolve(TaskRunResult.Failure); } @@ -97,7 +97,7 @@ export class DebugTaskRunner { return TaskRunResult.Success; } - this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + await this.panelService.openPanel(Constants.MARKERS_PANEL_ID); return Promise.resolve(TaskRunResult.Failure); } catch (err) { await onError(err.message, [this.taskService.configureAction()]); diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index 47bf7f1fff1..728ec69438b 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -56,8 +56,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: undefined, - handler: (accessor, args: any) => { - accessor.get(IPanelService).openPanel(Constants.MARKERS_PANEL_ID); + handler: async (accessor, args: any) => { + await accessor.get(IPanelService).openPanel(Constants.MARKERS_PANEL_ID); } }); @@ -314,13 +314,13 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { order: 4 }); -CommandsRegistry.registerCommand('workbench.actions.view.toggleProblems', accessor => { +CommandsRegistry.registerCommand('workbench.actions.view.toggleProblems', async (accessor) => { const panelService = accessor.get(IPanelService); const panel = accessor.get(IPanelService).getActivePanel(); if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { panelService.hideActivePanel(); } else { - panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + await panelService.openPanel(Constants.MARKERS_PANEL_ID, true); } }); diff --git a/src/vs/workbench/contrib/markers/browser/markersViewActions.ts b/src/vs/workbench/contrib/markers/browser/markersViewActions.ts index c21572f70bf..e8b570efdbe 100644 --- a/src/vs/workbench/contrib/markers/browser/markersViewActions.ts +++ b/src/vs/workbench/contrib/markers/browser/markersViewActions.ts @@ -40,8 +40,7 @@ export class ShowProblemsPanelAction extends Action { } public run(): Promise { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); - return Promise.resolve(); + return this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); } } diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 71f305e97a4..5af9dc00800 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -413,12 +413,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer return this.runShowTasks(); }); - CommandsRegistry.registerCommand('workbench.action.tasks.toggleProblems', () => { + CommandsRegistry.registerCommand('workbench.action.tasks.toggleProblems', async () => { const panel = this.panelService.getActivePanel(); if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { this.layoutService.setPanelHidden(true); } else { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + await this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); } }); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index 336926a4cc0..b84718415f1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -413,10 +413,10 @@ export class TerminalService implements ITerminalService { } public showPanel(focus?: boolean): Promise { - return new Promise((complete) => { + return new Promise(async (complete) => { const panel = this._panelService.getActivePanel(); if (!panel || panel.getId() !== TERMINAL_PANEL_ID) { - this._panelService.openPanel(TERMINAL_PANEL_ID, focus); + await this._panelService.openPanel(TERMINAL_PANEL_ID, focus); if (focus) { // Do the focus call asynchronously as going through the // command palette will force editor focus diff --git a/src/vs/workbench/services/panel/common/panelService.ts b/src/vs/workbench/services/panel/common/panelService.ts index 8622924d72c..3045900a7c0 100644 --- a/src/vs/workbench/services/panel/common/panelService.ts +++ b/src/vs/workbench/services/panel/common/panelService.ts @@ -28,12 +28,7 @@ export interface IPanelService { /** * Opens a panel with the given identifier and pass keyboard focus to it if specified. */ - openPanel(id: string, focus?: boolean): IPanel | undefined; - - /** - * Opens a panel with the given identifier and pass keyboard focus to it if specified. - */ - openPanelAsync(id?: string, focus?: boolean): Promise; + openPanel(id?: string, focus?: boolean): Promise; /** * Returns the current active panel or null if none diff --git a/src/vs/workbench/test/browser/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts index 65a50f43c73..7af33a23aad 100644 --- a/src/vs/workbench/test/browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -520,11 +520,7 @@ export class TestPanelService implements IPanelService { onDidPanelOpen = new Emitter<{ panel: IPanel, focus: boolean }>().event; onDidPanelClose = new Emitter().event; - openPanel(id: string, focus?: boolean): undefined { - return undefined; - } - - async openPanelAsync(id?: string, focus?: boolean): Promise { + async openPanel(id?: string, focus?: boolean): Promise { return undefined; } From 5623c36a400b0ce8d8a71deb134f14b7e569ed0b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Feb 2020 17:59:05 -0800 Subject: [PATCH 163/624] Remove surveyor code Not currently being used --- .../src/extension.ts | 3 - .../src/utils/surveyor.ts | 214 ------------------ 2 files changed, 217 deletions(-) delete mode 100644 extensions/typescript-language-features/src/utils/surveyor.ts diff --git a/extensions/typescript-language-features/src/extension.ts b/extensions/typescript-language-features/src/extension.ts index a7493570f1b..7416c5efdc3 100644 --- a/extensions/typescript-language-features/src/extension.ts +++ b/extensions/typescript-language-features/src/extension.ts @@ -19,7 +19,6 @@ import LogDirectoryProvider from './utils/logDirectoryProvider'; import ManagedFileContextManager from './utils/managedFileContext'; import { PluginManager } from './utils/plugins'; import * as ProjectStatus from './utils/projectStatus'; -import { Surveyor } from './utils/surveyor'; import TscTaskProvider from './features/task'; export function activate( @@ -70,8 +69,6 @@ function createLazyClientHost( context.subscriptions.push(clientHost); - context.subscriptions.push(new Surveyor(context.globalState, clientHost.serviceClient)); - clientHost.serviceClient.onReady(() => { context.subscriptions.push( ProjectStatus.create( diff --git a/extensions/typescript-language-features/src/utils/surveyor.ts b/extensions/typescript-language-features/src/utils/surveyor.ts deleted file mode 100644 index a98e84f7c33..00000000000 --- a/extensions/typescript-language-features/src/utils/surveyor.ts +++ /dev/null @@ -1,214 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as vscode from 'vscode'; -import * as nls from 'vscode-nls'; -import TypeScriptServiceClient from '../typescriptServiceClient'; -import { Disposable } from './dispose'; -import { memoize } from './memoize'; - -const localize = nls.loadMessageBundle(); - -interface SurveyData { - /** - * Internal id of the survey. Comes from TypeScript. - */ - readonly id: string; - - /** - * Text displayed to the user when survey is triggered. - */ - readonly prompt: string; - - /** - * Number of times to trigger with `surveyReady` before showing the survey. - * - * This is cumulative and shared across workspaces. - */ - readonly globalTriggerThreshold: number; - - /** - * Survey link. - */ - readonly url: vscode.Uri; - - /** - * Milliseconds to wait after 'Remind later' is chosen before trying to prompt again. - */ - readonly remindLaterDelayInMilliseconds: number; -} - -const allSurveys: ReadonlyArray = [ - { - id: 'checkJs', - prompt: localize('survey.checkJs.prompt', "Help improve VS Code's support for [checkJs](https://code.visualstudio.com/Docs/languages/javascript#_type-checking) in JavaScript! Since you have been using this feature, would you consider taking a short survey about your experience?"), - globalTriggerThreshold: 10, - url: vscode.Uri.parse('https://www.surveymonkey.com/r/FH8PZQ3'), - remindLaterDelayInMilliseconds: 3 * 24 * 60 * 60 * 1000 // 3 days - } -]; - -class Survey { - - private _hasShownInThisSession = false; - - public constructor( - private readonly data: SurveyData, - private readonly memento: vscode.Memento - ) { } - - public get id(): string { return this.data.id; } - - public get prompt(): string { return this.data.prompt; } - - public get isActive(): boolean { - return !this._hasShownInThisSession && !this.memento.get(this.isCompletedMementoKey); - } - - public open(): void { - this.markComplete(); - vscode.commands.executeCommand('vscode.open', this.data.url); - } - - public remindLater(): void { - // Make sure we don't show again in this session (but don't persist as completed) - this._hasShownInThisSession = true; - - // And save off prompt time. - this.memento.update(this.lastPromptTimeMementoKey, Date.now()); - } - - public trigger(): boolean { - const triggerCount = this.triggerCount + 1; - this.memento.update(this.triggerCountMementoKey, triggerCount); - if (triggerCount >= this.data.globalTriggerThreshold) { - const lastPromptTime = this.memento.get(this.lastPromptTimeMementoKey); - if (!lastPromptTime || isNaN(+lastPromptTime)) { - return true; - } - return (lastPromptTime + this.data.remindLaterDelayInMilliseconds < Date.now()); - } - return false; - } - - public willShow() { - this._hasShownInThisSession = true; - } - - public markComplete() { - this._hasShownInThisSession = true; - this.memento.update(this.isCompletedMementoKey, true); - } - - private get triggerCount(): number { - const count = this.memento.get(this.triggerCountMementoKey); - return !count || isNaN(+count) ? 0 : +count; - } - - private getMementoKey(part: string): string { - return `survey.v0.${this.id}.${part}`; - } - - private get isCompletedMementoKey(): string { - return this.getMementoKey('isComplete'); - } - - private get lastPromptTimeMementoKey(): string { - return this.getMementoKey('lastPromptTime'); - } - - private get triggerCountMementoKey(): string { - return this.getMementoKey('globalTriggerCount'); - } -} - -export class Surveyor extends Disposable { - - public constructor( - private readonly memento: vscode.Memento, - serviceClient: TypeScriptServiceClient, - ) { - super(); - - this._register(serviceClient.onSurveyReady(e => this.surveyReady(e.surveyId))); - } - - @memoize - private get surveys(): Map { - return new Map( - allSurveys.map(data => [data.id, new Survey(data, this.memento)] as [string, Survey])); - } - - private surveyReady(surveyId: string): void { - const survey = this.tryGetActiveSurvey(surveyId); - if (survey && survey.trigger()) { - survey.willShow(); - this.showSurveyToUser(survey); - } - } - - private async showSurveyToUser(survey: Survey): Promise { - enum Choice { - GoToSurvey = 1, - RemindLater = 2, - NeverAgain = 3, - } - - interface MessageItem extends vscode.MessageItem { - readonly choice: Choice; - } - - const response = await vscode.window.showInformationMessage(survey.prompt, - { - title: localize('takeShortSurvey', "Take Short Survey"), - choice: Choice.GoToSurvey - }, { - title: localize('remindLater', "Remind Me Later"), - choice: Choice.RemindLater - }, { - title: localize('neverAgain', "Disable JS/TS Surveys"), - choice: Choice.NeverAgain - }); - - switch (response && response.choice) { - case Choice.GoToSurvey: - survey.open(); - break; - - case Choice.NeverAgain: - survey.markComplete(); - this.disableSurveys(); - break; - - case Choice.RemindLater: - default: // If user just closes the notification, treat this as a remind later. - survey.remindLater(); - break; - } - } - - private tryGetActiveSurvey(surveyId: string): Survey | undefined { - const survey = this.surveys.get(surveyId); - if (!survey) { - return undefined; - } - - if (this.areSurveysEnabled() && survey.isActive) { - return survey; - } - - return undefined; - } - - private areSurveysEnabled() { - const config = vscode.workspace.getConfiguration('typescript'); - return config.get('surveys.enabled', true); - } - - private disableSurveys() { - const config = vscode.workspace.getConfiguration('typescript'); - config.update('surveys.enabled', false); - } -} From 75aa5fdcbf9bd455962ef1347308ae59b74933ab Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 11:43:14 -0800 Subject: [PATCH 164/624] Improving docs for providedCodeActionKinds --- src/vs/vscode.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 74dbf6f78a5..69c26fba1ed 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2169,14 +2169,16 @@ declare module 'vscode' { } /** - * Metadata about the type of code actions that a [CodeActionProvider](#CodeActionProvider) providers + * Metadata about the type of code actions that a [CodeActionProvider](#CodeActionProvider) providers. */ export interface CodeActionProviderMetadata { /** - * [CodeActionKinds](#CodeActionKind) that this provider may return. + * List of [CodeActionKinds](#CodeActionKind) that a [CodeActionProvider](#CodeActionProvider) may return. * - * The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the provider - * may list our every specific kind they provide, such as `CodeActionKind.Refactor.Extract.append('function`)` + * This list is used to determine if a given `CodeActionProvider` should be invoked or not. + * To avoid unnecessary computation, every `CodeActionProvider` should list use `providedCodeActionKinds`. The + * list of kinds may either be generic, such as `[CodeActionKind.Refactor]`, or list out every kind provided, + * such as `[CodeActionKind.Refactor.Extract.append('function'), CodeActionKind.Refactor.Extract.append('constant'), ...]`. */ readonly providedCodeActionKinds?: ReadonlyArray; } From 45999fdb8f7e29b66a9b043263b3e1d4bdc0a514 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 11:47:24 -0800 Subject: [PATCH 165/624] Remove extra cast Not required with TS 3.8 --- .../typescript-language-features/src/features/completions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index 00e0dd4d74e..274a7e5cd8c 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -464,7 +464,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider return this.client.apiVersion.gte(API.v310) && this.client.apiVersion.lt(API.v320) ? undefined : '@'; case '#': // Workaround for https://github.com/microsoft/TypeScript/issues/36367 - return this.client.apiVersion.lt(API.v381) ? undefined : '#' as Proto.CompletionsTriggerCharacter; + return this.client.apiVersion.lt(API.v381) ? undefined : '#'; case '.': case '"': From 5b284c140c06d1670267bbbc4eb660ba01a30a9d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 14:19:16 -0800 Subject: [PATCH 166/624] Build TS extension against current vscode.d.ts directly Currently extensions like TS have a dev dependency on the `"vscode"` package. This pulls in a copy of `vscode.d.ts` that we end up using instead of our local `vscode.d.ts`. This change uses the `paths` `tsconig` option so that we use our local `vscode.d.ts` instead of the one from `node_modules` --- .../src/features/jsDocCompletions.ts | 2 +- .../typescript-language-features/src/typings/ref.d.ts | 1 - extensions/typescript-language-features/tsconfig.json | 11 +++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/typescript-language-features/src/features/jsDocCompletions.ts b/extensions/typescript-language-features/src/features/jsDocCompletions.ts index 03feee6a334..80b0e219705 100644 --- a/extensions/typescript-language-features/src/features/jsDocCompletions.ts +++ b/extensions/typescript-language-features/src/features/jsDocCompletions.ts @@ -28,7 +28,7 @@ class JsDocCompletionItem extends vscode.CompletionItem { const suffix = line.slice(position.character).match(/^\s*\**\//); const start = position.translate(0, prefix ? -prefix[0].length : 0); const range = new vscode.Range(start, position.translate(0, suffix ? suffix[0].length : 0)); - this.range = { inserting: range, replacing: range }; + this.range = { inserting: range, replacing: range }; } } diff --git a/extensions/typescript-language-features/src/typings/ref.d.ts b/extensions/typescript-language-features/src/typings/ref.d.ts index c9849d48e08..43a9cadf250 100644 --- a/extensions/typescript-language-features/src/typings/ref.d.ts +++ b/extensions/typescript-language-features/src/typings/ref.d.ts @@ -3,5 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/// /// diff --git a/extensions/typescript-language-features/tsconfig.json b/extensions/typescript-language-features/tsconfig.json index d83a0817920..7a2eafbfa84 100644 --- a/extensions/typescript-language-features/tsconfig.json +++ b/extensions/typescript-language-features/tsconfig.json @@ -2,9 +2,16 @@ "extends": "../shared.tsconfig.json", "compilerOptions": { "outDir": "./out", - "experimentalDecorators": true + "experimentalDecorators": true, + // https://github.com/microsoft/TypeScript/issues/31869#issuecomment-515167432 + "baseUrl": "src/\u0000", + "paths": { + "vscode": [ + "../../../../src/vs/vscode.d.ts" + ] + } }, "include": [ "src/**/*" ] -} \ No newline at end of file +} From 6960e8c07bb2776dadf09bb9589a9af4c27b18ee Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 14:42:17 -0800 Subject: [PATCH 167/624] Fixing TS completion tests The current method of verifying when suggestions have been shown is not reliable so switch to use a delay instead :( --- .../src/test/completions.test.ts | 4 +- .../src/test/jsDocCompletions.test.ts | 8 ++-- .../src/test/suggestTestHelpers.ts | 39 ++----------------- 3 files changed, 11 insertions(+), 40 deletions(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index f35d0cae73c..7be588facfd 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -29,12 +29,14 @@ async function updateConfig(newConfig: VsCodeConfiguration): Promise { const configDefaults: VsCodeConfiguration = Object.freeze({ [Config.suggestSelection]: 'first', [Config.completeFunctionCalls]: false, + [Config.autoClosingBrackets]: 'always', }); const _disposables: vscode.Disposable[] = []; @@ -165,7 +167,7 @@ suite('TypeScript Completions', () => { `f('abc.abc$0')` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables, { useLineRange: true }); + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); assert.strictEqual( document.getText(), joinLines( diff --git a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts index ffd836f5ab3..e0f67065b0a 100644 --- a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts +++ b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts @@ -29,14 +29,14 @@ suite('JSDoc Completions', () => { `function abcdef(x, y) { }`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables, { useLineRange: true}); + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); assert.strictEqual( document.getText(), joinLines( `/**`, - ` *`, - ` * @param {*} x `, - ` * @param {*} y `, + ` * `, + ` * @param x `, + ` * @param y `, ` */`, `function abcdef(x, y) { }`, )); diff --git a/extensions/typescript-language-features/src/test/suggestTestHelpers.ts b/extensions/typescript-language-features/src/test/suggestTestHelpers.ts index 7c64a26ad5c..2a5f4368d74 100644 --- a/extensions/typescript-language-features/src/test/suggestTestHelpers.ts +++ b/extensions/typescript-language-features/src/test/suggestTestHelpers.ts @@ -7,23 +7,18 @@ import 'mocha'; import * as vscode from 'vscode'; import { wait } from './testUtils'; -export async function acceptFirstSuggestion(uri: vscode.Uri, _disposables: vscode.Disposable[], options?: { useLineRange?: boolean }) { +export async function acceptFirstSuggestion(uri: vscode.Uri, _disposables: vscode.Disposable[]) { const didChangeDocument = onChangedDocument(uri, _disposables); - const didSuggest = onDidSuggest(_disposables, options); await vscode.commands.executeCommand('editor.action.triggerSuggest'); - await didSuggest; - // TODO: depends on reverting fix for https://github.com/Microsoft/vscode/issues/64257 - // Make sure we have time to resolve the suggestion because `acceptSelectedSuggestion` doesn't - await wait(40); + await wait(1000); // Give time for suggestions to show await vscode.commands.executeCommand('acceptSelectedSuggestion'); - return await didChangeDocument; + return didChangeDocument; } export async function typeCommitCharacter(uri: vscode.Uri, character: string, _disposables: vscode.Disposable[]) { const didChangeDocument = onChangedDocument(uri, _disposables); - const didSuggest = onDidSuggest(_disposables); await vscode.commands.executeCommand('editor.action.triggerSuggest'); - await didSuggest; + await wait(1000); // Give time for suggestions to show await vscode.commands.executeCommand('type', { text: character }); return await didChangeDocument; } @@ -35,29 +30,3 @@ export function onChangedDocument(documentUri: vscode.Uri, disposables: vscode.D } }, undefined, disposables)); } - - -function onDidSuggest(disposables: vscode.Disposable[], options?: { useLineRange?: boolean }) { - return new Promise(resolve => - disposables.push(vscode.languages.registerCompletionItemProvider('typescript', new class implements vscode.CompletionItemProvider { - provideCompletionItems(doc: vscode.TextDocument, position: vscode.Position): vscode.ProviderResult { - // Return a fake item that will come first - const range = options && options.useLineRange - ? new vscode.Range(new vscode.Position(position.line, 0), position) - : doc.getWordRangeAtPosition(position.translate({ characterDelta: -1 })); - return [{ - label: '🦄', - insertText: doc.getText(range), - filterText: doc.getText(range), - preselect: true, - sortText: 'a', - range: range - }]; - } - async resolveCompletionItem(item: vscode.CompletionItem) { - await vscode.commands.executeCommand('selectNextSuggestion'); - resolve(); - return item; - } - }))); -} From 6205cf0fed41f9246f4f03aed51da64840fb1091 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 14:48:45 -0800 Subject: [PATCH 168/624] Add basic insert mode tests --- .../src/test/completions.test.ts | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 7be588facfd..ca307b70d1a 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -30,6 +30,7 @@ namespace Config { export const suggestSelection = 'editor.suggestSelection'; export const completeFunctionCalls = 'typescript.suggest.completeFunctionCalls'; export const autoClosingBrackets = 'editor.autoClosingBrackets'; + export const insertMode = 'editor.suggest.insertMode'; } suite('TypeScript Completions', () => { @@ -37,6 +38,7 @@ suite('TypeScript Completions', () => { [Config.suggestSelection]: 'first', [Config.completeFunctionCalls]: false, [Config.autoClosingBrackets]: 'always', + [Config.insertMode]: 'insert', }); const _disposables: vscode.Disposable[] = []; @@ -180,21 +182,6 @@ suite('TypeScript Completions', () => { )); }); - test.skip('Accepting a member completion should result in valid code. #58597', async () => { - await createTestEditor(testDocumentUri, - `const abc = 123;`, - `ab$0c` - ); - - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( - `const abc = 123;`, - `abc` - )); - }); - test('completeFunctionCalls should complete function parameters when at end of word', async () => { await updateConfig({ [Config.completeFunctionCalls]: true, @@ -294,5 +281,43 @@ suite('TypeScript Completions', () => { `}`, )); }); + + test('Accepting a completion in word using insert mode should insert', async () => { + await updateConfig({ + [Config.insertMode]: 'insert', + }); + + await createTestEditor(testDocumentUri, + `const abc = 123;`, + `ab$0c` + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abc = 123;`, + `abcc` + )); + }); + + test('Accepting a completion in word using replace mode should replace', async () => { + await updateConfig({ + [Config.insertMode]: 'replace', + }); + + await createTestEditor(testDocumentUri, + `const abc = 123;`, + `ab$0c` + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abc = 123;`, + `abc` + )); + }); }); From 78465390bded16a8b0942c1e3f245196431f1367 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 15:13:43 -0800 Subject: [PATCH 169/624] Run many of the JS/TS completion tests in both insert and replace completion mode --- .../src/test/completions.test.ts | 135 ++++++++++-------- 1 file changed, 79 insertions(+), 56 deletions(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index ca307b70d1a..e898483d578 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -33,6 +33,8 @@ namespace Config { export const insertMode = 'editor.suggest.insertMode'; } +const insertModes = Object.freeze(['insert', 'replace']); + suite('TypeScript Completions', () => { const configDefaults: VsCodeConfiguration = Object.freeze({ [Config.suggestSelection]: 'first', @@ -61,63 +63,74 @@ suite('TypeScript Completions', () => { }); test('Basic var completion', async () => { - await createTestEditor(testDocumentUri, - `const abcdef = 123;`, - `ab$0;` - ); - - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, `const abcdef = 123;`, - `abcdef;` - )); + `ab$0;` + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abcdef = 123;`, + `abcdef;` + ), + `config: ${config}` + ); + }); }); test('Should treat period as commit character for var completions', async () => { - await createTestEditor(testDocumentUri, - `const abcdef = 123;`, - `ab$0;` - ); - - const document = await typeCommitCharacter(testDocumentUri, '.', _disposables); - assert.strictEqual( - document.getText(), - joinLines( + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, `const abcdef = 123;`, - `abcdef.;` - )); + `ab$0;` + ); + + const document = await typeCommitCharacter(testDocumentUri, '.', _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abcdef = 123;`, + `abcdef.;` + ), + `config: ${config}`); + }); }); test('Should treat paren as commit character for function completions', async () => { - await createTestEditor(testDocumentUri, - `function abcdef() {};`, - `ab$0;` - ); - - const document = await typeCommitCharacter(testDocumentUri, '(', _disposables); - assert.strictEqual( - document.getText(), - joinLines( + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, `function abcdef() {};`, - `abcdef();` - )); + `ab$0;` + ); + + const document = await typeCommitCharacter(testDocumentUri, '(', _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `function abcdef() {};`, + `abcdef();` + ), `config: ${config}`); + }); }); test('Should insert backets when completing dot properties with spaces in name', async () => { - await createTestEditor(testDocumentUri, - 'const x = { "hello world": 1 };', - 'x.$0' - ); - - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, 'const x = { "hello world": 1 };', - 'x["hello world"]' - )); + 'x.$0' + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + 'const x = { "hello world": 1 };', + 'x["hello world"]' + ), `config: ${config}`); + }); }); test('Should allow commit characters for backet completions', async () => { @@ -144,19 +157,22 @@ suite('TypeScript Completions', () => { }); test('Should not prioritize bracket accessor completions. #63100', async () => { - // 'a' should be first entry in completion list - await createTestEditor(testDocumentUri, - 'const x = { "z-z": 1, a: 1 };', - 'x.$0' - ); - - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( + await enumerateConfig(Config.insertMode, insertModes, async config => { + // 'a' should be first entry in completion list + await createTestEditor(testDocumentUri, 'const x = { "z-z": 1, a: 1 };', - 'x.a' - )); + 'x.$0' + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + 'const x = { "z-z": 1, a: 1 };', + 'x.a' + ), + `config: ${config}`); + }); }); test('Accepting a string completion should replace the entire string. #53962', async () => { @@ -321,3 +337,10 @@ suite('TypeScript Completions', () => { }); }); +async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { + for (const value of values) { + const newConfig = { [configKey]: value }; + await updateConfig(newConfig); + await f(JSON.stringify(newConfig)); + } +} From 9887559f17e25da37ab325ce653682bf85fd5b40 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 15:39:06 -0800 Subject: [PATCH 170/624] Add basic JS/TS replace/insert completions For #87091 Adds basic support for insert/replace mode for JS/TS completions. We're blocked on full support by https://github.com/microsoft/TypeScript/issues/35602. I'll be adding some skipped tests that document current limitations --- .../src/features/completions.ts | 15 +-- .../src/test/completions.test.ts | 94 ++++++++++++------- 2 files changed, 69 insertions(+), 40 deletions(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index 274a7e5cd8c..d973b9360ec 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -124,24 +124,27 @@ class MyCompletionItem extends vscode.CompletionItem { return; } - const wordRange = this.document.getWordRangeAtPosition(this.position); - if (wordRange) { - // TODO: Reverted next line due to https://github.com/Microsoft/vscode/issues/66187 - // this.range = wordRange; - } + let replaceRange = wordRange; // Try getting longer, prefix based range for completions that span words const text = line.slice(Math.max(0, this.position.character - this.label.length), this.position.character).toLowerCase(); const entryName = this.label.toLowerCase(); for (let i = entryName.length; i >= 0; --i) { if (text.endsWith(entryName.substr(0, i)) && (!wordRange || wordRange.start.character > this.position.character - i)) { - this.range = new vscode.Range( + replaceRange = new vscode.Range( new vscode.Position(this.position.line, Math.max(0, this.position.character - i)), this.position); break; } } + + if (replaceRange) { + this.range = { + inserting: new vscode.Range(replaceRange.start, this.position), + replacing: replaceRange + }; + } } private static convertKind(kind: string): vscode.CompletionItemKind { diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index e898483d578..6875e882f60 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -199,9 +199,7 @@ suite('TypeScript Completions', () => { }); test('completeFunctionCalls should complete function parameters when at end of word', async () => { - await updateConfig({ - [Config.completeFunctionCalls]: true, - }); + await updateConfig({ [Config.completeFunctionCalls]: true }); // Complete with-in word await createTestEditor(testDocumentUri, @@ -219,9 +217,7 @@ suite('TypeScript Completions', () => { }); test.skip('completeFunctionCalls should complete function parameters when within word', async () => { - await updateConfig({ - [Config.completeFunctionCalls]: true, - }); + await updateConfig({ [Config.completeFunctionCalls]: true }); await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, @@ -238,9 +234,7 @@ suite('TypeScript Completions', () => { }); test('completeFunctionCalls should not complete function parameters at end of word if we are already in something that looks like a function call, #18131', async () => { - await updateConfig({ - [Config.completeFunctionCalls]: true, - }); + await updateConfig({ [Config.completeFunctionCalls]: true }); await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, @@ -257,9 +251,7 @@ suite('TypeScript Completions', () => { }); test.skip('completeFunctionCalls should not complete function parameters within word if we are already in something that looks like a function call, #18131', async () => { - await updateConfig({ - [Config.completeFunctionCalls]: true, - }); + await updateConfig({ [Config.completeFunctionCalls]: true }); await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, @@ -275,33 +267,34 @@ suite('TypeScript Completions', () => { )); }); - test('should not de-prioritized this.member suggestion, #74164', async () => { - await createTestEditor(testDocumentUri, - `class A {`, - ` private detail = '';`, - ` foo() {`, - ` det$0`, - ` }`, - `}`, - ); - - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( + test('should not de-prioritize this.member suggestion, #74164', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, `class A {`, ` private detail = '';`, ` foo() {`, - ` this.detail`, + ` det$0`, ` }`, `}`, - )); + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` private detail = '';`, + ` foo() {`, + ` this.detail`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); }); test('Accepting a completion in word using insert mode should insert', async () => { - await updateConfig({ - [Config.insertMode]: 'insert', - }); + await updateConfig({ [Config.insertMode]: 'insert' }); await createTestEditor(testDocumentUri, `const abc = 123;`, @@ -318,9 +311,7 @@ suite('TypeScript Completions', () => { }); test('Accepting a completion in word using replace mode should replace', async () => { - await updateConfig({ - [Config.insertMode]: 'replace', - }); + await updateConfig({ [Config.insertMode]: 'replace' }); await createTestEditor(testDocumentUri, `const abc = 123;`, @@ -335,6 +326,41 @@ suite('TypeScript Completions', () => { `abc` )); }); + + test('Accepting string completion inside string using insert mode should insert', async () => { + await updateConfig({ [Config.insertMode]: 'insert' }); + + await createTestEditor(testDocumentUri, + `const abc = { 'xy z': 123 }`, + `abc["x$0y w"]` + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abc = { 'xy z': 123 }`, + `abc["xy zy w"]` + )); + }); + + // Waiting on https://github.com/microsoft/TypeScript/issues/35602 + test.skip('Accepting string completion inside string using insert mode should insert', async () => { + await updateConfig({ [Config.insertMode]: 'replace' }); + + await createTestEditor(testDocumentUri, + `const abc = { 'xy z': 123 }`, + `abc["x$0y w"]` + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `const abc = { 'xy z': 123 }`, + `abc["xy w"]` + )); + }); }); async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { From 7b754d7d9521d28c9dd29824fd5fa4f4f14feeff Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 15:47:37 -0800 Subject: [PATCH 171/624] Adding more pinning tests for JS/TS completions --- .../src/test/completions.test.ts | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 6875e882f60..f00fbb530f2 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -267,7 +267,7 @@ suite('TypeScript Completions', () => { )); }); - test('should not de-prioritize this.member suggestion, #74164', async () => { + test('should not de-prioritize `this.member` suggestion, #74164', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { await createTestEditor(testDocumentUri, `class A {`, @@ -293,6 +293,32 @@ suite('TypeScript Completions', () => { }); }); + test('Member completions for string properties should insert `this.` and use brackets', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` ['xyz 123'] = 1`, + ` foo() {`, + ` xyz$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` ['xyz 123'] = 1`, + ` foo() {`, + ` this["xyz 123"]`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); + test('Accepting a completion in word using insert mode should insert', async () => { await updateConfig({ [Config.insertMode]: 'insert' }); @@ -327,6 +353,56 @@ suite('TypeScript Completions', () => { )); }); + test('Accepting a member completion in word using insert mode add `this.` and insert', async () => { + await updateConfig({ [Config.insertMode]: 'insert' }); + + await createTestEditor(testDocumentUri, + `class Foo {`, + ` abc = 1;`, + ` foo() {`, + ` ab$0c`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class Foo {`, + ` abc = 1;`, + ` foo() {`, + ` this.abcc`, + ` }`, + `}`, + )); + }); + + test('Accepting a member completion in word using replace mode should add `this.` and replace', async () => { + await updateConfig({ [Config.insertMode]: 'replace' }); + + await createTestEditor(testDocumentUri, + `class Foo {`, + ` abc = 1;`, + ` foo() {`, + ` ab$0c`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class Foo {`, + ` abc = 1;`, + ` foo() {`, + ` this.abc`, + ` }`, + `}`, + )); + }); + test('Accepting string completion inside string using insert mode should insert', async () => { await updateConfig({ [Config.insertMode]: 'insert' }); From b4a835f5b9456604e8481d42e198e10e0f4198ec Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 16:15:45 -0800 Subject: [PATCH 172/624] Fixing backet completion items not shown for cases such as `this.xy|` --- .../src/features/completions.ts | 34 +++++++++++++---- .../src/test/completions.test.ts | 38 ++++++++++++++++--- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index d973b9360ec..4a4a1d9eed9 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -66,17 +66,37 @@ class MyCompletionItem extends vscode.CompletionItem { this.useCodeSnippet = useCodeSnippetsOnMethodSuggest && (this.kind === vscode.CompletionItemKind.Function || this.kind === vscode.CompletionItemKind.Method); if (tsEntry.replacementSpan) { - this.range = typeConverters.Range.fromTextSpan(tsEntry.replacementSpan); + let replaceRange = typeConverters.Range.fromTextSpan(tsEntry.replacementSpan); // Make sure we only replace a single line at most - if (!this.range.isSingleLine) { - this.range = new vscode.Range(this.range.start.line, this.range.start.character, this.range.start.line, line.length); + if (!replaceRange.isSingleLine) { + replaceRange = new vscode.Range(replaceRange.start.line, replaceRange.start.character, replaceRange.start.line, line.length); } + this.range = { + inserting: new vscode.Range(replaceRange.start, position), + replacing: replaceRange, + }; } - this.insertText = tsEntry.insertText; - // Set filterText for intelliCode and bracket accessors , but not for `this.` completions since it results in - // them being overly prioritized. #74164 - this.filterText = tsEntry.insertText && !/^this\./.test(tsEntry.insertText) ? tsEntry.insertText : undefined; + if (tsEntry.insertText) { + this.insertText = tsEntry.insertText; + + // Set filterText for intelliCode and bracket accessors , but not for `this.` completions since it results in + // them being overly prioritized. #74164 + this.filterText = !(/^this\./).test(tsEntry.insertText) ? tsEntry.insertText : undefined; + + // Handle the case: + // + // ``` + // const xyz = { 'ab c': 1 }; + // xyz.ab| + // ``` + // + // In which case we want to insert a bracket accessor but should use `.abc` as the filter text instead of + // the bracketed insert text. + if (tsEntry.insertText[0] === '[') { + this.filterText = tsEntry.insertText.replace(/^\[['"](.+)[['"]\]$/, '.$1'); + } + } if (completionContext.isMemberCompletion && completionContext.dotAccessorContext) { this.filterText = completionContext.dotAccessorContext.text + (this.insertText || this.label); diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index f00fbb530f2..46c021d4489 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -293,7 +293,7 @@ suite('TypeScript Completions', () => { }); }); - test('Member completions for string properties should insert `this.` and use brackets', async () => { + test('Member completions for string property name should insert `this.` and use brackets', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { await createTestEditor(testDocumentUri, `class A {`, @@ -319,7 +319,33 @@ suite('TypeScript Completions', () => { }); }); - test('Accepting a completion in word using insert mode should insert', async () => { + test('Member completions for string property name already using `this.` should add brackets', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` ['xyz 123'] = 1`, + ` foo() {`, + ` this.xyz$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` ['xyz 123'] = 1`, + ` foo() {`, + ` this["xyz 123"]`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); + + test('Accepting a completion in word using `insert` mode should insert', async () => { await updateConfig({ [Config.insertMode]: 'insert' }); await createTestEditor(testDocumentUri, @@ -336,7 +362,7 @@ suite('TypeScript Completions', () => { )); }); - test('Accepting a completion in word using replace mode should replace', async () => { + test('Accepting a completion in word using `replace` mode should replace', async () => { await updateConfig({ [Config.insertMode]: 'replace' }); await createTestEditor(testDocumentUri, @@ -353,7 +379,7 @@ suite('TypeScript Completions', () => { )); }); - test('Accepting a member completion in word using insert mode add `this.` and insert', async () => { + test('Accepting a member completion in word using `insert` mode add `this.` and insert', async () => { await updateConfig({ [Config.insertMode]: 'insert' }); await createTestEditor(testDocumentUri, @@ -378,7 +404,7 @@ suite('TypeScript Completions', () => { )); }); - test('Accepting a member completion in word using replace mode should add `this.` and replace', async () => { + test('Accepting a member completion in word using `replace` mode should add `this.` and replace', async () => { await updateConfig({ [Config.insertMode]: 'replace' }); await createTestEditor(testDocumentUri, @@ -403,7 +429,7 @@ suite('TypeScript Completions', () => { )); }); - test('Accepting string completion inside string using insert mode should insert', async () => { + test('Accepting string completion inside string using `insert` mode should insert', async () => { await updateConfig({ [Config.insertMode]: 'insert' }); await createTestEditor(testDocumentUri, From 58fe34bb77aae5b596559d6dfe3cb81772e1dfca Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 17:17:00 -0800 Subject: [PATCH 173/624] Don't require strict prefix matches for private field completions Fixxes #89556 --- .../src/features/completions.ts | 58 ++++++--- .../src/features/languageConfiguration.ts | 2 +- .../src/test/completions.test.ts | 114 +++++++++++++++++- 3 files changed, 149 insertions(+), 25 deletions(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index 4a4a1d9eed9..52e82adf2a8 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -77,26 +77,8 @@ class MyCompletionItem extends vscode.CompletionItem { }; } - if (tsEntry.insertText) { - this.insertText = tsEntry.insertText; - - // Set filterText for intelliCode and bracket accessors , but not for `this.` completions since it results in - // them being overly prioritized. #74164 - this.filterText = !(/^this\./).test(tsEntry.insertText) ? tsEntry.insertText : undefined; - - // Handle the case: - // - // ``` - // const xyz = { 'ab c': 1 }; - // xyz.ab| - // ``` - // - // In which case we want to insert a bracket accessor but should use `.abc` as the filter text instead of - // the bracketed insert text. - if (tsEntry.insertText[0] === '[') { - this.filterText = tsEntry.insertText.replace(/^\[['"](.+)[['"]\]$/, '.$1'); - } - } + this.insertText = tsEntry.insertText; + this.filterText = this.getFilterText(line, tsEntry.insertText); if (completionContext.isMemberCompletion && completionContext.dotAccessorContext) { this.filterText = completionContext.dotAccessorContext.text + (this.insertText || this.label); @@ -139,6 +121,42 @@ class MyCompletionItem extends vscode.CompletionItem { this.resolveRange(line); } + private getFilterText(line: string, insertText: string | undefined): string | undefined { + // Handle private field completions + if (this.tsEntry.name.startsWith('#')) { + const wordRange = this.document.getWordRangeAtPosition(this.position); + const wordStart = wordRange ? line.charAt(wordRange.start.character) : undefined; + if (insertText) { + if (insertText.startsWith('this.#')) { + return wordStart === '#' ? insertText : insertText.replace(/^this\.#/, ''); + } else { + return insertText; + } + } else { + return wordStart === '#' ? undefined : this.tsEntry.name.replace(/^#/, ''); + } + return undefined; + } + + // For `this.` completions, generally don't set the filter text since we don't want them to be overly prioritized. #74164 + if (insertText?.startsWith('this.')) { + return undefined; + } + // Handle the case: + // ``` + // const xyz = { 'ab c': 1 }; + // xyz.ab| + // ``` + // In which case we want to insert a bracket accessor but should use `.abc` as the filter text instead of + // the bracketed insert text. + else if (insertText?.startsWith('[')) { + return insertText.replace(/^\[['"](.+)[['"]\]$/, '.$1'); + } + + // In all other cases, fallback to using the insertText + return insertText; + } + private resolveRange(line: string): void { if (this.range) { return; diff --git a/extensions/typescript-language-features/src/features/languageConfiguration.ts b/extensions/typescript-language-features/src/features/languageConfiguration.ts index 59fefa1007b..91cb4a36c91 100644 --- a/extensions/typescript-language-features/src/features/languageConfiguration.ts +++ b/extensions/typescript-language-features/src/features/languageConfiguration.ts @@ -17,7 +17,7 @@ const jsTsLanguageConfiguration: vscode.LanguageConfiguration = { decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/, increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/ }, - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, onEnterRules: [ { // e.g. /** | */ diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 46c021d4489..196b034402f 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -27,20 +27,22 @@ async function updateConfig(newConfig: VsCodeConfiguration): Promise { const configDefaults: VsCodeConfiguration = Object.freeze({ - [Config.suggestSelection]: 'first', - [Config.completeFunctionCalls]: false, [Config.autoClosingBrackets]: 'always', + [Config.completeFunctionCalls]: false, [Config.insertMode]: 'insert', + [Config.snippetSuggestions]: 'none', + [Config.suggestSelection]: 'first', }); const _disposables: vscode.Disposable[] = []; @@ -463,6 +465,110 @@ suite('TypeScript Completions', () => { `abc["xy w"]` )); }); + + test('Private field completions on `this.#` should work', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.#$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.#xyz`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); + + test('Private field completions on `#` should insert `this.`', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` #$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.#xyz`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); + + test('Private field completions should not require strict prefix match (#89556)', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.xyz$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.#xyz`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); + + test('Private field completions without `this.` should not require strict prefix match (#89556)', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` xyz$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` #xyz = 1;`, + ` foo() {`, + ` this.#xyz`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); }); async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { From a32cb805a2f8cc144354fa606923db2452ba1a0d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 17:34:12 -0800 Subject: [PATCH 174/624] Adding some basic tests for auto insert of await on completions --- .../src/test/completions.test.ts | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 196b034402f..644871101d0 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -569,6 +569,82 @@ suite('TypeScript Completions', () => { `Config: ${config}`); }); }); + + test('Accepting a completion for async property in `insert` mode should insert and add await', async () => { + await updateConfig({ [Config.insertMode]: 'insert' }); + + await createTestEditor(testDocumentUri, + `class A {`, + ` xyz = Promise.resolve({ 'abc': 1 });`, + ` async foo() {`, + ` this.xyz.ab$0c`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` xyz = Promise.resolve({ 'abc': 1 });`, + ` async foo() {`, + ` (await this.xyz).abcc`, + ` }`, + `}`, + )); + }); + + test('Accepting a completion for async property in `replace` mode should replace and add await', async () => { + await updateConfig({ [Config.insertMode]: 'replace' }); + + await createTestEditor(testDocumentUri, + `class A {`, + ` xyz = Promise.resolve({ 'abc': 1 });`, + ` async foo() {`, + ` this.xyz.ab$0c`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` xyz = Promise.resolve({ 'abc': 1 });`, + ` async foo() {`, + ` (await this.xyz).abc`, + ` }`, + `}`, + )); + }); + + test.skip('Accepting a completion for async string property should add await plus brackets', async () => { + await enumerateConfig(Config.insertMode, insertModes, async config => { + await createTestEditor(testDocumentUri, + `class A {`, + ` xyz = Promise.resolve({ 'ab c': 1 });`, + ` async foo() {`, + ` this.xyz.ab$0`, + ` }`, + `}`, + ); + + const document = await acceptFirstSuggestion(testDocumentUri, _disposables); + assert.strictEqual( + document.getText(), + joinLines( + `class A {`, + ` xyz = Promise.resolve({ 'abc': 1 });`, + ` async foo() {`, + ` (await this.xyz)["ab c"]`, + ` }`, + `}`, + ), + `Config: ${config}`); + }); + }); }); async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { From e7451b12ce92471707f6a0d8e8ff78255e6164a3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 17:52:11 -0800 Subject: [PATCH 175/624] Adding assertEditorContents helper function and fixing jsdoc completion tests --- .../src/test/completions.test.ts | 248 +++++++----------- .../src/test/jsDocCompletions.test.ts | 16 +- .../src/test/testUtils.ts | 49 +++- 3 files changed, 164 insertions(+), 149 deletions(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 644871101d0..6cb29a8b66d 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -3,37 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; import 'mocha'; import * as vscode from 'vscode'; import { disposeAll } from '../utils/dispose'; -import { createTestEditor, joinLines, wait } from './testUtils'; import { acceptFirstSuggestion, typeCommitCharacter } from './suggestTestHelpers'; +import { assertEditorContents, Config, createTestEditor, joinLines, updateConfig, VsCodeConfiguration, wait } from './testUtils'; const testDocumentUri = vscode.Uri.parse('untitled:test.ts'); -type VsCodeConfiguration = { [key: string]: any }; - -async function updateConfig(newConfig: VsCodeConfiguration): Promise { - const oldConfig: VsCodeConfiguration = {}; - const config = vscode.workspace.getConfiguration(undefined, testDocumentUri); - for (const configKey of Object.keys(newConfig)) { - oldConfig[configKey] = config.get(configKey); - await new Promise((resolve, reject) => - config.update(configKey, newConfig[configKey], vscode.ConfigurationTarget.Global) - .then(() => resolve(), reject)); - } - return oldConfig; -} - -namespace Config { - export const autoClosingBrackets = 'editor.autoClosingBrackets'; - export const completeFunctionCalls = 'typescript.suggest.completeFunctionCalls'; - export const insertMode = 'editor.suggest.insertMode'; - export const snippetSuggestions = 'editor.snippetSuggestions'; - export const suggestSelection = 'editor.suggestSelection'; -} - const insertModes = Object.freeze(['insert', 'replace']); suite('TypeScript Completions', () => { @@ -52,28 +29,27 @@ suite('TypeScript Completions', () => { await wait(100); // Save off config and apply defaults - oldConfig = await updateConfig(configDefaults); + oldConfig = await updateConfig(testDocumentUri, configDefaults); }); teardown(async () => { disposeAll(_disposables); // Restore config - await updateConfig(oldConfig); + await updateConfig(testDocumentUri, oldConfig); return vscode.commands.executeCommand('workbench.action.closeAllEditors'); }); test('Basic var completion', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abcdef = 123;`, `ab$0;` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abcdef = 123;`, `abcdef;` @@ -85,14 +61,14 @@ suite('TypeScript Completions', () => { test('Should treat period as commit character for var completions', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abcdef = 123;`, `ab$0;` ); - const document = await typeCommitCharacter(testDocumentUri, '.', _disposables); - assert.strictEqual( - document.getText(), + await typeCommitCharacter(testDocumentUri, '.', _disposables); + + assertEditorContents(editor, joinLines( `const abcdef = 123;`, `abcdef.;` @@ -103,14 +79,14 @@ suite('TypeScript Completions', () => { test('Should treat paren as commit character for function completions', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `function abcdef() {};`, `ab$0;` ); - const document = await typeCommitCharacter(testDocumentUri, '(', _disposables); - assert.strictEqual( - document.getText(), + await typeCommitCharacter(testDocumentUri, '(', _disposables); + + assertEditorContents(editor, joinLines( `function abcdef() {};`, `abcdef();` @@ -120,14 +96,13 @@ suite('TypeScript Completions', () => { test('Should insert backets when completing dot properties with spaces in name', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, 'const x = { "hello world": 1 };', 'x.$0' ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'const x = { "hello world": 1 };', 'x["hello world"]' @@ -140,14 +115,14 @@ suite('TypeScript Completions', () => { { char: '.', insert: '.' }, { char: '(', insert: '()' }, ]) { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, 'const x = { "hello world2": 1 };', 'x.$0' ); - const document = await typeCommitCharacter(testDocumentUri, char, _disposables); - assert.strictEqual( - document.getText(), + await typeCommitCharacter(testDocumentUri, char, _disposables); + + assertEditorContents(editor, joinLines( 'const x = { "hello world2": 1 };', `x["hello world2"]${insert}` @@ -161,14 +136,13 @@ suite('TypeScript Completions', () => { test('Should not prioritize bracket accessor completions. #63100', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { // 'a' should be first entry in completion list - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, 'const x = { "z-z": 1, a: 1 };', 'x.$0' ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'const x = { "z-z": 1, a: 1 };', 'x.a' @@ -178,7 +152,7 @@ suite('TypeScript Completions', () => { }); test('Accepting a string completion should replace the entire string. #53962', async () => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, 'interface TFunction {', ` (_: 'abc.abc2', __ ?: {}): string;`, ` (_: 'abc.abc', __?: {}): string;`, @@ -187,9 +161,8 @@ suite('TypeScript Completions', () => { `f('abc.abc$0')` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'interface TFunction {', ` (_: 'abc.abc2', __ ?: {}): string;`, @@ -201,17 +174,16 @@ suite('TypeScript Completions', () => { }); test('completeFunctionCalls should complete function parameters when at end of word', async () => { - await updateConfig({ [Config.completeFunctionCalls]: true }); + await updateConfig(testDocumentUri, { [Config.completeFunctionCalls]: true }); // Complete with-in word - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, `abcdef$0` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, `abcdef(x, y, z)` @@ -219,16 +191,15 @@ suite('TypeScript Completions', () => { }); test.skip('completeFunctionCalls should complete function parameters when within word', async () => { - await updateConfig({ [Config.completeFunctionCalls]: true }); + await updateConfig(testDocumentUri, { [Config.completeFunctionCalls]: true }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, `abcd$0ef` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, `abcdef(x, y, z)` @@ -236,16 +207,15 @@ suite('TypeScript Completions', () => { }); test('completeFunctionCalls should not complete function parameters at end of word if we are already in something that looks like a function call, #18131', async () => { - await updateConfig({ [Config.completeFunctionCalls]: true }); + await updateConfig(testDocumentUri, { [Config.completeFunctionCalls]: true }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, `abcdef$0(1, 2, 3)` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, `abcdef(1, 2, 3)` @@ -253,16 +223,15 @@ suite('TypeScript Completions', () => { }); test.skip('completeFunctionCalls should not complete function parameters within word if we are already in something that looks like a function call, #18131', async () => { - await updateConfig({ [Config.completeFunctionCalls]: true }); + await updateConfig(testDocumentUri, { [Config.completeFunctionCalls]: true }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `function abcdef(x, y, z) { }`, `abcd$0ef(1, 2, 3)` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, `abcdef(1, 2, 3)` @@ -271,7 +240,7 @@ suite('TypeScript Completions', () => { test('should not de-prioritize `this.member` suggestion, #74164', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` private detail = '';`, ` foo() {`, @@ -280,9 +249,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` private detail = '';`, @@ -297,7 +265,7 @@ suite('TypeScript Completions', () => { test('Member completions for string property name should insert `this.` and use brackets', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` ['xyz 123'] = 1`, ` foo() {`, @@ -306,9 +274,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` ['xyz 123'] = 1`, @@ -323,7 +290,7 @@ suite('TypeScript Completions', () => { test('Member completions for string property name already using `this.` should add brackets', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` ['xyz 123'] = 1`, ` foo() {`, @@ -332,9 +299,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` ['xyz 123'] = 1`, @@ -348,16 +314,15 @@ suite('TypeScript Completions', () => { }); test('Accepting a completion in word using `insert` mode should insert', async () => { - await updateConfig({ [Config.insertMode]: 'insert' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'insert' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abc = 123;`, `ab$0c` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = 123;`, `abcc` @@ -365,16 +330,15 @@ suite('TypeScript Completions', () => { }); test('Accepting a completion in word using `replace` mode should replace', async () => { - await updateConfig({ [Config.insertMode]: 'replace' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'replace' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abc = 123;`, `ab$0c` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = 123;`, `abc` @@ -382,9 +346,9 @@ suite('TypeScript Completions', () => { }); test('Accepting a member completion in word using `insert` mode add `this.` and insert', async () => { - await updateConfig({ [Config.insertMode]: 'insert' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'insert' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class Foo {`, ` abc = 1;`, ` foo() {`, @@ -393,9 +357,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class Foo {`, ` abc = 1;`, @@ -407,9 +370,9 @@ suite('TypeScript Completions', () => { }); test('Accepting a member completion in word using `replace` mode should add `this.` and replace', async () => { - await updateConfig({ [Config.insertMode]: 'replace' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'replace' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class Foo {`, ` abc = 1;`, ` foo() {`, @@ -418,9 +381,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class Foo {`, ` abc = 1;`, @@ -432,16 +394,15 @@ suite('TypeScript Completions', () => { }); test('Accepting string completion inside string using `insert` mode should insert', async () => { - await updateConfig({ [Config.insertMode]: 'insert' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'insert' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abc = { 'xy z': 123 }`, `abc["x$0y w"]` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = { 'xy z': 123 }`, `abc["xy zy w"]` @@ -450,16 +411,15 @@ suite('TypeScript Completions', () => { // Waiting on https://github.com/microsoft/TypeScript/issues/35602 test.skip('Accepting string completion inside string using insert mode should insert', async () => { - await updateConfig({ [Config.insertMode]: 'replace' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'replace' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `const abc = { 'xy z': 123 }`, `abc["x$0y w"]` ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = { 'xy z': 123 }`, `abc["xy w"]` @@ -468,7 +428,7 @@ suite('TypeScript Completions', () => { test('Private field completions on `this.#` should work', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, ` foo() {`, @@ -477,9 +437,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` #xyz = 1;`, @@ -494,7 +453,7 @@ suite('TypeScript Completions', () => { test('Private field completions on `#` should insert `this.`', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, ` foo() {`, @@ -503,9 +462,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` #xyz = 1;`, @@ -520,7 +478,7 @@ suite('TypeScript Completions', () => { test('Private field completions should not require strict prefix match (#89556)', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, ` foo() {`, @@ -529,9 +487,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` #xyz = 1;`, @@ -546,7 +503,7 @@ suite('TypeScript Completions', () => { test('Private field completions without `this.` should not require strict prefix match (#89556)', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, ` foo() {`, @@ -555,9 +512,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` #xyz = 1;`, @@ -571,9 +527,9 @@ suite('TypeScript Completions', () => { }); test('Accepting a completion for async property in `insert` mode should insert and add await', async () => { - await updateConfig({ [Config.insertMode]: 'insert' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'insert' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` xyz = Promise.resolve({ 'abc': 1 });`, ` async foo() {`, @@ -582,9 +538,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` xyz = Promise.resolve({ 'abc': 1 });`, @@ -596,9 +551,9 @@ suite('TypeScript Completions', () => { }); test('Accepting a completion for async property in `replace` mode should replace and add await', async () => { - await updateConfig({ [Config.insertMode]: 'replace' }); + await updateConfig(testDocumentUri, { [Config.insertMode]: 'replace' }); - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` xyz = Promise.resolve({ 'abc': 1 });`, ` async foo() {`, @@ -607,9 +562,8 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, ` xyz = Promise.resolve({ 'abc': 1 });`, @@ -622,7 +576,7 @@ suite('TypeScript Completions', () => { test.skip('Accepting a completion for async string property should add await plus brackets', async () => { await enumerateConfig(Config.insertMode, insertModes, async config => { - await createTestEditor(testDocumentUri, + const editor = await createTestEditor(testDocumentUri, `class A {`, ` xyz = Promise.resolve({ 'ab c': 1 });`, ` async foo() {`, @@ -631,9 +585,9 @@ suite('TypeScript Completions', () => { `}`, ); - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), + await acceptFirstSuggestion(testDocumentUri, _disposables); + + assertEditorContents(editor, joinLines( `class A {`, ` xyz = Promise.resolve({ 'abc': 1 });`, @@ -650,7 +604,7 @@ suite('TypeScript Completions', () => { async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { for (const value of values) { const newConfig = { [configKey]: value }; - await updateConfig(newConfig); + await updateConfig(testDocumentUri, newConfig); await f(JSON.stringify(newConfig)); } } diff --git a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts index e0f67065b0a..f9c6c39da88 100644 --- a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts +++ b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts @@ -7,20 +7,34 @@ import * as assert from 'assert'; import 'mocha'; import * as vscode from 'vscode'; import { disposeAll } from '../utils/dispose'; -import { createTestEditor, joinLines, wait } from './testUtils'; import { acceptFirstSuggestion } from './suggestTestHelpers'; +import { Config, createTestEditor, joinLines, updateConfig, VsCodeConfiguration, wait } from './testUtils'; const testDocumentUri = vscode.Uri.parse('untitled:test.ts'); suite('JSDoc Completions', () => { const _disposables: vscode.Disposable[] = []; + const configDefaults: VsCodeConfiguration = Object.freeze({ + [Config.snippetSuggestions]: 'inline', + }); + + let oldConfig: { [key: string]: any } = {}; + setup(async () => { await wait(100); + + // Save off config and apply defaults + oldConfig = await updateConfig(testDocumentUri, configDefaults); }); teardown(async () => { disposeAll(_disposables); + + // Restore config + await updateConfig(testDocumentUri, oldConfig); + + return vscode.commands.executeCommand('workbench.action.closeAllEditors'); }); test('Should complete jsdoc inside single line comment', async () => { diff --git a/extensions/typescript-language-features/src/test/testUtils.ts b/extensions/typescript-language-features/src/test/testUtils.ts index 753814a99bd..e0b4ac867e2 100644 --- a/extensions/typescript-language-features/src/test/testUtils.ts +++ b/extensions/typescript-language-features/src/test/testUtils.ts @@ -3,10 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as assert from 'assert'; import * as fs from 'fs'; import * as os from 'os'; import { join } from 'path'; +import * as vscode from 'vscode'; function rndName() { return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10); @@ -80,4 +81,50 @@ export async function createTestEditor(uri: vscode.Uri, ...lines: string[]) { } await activeEditor.insertSnippet(new vscode.SnippetString(joinLines(...lines)), new vscode.Range(0, 0, 1000, 0)); + return activeEditor; } + +export function assertEditorContents(editor: vscode.TextEditor, expectedDocContent: string, message?: string): void { + const cursorIndex = expectedDocContent.indexOf(CURSOR); + + assert.strictEqual( + editor.document.getText(), + expectedDocContent.replace(CURSOR, ''), + message); + + if (cursorIndex >= 0) { + const expectedCursorPos = editor.document.positionAt(cursorIndex); + assert.strictEqual( + editor.selection.active.line, + expectedCursorPos.line + ); + assert.strictEqual( + editor.selection.active.character, + expectedCursorPos.character + ); + + } +} + +export type VsCodeConfiguration = { [key: string]: any }; + +export async function updateConfig(documentUri: vscode.Uri, newConfig: VsCodeConfiguration): Promise { + const oldConfig: VsCodeConfiguration = {}; + const config = vscode.workspace.getConfiguration(undefined, documentUri); + for (const configKey of Object.keys(newConfig)) { + oldConfig[configKey] = config.get(configKey); + await new Promise((resolve, reject) => + config.update(configKey, newConfig[configKey], vscode.ConfigurationTarget.Global) + .then(() => resolve(), reject)); + } + return oldConfig; +} + + +export const Config = Object.freeze({ + autoClosingBrackets: 'editor.autoClosingBrackets', + completeFunctionCalls: 'typescript.suggest.completeFunctionCalls', + insertMode: 'editor.suggest.insertMode', + snippetSuggestions: 'editor.snippetSuggestions', + suggestSelection: 'editor.suggestSelection', +} as const); From 2b7e6ab2fd7ea1c58170eea1c7047ed6a845be1a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 18:00:03 -0800 Subject: [PATCH 176/624] :lipstick: --- .../src/test/completions.test.ts | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/extensions/typescript-language-features/src/test/completions.test.ts b/extensions/typescript-language-features/src/test/completions.test.ts index 6cb29a8b66d..20afd43678e 100644 --- a/extensions/typescript-language-features/src/test/completions.test.ts +++ b/extensions/typescript-language-features/src/test/completions.test.ts @@ -7,7 +7,7 @@ import 'mocha'; import * as vscode from 'vscode'; import { disposeAll } from '../utils/dispose'; import { acceptFirstSuggestion, typeCommitCharacter } from './suggestTestHelpers'; -import { assertEditorContents, Config, createTestEditor, joinLines, updateConfig, VsCodeConfiguration, wait } from './testUtils'; +import { assertEditorContents, Config, createTestEditor, joinLines, updateConfig, VsCodeConfiguration, wait, enumerateConfig } from './testUtils'; const testDocumentUri = vscode.Uri.parse('untitled:test.ts'); @@ -42,13 +42,14 @@ suite('TypeScript Completions', () => { }); test('Basic var completion', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `const abcdef = 123;`, `ab$0;` ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abcdef = 123;`, @@ -60,7 +61,7 @@ suite('TypeScript Completions', () => { }); test('Should treat period as commit character for var completions', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `const abcdef = 123;`, `ab$0;` @@ -78,7 +79,7 @@ suite('TypeScript Completions', () => { }); test('Should treat paren as commit character for function completions', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `function abcdef() {};`, `ab$0;` @@ -95,13 +96,14 @@ suite('TypeScript Completions', () => { }); test('Should insert backets when completing dot properties with spaces in name', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, 'const x = { "hello world": 1 };', 'x.$0' ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'const x = { "hello world": 1 };', @@ -134,7 +136,7 @@ suite('TypeScript Completions', () => { }); test('Should not prioritize bracket accessor completions. #63100', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { // 'a' should be first entry in completion list const editor = await createTestEditor(testDocumentUri, 'const x = { "z-z": 1, a: 1 };', @@ -142,6 +144,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'const x = { "z-z": 1, a: 1 };', @@ -162,6 +165,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( 'interface TFunction {', @@ -183,6 +187,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, @@ -199,6 +204,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, @@ -215,6 +221,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, @@ -231,6 +238,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `function abcdef(x, y, z) { }`, @@ -239,7 +247,7 @@ suite('TypeScript Completions', () => { }); test('should not de-prioritize `this.member` suggestion, #74164', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` private detail = '';`, @@ -250,6 +258,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -264,7 +273,7 @@ suite('TypeScript Completions', () => { }); test('Member completions for string property name should insert `this.` and use brackets', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` ['xyz 123'] = 1`, @@ -275,6 +284,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -289,7 +299,7 @@ suite('TypeScript Completions', () => { }); test('Member completions for string property name already using `this.` should add brackets', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` ['xyz 123'] = 1`, @@ -300,6 +310,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -322,6 +333,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = 123;`, @@ -338,6 +350,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = 123;`, @@ -358,6 +371,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class Foo {`, @@ -382,6 +396,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class Foo {`, @@ -402,6 +417,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = { 'xy z': 123 }`, @@ -419,6 +435,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `const abc = { 'xy z': 123 }`, @@ -427,7 +444,7 @@ suite('TypeScript Completions', () => { }); test('Private field completions on `this.#` should work', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, @@ -438,6 +455,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -452,7 +470,7 @@ suite('TypeScript Completions', () => { }); test('Private field completions on `#` should insert `this.`', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, @@ -463,6 +481,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -477,7 +496,7 @@ suite('TypeScript Completions', () => { }); test('Private field completions should not require strict prefix match (#89556)', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, @@ -488,6 +507,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -502,7 +522,7 @@ suite('TypeScript Completions', () => { }); test('Private field completions without `this.` should not require strict prefix match (#89556)', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` #xyz = 1;`, @@ -513,6 +533,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -539,6 +560,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -563,6 +585,7 @@ suite('TypeScript Completions', () => { ); await acceptFirstSuggestion(testDocumentUri, _disposables); + assertEditorContents(editor, joinLines( `class A {`, @@ -575,7 +598,7 @@ suite('TypeScript Completions', () => { }); test.skip('Accepting a completion for async string property should add await plus brackets', async () => { - await enumerateConfig(Config.insertMode, insertModes, async config => { + await enumerateConfig(testDocumentUri, Config.insertMode, insertModes, async config => { const editor = await createTestEditor(testDocumentUri, `class A {`, ` xyz = Promise.resolve({ 'ab c': 1 });`, @@ -600,11 +623,3 @@ suite('TypeScript Completions', () => { }); }); }); - -async function enumerateConfig(configKey: string, values: readonly string[], f: (message: string) => Promise): Promise { - for (const value of values) { - const newConfig = { [configKey]: value }; - await updateConfig(testDocumentUri, newConfig); - await f(JSON.stringify(newConfig)); - } -} From 87b6d03182f3ad2a0f4688a077b26e467719b906 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 18:02:38 -0800 Subject: [PATCH 177/624] Add cursor position check to jsDocCompletionTest --- .../src/test/jsDocCompletions.test.ts | 35 +++++++++-------- .../src/test/testUtils.ts | 39 +++++++++++-------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts index f9c6c39da88..63d3f144f9a 100644 --- a/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts +++ b/extensions/typescript-language-features/src/test/jsDocCompletions.test.ts @@ -3,12 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; import 'mocha'; import * as vscode from 'vscode'; import { disposeAll } from '../utils/dispose'; import { acceptFirstSuggestion } from './suggestTestHelpers'; -import { Config, createTestEditor, joinLines, updateConfig, VsCodeConfiguration, wait } from './testUtils'; +import { assertEditorContents, Config, createTestEditor, CURSOR, enumerateConfig, insertModesValues, joinLines, updateConfig, VsCodeConfiguration, wait } from './testUtils'; const testDocumentUri = vscode.Uri.parse('untitled:test.ts'); @@ -38,21 +37,25 @@ suite('JSDoc Completions', () => { }); test('Should complete jsdoc inside single line comment', async () => { - await createTestEditor(testDocumentUri, - `/**$0 */`, - `function abcdef(x, y) { }`, - ); + await enumerateConfig(testDocumentUri, Config.insertMode, insertModesValues, async config => { - const document = await acceptFirstSuggestion(testDocumentUri, _disposables); - assert.strictEqual( - document.getText(), - joinLines( - `/**`, - ` * `, - ` * @param x `, - ` * @param y `, - ` */`, + const editor = await createTestEditor(testDocumentUri, + `/**$0 */`, `function abcdef(x, y) { }`, - )); + ); + + await acceptFirstSuggestion(testDocumentUri, _disposables); + + assertEditorContents(editor, + joinLines( + `/**`, + ` * `, + ` * @param x ${CURSOR}`, + ` * @param y `, + ` */`, + `function abcdef(x, y) { }`, + ), + `Config: ${config}`); + }); }); }); diff --git a/extensions/typescript-language-features/src/test/testUtils.ts b/extensions/typescript-language-features/src/test/testUtils.ts index e0b4ac867e2..7b2c95dcf1c 100644 --- a/extensions/typescript-language-features/src/test/testUtils.ts +++ b/extensions/typescript-language-features/src/test/testUtils.ts @@ -74,14 +74,9 @@ export const joinLines = (...args: string[]) => args.join('\n'); export async function createTestEditor(uri: vscode.Uri, ...lines: string[]) { const document = await vscode.workspace.openTextDocument(uri); - await vscode.window.showTextDocument(document); - const activeEditor = vscode.window.activeTextEditor; - if (!activeEditor) { - throw new Error('no active editor'); - } - - await activeEditor.insertSnippet(new vscode.SnippetString(joinLines(...lines)), new vscode.Range(0, 0, 1000, 0)); - return activeEditor; + const editor = await vscode.window.showTextDocument(document); + await editor.insertSnippet(new vscode.SnippetString(joinLines(...lines)), new vscode.Range(0, 0, 1000, 0)); + return editor; } export function assertEditorContents(editor: vscode.TextEditor, expectedDocContent: string, message?: string): void { @@ -94,15 +89,11 @@ export function assertEditorContents(editor: vscode.TextEditor, expectedDocConte if (cursorIndex >= 0) { const expectedCursorPos = editor.document.positionAt(cursorIndex); - assert.strictEqual( - editor.selection.active.line, - expectedCursorPos.line + assert.deepEqual( + { line: editor.selection.active.line, character: editor.selection.active.line }, + { line: expectedCursorPos.line, character: expectedCursorPos.line }, + 'Cursor position' ); - assert.strictEqual( - editor.selection.active.character, - expectedCursorPos.character - ); - } } @@ -120,7 +111,6 @@ export async function updateConfig(documentUri: vscode.Uri, newConfig: VsCodeCon return oldConfig; } - export const Config = Object.freeze({ autoClosingBrackets: 'editor.autoClosingBrackets', completeFunctionCalls: 'typescript.suggest.completeFunctionCalls', @@ -128,3 +118,18 @@ export const Config = Object.freeze({ snippetSuggestions: 'editor.snippetSuggestions', suggestSelection: 'editor.suggestSelection', } as const); + +export const insertModesValues = Object.freeze(['insert', 'replace']); + +export async function enumerateConfig( + documentUri: vscode.Uri, + configKey: string, + values: readonly string[], + f: (message: string) => Promise +): Promise { + for (const value of values) { + const newConfig = { [configKey]: value }; + await updateConfig(documentUri, newConfig); + await f(JSON.stringify(newConfig)); + } +} From 16ce66c8891953ba2eaaaffbc17235229592c85b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 07:40:37 +0100 Subject: [PATCH 178/624] :up: distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c300c39400..8f230666c2c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.43.0", - "distro": "96df0648d477ca7b7a3d26028519c1dfe02dee33", + "distro": "b975cdab7c0c0e7705fa7eac4c8411ad8a790f4b", "author": { "name": "Microsoft Corporation" }, From 7e2c9f5dbaa15087c1492df3557bfd9e78fe9392 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 08:34:20 +0100 Subject: [PATCH 179/624] tests - lift a few into browser/common --- .../extensionManagement.test.ts | 2 +- .../extensionValidator.test.ts | 2 +- .../telemetryService.test.ts | 0 .../bulkEditPreview.test.ts | 3 +- .../experimentService.test.ts | 2 +- .../extensionsActions.test.ts | 2 +- .../extensionsTipsService.test.ts | 2 +- .../electron-browser/extensionsViews.test.ts | 2 +- .../extensionsWorkbenchService.test.ts | 2 +- .../explorerModel.test.ts | 0 .../fileActions.test.ts | 0 .../markersModel.test.ts | 0 .../configuration.test.ts | 0 .../extensionEnablementService.test.ts | 0 .../test/{node => common}/rpcProtocol.test.ts | 0 .../test/browser/workbenchTestServices.ts | 645 ++++-------------- .../test/common/workbenchTestServices.ts | 8 + .../electron-browser/workbenchTestServices.ts | 4 +- 18 files changed, 154 insertions(+), 520 deletions(-) rename src/vs/platform/extensionManagement/test/{electron-browser => common}/extensionManagement.test.ts (99%) rename src/vs/platform/extensions/test/{node => common}/extensionValidator.test.ts (99%) rename src/vs/platform/telemetry/test/{electron-browser => browser}/telemetryService.test.ts (100%) rename src/vs/workbench/contrib/bulkEdit/test/{electron-brower => browser}/bulkEditPreview.test.ts (98%) rename src/vs/workbench/contrib/files/test/{electron-browser => browser}/explorerModel.test.ts (100%) rename src/vs/workbench/contrib/files/test/{electron-browser => browser}/fileActions.test.ts (100%) rename src/vs/workbench/contrib/markers/test/{electron-browser => browser}/markersModel.test.ts (100%) rename src/vs/workbench/contrib/tasks/test/{electron-browser => common}/configuration.test.ts (100%) rename src/vs/workbench/services/extensionManagement/test/{electron-browser => browser}/extensionEnablementService.test.ts (100%) rename src/vs/workbench/services/extensions/test/{node => common}/rpcProtocol.test.ts (100%) diff --git a/src/vs/platform/extensionManagement/test/electron-browser/extensionManagement.test.ts b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts similarity index 99% rename from src/vs/platform/extensionManagement/test/electron-browser/extensionManagement.test.ts rename to src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts index 300491c6cce..32c514601c7 100644 --- a/src/vs/platform/extensionManagement/test/electron-browser/extensionManagement.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts @@ -24,4 +24,4 @@ suite('Extension Identifier Pattern', () => { assert.equal(false, regEx.test('publ_isher.name')); assert.equal(false, regEx.test('publisher._name')); }); -}); \ No newline at end of file +}); diff --git a/src/vs/platform/extensions/test/node/extensionValidator.test.ts b/src/vs/platform/extensions/test/common/extensionValidator.test.ts similarity index 99% rename from src/vs/platform/extensions/test/node/extensionValidator.test.ts rename to src/vs/platform/extensions/test/common/extensionValidator.test.ts index 860d2201e73..eeacc9baac6 100644 --- a/src/vs/platform/extensions/test/node/extensionValidator.test.ts +++ b/src/vs/platform/extensions/test/common/extensionValidator.test.ts @@ -391,4 +391,4 @@ suite('Extension Version Validator', () => { testIsValidVersion('2.0.0', '^2.0.0', true); testIsValidVersion('2.0.0', '*', false); // fails due to lack of specificity }); -}); \ No newline at end of file +}); diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/browser/telemetryService.test.ts similarity index 100% rename from src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts rename to src/vs/platform/telemetry/test/browser/telemetryService.test.ts diff --git a/src/vs/workbench/contrib/bulkEdit/test/electron-brower/bulkEditPreview.test.ts b/src/vs/workbench/contrib/bulkEdit/test/browser/bulkEditPreview.test.ts similarity index 98% rename from src/vs/workbench/contrib/bulkEdit/test/electron-brower/bulkEditPreview.test.ts rename to src/vs/workbench/contrib/bulkEdit/test/browser/bulkEditPreview.test.ts index e60fbd6f689..9d952a98043 100644 --- a/src/vs/workbench/contrib/bulkEdit/test/electron-brower/bulkEditPreview.test.ts +++ b/src/vs/workbench/contrib/bulkEdit/test/browser/bulkEditPreview.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { Event } from 'vs/base/common/event'; import { IFileService } from 'vs/platform/files/common/files'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/common/workbenchTestServices'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -16,7 +16,6 @@ import { URI } from 'vs/base/common/uri'; import { BulkFileOperations } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditPreview'; import { Range } from 'vs/editor/common/core/range'; - suite('BulkEditPreview', function () { 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 c15f650b26f..c19c6ec0085 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 @@ -13,7 +13,7 @@ import { import { IWorkbenchExtensionEnablementService } 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'; +import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test'; import { URLService } from 'vs/platform/url/node/urlService'; import { IURLService } from 'vs/platform/url/common/url'; import { ITelemetryService, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry'; 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 8332aa9209c..52f71ee6229 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 @@ -17,7 +17,7 @@ import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManage import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/browser/extensionTipsService'; -import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test'; +import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test'; 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'; 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 d9af9315a0d..d5b808c4bf8 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 @@ -35,7 +35,7 @@ import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/ex import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test'; +import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test'; import { IURLService } from 'vs/platform/url/common/url'; import { ITextModel } from 'vs/editor/common/model'; import { IModelService } from 'vs/editor/common/services/modelService'; 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 89f4df2db7c..7334f11625f 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 @@ -18,7 +18,7 @@ import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManage import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/browser/extensionTipsService'; -import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test'; +import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; import { IURLService } from 'vs/platform/url/common/url'; import { Emitter } from 'vs/base/common/event'; 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 13655b0da65..6d22875244d 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 @@ -18,7 +18,7 @@ import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManage import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/browser/extensionTipsService'; -import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test'; +import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test'; 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'; diff --git a/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts b/src/vs/workbench/contrib/files/test/browser/explorerModel.test.ts similarity index 100% rename from src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts rename to src/vs/workbench/contrib/files/test/browser/explorerModel.test.ts diff --git a/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts b/src/vs/workbench/contrib/files/test/browser/fileActions.test.ts similarity index 100% rename from src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts rename to src/vs/workbench/contrib/files/test/browser/fileActions.test.ts diff --git a/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts b/src/vs/workbench/contrib/markers/test/browser/markersModel.test.ts similarity index 100% rename from src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts rename to src/vs/workbench/contrib/markers/test/browser/markersModel.test.ts diff --git a/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts b/src/vs/workbench/contrib/tasks/test/common/configuration.test.ts similarity index 100% rename from src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts rename to src/vs/workbench/contrib/tasks/test/common/configuration.test.ts diff --git a/src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts similarity index 100% rename from src/vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test.ts rename to src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts diff --git a/src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts b/src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts similarity index 100% rename from src/vs/workbench/services/extensions/test/node/rpcProtocol.test.ts rename to src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts diff --git a/src/vs/workbench/test/browser/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts index 7af33a23aad..770514ff8fb 100644 --- a/src/vs/workbench/test/browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -225,8 +225,11 @@ export class TestAccessibilityService implements IAccessibilityService { } export class TestDecorationsService implements IDecorationsService { + _serviceBrand: undefined; + onDidChangeDecorations: Event = Event.None; + registerDecorationsProvider(_provider: IDecorationsProvider): IDisposable { return Disposable.None; } getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration | undefined { return undefined; } } @@ -271,17 +274,9 @@ export class TestDialogService implements IDialogService { _serviceBrand: undefined; - confirm(_confirmation: IConfirmation): Promise { - return Promise.resolve({ confirmed: false }); - } - - show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise { - return Promise.resolve({ choice: 0 }); - } - - about(): Promise { - return Promise.resolve(); - } + confirm(_confirmation: IConfirmation): Promise { return Promise.resolve({ confirmed: false }); } + show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise { return Promise.resolve({ choice: 0 }); } + about(): Promise { return Promise.resolve(); } } export class TestFileDialogService implements IFileDialogService { @@ -290,46 +285,23 @@ export class TestFileDialogService implements IFileDialogService { private confirmResult!: ConfirmResult; - defaultFilePath(_schemeFilter?: string): URI | undefined { - return undefined; - } - defaultFolderPath(_schemeFilter?: string): URI | undefined { - return undefined; - } - defaultWorkspacePath(_schemeFilter?: string): URI | undefined { - return undefined; - } - pickFileFolderAndOpen(_options: IPickAndOpenOptions): Promise { - return Promise.resolve(0); - } - pickFileAndOpen(_options: IPickAndOpenOptions): Promise { - return Promise.resolve(0); - } - pickFolderAndOpen(_options: IPickAndOpenOptions): Promise { - return Promise.resolve(0); - } - pickWorkspaceAndOpen(_options: IPickAndOpenOptions): Promise { - return Promise.resolve(0); - } + defaultFilePath(_schemeFilter?: string): URI | undefined { return undefined; } + defaultFolderPath(_schemeFilter?: string): URI | undefined { return undefined; } + defaultWorkspacePath(_schemeFilter?: string): URI | undefined { return undefined; } + pickFileFolderAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); } + pickFileAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); } + pickFolderAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); } + pickWorkspaceAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); } + private fileToSave!: URI; - setPickFileToSave(path: URI): void { - this.fileToSave = path; - } - pickFileToSave(defaultUri: URI, availableFileSystems?: string[]): Promise { - return Promise.resolve(this.fileToSave); - } - showSaveDialog(_options: ISaveDialogOptions): Promise { - return Promise.resolve(undefined); - } - showOpenDialog(_options: IOpenDialogOptions): Promise { - return Promise.resolve(undefined); - } - setConfirmResult(result: ConfirmResult): void { - this.confirmResult = result; - } - showSaveConfirm(fileNamesOrResources: (string | URI)[]): Promise { - return Promise.resolve(this.confirmResult); - } + setPickFileToSave(path: URI): void { this.fileToSave = path; } + pickFileToSave(defaultUri: URI, availableFileSystems?: string[]): Promise { return Promise.resolve(this.fileToSave); } + + showSaveDialog(_options: ISaveDialogOptions): Promise { return Promise.resolve(undefined); } + showOpenDialog(_options: IOpenDialogOptions): Promise { return Promise.resolve(undefined); } + + setConfirmResult(result: ConfirmResult): void { this.confirmResult = result; } + showSaveConfirm(fileNamesOrResources: (string | URI)[]): Promise { return Promise.resolve(this.confirmResult); } } export class TestLayoutService implements IWorkbenchLayoutService { @@ -349,115 +321,42 @@ export class TestLayoutService implements IWorkbenchLayoutService { onLayout = Event.None; private readonly _onMenubarVisibilityChange = new Emitter(); + get onMenubarVisibilityChange(): Event { return this._onMenubarVisibilityChange.event; } - get onMenubarVisibilityChange(): Event { - return this._onMenubarVisibilityChange.event; - } - - isRestored(): boolean { - return true; - } - - hasFocus(_part: Parts): boolean { - return false; - } - - hasWindowBorder(): boolean { - return false; - } - - getWindowBorderRadius(): string | undefined { - return undefined; - } - - isVisible(_part: Parts): boolean { - return true; - } - - getDimension(_part: Parts): Dimension { - return new Dimension(0, 0); - } - - getContainer(_part: Parts): HTMLElement { - return null!; - } - - isTitleBarHidden(): boolean { - return false; - } - - getTitleBarOffset(): number { - return 0; - } - - isStatusBarHidden(): boolean { - return false; - } - - isActivityBarHidden(): boolean { - return false; - } - + isRestored(): boolean { return true; } + hasFocus(_part: Parts): boolean { return false; } + hasWindowBorder(): boolean { return false; } + getWindowBorderRadius(): string | undefined { return undefined; } + isVisible(_part: Parts): boolean { return true; } + getDimension(_part: Parts): Dimension { return new Dimension(0, 0); } + getContainer(_part: Parts): HTMLElement { return null!; } + isTitleBarHidden(): boolean { return false; } + getTitleBarOffset(): number { return 0; } + isStatusBarHidden(): boolean { return false; } + isActivityBarHidden(): boolean { return false; } setActivityBarHidden(_hidden: boolean): void { } - - isSideBarHidden(): boolean { - return false; - } - + isSideBarHidden(): boolean { return false; } setEditorHidden(_hidden: boolean): Promise { return Promise.resolve(); } - setSideBarHidden(_hidden: boolean): Promise { return Promise.resolve(); } - - isPanelHidden(): boolean { - return false; - } - + isPanelHidden(): boolean { return false; } setPanelHidden(_hidden: boolean): Promise { return Promise.resolve(); } - toggleMaximizedPanel(): void { } - - isPanelMaximized(): boolean { - return false; - } - - getMenubarVisibility(): MenuBarVisibility { - throw new Error('not implemented'); - } - - getSideBarPosition() { - return 0; - } - - getPanelPosition() { - return 0; - } - - setPanelPosition(_position: PartPosition): Promise { - return Promise.resolve(); - } - + isPanelMaximized(): boolean { return false; } + getMenubarVisibility(): MenuBarVisibility { throw new Error('not implemented'); } + getSideBarPosition() { return 0; } + getPanelPosition() { return 0; } + setPanelPosition(_position: PartPosition): Promise { return Promise.resolve(); } addClass(_clazz: string): void { } removeClass(_clazz: string): void { } - getMaximumEditorDimensions(): Dimension { throw new Error('not implemented'); } - getWorkbenchContainer(): HTMLElement { throw new Error('not implemented'); } getWorkbenchElement(): HTMLElement { throw new Error('not implemented'); } - toggleZenMode(): void { } - isEditorLayoutCentered(): boolean { return false; } centerEditorLayout(_active: boolean): void { } - - resizePart(_part: Parts, _sizeChange: number): void { } - registerPart(part: Part): void { } - - isWindowMaximized() { - return false; - } - + isWindowMaximized() { return false; } updateWindowMaximizedState(maximized: boolean): void { } } @@ -476,42 +375,16 @@ export class TestViewletService implements IViewletService { onDidViewletOpen = this.onDidViewletOpenEmitter.event; onDidViewletClose = this.onDidViewletCloseEmitter.event; - openViewlet(id: string, focus?: boolean): Promise { - return Promise.resolve(undefined); - } - - getViewlets(): ViewletDescriptor[] { - return []; - } - - getAllViewlets(): ViewletDescriptor[] { - return []; - } - - getActiveViewlet(): IViewlet { - return activeViewlet; - } - - dispose() { - } - - getDefaultViewletId(): string { - return 'workbench.view.explorer'; - } - - getViewlet(id: string): ViewletDescriptor | undefined { - return undefined; - } - - getProgressIndicator(id: string) { - return undefined; - } - + openViewlet(id: string, focus?: boolean): Promise { return Promise.resolve(undefined); } + getViewlets(): ViewletDescriptor[] { return []; } + getAllViewlets(): ViewletDescriptor[] { return []; } + getActiveViewlet(): IViewlet { return activeViewlet; } + getDefaultViewletId(): string { return 'workbench.view.explorer'; } + getViewlet(id: string): ViewletDescriptor | undefined { return undefined; } + getProgressIndicator(id: string) { return undefined; } hideActiveViewlet(): void { } - - getLastActiveViewletId(): string { - return undefined!; - } + getLastActiveViewletId(): string { return undefined!; } + dispose() { } } export class TestPanelService implements IPanelService { @@ -520,44 +393,17 @@ export class TestPanelService implements IPanelService { onDidPanelOpen = new Emitter<{ panel: IPanel, focus: boolean }>().event; onDidPanelClose = new Emitter().event; - async openPanel(id?: string, focus?: boolean): Promise { - return undefined; - } - - getPanel(id: string): any { - return activeViewlet; - } - - getPanels() { - return []; - } - - getPinnedPanels() { - return []; - } - - getActivePanel(): IViewlet { - return activeViewlet; - } - + async openPanel(id?: string, focus?: boolean): Promise { return undefined; } + getPanel(id: string): any { return activeViewlet; } + getPanels() { return []; } + getPinnedPanels() { return []; } + getActivePanel(): IViewlet { return activeViewlet; } setPanelEnablement(id: string, enabled: boolean): void { } - - dispose() { - } - - showActivity(panelId: string, badge: IBadge, clazz?: string): IDisposable { - throw new Error('Method not implemented.'); - } - - getProgressIndicator(id: string) { - return null!; - } - + dispose() { } + showActivity(panelId: string, badge: IBadge, clazz?: string): IDisposable { throw new Error('Method not implemented.'); } + getProgressIndicator(id: string) { return null!; } hideActivePanel(): void { } - - getLastActivePanelId(): string { - return undefined!; - } + getLastActivePanelId(): string { return undefined!; } } export class TestEditorGroupsService implements IEditorGroupsService { @@ -581,78 +427,30 @@ export class TestEditorGroupsService implements IEditorGroupsService { contentDimension = { width: 800, height: 600 }; - get activeGroup(): IEditorGroup { - return this.groups[0]; - } - - get count(): number { - return this.groups.length; - } - - getGroups(_order?: GroupsOrder): ReadonlyArray { - return this.groups; - } - - getGroup(identifier: number): IEditorGroup | undefined { - return find(this.groups, group => group.id === identifier); - } - - getLabel(_identifier: number): string { - return 'Group 1'; - } - - findGroup(_scope: IFindGroupScope, _source?: number | IEditorGroup, _wrap?: boolean): IEditorGroup { - throw new Error('not implemented'); - } - - activateGroup(_group: number | IEditorGroup): IEditorGroup { - throw new Error('not implemented'); - } - - restoreGroup(_group: number | IEditorGroup): IEditorGroup { - throw new Error('not implemented'); - } - - getSize(_group: number | IEditorGroup): { width: number, height: number } { - return { width: 100, height: 100 }; - } + get activeGroup(): IEditorGroup { return this.groups[0]; } + get count(): number { return this.groups.length; } + getGroups(_order?: GroupsOrder): ReadonlyArray { return this.groups; } + getGroup(identifier: number): IEditorGroup | undefined { return find(this.groups, group => group.id === identifier); } + getLabel(_identifier: number): string { return 'Group 1'; } + findGroup(_scope: IFindGroupScope, _source?: number | IEditorGroup, _wrap?: boolean): IEditorGroup { throw new Error('not implemented'); } + activateGroup(_group: number | IEditorGroup): IEditorGroup { throw new Error('not implemented'); } + restoreGroup(_group: number | IEditorGroup): IEditorGroup { throw new Error('not implemented'); } + getSize(_group: number | IEditorGroup): { width: number, height: number } { return { width: 100, height: 100 }; } setSize(_group: number | IEditorGroup, _size: { width: number, height: number }): void { } - arrangeGroups(_arrangement: GroupsArrangement): void { } - applyLayout(_layout: EditorGroupLayout): void { } - setGroupOrientation(_orientation: any): void { } - - addGroup(_location: number | IEditorGroup, _direction: GroupDirection, _options?: IAddGroupOptions): IEditorGroup { - throw new Error('not implemented'); - } - + addGroup(_location: number | IEditorGroup, _direction: GroupDirection, _options?: IAddGroupOptions): IEditorGroup { throw new Error('not implemented'); } removeGroup(_group: number | IEditorGroup): void { } - - moveGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { - throw new Error('not implemented'); - } - - mergeGroup(_group: number | IEditorGroup, _target: number | IEditorGroup, _options?: IMergeGroupOptions): IEditorGroup { - throw new Error('not implemented'); - } - - copyGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { - throw new Error('not implemented'); - } - + moveGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { throw new Error('not implemented'); } + mergeGroup(_group: number | IEditorGroup, _target: number | IEditorGroup, _options?: IMergeGroupOptions): IEditorGroup { throw new Error('not implemented'); } + copyGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { throw new Error('not implemented'); } centerLayout(active: boolean): void { } - - isLayoutCentered(): boolean { - return false; - } + isLayoutCentered(): boolean { return false; } partOptions!: IEditorPartOptions; - enforcePartOptions(options: IEditorPartOptions): IDisposable { - return Disposable.None; - } + enforcePartOptions(options: IEditorPartOptions): IDisposable { return Disposable.None; } } export class TestEditorGroupView implements IEditorGroupView { @@ -688,66 +486,23 @@ export class TestEditorGroupView implements IEditorGroupView { onDidFocus: Event = Event.None; onDidChange: Event<{ width: number; height: number; }> = Event.None; - getEditors(_order?: EditorsOrder): ReadonlyArray { - return []; - } - - getEditorByIndex(_index: number): IEditorInput { - throw new Error('not implemented'); - } - - getIndexOfEditor(_editor: IEditorInput): number { - return -1; - } - - openEditor(_editor: IEditorInput, _options?: IEditorOptions): Promise { - throw new Error('not implemented'); - } - - openEditors(_editors: IEditorInputWithOptions[]): Promise { - throw new Error('not implemented'); - } - - isOpened(_editor: IEditorInput | IResourceInput): boolean { - return false; - } - - isPinned(_editor: IEditorInput): boolean { - return false; - } - - isActive(_editor: IEditorInput): boolean { - return false; - } - + getEditors(_order?: EditorsOrder): ReadonlyArray { return []; } + getEditorByIndex(_index: number): IEditorInput { throw new Error('not implemented'); } + getIndexOfEditor(_editor: IEditorInput): number { return -1; } + openEditor(_editor: IEditorInput, _options?: IEditorOptions): Promise { throw new Error('not implemented'); } + openEditors(_editors: IEditorInputWithOptions[]): Promise { throw new Error('not implemented'); } + isOpened(_editor: IEditorInput | IResourceInput): boolean { return false; } + isPinned(_editor: IEditorInput): boolean { return false; } + isActive(_editor: IEditorInput): boolean { return false; } moveEditor(_editor: IEditorInput, _target: IEditorGroup, _options?: IMoveEditorOptions): void { } - copyEditor(_editor: IEditorInput, _target: IEditorGroup, _options?: ICopyEditorOptions): void { } - - closeEditor(_editor?: IEditorInput, options?: ICloseEditorOptions): Promise { - return Promise.resolve(); - } - - closeEditors(_editors: IEditorInput[] | { except?: IEditorInput; direction?: CloseDirection; savedOnly?: boolean; }, options?: ICloseEditorOptions): Promise { - return Promise.resolve(); - } - - closeAllEditors(): Promise { - return Promise.resolve(); - } - - replaceEditors(_editors: IEditorReplacement[]): Promise { - return Promise.resolve(); - } - + closeEditor(_editor?: IEditorInput, options?: ICloseEditorOptions): Promise { return Promise.resolve(); } + closeEditors(_editors: IEditorInput[] | { except?: IEditorInput; direction?: CloseDirection; savedOnly?: boolean; }, options?: ICloseEditorOptions): Promise { return Promise.resolve(); } + closeAllEditors(): Promise { return Promise.resolve(); } + replaceEditors(_editors: IEditorReplacement[]): Promise { return Promise.resolve(); } pinEditor(_editor?: IEditorInput): void { } - focus(): void { } - - invokeWithinContext(fn: (accessor: ServicesAccessor) => T): T { - throw new Error('not implemented'); - } - + invokeWithinContext(fn: (accessor: ServicesAccessor) => T): T { throw new Error('not implemented'); } setActive(_isActive: boolean): void { } notifyIndexChanged(_index: number): void { } dispose(): void { } @@ -802,15 +557,8 @@ export class TestEditorService implements EditorServiceImpl { constructor(private editorGroupService?: IEditorGroupsService) { } getEditors() { return []; } - - overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable { - return toDisposable(() => undefined); - } - - openEditor(_editor: any, _options?: any, _group?: any): Promise { - throw new Error('not implemented'); - } - + overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable { return toDisposable(() => undefined); } + openEditor(_editor: any, _options?: any, _group?: any): Promise { throw new Error('not implemented'); } doResolveEditorOpenRequest(editor: IEditorInput | IResourceEditor): [IEditorGroup, EditorInput, EditorOptions | undefined] | undefined { if (!this.editorGroupService) { return undefined; @@ -818,46 +566,16 @@ export class TestEditorService implements EditorServiceImpl { return [this.editorGroupService.activeGroup, editor as EditorInput, undefined]; } - - openEditors(_editors: any, _group?: any): Promise { - throw new Error('not implemented'); - } - - isOpen(_editor: IEditorInput | IResourceInput | IUntitledTextResourceInput): boolean { - return false; - } - - getOpened(_editor: IEditorInput | IResourceInput | IUntitledTextResourceInput): IEditorInput { - throw new Error('not implemented'); - } - - replaceEditors(_editors: any, _group: any) { - return Promise.resolve(undefined); - } - - invokeWithinEditorContext(fn: (accessor: ServicesAccessor) => T): T { - throw new Error('not implemented'); - } - - createInput(_input: IResourceInput | IUntitledTextResourceInput | IResourceDiffInput | IResourceSideBySideInput): IEditorInput { - throw new Error('not implemented'); - } - - save(editors: IEditorIdentifier[], options?: ISaveEditorsOptions): Promise { - throw new Error('Method not implemented.'); - } - - saveAll(options?: ISaveEditorsOptions): Promise { - throw new Error('Method not implemented.'); - } - - revert(editors: IEditorIdentifier[], options?: IRevertOptions): Promise { - throw new Error('Method not implemented.'); - } - - revertAll(options?: IRevertAllEditorsOptions): Promise { - throw new Error('Method not implemented.'); - } + openEditors(_editors: any, _group?: any): Promise { throw new Error('not implemented'); } + isOpen(_editor: IEditorInput | IResourceInput | IUntitledTextResourceInput): boolean { return false; } + getOpened(_editor: IEditorInput | IResourceInput | IUntitledTextResourceInput): IEditorInput { throw new Error('not implemented'); } + replaceEditors(_editors: any, _group: any) { return Promise.resolve(undefined); } + invokeWithinEditorContext(fn: (accessor: ServicesAccessor) => T): T { throw new Error('not implemented'); } + createInput(_input: IResourceInput | IUntitledTextResourceInput | IResourceDiffInput | IResourceSideBySideInput): IEditorInput { throw new Error('not implemented'); } + save(editors: IEditorIdentifier[], options?: ISaveEditorsOptions): Promise { throw new Error('Method not implemented.'); } + saveAll(options?: ISaveEditorsOptions): Promise { throw new Error('Method not implemented.'); } + revert(editors: IEditorIdentifier[], options?: IRevertOptions): Promise { throw new Error('Method not implemented.'); } + revertAll(options?: IRevertAllEditorsOptions): Promise { throw new Error('Method not implemented.'); } } export class TestFileService implements IFileService { @@ -879,34 +597,13 @@ export class TestFileService implements IFileService { this._onAfterOperation = new Emitter(); } - setContent(content: string): void { - this.content = content; - } - - getContent(): string { - return this.content; - } - - getLastReadFileUri(): URI { - return this.lastReadFileUri; - } - - get onFileChanges(): Event { - return this._onFileChanges.event; - } - - fireFileChanges(event: FileChangesEvent): void { - this._onFileChanges.fire(event); - } - - get onAfterOperation(): Event { - return this._onAfterOperation.event; - } - - fireAfterOperation(event: FileOperationEvent): void { - this._onAfterOperation.fire(event); - } - + setContent(content: string): void { this.content = content; } + getContent(): string { return this.content; } + getLastReadFileUri(): URI { return this.lastReadFileUri; } + get onFileChanges(): Event { return this._onFileChanges.event; } + fireFileChanges(event: FileChangesEvent): void { this._onFileChanges.fire(event); } + get onAfterOperation(): Event { return this._onAfterOperation.event; } + fireAfterOperation(event: FileOperationEvent): void { this._onAfterOperation.fire(event); } resolve(resource: URI, _options?: IResolveFileOptions): Promise; resolve(resource: URI, _options: IResolveMetadataFileOptions): Promise; resolve(resource: URI, _options?: IResolveFileOptions): Promise { @@ -929,9 +626,7 @@ export class TestFileService implements IFileService { return stats.map(stat => ({ stat, success: true })); } - async exists(_resource: URI): Promise { - return true; - } + async exists(_resource: URI): Promise { return true; } readFile(resource: URI, options?: IReadFileOptions | undefined): Promise { this.lastReadFileUri = resource; @@ -997,21 +692,10 @@ export class TestFileService implements IFileService { }); } - move(_source: URI, _target: URI, _overwrite?: boolean): Promise { - return Promise.resolve(null!); - } - - copy(_source: URI, _target: URI, _overwrite?: boolean): Promise { - return Promise.resolve(null!); - } - - createFile(_resource: URI, _content?: VSBuffer | VSBufferReadable, _options?: ICreateFileOptions): Promise { - return Promise.resolve(null!); - } - - createFolder(_resource: URI): Promise { - throw new Error('not implemented'); - } + move(_source: URI, _target: URI, _overwrite?: boolean): Promise { return Promise.resolve(null!); } + copy(_source: URI, _target: URI, _overwrite?: boolean): Promise { return Promise.resolve(null!); } + createFile(_resource: URI, _content?: VSBuffer | VSBufferReadable, _options?: ICreateFileOptions): Promise { return Promise.resolve(null!); } + createFolder(_resource: URI): Promise { throw new Error('not implemented'); } onDidChangeFileSystemProviderRegistrations = Event.None; @@ -1023,14 +707,8 @@ export class TestFileService implements IFileService { return toDisposable(() => this.providers.delete(scheme)); } - activateProvider(_scheme: string): Promise { - throw new Error('not implemented'); - } - - canHandleResource(resource: URI): boolean { - return resource.scheme === 'file' || this.providers.has(resource.scheme); - } - + activateProvider(_scheme: string): Promise { throw new Error('not implemented'); } + canHandleResource(resource: URI): boolean { return resource.scheme === 'file' || this.providers.has(resource.scheme); } hasCapability(resource: URI, capability: FileSystemProviderCapabilities): boolean { if (capability === FileSystemProviderCapabilities.PathCaseSensitive && isLinux) { return true; @@ -1039,67 +717,30 @@ export class TestFileService implements IFileService { return false; } - del(_resource: URI, _options?: { useTrash?: boolean, recursive?: boolean }): Promise { - return Promise.resolve(); - } - - watch(_resource: URI): IDisposable { - return Disposable.None; - } - - getWriteEncoding(_resource: URI): IResourceEncoding { - return { encoding: 'utf8', hasBOM: false }; - } - - dispose(): void { - } + del(_resource: URI, _options?: { useTrash?: boolean, recursive?: boolean }): Promise { return Promise.resolve(); } + watch(_resource: URI): IDisposable { return Disposable.None; } + getWriteEncoding(_resource: URI): IResourceEncoding { return { encoding: 'utf8', hasBOM: false }; } + dispose(): void { } } export class TestBackupFileService implements IBackupFileService { _serviceBrand: undefined; - hasBackups(): Promise { - return Promise.resolve(false); - } - - hasBackup(_resource: URI): Promise { - return Promise.resolve(false); - } - - hasBackupSync(resource: URI, versionId?: number): boolean { - return false; - } - - registerResourceForBackup(_resource: URI): Promise { - return Promise.resolve(); - } - - deregisterResourceForBackup(_resource: URI): Promise { - return Promise.resolve(); - } - - backup(_resource: URI, _content?: ITextSnapshot, versionId?: number, meta?: T): Promise { - return Promise.resolve(); - } - - getBackups(): Promise { - return Promise.resolve([]); - } - + hasBackups(): Promise { return Promise.resolve(false); } + hasBackup(_resource: URI): Promise { return Promise.resolve(false); } + hasBackupSync(resource: URI, versionId?: number): boolean { return false; } + registerResourceForBackup(_resource: URI): Promise { return Promise.resolve(); } + deregisterResourceForBackup(_resource: URI): Promise { return Promise.resolve(); } + backup(_resource: URI, _content?: ITextSnapshot, versionId?: number, meta?: T): Promise { return Promise.resolve(); } + getBackups(): Promise { return Promise.resolve([]); } + resolve(_backup: URI): Promise | undefined> { return Promise.resolve(undefined); } + discardBackup(_resource: URI): Promise { return Promise.resolve(); } parseBackupContent(textBufferFactory: ITextBufferFactory): string { const textBuffer = textBufferFactory.create(DefaultEndOfLine.LF); const lineCount = textBuffer.getLineCount(); const range = new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1); return textBuffer.getValueInRange(range, EndOfLinePreference.TextDefined); } - - resolve(_backup: URI): Promise | undefined> { - return Promise.resolve(undefined); - } - - discardBackup(_resource: URI): Promise { - return Promise.resolve(); - } } export class TestCodeEditorService implements ICodeEditorService { @@ -1136,12 +777,15 @@ export class TestLifecycleService implements ILifecycleService { startupKind!: StartupKind; private readonly _onBeforeShutdown = new Emitter(); - private readonly _onWillShutdown = new Emitter(); - private readonly _onShutdown = new Emitter(); + get onBeforeShutdown(): Event { return this._onBeforeShutdown.event; } - when(): Promise { - return Promise.resolve(); - } + private readonly _onWillShutdown = new Emitter(); + get onWillShutdown(): Event { return this._onWillShutdown.event; } + + private readonly _onShutdown = new Emitter(); + get onShutdown(): Event { return this._onShutdown.event; } + + when(): Promise { return Promise.resolve(); } fireShutdown(reason = ShutdownReason.QUIT): void { this._onWillShutdown.fire({ @@ -1150,29 +794,14 @@ export class TestLifecycleService implements ILifecycleService { }); } - fireWillShutdown(event: BeforeShutdownEvent): void { - this._onBeforeShutdown.fire(event); - } - - get onBeforeShutdown(): Event { - return this._onBeforeShutdown.event; - } - - get onWillShutdown(): Event { - return this._onWillShutdown.event; - } - - get onShutdown(): Event { - return this._onShutdown.event; - } + fireWillShutdown(event: BeforeShutdownEvent): void { this._onBeforeShutdown.fire(event); } } export class TestTextResourceConfigurationService implements ITextResourceConfigurationService { _serviceBrand: undefined; - constructor(private configurationService = new TestConfigurationService()) { - } + constructor(private configurationService = new TestConfigurationService()) { } onDidChangeConfiguration() { return { dispose() { } }; diff --git a/src/vs/workbench/test/common/workbenchTestServices.ts b/src/vs/workbench/test/common/workbenchTestServices.ts index 0ab76f0644e..dfe948f1797 100644 --- a/src/vs/workbench/test/common/workbenchTestServices.ts +++ b/src/vs/workbench/test/common/workbenchTestServices.ts @@ -127,3 +127,11 @@ export class TestStorageService extends InMemoryStorageService { } export class TestWorkingCopyService extends WorkingCopyService { } + +export function mock(): Ctor { + return function () { } as any; +} + +export interface Ctor { + new(): T; +} diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index a5705d198a9..a6435298de7 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -111,9 +111,7 @@ export class TestSharedProcessService implements ISharedProcessService { _serviceBrand: undefined; - getChannel(channelName: string): any { - return undefined; - } + getChannel(channelName: string): any { return undefined; } registerChannel(channelName: string, channel: any): void { } From 2458ab3a4a91e067bce4bd85cd4de8e28ad5d63d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 08:40:08 +0100 Subject: [PATCH 180/624] files - move window.openFilesInNewWindow setting over --- .../workbench/browser/workbench.contribution.ts | 17 +++++++++++++++++ .../electron-browser/desktop.contribution.ts | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 12de454be62..c59e345f813 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -312,6 +312,23 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio 'markdownDescription': nls.localize('customMenuBarAltFocus', "Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."), 'included': isWindows || isLinux || isWeb }, + 'window.openFilesInNewWindow': { + 'type': 'string', + 'enum': ['on', 'off', 'default'], + 'enumDescriptions': [ + nls.localize('window.openFilesInNewWindow.on', "Files will open in a new window."), + nls.localize('window.openFilesInNewWindow.off', "Files will open in the window with the files' folder open or the last active window."), + isMacintosh ? + nls.localize('window.openFilesInNewWindow.defaultMac', "Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder.") : + nls.localize('window.openFilesInNewWindow.default', "Files will open in a new window unless picked from within the application (e.g. via the File menu).") + ], + 'default': 'off', + 'scope': ConfigurationScope.APPLICATION, + 'markdownDescription': + isMacintosh ? + nls.localize('openFilesInNewWindowMac', "Controls whether files should open in a new window. \nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).") : + nls.localize('openFilesInNewWindow', "Controls whether files should open in a new window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).") + }, 'window.openFoldersInNewWindow': { 'type': 'string', 'enum': ['on', 'off', 'default'], diff --git a/src/vs/workbench/electron-browser/desktop.contribution.ts b/src/vs/workbench/electron-browser/desktop.contribution.ts index 6eaa0687e48..61e2e2e5885 100644 --- a/src/vs/workbench/electron-browser/desktop.contribution.ts +++ b/src/vs/workbench/electron-browser/desktop.contribution.ts @@ -202,23 +202,6 @@ import product from 'vs/platform/product/common/product'; 'title': nls.localize('windowConfigurationTitle', "Window"), 'type': 'object', 'properties': { - 'window.openFilesInNewWindow': { - 'type': 'string', - 'enum': ['on', 'off', 'default'], - 'enumDescriptions': [ - nls.localize('window.openFilesInNewWindow.on', "Files will open in a new window."), - nls.localize('window.openFilesInNewWindow.off', "Files will open in the window with the files' folder open or the last active window."), - isMacintosh ? - nls.localize('window.openFilesInNewWindow.defaultMac', "Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder.") : - nls.localize('window.openFilesInNewWindow.default', "Files will open in a new window unless picked from within the application (e.g. via the File menu).") - ], - 'default': 'off', - 'scope': ConfigurationScope.APPLICATION, - 'markdownDescription': - isMacintosh ? - nls.localize('openFilesInNewWindowMac', "Controls whether files should open in a new window. \nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).") : - nls.localize('openFilesInNewWindow', "Controls whether files should open in a new window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).") - }, 'window.openWithoutArgumentsInNewWindow': { 'type': 'string', 'enum': ['on', 'off'], From d24ed62c0e47d4ba8e16a7444f4a5771a7d373d1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 09:13:21 +0100 Subject: [PATCH 181/624] maybe --- scripts/test-integration.bat | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index b7a236bc0e4..3bb59232f97 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -3,7 +3,7 @@ setlocal pushd %~dp0\.. -set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2% +set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2% :: Figure out which Electron to use for running tests if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( @@ -50,10 +50,10 @@ if %errorlevel% neq 0 exit /b %errorlevel% call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . if %errorlevel% neq 0 exit /b %errorlevel% -REM set GITWORKSPACE=%TMP%\git-%RANDOM% -REM mkdir %GITWORKSPACE% -REM call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% -REM if %errorlevel% neq 0 exit /b %errorlevel% +set GITWORKSPACE=%TEMP%\git-%RANDOM% +mkdir %GITWORKSPACE% +call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% +if %errorlevel% neq 0 exit /b %errorlevel% :: Tests in commonJS (HTML, CSS, JSON language server tests...) call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js From ce1bb2220ab9cb34a78c6f95e036a29e8067cd46 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:16:01 +0100 Subject: [PATCH 182/624] improper deepStrictEqual implementation --- test/assert.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/assert.js b/test/assert.js index 85e2008597c..94971d6b49b 100644 --- a/test/assert.js +++ b/test/assert.js @@ -468,7 +468,10 @@ assert.doesNotThrow = function(block, /*optional*/message) { _throws.apply(this, [false].concat(pSlice.call(arguments))); }; -assert.ifError = function(err) { if (err) {throw err;}}; +// VSCODE-CHANGE, todo@joh this isn't correct!! +assert.deepStrictEqual = assert.deepEqual; + +assert.ifError = function (err) { if (err) { throw err; } }; return assert; }); From 850206d0fbe959db7c6343123b8a0d6ff6cdd5c6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:16:52 +0100 Subject: [PATCH 183/624] support --browser flag --- test/browser/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index 9c85e985af5..ef3ab565154 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -19,6 +19,7 @@ const optimist = require('optimist') .describe('grep', 'only run tests matching ').alias('grep', 'g').alias('grep', 'f').string('grep') .describe('run', 'only run tests matching ').alias('run', 'glob').string('runGlob') .describe('build', 'run with build output (out-build)').boolean('build') + .describe('browser', 'browsers in which tests should run').string('browser').default('browser', ['chromium']) .describe('reporter', 'the mocha reporter').string('reporter').default('reporter', defaultReporterName) .describe('reporter-options', 'the mocha reporter options').string('reporter-options').default('reporter-options', '') .describe('tfs', 'tfs').string('tfs') @@ -27,7 +28,6 @@ const optimist = require('optimist') // logic const argv = optimist.argv; - const Reporter = (function () { const reporterPath = path.join(path.dirname(require.resolve('mocha')), 'lib', 'reporters', argv.reporter); let Reporter; @@ -161,11 +161,11 @@ class EchoRunner extends events.EventEmitter { } testModules.then(async modules => { - await Promise.all([ - runTestsInBrowser(modules, 'chromium'), - runTestsInBrowser(modules, 'webkit'), - // runTestsInBrowser(modules, 'firefox'), - ]); + + const browserTypes = Array.isArray(argv.browser) ? argv.browser : [argv.browser]; + const promises = browserTypes.map(browserType => runTestsInBrowser(modules, browserType)); + await Promise.all(promises); + }).catch(err => { console.error(err); }); From a991071307e62aa969e8a5fc9b921ea8869d60e6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:20:57 +0100 Subject: [PATCH 184/624] don't use Buffer in common/utils.ts --- src/vs/base/test/common/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/test/common/utils.ts b/src/vs/base/test/common/utils.ts index 26b225a1fa9..33ba88e8f4a 100644 --- a/src/vs/base/test/common/utils.ts +++ b/src/vs/base/test/common/utils.ts @@ -51,10 +51,10 @@ export class DeferredPromise { export function toResource(this: any, path: string) { if (isWindows) { - return URI.file(join('C:\\', Buffer.from(this.test.fullTitle()).toString('base64'), path)); + return URI.file(join('C:\\', btoa(this.test.fullTitle()), path)); } - return URI.file(join('/', Buffer.from(this.test.fullTitle()).toString('base64'), path)); + return URI.file(join('/', btoa(this.test.fullTitle()), path)); } export function suiteRepeat(n: number, description: string, callback: (this: any) => void): void { From 78edac9e13cfa89d759bb472e22bcbc31bfbca28 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 09:35:22 +0100 Subject: [PATCH 185/624] what the f --- scripts/test-integration.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 3bb59232f97..6b9036fb77a 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -50,7 +50,8 @@ if %errorlevel% neq 0 exit /b %errorlevel% call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% . if %errorlevel% neq 0 exit /b %errorlevel% -set GITWORKSPACE=%TEMP%\git-%RANDOM% +for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i +set GITWORKSPACE=%TEMPDIR%\git-%RANDOM% mkdir %GITWORKSPACE% call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% if %errorlevel% neq 0 exit /b %errorlevel% From 5e5f9fb3e63d82018df3401b4e3b168849741ea8 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:44:49 +0100 Subject: [PATCH 186/624] move tests to /node/ or make them not use node globals --- src/vs/base/test/common/utils.ts | 15 ++++++--------- src/vs/base/test/{common => node}/path.test.ts | 0 .../debug/test/browser/baseDebugView.test.ts | 5 +++-- .../extensions/test/common/rpcProtocol.test.ts | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) rename src/vs/base/test/{common => node}/path.test.ts (100%) diff --git a/src/vs/base/test/common/utils.ts b/src/vs/base/test/common/utils.ts index 33ba88e8f4a..d77f9f786e2 100644 --- a/src/vs/base/test/common/utils.ts +++ b/src/vs/base/test/common/utils.ts @@ -26,25 +26,22 @@ export class DeferredPromise { public complete(value: T) { return new Promise(resolve => { - process.nextTick(() => { - this.completeCallback(value); - resolve(); - }); + this.completeCallback(value); + resolve(); }); } public error(err: any) { return new Promise(resolve => { - process.nextTick(() => { - this.errorCallback(err); - resolve(); - }); + this.errorCallback(err); + resolve(); }); } public cancel() { - process.nextTick(() => { + new Promise(resolve => { this.errorCallback(canceled()); + resolve(); }); } } diff --git a/src/vs/base/test/common/path.test.ts b/src/vs/base/test/node/path.test.ts similarity index 100% rename from src/vs/base/test/common/path.test.ts rename to src/vs/base/test/node/path.test.ts diff --git a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts index eb29ef3a07c..3f3d5a8419a 100644 --- a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts @@ -15,6 +15,7 @@ import { workbenchInstantiationService } from 'vs/workbench/test/browser/workben import { createMockSession } from 'vs/workbench/contrib/debug/test/browser/callStack.test'; import { isStatusbarInDebugMode } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider'; import { State } from 'vs/workbench/contrib/debug/common/debug'; +import { isWindows } from 'vs/base/common/platform'; const $ = dom.$; suite('Debug - Base Debug View', () => { @@ -76,7 +77,7 @@ suite('Debug - Base Debug View', () => { renderExpressionValue(expression, container, { colorize: true, maxValueLength: 4, linkDetector }); assert.equal(container.textContent, 'this...'); - expression.value = process.platform === 'win32' ? 'C:\\foo.js:5' : '/foo.js:5'; + expression.value = isWindows ? 'C:\\foo.js:5' : '/foo.js:5'; container = $('.container'); renderExpressionValue(expression, container, { colorize: true, linkDetector }); assert.ok(container.querySelector('a')); @@ -109,7 +110,7 @@ suite('Debug - Base Debug View', () => { assert.equal(label.element.textContent, 'foo:'); assert.equal(label.element.title, 'string'); - variable.value = process.platform === 'win32' ? 'C:\\foo.js:5' : '/foo.js:5'; + variable.value = isWindows ? 'C:\\foo.js:5' : '/foo.js:5'; expression = $('.'); name = $('.'); value = $('.'); diff --git a/src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts b/src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts index 51951f79e20..6f6687a10d8 100644 --- a/src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts +++ b/src/vs/workbench/services/extensions/test/common/rpcProtocol.test.ts @@ -24,7 +24,7 @@ suite('RPCProtocol', () => { } public send(buffer: VSBuffer): void { - process.nextTick(() => { + Promise.resolve().then(() => { this._pair!._onMessage.fire(buffer); }); } From 1355463c76e07df4b60dfc8b03359506bdba2301 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:48:15 +0100 Subject: [PATCH 187/624] print browser when printing fails --- test/browser/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index ef3ab565154..2f954cf6839 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -123,7 +123,7 @@ class EchoRunner extends events.EventEmitter { event.on('hook', (hook) => this.emit('hook', EchoRunner.deserializeRunnable(hook))); event.on('hook end', (hook) => this.emit('hook end', EchoRunner.deserializeRunnable(hook))); event.on('pass', (test) => this.emit('pass', EchoRunner.deserializeRunnable(test))); - event.on('fail', (test, err) => this.emit('fail', EchoRunner.deserializeRunnable(test), EchoRunner.deserializeError(err))); + event.on('fail', (test, err) => this.emit('fail', EchoRunner.deserializeRunnable(test, title), EchoRunner.deserializeError(err))); event.on('pending', (test) => this.emit('pending', EchoRunner.deserializeRunnable(test))); } @@ -142,10 +142,10 @@ class EchoRunner extends events.EventEmitter { }; } - static deserializeRunnable(runnable) { + static deserializeRunnable(runnable, titleExtra) { return { title: runnable.title, - fullTitle: () => runnable.fullTitle, + fullTitle: () => titleExtra && runnable.fullTitle ? `${runnable.fullTitle} - /${titleExtra}/` : runnable.fullTitle, async: runnable.async, slow: () => runnable.slow, speed: runnable.speed, From 992c4daa4f5ff58cb748036afaecad0d9290d09e Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 09:53:48 +0100 Subject: [PATCH 188/624] fix path test that reflects on its own name --- src/vs/base/test/node/path.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/test/node/path.test.ts b/src/vs/base/test/node/path.test.ts index f5230c4a35c..688c184a99e 100644 --- a/src/vs/base/test/node/path.test.ts +++ b/src/vs/base/test/node/path.test.ts @@ -176,8 +176,8 @@ suite('Paths (Node Implementation)', () => { }); test('dirname', () => { - assert.strictEqual(path.dirname(path.normalize(__filename)).substr(-11), - isWindows ? 'test\\common' : 'test/common'); + assert.strictEqual(path.dirname(path.normalize(__filename)).substr(-9), + isWindows ? 'test\\node' : 'test/node'); assert.strictEqual(path.posix.dirname('/a/b/'), '/a'); assert.strictEqual(path.posix.dirname('/a/b'), '/a'); From 69657a759a33b8b0468e533847209cab903de3c6 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 10:00:12 +0100 Subject: [PATCH 189/624] #89610 use locaContent and remoteContent instead of hasLocalChanged and hasRemoteChanged --- .../userDataSync/common/settingsMerge.ts | 28 +++++++- .../userDataSync/common/settingsSync.ts | 68 ++++++------------- 2 files changed, 46 insertions(+), 50 deletions(-) diff --git a/src/vs/platform/userDataSync/common/settingsMerge.ts b/src/vs/platform/userDataSync/common/settingsMerge.ts index baca5690c82..dfc1f7af2b8 100644 --- a/src/vs/platform/userDataSync/common/settingsMerge.ts +++ b/src/vs/platform/userDataSync/common/settingsMerge.ts @@ -10,8 +10,10 @@ import { values } from 'vs/base/common/map'; import { IStringDictionary } from 'vs/base/common/collections'; import { FormattingOptions, Edit, getEOL } from 'vs/base/common/jsonFormatter'; import * as contentUtil from 'vs/platform/userDataSync/common/content'; -import { IConflictSetting } from 'vs/platform/userDataSync/common/userDataSync'; +import { IConflictSetting, DEFAULT_IGNORED_SETTINGS } from 'vs/platform/userDataSync/common/userDataSync'; import { firstIndex } from 'vs/base/common/arrays'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { startsWith } from 'vs/base/common/strings'; export interface IMergeResult { localContent: string | null; @@ -20,6 +22,30 @@ export interface IMergeResult { conflictsSettings: IConflictSetting[]; } +export function getIgnoredSettings(configurationService: IConfigurationService, settingsContent?: string): string[] { + let value: string[] = []; + if (settingsContent) { + const setting = parse(settingsContent); + if (setting) { + value = setting['sync.ignoredSettings']; + } + } else { + value = configurationService.getValue('sync.ignoredSettings'); + } + const added: string[] = [], removed: string[] = []; + if (Array.isArray(value)) { + for (const key of value) { + if (startsWith(key, '-')) { + removed.push(key.substring(1)); + } else { + added.push(key); + } + } + } + return [...DEFAULT_IGNORED_SETTINGS, ...added].filter(setting => removed.indexOf(setting) === -1); +} + + export function updateIgnoredSettings(targetContent: string, sourceContent: string, ignoredSettings: string[], formattingOptions: FormattingOptions): string { if (ignoredSettings.length) { const sourceTree = parseSettings(sourceContent); diff --git a/src/vs/platform/userDataSync/common/settingsSync.ts b/src/vs/platform/userDataSync/common/settingsSync.ts index 5a7c071d5c0..cc43d787469 100644 --- a/src/vs/platform/userDataSync/common/settingsSync.ts +++ b/src/vs/platform/userDataSync/common/settingsSync.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IFileService, FileSystemProviderErrorCode, FileSystemProviderError, IFileContent, FileOperationError, FileOperationResult } from 'vs/platform/files/common/files'; -import { IUserData, UserDataSyncError, UserDataSyncErrorCode, SyncStatus, IUserDataSyncStoreService, DEFAULT_IGNORED_SETTINGS, IUserDataSyncLogService, IUserDataSyncUtilService, IConflictSetting, ISettingsSyncService, CONFIGURATION_SYNC_STORE_KEY, SyncSource } from 'vs/platform/userDataSync/common/userDataSync'; +import { IUserData, UserDataSyncError, UserDataSyncErrorCode, SyncStatus, IUserDataSyncStoreService, IUserDataSyncLogService, IUserDataSyncUtilService, IConflictSetting, ISettingsSyncService, CONFIGURATION_SYNC_STORE_KEY, SyncSource } from 'vs/platform/userDataSync/common/userDataSync'; import { VSBuffer } from 'vs/base/common/buffer'; import { parse, ParseError } from 'vs/base/common/json'; import { localize } from 'vs/nls'; @@ -12,9 +12,8 @@ import { Emitter, Event } from 'vs/base/common/event'; import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { startsWith } from 'vs/base/common/strings'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { updateIgnoredSettings, merge } from 'vs/platform/userDataSync/common/settingsMerge'; +import { updateIgnoredSettings, merge, getIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; import { FormattingOptions } from 'vs/base/common/jsonFormatter'; import * as arrays from 'vs/base/common/arrays'; import * as objects from 'vs/base/common/objects'; @@ -26,8 +25,7 @@ interface ISyncPreviewResult { readonly fileContent: IFileContent | null; readonly remoteUserData: IUserData; readonly lastSyncUserData: IUserData | null; - readonly hasLocalChanged: boolean; - readonly hasRemoteChanged: boolean; + readonly localContent: string | null; readonly remoteContent: string | null; readonly hasConflicts: boolean; readonly conflictSettings: IConflictSetting[]; @@ -92,16 +90,15 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const fileContent = await this.getLocalFileContent(); const formatUtils = await this.getFormattingOptions(); // Update ignored settings - const content = updateIgnoredSettings(remoteUserData.content, fileContent ? fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); - await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(content)); + const localContent = updateIgnoredSettings(remoteUserData.content, fileContent ? fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); + await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(localContent)); this.syncPreviewResultPromise = createCancelablePromise(() => Promise.resolve({ hasConflicts: false, conflictSettings: [], fileContent, - hasLocalChanged: true, - hasRemoteChanged: false, - remoteContent: content, + localContent, + remoteContent: null, remoteUserData, lastSyncUserData, })); @@ -146,8 +143,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS conflictSettings: [], hasConflicts: false, fileContent, - hasLocalChanged: false, - hasRemoteChanged: true, + localContent: null, remoteContent: content, remoteUserData, lastSyncUserData, @@ -300,7 +296,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS return; } - let { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; + let { fileContent, remoteUserData, lastSyncUserData, localContent, remoteContent } = await this.syncPreviewResultPromise; if (content === undefined) { if (await this.fileService.exists(this.environmentService.settingsSyncPreviewResource)) { @@ -317,14 +313,14 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS throw error; } - if (!hasLocalChanged && !hasRemoteChanged) { + if (localContent === null && remoteContent === null) { this.logService.trace('Settings: No changes found during synchronizing settings.'); } - if (hasLocalChanged) { + if (localContent !== null) { this.logService.info('Settings: Updating local settings'); await this.updateLocalFileContent(content, fileContent); } - if (hasRemoteChanged) { + if (remoteContent !== null) { const formatUtils = await this.getFormattingOptions(); content = updateIgnoredSettings(content, remoteUserData.content || '{}', getIgnoredSettings(this.configurationService, content), formatUtils); this.logService.info('Settings: Updating remote settings'); @@ -364,29 +360,27 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const remoteUserData = await this.getRemoteUserData(lastSyncUserData); // Get file content last to get the latest const fileContent = await this.getLocalFileContent(); - let hasLocalChanged: boolean = false; - let hasRemoteChanged: boolean = false; + let localContent: string | null = null; + let remoteContent: string | null = null; let hasConflicts: boolean = false; let conflictSettings: IConflictSetting[] = []; let previewContent: string | null = null; - let remoteContent: string | null = null; if (remoteUserData.content) { - const localContent: string = fileContent ? fileContent.value.toString() : '{}'; + const content: string = fileContent ? fileContent.value.toString() : '{}'; // No action when there are errors - if (this.hasErrors(localContent)) { + if (this.hasErrors(content)) { this.logService.error('Settings: Unable to sync settings as there are errors/warning in settings file.'); } else { this.logService.trace('Settings: Merging remote settings with local settings...'); const formatUtils = await this.getFormattingOptions(); - const result = merge(localContent, remoteUserData.content, lastSyncUserData ? lastSyncUserData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); + const result = merge(content, remoteUserData.content, lastSyncUserData ? lastSyncUserData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); hasConflicts = result.hasConflicts; - hasLocalChanged = result.localContent !== null; - hasRemoteChanged = result.remoteContent !== null; conflictSettings = result.conflictsSettings; + localContent = result.localContent; remoteContent = result.remoteContent; previewContent = result.localContent || result.remoteContent; } @@ -395,7 +389,6 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS // First time syncing to remote else if (fileContent) { this.logService.trace('Settings: Remote settings does not exist. Synchronizing settings for the first time.'); - hasRemoteChanged = true; previewContent = fileContent.value.toString(); remoteContent = fileContent.value.toString(); } @@ -405,7 +398,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } this.setConflicts(conflictSettings); - return { fileContent, remoteUserData, lastSyncUserData, hasLocalChanged, hasRemoteChanged, remoteContent, conflictSettings, hasConflicts }; + return { fileContent, remoteUserData, lastSyncUserData, remoteContent, localContent, conflictSettings, hasConflicts }; } private _formattingOptions: Promise | undefined = undefined; @@ -417,26 +410,3 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } } - -export function getIgnoredSettings(configurationService: IConfigurationService, settingsContent?: string): string[] { - let value: string[] = []; - if (settingsContent) { - const setting = parse(settingsContent); - if (setting) { - value = setting['sync.ignoredSettings']; - } - } else { - value = configurationService.getValue('sync.ignoredSettings'); - } - const added: string[] = [], removed: string[] = []; - if (Array.isArray(value)) { - for (const key of value) { - if (startsWith(key, '-')) { - removed.push(key.substring(1)); - } else { - added.push(key); - } - } - } - return [...DEFAULT_IGNORED_SETTINGS, ...added].filter(setting => removed.indexOf(setting) === -1); -} From 06dbb1938f6b559cdc8a3e553475b80b73bf67ff Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 10:24:40 +0100 Subject: [PATCH 190/624] make sure git is activated before integration tests run --- extensions/git/package.json | 9 +++++++++ extensions/git/package.nls.json | 1 + extensions/git/src/commands.ts | 5 +++++ extensions/git/src/test/smoke.test.ts | 2 ++ 4 files changed, 17 insertions(+) diff --git a/extensions/git/package.json b/extensions/git/package.json index c1cd8b5135c..a7f9e33f31d 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -26,6 +26,11 @@ }, "contributes": { "commands": [ + { + "command": "git.activate", + "title": "%command.activate%", + "category": "Git" + }, { "command": "git.setLogLevel", "title": "%command.setLogLevel%", @@ -451,6 +456,10 @@ ], "menus": { "commandPalette": [ + { + "command": "git.activate", + "when": "false" + }, { "command": "git.clone", "when": "config.git.enabled" diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index f3d75519653..8cd65b4e477 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -1,6 +1,7 @@ { "displayName": "Git", "description": "Git SCM Integration", + "command.activate": "Activate", "command.setLogLevel": "Set Log Level...", "command.clone": "Clone", "command.init": "Initialize Repository", diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index be0f5387d15..25090369b71 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -253,6 +253,11 @@ export class CommandCenter { }); } + @command('git.activate') + async activate(): Promise { + // noop + } + @command('git.setLogLevel') async setLogLevel(): Promise { const createItem = (logLevel: LogLevel) => ({ diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index 5430ca5f1d8..966448e9429 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -40,6 +40,8 @@ suite('git smoke test', function () { cp.execSync('git add .', { cwd }); cp.execSync('git commit -m "initial commit"', { cwd }); + // make sure git is activated + await commands.executeCommand('git.activate'); git = extensions.getExtension('vscode.git')!.exports.getAPI(1); if (git.repositories.length === 0) { From f69165d0c109d1c64ef2fb7c495ab282f94a213b Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 10:38:06 +0100 Subject: [PATCH 191/624] fix compilation --- src/vs/workbench/contrib/preferences/browser/settingsTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index a544d97188c..c66d36362c0 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -42,7 +42,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { editorBackground, errorForeground, focusBorder, foreground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground } from 'vs/platform/theme/common/colorRegistry'; import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler, attachStyler } from 'vs/platform/theme/common/styler'; import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { getIgnoredSettings } from 'vs/platform/userDataSync/common/settingsSync'; +import { getIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; 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, IListChangeEvent, IListDataItem, ListSettingWidget, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; From 1e057b73930c16738d31278a068b0d50eb476c28 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 10:49:16 +0100 Subject: [PATCH 192/624] debug integration tests: make sure to focus editor before toggleBreakpoint fixes #90047 --- .../vscode-api-tests/src/singlefolder-tests/debug.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts index 57bc7b517fe..ed8f4555cc3 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -41,13 +41,13 @@ suite('Debug', function () { const file = await createRandomFile('let i = 5;', undefined, '.js'); const doc = await workspace.openTextDocument(file); await window.showTextDocument(doc, undefined, false); - const breakpointsChanged = new Promise(resolve => onBreakpointsChange = resolve); await commands.executeCommand('editor.debug.action.toggleBreakpoint'); await breakpointsChanged; assert.equal(debug.breakpoints.length, 1); assert.equal(debug.breakpoints[0].enabled, true); + await window.showTextDocument(doc, undefined, false); const breakpointsChangedSecond = new Promise(resolve => onBreakpointsChange = resolve); await commands.executeCommand('editor.debug.action.toggleBreakpoint'); await breakpointsChangedSecond; From 0e7ef1f5ff06e847be07004b92c1d2eb9482f0c5 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 10:57:10 +0100 Subject: [PATCH 193/624] Introduce and adopt ITextEditorOptions.selectionRevealType --- src/vs/editor/contrib/gotoError/gotoError.ts | 3 +- .../editor/contrib/gotoSymbol/goToCommands.ts | 3 +- .../contrib/gotoSymbol/symbolNavigation.ts | 3 +- src/vs/platform/editor/common/editor.ts | 27 +++++++++++------ .../parts/editor/breadcrumbsControl.ts | 3 +- src/vs/workbench/common/editor.ts | 30 +++++-------------- .../contrib/debug/browser/breakpointsView.ts | 3 +- .../contrib/debug/common/debugSource.ts | 3 +- .../contrib/outline/browser/outlinePane.ts | 4 +-- .../tasks/browser/abstractTaskService.ts | 4 +-- .../services/history/browser/history.ts | 4 +-- 11 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index 5ac29409f1c..304f06cf306 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -28,6 +28,7 @@ import { Action } from 'vs/base/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { isEqual } from 'vs/base/common/resources'; import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; class MarkerModel { @@ -396,7 +397,7 @@ class MarkerNavigationAction extends EditorAction { return editorService.openCodeEditor({ resource: newMarker.resource, - options: { pinned: false, revealIfOpened: true, revealInCenterIfOutsideViewport: true, selection: newMarker } + options: { pinned: false, revealIfOpened: true, selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport, selection: newMarker } }, editor).then(editor => { if (!editor) { return undefined; diff --git a/src/vs/editor/contrib/gotoSymbol/goToCommands.ts b/src/vs/editor/contrib/gotoSymbol/goToCommands.ts index f060f6aaf5c..f1857f14862 100644 --- a/src/vs/editor/contrib/gotoSymbol/goToCommands.ts +++ b/src/vs/editor/contrib/gotoSymbol/goToCommands.ts @@ -37,6 +37,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ScrollType, IEditorAction } from 'vs/editor/common/editorCommon'; import { assertType } from 'vs/base/common/types'; import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; MenuRegistry.appendMenuItem(MenuId.EditorContext, { @@ -166,7 +167,7 @@ abstract class SymbolNavigationAction extends EditorAction { resource: reference.uri, options: { selection: Range.collapseToStart(range), - revealInCenterIfOutsideViewport: true + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport } }, editor, sideBySide); diff --git a/src/vs/editor/contrib/gotoSymbol/symbolNavigation.ts b/src/vs/editor/contrib/gotoSymbol/symbolNavigation.ts index 879f3b9aaf9..0385d330427 100644 --- a/src/vs/editor/contrib/gotoSymbol/symbolNavigation.ts +++ b/src/vs/editor/contrib/gotoSymbol/symbolNavigation.ts @@ -19,6 +19,7 @@ import { localize } from 'vs/nls'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { isEqual } from 'vs/base/common/resources'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; export const ctxHasSymbols = new RawContextKey('hasSymbols', false); @@ -127,7 +128,7 @@ class SymbolNavigationService implements ISymbolNavigationService { resource: reference.uri, options: { selection: Range.collapseToStart(reference.range), - revealInCenterIfOutsideViewport: true + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport } }, source).finally(() => { this._ignoreEditorChange = false; diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index dda9f3ae1e8..d56f9a069e2 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -215,6 +215,21 @@ export interface ITextEditorSelection { readonly endColumn?: number; } +export const enum TextEditorSelectionRevealType { + /** + * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically. + */ + Center = 0, + /** + * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. + */ + CenterIfOutsideViewport = 1, + /** + * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, but not quite at the top. + */ + Definition = 2, +} + export interface ITextEditorOptions extends IEditorOptions { /** @@ -228,14 +243,8 @@ export interface ITextEditorOptions extends IEditorOptions { readonly viewState?: object; /** - * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. - * This can't be used in combination with revealAtDefinition. + * Option to control the text editor selection reveal type. + * Defaults to TextEditorSelectionRevealType.Center */ - readonly revealInCenterIfOutsideViewport?: boolean; - - /** - * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, - * optimized for viewing a code definition. - */ - readonly revealAtDefinition?: boolean; + readonly selectionRevealType?: TextEditorSelectionRevealType; } diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts index b58850125ba..db819929569 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts @@ -48,6 +48,7 @@ import { onDidChangeZoomLevel } from 'vs/base/browser/browser'; import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; import { ILabelService } from 'vs/platform/label/common/label'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; class Item extends BreadcrumbsItem { @@ -490,7 +491,7 @@ export class BreadcrumbsControl { resource: model.textModel.uri, options: { selection: Range.collapseToStart(element.symbol.selectionRange), - revealInCenterIfOutsideViewport: true + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport } }, withUndefinedAsNull(this._getActiveCodeEditor()), group === SIDE_GROUP); } diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 78a38b82d58..98c8d4f35d4 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -10,7 +10,7 @@ import { withNullAsUndefined, assertIsDefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { IEditor as ICodeEditor, IEditorViewState, ScrollType, IDiffEditor } from 'vs/editor/common/editorCommon'; -import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput, EditorActivation, EditorOpenContext, ITextEditorSelection } from 'vs/platform/editor/common/editor'; +import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput, EditorActivation, EditorOpenContext, ITextEditorSelection, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; import { IInstantiationService, IConstructorSignature0, ServicesAccessor, BrandedService } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -1110,16 +1110,9 @@ export class TextEditorOptions extends EditorOptions implements ITextEditorOptio editorViewState: IEditorViewState | undefined; /** - * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. - * This can't be used in combination with revealAtDefinition. + * Option to control the text editor selection reveal type. */ - revealInCenterIfOutsideViewport: boolean | undefined; - - /** - * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, - * optimized for viewing a code definition. - */ - revealAtDefinition: boolean | undefined; + selectionRevealType: TextEditorSelectionRevealType | undefined; static from(input?: IBaseResourceInput): TextEditorOptions | undefined { if (!input || !input.options) { @@ -1158,15 +1151,8 @@ export class TextEditorOptions extends EditorOptions implements ITextEditorOptio this.editorViewState = options.viewState as IEditorViewState; } - if (typeof options.revealAtDefinition === 'boolean') { - this.revealAtDefinition = options.revealAtDefinition; - if (options.revealInCenterIfOutsideViewport) { - throw new Error('revealInCenterIfOutsideViewport and revealAtDefinition cannot both be true'); - } - } - - if (typeof options.revealInCenterIfOutsideViewport === 'boolean') { - this.revealInCenterIfOutsideViewport = options.revealInCenterIfOutsideViewport; + if (typeof options.selectionRevealType !== 'undefined') { + this.selectionRevealType = options.selectionRevealType; } return this; @@ -1176,7 +1162,7 @@ export class TextEditorOptions extends EditorOptions implements ITextEditorOptio * Returns if this options object has objects defined for the editor. */ hasOptionsDefined(): boolean { - return !!this.editorViewState || !!this.revealInCenterIfOutsideViewport || !!this.selection; + return !!this.editorViewState || !!this.selectionRevealType || !!this.selection; } /** @@ -1216,9 +1202,9 @@ export class TextEditorOptions extends EditorOptions implements ITextEditorOptio editor.setSelection(range); - if (this.revealAtDefinition) { + if (this.selectionRevealType === TextEditorSelectionRevealType.Definition) { editor.revealRangeAtDefinition(range, scrollType); - } else if (this.revealInCenterIfOutsideViewport) { + } else if (this.selectionRevealType === TextEditorSelectionRevealType.CenterIfOutsideViewport) { editor.revealRangeInCenterIfOutsideViewport(range, scrollType); } else { editor.revealRangeInCenter(range, scrollType); diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index babb3753773..ae2df49c344 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -34,6 +34,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; import { Gesture } from 'vs/base/browser/touch'; import { IViewDescriptorService } from 'vs/workbench/common/views'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; const $ = dom.$; @@ -633,7 +634,7 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea preserveFocus, selection, revealIfOpened: true, - revealInCenterIfOutsideViewport: true, + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport, pinned: !preserveFocus } }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP); diff --git a/src/vs/workbench/contrib/debug/common/debugSource.ts b/src/vs/workbench/contrib/debug/common/debugSource.ts index c4ac1470595..cf4a9dfe80b 100644 --- a/src/vs/workbench/contrib/debug/common/debugSource.ts +++ b/src/vs/workbench/contrib/debug/common/debugSource.ts @@ -13,6 +13,7 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/ import { Schemas } from 'vs/base/common/network'; import { isUri } from 'vs/workbench/contrib/debug/common/debugUtils'; import { ITextEditor } from 'vs/workbench/common/editor'; +import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; export const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source"); @@ -101,7 +102,7 @@ export class Source { preserveFocus, selection, revealIfOpened: true, - revealInCenterIfOutsideViewport: true, + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport, pinned: pinned || (!preserveFocus && !this.inMemory) } }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP); diff --git a/src/vs/workbench/contrib/outline/browser/outlinePane.ts b/src/vs/workbench/contrib/outline/browser/outlinePane.ts index a3ff12fa450..d453097768d 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePane.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePane.ts @@ -27,7 +27,7 @@ import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IResourceInput } from 'vs/platform/editor/common/editor'; +import { IResourceInput, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { WorkbenchDataTree } from 'vs/platform/list/browser/listService'; @@ -630,7 +630,7 @@ export class OutlinePane extends ViewPane { options: { preserveFocus: !focus, selection: Range.collapseToStart(element.symbol.selectionRange), - revealAtDefinition: true, + selectionRevealType: TextEditorSelectionRevealType.Definition, } } as IResourceInput, aside ? SIDE_GROUP : ACTIVE_GROUP); } diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 5af9dc00800..65fcf406eaa 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -76,7 +76,7 @@ import { format } from 'vs/base/common/jsonFormatter'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { applyEdits } from 'vs/base/common/jsonEdit'; import { ITextEditor } from 'vs/workbench/common/editor'; -import { ITextEditorSelection } from 'vs/platform/editor/common/editor'; +import { ITextEditorSelection, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { find } from 'vs/base/common/arrays'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; @@ -968,7 +968,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer pinned: false, forceReload: true, // because content might have changed selection, - revealInCenterIfOutsideViewport: !!selection + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport } }); }); diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index 34b84fcff5a..b05c5830535 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -5,7 +5,7 @@ import { URI, UriComponents } from 'vs/base/common/uri'; import { IEditor } from 'vs/editor/common/editorCommon'; -import { ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; +import { ITextEditorOptions, IResourceInput, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; import { IEditorInput, IEditor as IBaseEditor, Extensions as EditorExtensions, EditorInput, IEditorCloseEvent, IEditorInputFactoryRegistry, toResource, IEditorIdentifier, GroupIdentifier, EditorsOrder } from 'vs/workbench/common/editor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; @@ -351,7 +351,7 @@ export class HistoryService extends Disposable implements IHistoryService { const options: ITextEditorOptions = { revealIfOpened: true, // support to navigate across editor groups, selection: location.selection, - revealInCenterIfOutsideViewport: !!location.selection + selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport }; if (location.input instanceof EditorInput) { From ba25c52127e206e5936f48fb1b429f0f75da92ee Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 10:57:25 +0100 Subject: [PATCH 194/624] more git smoke test fixes --- extensions/git/src/test/smoke.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index 966448e9429..171151b9967 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -60,7 +60,7 @@ suite('git smoke test', function () { const appjs = await open('app.js'); await type(appjs, ' world'); await appjs.save(); - await eventToPromise(repository.state.onDidChange); + await repository.status(); assert.equal(repository.state.workingTreeChanges.length, 1); repository.state.workingTreeChanges.some(r => r.uri.path === appjs.uri.path && r.status === Status.MODIFIED); From 3b66dc7307835f917a7f3956c7df278b38d03698 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 11:06:21 +0100 Subject: [PATCH 195/624] better glob to catch all tests for browser and common --- test/browser/index.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index 2f954cf6839..1d423fbc893 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -55,7 +55,8 @@ const out = path.join(__dirname, `../../${outdir}`); const testModules = (async function () { - const defaultGlob = '**/test/**/{common,browser}/**/*.test.js'; + const defaultGlob = '**/*.test.js'; + const excludeGlob = '**/{node,electron-browser,electron-main}/**/*.test.js'; const pattern = argv.glob || defaultGlob return new Promise((resolve, reject) => { @@ -65,17 +66,20 @@ const testModules = (async function () { return; } - let modules = files.map(file => file.replace(/\.js$/, '')); + const modules = []; + const badFiles = []; - if (pattern !== defaultGlob) { - // defaultGlob is the biggest set of files - const len = modules.length; - modules = modules.filter(module => !minimatch(module, defaultGlob)); - if (len !== modules.length) { - console.warn(`DROPPED ${len - modules.length} files because ${pattern} is more relaxed than ${defaultGlob}`) + for (let file of files) { + if (minimatch(file, excludeGlob)) { + badFiles.push(file); + } else { + modules.push(file.replace(/\.js$/, '')); } } + if (badFiles.length > 0 && pattern !== defaultGlob) { + console.warn(`DROPPED ${badFiles.length} files because '${pattern}' includes files from invalid layers.${badFiles.map(file => `\n\t-${file}`)}`); + } resolve(modules); }); }) From 2ce6f5115e7fdb83c11e267566b60b8f1cf4ea00 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 11:11:51 +0100 Subject: [PATCH 196/624] add --debug option to run not headless --- test/browser/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/browser/index.js b/test/browser/index.js index 1d423fbc893..a89053b562c 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -19,6 +19,7 @@ const optimist = require('optimist') .describe('grep', 'only run tests matching ').alias('grep', 'g').alias('grep', 'f').string('grep') .describe('run', 'only run tests matching ').alias('run', 'glob').string('runGlob') .describe('build', 'run with build output (out-build)').boolean('build') + .describe('debug', 'do not run browsers headless').boolean('debug') .describe('browser', 'browsers in which tests should run').string('browser').default('browser', ['chromium']) .describe('reporter', 'the mocha reporter').string('reporter').default('reporter', defaultReporterName) .describe('reporter-options', 'the mocha reporter options').string('reporter-options').default('reporter-options', '') @@ -88,7 +89,7 @@ const testModules = (async function () { async function runTestsInBrowser(testModules, browserType) { - const browser = await playwright[browserType].launch(); + const browser = await playwright[browserType].launch({ headless: !Boolean(argv.debug) }); const context = await browser.newContext(); const target = url.pathToFileURL(path.join(__dirname, 'renderer.html')); From 5c26b4e4d41adaf84a4af548ec82947f97a03a8b Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 11:17:04 +0100 Subject: [PATCH 197/624] Do not expose TextEditorRevealType.AtDefinition in the API yet --- src/vs/editor/browser/controller/coreCommands.ts | 6 +----- src/vs/editor/browser/widget/codeEditorWidget.ts | 9 --------- src/vs/editor/browser/widget/diffEditorWidget.ts | 4 ---- src/vs/vscode.d.ts | 7 +------ src/vs/workbench/api/browser/mainThreadEditor.ts | 3 --- src/vs/workbench/api/common/extHost.protocol.ts | 3 +-- src/vs/workbench/api/common/extHostTypes.ts | 3 +-- 7 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/vs/editor/browser/controller/coreCommands.ts b/src/vs/editor/browser/controller/coreCommands.ts index ae8c3fe20b1..cb20bc72ea6 100644 --- a/src/vs/editor/browser/controller/coreCommands.ts +++ b/src/vs/editor/browser/controller/coreCommands.ts @@ -270,8 +270,7 @@ export namespace RevealLine_ { export const RawAtArgument = { Top: 'top', Center: 'center', - Bottom: 'bottom', - Definition: 'definition', + Bottom: 'bottom' }; } @@ -1478,9 +1477,6 @@ export namespace CoreNavigationCommands { case RevealLine_.RawAtArgument.Bottom: revealAt = VerticalRevealType.Bottom; break; - case RevealLine_.RawAtArgument.Definition: - revealAt = VerticalRevealType.Definition; - break; default: break; } diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 3c773347e6c..e291fe7de5b 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -765,15 +765,6 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } - public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this._revealRange( - range, - VerticalRevealType.Definition, - true, - scrollType - ); - } - private _revealRange(range: IRange, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void { if (!Range.isIRange(range)) { throw new Error('Invalid arguments'); diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index fd57746dfb4..03e90e73129 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -839,10 +839,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealRangeAtTop(range, scrollType); } - public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this.modifiedEditor.revealRangeNearTop(range, scrollType); - } - public getSupportedActions(): editorCommon.IEditorAction[] { return this.modifiedEditor.getSupportedActions(); } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index f081afcf09a..69c26fba1ed 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -710,12 +710,7 @@ declare module 'vscode' { /** * The range will always be revealed at the top of the viewport. */ - AtTop = 3, - /** - * The range will always be revealed close to the top of the viewport, - * optimized for viewing a code definition. - */ - AtDefinition = 4, + AtTop = 3 } /** diff --git a/src/vs/workbench/api/browser/mainThreadEditor.ts b/src/vs/workbench/api/browser/mainThreadEditor.ts index d5ccfa6eee5..4de14d85d61 100644 --- a/src/vs/workbench/api/browser/mainThreadEditor.ts +++ b/src/vs/workbench/api/browser/mainThreadEditor.ts @@ -400,9 +400,6 @@ export class MainThreadTextEditor { case TextEditorRevealType.AtTop: this._codeEditor.revealRangeAtTop(range, ScrollType.Smooth); break; - case TextEditorRevealType.AtDefinition: - this._codeEditor.revealRangeAtDefinition(range, ScrollType.Smooth); - break; default: console.warn(`Unknown revealType: ${revealType}`); break; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 8240275b69c..40bb47aef3b 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -224,8 +224,7 @@ export enum TextEditorRevealType { Default = 0, InCenter = 1, InCenterIfOutsideViewport = 2, - AtTop = 3, - AtDefinition = 4, + AtTop = 3 } export interface IUndoStopOptions { diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index b665a8f4d7d..f9f9de26758 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1452,8 +1452,7 @@ export enum TextEditorRevealType { Default = 0, InCenter = 1, InCenterIfOutsideViewport = 2, - AtTop = 3, - AtDefinition = 4, + AtTop = 3 } export enum TextEditorSelectionChangeKind { From 2095810809a504995bd932ff3330d77ef7e28682 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 11:18:53 +0100 Subject: [PATCH 198/624] layers check - make sure to test editor contrib as well --- build/lib/eslint/vscode-dts-event-naming.js | 6 +++--- build/lib/extensions.js | 2 +- build/lib/layersChecker.js | 9 +++++++++ build/lib/layersChecker.ts | 10 ++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/build/lib/eslint/vscode-dts-event-naming.js b/build/lib/eslint/vscode-dts-event-naming.js index c93c1818305..1e6bc422119 100644 --- a/build/lib/eslint/vscode-dts-event-naming.js +++ b/build/lib/eslint/vscode-dts-event-naming.js @@ -25,13 +25,13 @@ module.exports = new (_a = class ApiEventNaming { const verbs = new Set(config.verbs); return { ['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node) => { - var _a, _b; + var _a, _b, _c, _d, _e; const def = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent; let ident; - if ((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { + if (((_c = def) === null || _c === void 0 ? void 0 : _c.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { ident = def; } - else if (((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || (def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + else if ((((_d = def) === null || _d === void 0 ? void 0 : _d.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || ((_e = def) === null || _e === void 0 ? void 0 : _e.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { ident = def.key; } if (!ident) { diff --git a/build/lib/extensions.js b/build/lib/extensions.js index e45b0d4e35a..0cec11f997a 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -188,7 +188,7 @@ const excludedExtensions = [ 'ms.vscode.js-debug-nightly' ]; const builtInExtensions = require('../builtInExtensions.json') - .filter(({ forQualities }) => { var _a; return !product.quality || ((_a = forQualities === null || forQualities === void 0 ? void 0 : forQualities.includes) === null || _a === void 0 ? void 0 : _a.call(forQualities, product.quality)) !== false; }); + .filter(({ forQualities }) => { var _a, _b, _c; return !product.quality || ((_c = (_a = forQualities) === null || _a === void 0 ? void 0 : (_b = _a).includes) === null || _c === void 0 ? void 0 : _c.call(_b, product.quality)) !== false; }); function packageLocalExtensionsStream() { const localExtensionDescriptions = glob.sync('extensions/*/package.json') .map(manifestPath => { diff --git a/build/lib/layersChecker.js b/build/lib/layersChecker.js index 8f77ed81458..663769dacea 100644 --- a/build/lib/layersChecker.js +++ b/build/lib/layersChecker.js @@ -38,6 +38,7 @@ const CORE_TYPES = [ 'group', 'groupEnd', 'table', + 'assert', 'Error', 'String', 'throws', @@ -102,6 +103,14 @@ const RULES = [ '@types/node' // no node.js ] }, + // Browser (editor contrib) + { + target: '**/src/vs/editor/contrib/**', + allowedTypes: CORE_TYPES, + disallowedDefinitions: [ + '@types/node' // no node.js + ] + }, // node.js { target: '**/vs/**/node/**', diff --git a/build/lib/layersChecker.ts b/build/lib/layersChecker.ts index 787ddf967ce..0dcedb8d4e3 100644 --- a/build/lib/layersChecker.ts +++ b/build/lib/layersChecker.ts @@ -39,6 +39,7 @@ const CORE_TYPES = [ 'group', 'groupEnd', 'table', + 'assert', 'Error', 'String', 'throws', @@ -112,6 +113,15 @@ const RULES = [ ] }, + // Browser (editor contrib) + { + target: '**/src/vs/editor/contrib/**', + allowedTypes: CORE_TYPES, + disallowedDefinitions: [ + '@types/node' // no node.js + ] + }, + // node.js { target: '**/vs/**/node/**', From 453e0423bf7b60ae7a7583fb02c878a187f1e94f Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 11:29:08 +0100 Subject: [PATCH 199/624] build leftover --- build/lib/extensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lib/extensions.js b/build/lib/extensions.js index 0cec11f997a..e45b0d4e35a 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -188,7 +188,7 @@ const excludedExtensions = [ 'ms.vscode.js-debug-nightly' ]; const builtInExtensions = require('../builtInExtensions.json') - .filter(({ forQualities }) => { var _a, _b, _c; return !product.quality || ((_c = (_a = forQualities) === null || _a === void 0 ? void 0 : (_b = _a).includes) === null || _c === void 0 ? void 0 : _c.call(_b, product.quality)) !== false; }); + .filter(({ forQualities }) => { var _a; return !product.quality || ((_a = forQualities === null || forQualities === void 0 ? void 0 : forQualities.includes) === null || _a === void 0 ? void 0 : _a.call(forQualities, product.quality)) !== false; }); function packageLocalExtensionsStream() { const localExtensionDescriptions = glob.sync('extensions/*/package.json') .map(manifestPath => { From c4622ac41a1ff51535c7e980c342e0b42603a9b5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 11:29:30 +0100 Subject: [PATCH 200/624] build leftover --- build/lib/eslint/vscode-dts-event-naming.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lib/eslint/vscode-dts-event-naming.js b/build/lib/eslint/vscode-dts-event-naming.js index 1e6bc422119..c93c1818305 100644 --- a/build/lib/eslint/vscode-dts-event-naming.js +++ b/build/lib/eslint/vscode-dts-event-naming.js @@ -25,13 +25,13 @@ module.exports = new (_a = class ApiEventNaming { const verbs = new Set(config.verbs); return { ['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node) => { - var _a, _b, _c, _d, _e; + var _a, _b; const def = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent; let ident; - if (((_c = def) === null || _c === void 0 ? void 0 : _c.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { + if ((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { ident = def; } - else if ((((_d = def) === null || _d === void 0 ? void 0 : _d.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || ((_e = def) === null || _e === void 0 ? void 0 : _e.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + else if (((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || (def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { ident = def.key; } if (!ident) { From e2fbad5a2c25e3301c3a76706e4165345e45ca4d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 11:31:19 +0100 Subject: [PATCH 201/624] vscode.workspace.fs.readDirectory() reports symlinks to sockets incorrectly. (fix #90032) --- src/vs/platform/files/node/diskFileSystemProvider.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index 08b595a6bd4..9cc6dff8ed3 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -116,11 +116,12 @@ export class DiskFileSystemProvider extends Disposable implements } private toType(entry: Stats | Dirent, isSymbolicLink = entry.isSymbolicLink()): FileType { + let type = entry.isFile() ? FileType.File : entry.isDirectory() ? FileType.Directory : FileType.Unknown; if (isSymbolicLink) { - return FileType.SymbolicLink | (entry.isDirectory() ? FileType.Directory : FileType.File); + type |= FileType.SymbolicLink; } - return entry.isFile() ? FileType.File : entry.isDirectory() ? FileType.Directory : FileType.Unknown; + return type; } //#endregion From c739b34b502cb25bd9c0a46d7cd6653ebaf0b2f5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 11:41:46 +0100 Subject: [PATCH 202/624] vscode.workspace.fs.readDirectory() ignores broken symlinks. (fix #90031) --- .../platform/files/node/diskFileSystemProvider.ts | 13 ++++++++++++- .../files/test/node/diskFileService.test.ts | 10 ++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index 9cc6dff8ed3..bccd1c8d1b0 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -98,7 +98,18 @@ export class DiskFileSystemProvider extends Disposable implements try { let type: FileType; if (child.isSymbolicLink()) { - type = (await this.stat(joinPath(resource, child.name))).type; // always resolve target the link points to if any + try { + type = (await this.stat(joinPath(resource, child.name))).type; // always resolve target the link points to if any + } catch (error) { + if (error.code !== FileSystemProviderErrorCode.FileNotFound) { + throw error; // any error that is not file not found is unexpected + } + + // a symbolic link can point to a target that does + // not exist on the file system. in that case we + // still want to return the element as UNKNOWN. + type = FileType.SymbolicLink | FileType.Unknown; + } } else { type = this.toType(child); } diff --git a/src/vs/platform/files/test/node/diskFileService.test.ts b/src/vs/platform/files/test/node/diskFileService.test.ts index 8c3ae0bef46..c58e7045e14 100644 --- a/src/vs/platform/files/test/node/diskFileService.test.ts +++ b/src/vs/platform/files/test/node/diskFileService.test.ts @@ -440,7 +440,7 @@ suite('Disk File Service', function () { assert.equal(resolved.isSymbolicLink, true); }); - test('resolve - invalid symbolic link does not break', async () => { + test('resolve - symbolic link pointing to non-existing file does not break', async () => { if (isWindows) { return; // not reliable on windows } @@ -450,7 +450,13 @@ suite('Disk File Service', function () { const resolved = await service.resolve(URI.file(testDir)); assert.equal(resolved.isDirectory, true); - assert.equal(resolved.children!.length, 8); + assert.equal(resolved.children!.length, 9); + + const resolvedLink = resolved.children?.filter(child => child.name === 'bar' && child.isSymbolicLink)[0]; + assert.ok(resolvedLink); + + assert.ok(!resolvedLink?.isDirectory); + assert.ok(!resolvedLink?.isFile); }); test('deleteFile', async () => { From 7ed993013698c44f1c159eae3b8bc1642d7bc13f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 11:42:33 +0100 Subject: [PATCH 203/624] :lipstick: --- extensions/git/src/test/smoke.test.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index 171151b9967..ce99e15cfe2 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -14,19 +14,27 @@ import { eventToPromise } from '../util'; suite('git smoke test', function () { const cwd = fs.realpathSync(workspace.workspaceFolders![0].uri.fsPath); - const file = (relativePath: string) => path.join(cwd, relativePath); - const uri = (relativePath: string) => Uri.file(file(relativePath)); - const open = async (relativePath: string) => { + + function file(relativePath: string) { + return path.join(cwd, relativePath); + } + + function uri(relativePath: string) { + return Uri.file(file(relativePath)); + } + + async function open(relativePath: string) { const doc = await workspace.openTextDocument(uri(relativePath)); await window.showTextDocument(doc); return doc; - }; - const type = async (doc: TextDocument, text: string) => { + } + + async function type(doc: TextDocument, text: string) { const edit = new WorkspaceEdit(); const end = doc.lineAt(doc.lineCount - 1).range.end; edit.replace(doc.uri, new Range(end, end), text); await workspace.applyEdit(edit); - }; + } let git: API; let repository: Repository; From c47f30e7c09819eb41a85ded52ea373367582c23 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 11:45:51 +0100 Subject: [PATCH 204/624] debug integration tests: remove flaky part of test that requires window focus --- .../src/singlefolder-tests/debug.test.ts | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts index ed8f4555cc3..e55c3e3d2a5 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { debug, workspace, commands, window, Disposable } from 'vscode'; import { basename } from 'path'; -import { disposeAll, createRandomFile } from '../utils'; +import { disposeAll } from '../utils'; suite('Debug', function () { @@ -14,13 +14,9 @@ suite('Debug', function () { assert.equal(debug.breakpoints.length, 0); let onDidChangeBreakpointsCounter = 0; const toDispose: Disposable[] = []; - let onBreakpointsChange: () => void; toDispose.push(debug.onDidChangeBreakpoints(() => { onDidChangeBreakpointsCounter++; - if (onBreakpointsChange) { - onBreakpointsChange(); - } })); debug.addBreakpoints([{ id: '1', enabled: true }, { id: '2', enabled: false, condition: '2 < 5' }]); @@ -38,21 +34,6 @@ suite('Debug', function () { assert.equal(onDidChangeBreakpointsCounter, 3); assert.equal(debug.breakpoints.length, 0); - const file = await createRandomFile('let i = 5;', undefined, '.js'); - const doc = await workspace.openTextDocument(file); - await window.showTextDocument(doc, undefined, false); - const breakpointsChanged = new Promise(resolve => onBreakpointsChange = resolve); - await commands.executeCommand('editor.debug.action.toggleBreakpoint'); - await breakpointsChanged; - assert.equal(debug.breakpoints.length, 1); - assert.equal(debug.breakpoints[0].enabled, true); - - await window.showTextDocument(doc, undefined, false); - const breakpointsChangedSecond = new Promise(resolve => onBreakpointsChange = resolve); - await commands.executeCommand('editor.debug.action.toggleBreakpoint'); - await breakpointsChangedSecond; - assert.equal(debug.breakpoints.length, 0); - disposeAll(toDispose); }); From e584763f2a1a72d256678f080e2ea74f48b4ddc4 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 11:53:30 +0100 Subject: [PATCH 205/624] browser tests support reporter-options --- test/browser/index.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index a89053b562c..19471196973 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -29,26 +29,31 @@ const optimist = require('optimist') // logic const argv = optimist.argv; -const Reporter = (function () { +const withReporter = (function () { const reporterPath = path.join(path.dirname(require.resolve('mocha')), 'lib', 'reporters', argv.reporter); - let Reporter; + let ctor; try { - Reporter = require(reporterPath); + ctor = require(reporterPath); } catch (err) { try { - Reporter = require(argv.reporter); + ctor = require(argv.reporter); } catch (err) { - Reporter = process.platform === 'win32' ? mocha.reporters.List : mocha.reporters.Spec; - console.warn(`could not load reporter: ${argv.reporter}, using ${Reporter.name}`); + ctor = process.platform === 'win32' ? mocha.reporters.List : mocha.reporters.Spec; + console.warn(`could not load reporter: ${argv.reporter}, using ${ctor.name}`); } } - // let reporterOptions = argv['reporter-options']; - // reporterOptions = typeof reporterOptions === 'string' ? [reporterOptions] : reporterOptions; - // reporterOptions = reporterOptions.reduce((r, o) => Object.assign(r, parseReporterOption(o)), {}); + function parseReporterOption(value) { + let r = /^([^=]+)=(.*)$/.exec(value); + return r ? { [r[1]]: r[2] } : {}; + } - return Reporter + let reporterOptions = argv['reporter-options']; + reporterOptions = typeof reporterOptions === 'string' ? [reporterOptions] : reporterOptions; + reporterOptions = reporterOptions.reduce((r, o) => Object.assign(r, parseReporterOption(o)), {}); + + return (runner) => new ctor(runner, { reporterOptions }) })() const outdir = argv.build ? 'out-build' : 'out'; @@ -104,7 +109,7 @@ async function runTestsInBrowser(testModules, browserType) { console[msg.type()](msg.text(), await Promise.all(msg.args().map(async arg => await arg.jsonValue()))); }); - new Reporter(new EchoRunner(emitter, browserType.toUpperCase())); + withReporter(new EchoRunner(emitter, browserType.toUpperCase())); try { // @ts-ignore From 632939e15963cd0c2d745ba4c5626dda28be4a62 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 12:10:02 +0100 Subject: [PATCH 206/624] update assert.js-copy --- test/assert.js | 96 +++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 51 deletions(-) diff --git a/test/assert.js b/test/assert.js index 94971d6b49b..228016e796c 100644 --- a/test/assert.js +++ b/test/assert.js @@ -273,25 +273,24 @@ assert.notEqual = function notEqual(actual, expected, message) { // assert.deepEqual(actual, expected, message_opt); assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { + if (!_deepEqual(actual, expected, false)) { fail(actual, expected, message, 'deepEqual', assert.deepEqual); } }; -function _deepEqual(actual, expected) { +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict) { // 7.1. All identical values are equivalent, as determined by ===. if (actual === expected) { return true; + // } else if (actual instanceof Buffer && expected instanceof Buffer) { + // return compare(actual, expected) === 0; - // } else if (util.isBuffer(actual) && util.isBuffer(expected)) { - // if (actual.length != expected.length) return false; - // - // for (var i = 0; i < actual.length; i++) { - // if (actual[i] !== expected[i]) return false; - // } - // - // return true; - // // 7.2. If the expected value is a Date object, the actual value is // equivalent if it is also a Date object that refers to the same time. } else if (util.isDate(actual) && util.isDate(expected)) { @@ -309,8 +308,9 @@ function _deepEqual(actual, expected) { // 7.4. Other pairs that do not both pass typeof value == 'object', // equivalence is determined by ==. - } else if (!util.isObject(actual) && !util.isObject(expected)) { - return actual == expected; + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; // 7.5 For all other Object pairs, including Array objects, equivalence is // determined by having the same number of owned properties (as verified @@ -319,32 +319,22 @@ function _deepEqual(actual, expected) { // corresponding key, and an identical 'prototype' property. Note: this // accounts for both named and indexed properties on Arrays. } else { - return objEquiv(actual, expected); + return objEquiv(actual, expected, strict); } } -var isArguments = function(object) { +function isArguments(object) { return Object.prototype.toString.call(object) == '[object Arguments]'; -}; +} -(function() { - if (!isArguments(arguments)) { - isArguments = function(object) { - return object != null && - typeof object === 'object' && - typeof object.callee === 'function' && - typeof object.length === 'number' || false; - }; - } -})(); - -function objEquiv(a, b) { - if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) +function objEquiv(a, b, strict) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. var aIsArgs = isArguments(a), bIsArgs = isArguments(b); if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) @@ -352,32 +342,28 @@ function objEquiv(a, b) { if (aIsArgs) { a = pSlice.call(a); b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = Object_keys(a), - kb = Object_keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; + return _deepEqual(a, b, strict); } + var ka = Object.keys(a), + kb = Object.keys(b), + key, i; // having the same number of owned properties (keys incorporates // hasOwnProperty) - if (ka.length != kb.length) + if (ka.length !== kb.length) return false; //the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); //~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) + if (ka[i] !== kb[i]) return false; } //equivalent values for every corresponding key, and //~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; + if (!_deepEqual(a[key], b[key], strict)) return false; } return true; } @@ -386,11 +372,19 @@ function objEquiv(a, b) { // assert.notDeepEqual(actual, expected, message_opt); assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { + if (_deepEqual(actual, expected, false)) { fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); } }; +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} + + // 9. The strict equality assertion tests strict equality, as determined by ===. // assert.strictEqual(actual, expected, message_opt); @@ -428,7 +422,11 @@ function expectedException(actual, expected) { function _throws(shouldThrow, block, expected, message) { var actual; - if (util.isString(expected)) { + if (typeof block !== 'function') { + throw new TypeError('block must be a function'); + } + + if (typeof expected === 'string') { message = expected; expected = null; } @@ -468,10 +466,6 @@ assert.doesNotThrow = function(block, /*optional*/message) { _throws.apply(this, [false].concat(pSlice.call(arguments))); }; -// VSCODE-CHANGE, todo@joh this isn't correct!! -assert.deepStrictEqual = assert.deepEqual; - -assert.ifError = function (err) { if (err) { throw err; } }; - +assert.ifError = function(err) { if (err) {throw err;}}; return assert; }); From 1433463ca2083b66612183e2a179383c3222dd89 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 12:09:40 +0100 Subject: [PATCH 207/624] debug: minor refactoring when sending breakpoints --- .../contrib/debug/browser/debugService.ts | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index 277c7ea8004..d84f499b404 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -883,44 +883,36 @@ export class DebugService implements IDebugService { await this.sendExceptionBreakpoints(session); } - private sendBreakpoints(modelUri: uri, sourceModified = false, session?: IDebugSession): Promise { + private async sendBreakpoints(modelUri: uri, sourceModified = false, session?: IDebugSession): Promise { const breakpointsToSend = this.model.getBreakpoints({ uri: modelUri, enabledOnly: true }); - return this.sendToOneOrAllSessions(session, s => - s.sendBreakpoints(modelUri, breakpointsToSend, sourceModified) - ); + await sendToOneOrAllSessions(this.model, session, s => s.sendBreakpoints(modelUri, breakpointsToSend, sourceModified)); } - private sendFunctionBreakpoints(session?: IDebugSession): Promise { + private async sendFunctionBreakpoints(session?: IDebugSession): Promise { const breakpointsToSend = this.model.getFunctionBreakpoints().filter(fbp => fbp.enabled && this.model.areBreakpointsActivated()); - return this.sendToOneOrAllSessions(session, s => { - return s.capabilities.supportsFunctionBreakpoints ? s.sendFunctionBreakpoints(breakpointsToSend) : Promise.resolve(undefined); + await sendToOneOrAllSessions(this.model, session, async s => { + if (s.capabilities.supportsFunctionBreakpoints) { + await s.sendFunctionBreakpoints(breakpointsToSend); + } }); } private sendDataBreakpoints(session?: IDebugSession): Promise { const breakpointsToSend = this.model.getDataBreakpoints().filter(fbp => fbp.enabled && this.model.areBreakpointsActivated()); - return this.sendToOneOrAllSessions(session, s => { - return s.capabilities.supportsDataBreakpoints ? s.sendDataBreakpoints(breakpointsToSend) : Promise.resolve(undefined); + return sendToOneOrAllSessions(this.model, session, async s => { + if (s.capabilities.supportsDataBreakpoints) { + await s.sendDataBreakpoints(breakpointsToSend); + } }); } private sendExceptionBreakpoints(session?: IDebugSession): Promise { const enabledExceptionBps = this.model.getExceptionBreakpoints().filter(exb => exb.enabled); - return this.sendToOneOrAllSessions(session, s => { - return s.sendExceptionBreakpoints(enabledExceptionBps); - }); - } - - private async sendToOneOrAllSessions(session: IDebugSession | undefined, send: (session: IDebugSession) => Promise): Promise { - if (session) { - await send(session); - } else { - await Promise.all(this.model.getSessions().map(s => send(s))); - } + return sendToOneOrAllSessions(this.model, session, s => s.sendExceptionBreakpoints(enabledExceptionBps)); } private onFileChanges(fileChangesEvent: FileChangesEvent): void { @@ -1134,3 +1126,11 @@ export function getStackFrameThreadAndSessionToFocus(model: IDebugModel, stackFr return { session, thread, stackFrame }; } + +async function sendToOneOrAllSessions(model: DebugModel, session: IDebugSession | undefined, send: (session: IDebugSession) => Promise): Promise { + if (session) { + await send(session); + } else { + await Promise.all(model.getSessions().map(s => send(s))); + } +} From 51bccba93fa4fd7363dc921706ace3b94532c8d8 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 12:12:41 +0100 Subject: [PATCH 208/624] debug: move ansi handling to electron/browser #90063 --- .../test/{browser => electron-browser}/debugANSIHandling.test.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/vs/workbench/contrib/debug/test/{browser => electron-browser}/debugANSIHandling.test.ts (100%) diff --git a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts similarity index 100% rename from src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts rename to src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts From 27d43269707365cdda9714e753fcd6cdf1b2270a Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 5 Feb 2020 12:17:27 +0100 Subject: [PATCH 209/624] Don't allow addtional properties in tasks runOptions --- src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts index 1fcd569b476..840cfc8e52e 100644 --- a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts +++ b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts @@ -316,6 +316,7 @@ const identifier: IJSONSchema = { const runOptions: IJSONSchema = { type: 'object', + additionalProperties: false, properties: { reevaluateOnRerun: { type: 'boolean', From 8aa95e5d17fbc4ce15a30a8376886a1e91f15dcb Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 12:18:26 +0100 Subject: [PATCH 210/624] perf: prevent update service from running before first window open --- src/vs/code/electron-main/app.ts | 11 ++++++++--- .../update/electron-main/abstractUpdateService.ts | 12 ++++++++++-- .../update/electron-main/updateService.darwin.ts | 4 ++++ .../update/electron-main/updateService.win32.ts | 6 +++++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 712d6f05c5b..06eaf83961a 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -391,7 +391,7 @@ export class CodeApplication extends Disposable { const windows = appInstantiationService.invokeFunction(accessor => this.openFirstWindow(accessor, electronIpcServer, sharedProcessClient)); // Post Open Windows Tasks - this.afterWindowOpen(); + appInstantiationService.invokeFunction(this.afterWindowOpen.bind(this)); // Tracing: Stop tracing after windows are ready if enabled if (this.environmentService.args.trace) { @@ -708,13 +708,18 @@ export class CodeApplication extends Disposable { return { fileUri: URI.file(path) }; } - private afterWindowOpen(): void { - + private afterWindowOpen(accessor: ServicesAccessor): void { // Signal phase: after window open this.lifecycleMainService.phase = LifecycleMainPhase.AfterWindowOpen; // Remote Authorities this.handleRemoteAuthorities(); + + // Initialize update service + const updateService = accessor.get(IUpdateService); + if (updateService instanceof Win32UpdateService || updateService instanceof LinuxUpdateService || updateService instanceof DarwinUpdateService) { + updateService.initialize(); + } } private handleRemoteAuthorities(): void { diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index d8bf464fed9..380f553f5d8 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -26,7 +26,7 @@ export abstract class AbstractUpdateService implements IUpdateService { _serviceBrand: undefined; - protected readonly url: string | undefined; + protected url: string | undefined; private _state: State = State.Uninitialized; @@ -49,7 +49,14 @@ export abstract class AbstractUpdateService implements IUpdateService { @IEnvironmentService private readonly environmentService: IEnvironmentService, @IRequestService protected requestService: IRequestService, @ILogService protected logService: ILogService, - ) { + ) { } + + /** + * This must be called before any other call. This is a performance + * optimization, to avoid using extra CPU cycles before first window open. + * https://github.com/microsoft/vscode/issues/89784 + */ + initialize(): void { if (!this.environmentService.isBuilt) { return; // updates are never enabled when running out of sources } @@ -173,6 +180,7 @@ export abstract class AbstractUpdateService implements IUpdateService { if (!this.url) { return Promise.resolve(undefined); } + return this.requestService.request({ url: this.url }, CancellationToken.None).then(context => { // The update server replies with 204 (No Content) when no // update is available - that's all we want to know. diff --git a/src/vs/platform/update/electron-main/updateService.darwin.ts b/src/vs/platform/update/electron-main/updateService.darwin.ts index d25c577b66e..c3f9210c24e 100644 --- a/src/vs/platform/update/electron-main/updateService.darwin.ts +++ b/src/vs/platform/update/electron-main/updateService.darwin.ts @@ -36,6 +36,10 @@ export class DarwinUpdateService extends AbstractUpdateService { @ILogService logService: ILogService ) { super(lifecycleMainService, configurationService, environmentService, requestService, logService); + } + + initialize(): void { + super.initialize(); this.onRawError(this.onError, this, this.disposables); this.onRawUpdateAvailable(this.onUpdateAvailable, this, this.disposables); this.onRawUpdateDownloaded(this.onUpdateDownloaded, this, this.disposables); diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index 8f87787b9e7..7c7948d79b5 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -69,6 +69,10 @@ export class Win32UpdateService extends AbstractUpdateService { @IFileService private readonly fileService: IFileService ) { super(lifecycleMainService, configurationService, environmentService, requestService, logService); + } + + initialize(): void { + super.initialize(); if (getUpdateType() === UpdateType.Setup) { /* __GDPR__ @@ -81,7 +85,7 @@ export class Win32UpdateService extends AbstractUpdateService { "target" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ - telemetryService.publicLog('update:win32SetupTarget', { target: product.target }); + this.telemetryService.publicLog('update:win32SetupTarget', { target: product.target }); } } From 57e3d67a0a453b9e8670bff1f557fe1962a4b693 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 5 Feb 2020 12:27:53 +0100 Subject: [PATCH 211/624] Use _sanitizeCwd instead --- .../contrib/terminal/common/terminalEnvironment.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index 8ae397f46e5..74424a6aa6a 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -11,7 +11,6 @@ import { IShellLaunchConfig, ITerminalEnvironment } from 'vs/workbench/contrib/t import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { sanitizeProcessEnvironment } from 'vs/base/common/processes'; import { ILogService } from 'vs/platform/log/common/log'; -import { originalFSPath } from 'vs/base/common/resources'; /** * This module contains utility functions related to the environment, cwd and paths. @@ -185,9 +184,9 @@ export function getCwd( logService?: ILogService ): string { if (shell.cwd) { - const unresolved = (typeof shell.cwd === 'object') ? originalFSPath(shell.cwd) : shell.cwd; + const unresolved = (typeof shell.cwd === 'object') ? shell.cwd.fsPath : shell.cwd; const resolved = _resolveCwd(unresolved, lastActiveWorkspace, configurationResolverService); - return resolved || unresolved; + return _sanitizeCwd(resolved || unresolved); } let cwd: string | undefined; @@ -200,14 +199,14 @@ export function getCwd( if (path.isAbsolute(customCwd)) { cwd = customCwd; } else if (root) { - cwd = path.join(originalFSPath(root), customCwd); + cwd = path.join(root.fsPath, customCwd); } } } // If there was no custom cwd or it was relative with no workspace if (!cwd) { - cwd = root ? originalFSPath(root) : userHome; + cwd = root ? root.fsPath : userHome; } return _sanitizeCwd(cwd); From 39587fe58b39cb0f08c718d5517277263e51fc7c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 12:34:07 +0100 Subject: [PATCH 212/624] Always show insert-highlight, #89413 --- src/vs/editor/common/config/editorOptions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index c66c92d66f9..4d7afb226fb 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2666,7 +2666,7 @@ class EditorSuggest extends BaseEditorOption Date: Wed, 5 Feb 2020 12:34:13 +0100 Subject: [PATCH 213/624] Simplify logic for VerticalRevealType.Definition --- .../browser/viewParts/lines/viewLines.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index 6d8cc970b7a..20ef5be0b00 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -589,21 +589,22 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, if (boxEndY - boxStartY > viewportHeight) { // the box is larger than the viewport ... scroll to its top newScrollTop = boxStartY; - } else if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport || verticalType === viewEvents.VerticalRevealType.Definition) { + } else if (verticalType === viewEvents.VerticalRevealType.Definition) { + // We want a gap that is 20% of the viewport, but with a minimum of 5 lines + const desiredGapAbove = Math.max(5 * this._lineHeight, viewportHeight * 0.2); + // Try to scroll just above the box with the desired gap + const desiredScrollTop = boxStartY - desiredGapAbove; + // But ensure that the box is not pushed out of viewport + const minScrollTop = boxEndY - viewportHeight; + newScrollTop = Math.max(minScrollTop, desiredScrollTop); + } else if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) { if (verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { // Box is already in the viewport... do nothing newScrollTop = viewportStartY; } else { // Box is outside the viewport... center it const boxMiddleY = (boxStartY + boxEndY) / 2; - let delta = viewportHeight * 0.5; - if (verticalType === viewEvents.VerticalRevealType.Definition) { - // Definition scrolls to 20% from the top of the viewport, but ensures a minimum amount of space from the top - // and never scrolls beyond the center. - const minSpace = 100; - delta = Math.min(delta, Math.max(minSpace, viewportHeight * 0.2)); - } - newScrollTop = Math.max(0, boxMiddleY - delta); + newScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2); } } else { newScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === viewEvents.VerticalRevealType.Top, verticalType === viewEvents.VerticalRevealType.Bottom); From fc6e8fdac2e6a4ffce304ec7752bc028ddae289f Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 12:40:26 +0100 Subject: [PATCH 214/624] fixes #89059 --- .../contrib/debug/browser/debugSession.ts | 3 +-- .../contrib/debug/browser/rawDebugSession.ts | 16 +++++++++++----- .../workbench/contrib/debug/common/debugUtils.ts | 2 +- .../contrib/debug/test/browser/repl.test.ts | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index a6c75b4d2ae..11c7ef8329c 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -190,7 +190,7 @@ export class DebugSession implements IDebugSession { try { const customTelemetryService = await dbgr.getCustomTelemetryService(); const debugAdapter = await dbgr.createDebugAdapter(this); - this.raw = new RawDebugSession(debugAdapter, dbgr, this.telemetryService, customTelemetryService, this.extensionHostDebugService, this.openerService); + this.raw = new RawDebugSession(debugAdapter, dbgr, this.telemetryService, customTelemetryService, this.extensionHostDebugService, this.openerService, this.notificationService); await this.raw.start(); this.registerListeners(); @@ -693,7 +693,6 @@ export class DebugSession implements IDebugSession { await this.raw.configurationDone(); } catch (e) { // Disconnect the debug session on configuration done error #10596 - this.notificationService.error(e); if (this.raw) { this.raw.disconnect(); } diff --git a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts index f7bbb068852..f751bebda62 100644 --- a/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts @@ -19,6 +19,7 @@ import { env as processEnv } from 'vs/base/common/process'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { CancellationToken } from 'vs/base/common/cancellation'; +import { INotificationService } from 'vs/platform/notification/common/notification'; /** * This interface represents a single command line argument split into a "prefix" and a "path" half. @@ -79,7 +80,8 @@ export class RawDebugSession implements IDisposable { private readonly telemetryService: ITelemetryService, public readonly customTelemetryService: ITelemetryService | undefined, private readonly extensionHostDebugService: IExtensionHostDebugService, - private readonly openerService: IOpenerService + private readonly openerService: IOpenerService, + private readonly notificationService: INotificationService ) { this.debugAdapter = debugAdapter; this._capabilities = Object.create(null); @@ -632,8 +634,8 @@ export class RawDebugSession implements IDisposable { return errors.canceled(); } - const error = errorResponse && errorResponse.body ? errorResponse.body.error : null; - const errorMessage = errorResponse ? errorResponse.message || '' : ''; + const error: DebugProtocol.Message | undefined = errorResponse?.body?.error; + const errorMessage = errorResponse?.message || ''; if (error && error.sendTelemetry) { const telemetryMessage = error ? formatPII(error.format, true, error.variables) : errorMessage; @@ -641,15 +643,19 @@ export class RawDebugSession implements IDisposable { } const userMessage = error ? formatPII(error.format, false, error.variables) : errorMessage; - if (error && error.url) { + const url = error?.url; + if (error && url) { const label = error.urlLabel ? error.urlLabel : nls.localize('moreInfo', "More Info"); return createErrorWithActions(userMessage, { actions: [new Action('debug.moreInfo', label, undefined, true, () => { - this.openerService.open(URI.parse(error.url)); + this.openerService.open(URI.parse(url)); return Promise.resolve(null); })] }); } + if (error && error.format && error.showUser) { + this.notificationService.error(error.format); + } return new Error(userMessage); } diff --git a/src/vs/workbench/contrib/debug/common/debugUtils.ts b/src/vs/workbench/contrib/debug/common/debugUtils.ts index 0b287f5a12c..5f7e0b2b8ae 100644 --- a/src/vs/workbench/contrib/debug/common/debugUtils.ts +++ b/src/vs/workbench/contrib/debug/common/debugUtils.ts @@ -11,7 +11,7 @@ import { deepClone } from 'vs/base/common/objects'; const _formatPIIRegexp = /{([^}]+)}/g; -export function formatPII(value: string, excludePII: boolean, args: { [key: string]: string }): string { +export function formatPII(value: string, excludePII: boolean, args: { [key: string]: string } | undefined): string { return value.replace(_formatPIIRegexp, function (match, group) { if (excludePII && group.length > 0 && group[0] !== '_') { return match; diff --git a/src/vs/workbench/contrib/debug/test/browser/repl.test.ts b/src/vs/workbench/contrib/debug/test/browser/repl.test.ts index c155eca7669..297496be064 100644 --- a/src/vs/workbench/contrib/debug/test/browser/repl.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/repl.test.ts @@ -135,7 +135,7 @@ suite('Debug - REPL', () => { model.addSession(session); const adapter = new MockDebugAdapter(); - const raw = new RawDebugSession(adapter, undefined!, undefined!, undefined!, undefined!, undefined!); + const raw = new RawDebugSession(adapter, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!); session.initializeForTest(raw); await session.addReplExpression(undefined, 'before.1'); From 361a8c77f59186d3bbb3dcf88d1840720fa8af9c Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 12:44:26 +0100 Subject: [PATCH 215/624] Rename reveal type to match its behavior more --- .../editor/browser/viewParts/lines/viewLines.ts | 2 +- src/vs/editor/browser/widget/codeEditorWidget.ts | 16 ++++++++-------- src/vs/editor/browser/widget/diffEditorWidget.ts | 16 ++++++++-------- src/vs/editor/common/editorCommon.ts | 8 ++++---- src/vs/editor/common/view/viewEvents.ts | 2 +- src/vs/monaco.d.ts | 8 ++++---- src/vs/platform/editor/common/editor.ts | 2 +- src/vs/workbench/common/editor.ts | 4 ++-- .../contrib/outline/browser/outlinePane.ts | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index 20ef5be0b00..8df47a030f8 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -589,7 +589,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, if (boxEndY - boxStartY > viewportHeight) { // the box is larger than the viewport ... scroll to its top newScrollTop = boxStartY; - } else if (verticalType === viewEvents.VerticalRevealType.Definition) { + } else if (verticalType === viewEvents.VerticalRevealType.NearTop) { // We want a gap that is 20% of the viewport, but with a minimum of 5 lines const desiredGapAbove = Math.max(5 * this._lineHeight, viewportHeight * 0.2); // Try to scroll just above the box with the desired gap diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index e291fe7de5b..793ebe48c2e 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -557,8 +557,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE this._revealLine(lineNumber, VerticalRevealType.CenterIfOutsideViewport, scrollType); } - public revealLineAtDefinition(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this._revealLine(lineNumber, VerticalRevealType.Definition, scrollType); + public revealLineNearTop(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this._revealLine(lineNumber, VerticalRevealType.NearTop, scrollType); } private _revealLine(lineNumber: number, revealType: VerticalRevealType, scrollType: editorCommon.ScrollType): void { @@ -601,10 +601,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } - public revealPositionAtDefinition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + public revealPositionNearTop(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this._revealPosition( position, - VerticalRevealType.Definition, + VerticalRevealType.NearTop, true, scrollType ); @@ -698,11 +698,11 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } - public revealLinesAtDefinition(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + public revealLinesNearTop(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this._revealLines( startLineNumber, endLineNumber, - VerticalRevealType.Definition, + VerticalRevealType.NearTop, scrollType ); } @@ -747,10 +747,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE ); } - public revealRangeAtDefinition(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { this._revealRange( range, - VerticalRevealType.Definition, + VerticalRevealType.NearTop, true, scrollType ); diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 03e90e73129..ffbe2519541 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -763,8 +763,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealLineInCenterIfOutsideViewport(lineNumber, scrollType); } - public revealLineAtDefinition(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this.modifiedEditor.revealLineAtDefinition(lineNumber, scrollType); + public revealLineNearTop(lineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealLineNearTop(lineNumber, scrollType); } public revealPosition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { @@ -779,8 +779,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealPositionInCenterIfOutsideViewport(position, scrollType); } - public revealPositionAtDefinition(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this.modifiedEditor.revealPositionAtDefinition(position, scrollType); + public revealPositionNearTop(position: IPosition, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealPositionNearTop(position, scrollType); } public getSelection(): Selection | null { @@ -815,8 +815,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType); } - public revealLinesAtDefinition(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this.modifiedEditor.revealLinesAtDefinition(startLineNumber, endLineNumber, scrollType); + public revealLinesNearTop(startLineNumber: number, endLineNumber: number, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealLinesNearTop(startLineNumber, endLineNumber, scrollType); } public revealRange(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth, revealVerticalInCenter: boolean = false, revealHorizontal: boolean = true): void { @@ -831,8 +831,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this.modifiedEditor.revealRangeInCenterIfOutsideViewport(range, scrollType); } - public revealRangeAtDefinition(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { - this.modifiedEditor.revealRangeAtDefinition(range, scrollType); + public revealRangeNearTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { + this.modifiedEditor.revealRangeNearTop(range, scrollType); } public revealRangeAtTop(range: IRange, scrollType: editorCommon.ScrollType = editorCommon.ScrollType.Smooth): void { diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 93c19c9379c..426b028ed3d 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -359,7 +359,7 @@ export interface IEditor { * Scroll vertically as necessary and reveal a line close to the top of the viewport, * optimized for viewing a code definition. */ - revealLineAtDefinition(lineNumber: number, scrollType?: ScrollType): void; + revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a position. @@ -380,7 +380,7 @@ export interface IEditor { * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, * optimized for viewing a code definition. */ - revealPositionAtDefinition(position: IPosition, scrollType?: ScrollType): void; + revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void; /** * Returns the primary selection of the editor. @@ -438,7 +438,7 @@ export interface IEditor { * Scroll vertically as necessary and reveal lines close to the top of the viewport, * optimized for viewing a code definition. */ - revealLinesAtDefinition(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a range. @@ -464,7 +464,7 @@ export interface IEditor { * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, * optimized for viewing a code definition. */ - revealRangeAtDefinition(range: IRange, scrollType?: ScrollType): void; + revealRangeNearTop(range: IRange, scrollType?: ScrollType): void; /** * Directly trigger a handler or an editor action. diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts index 8850657b687..1d9290b5e76 100644 --- a/src/vs/editor/common/view/viewEvents.ts +++ b/src/vs/editor/common/view/viewEvents.ts @@ -184,7 +184,7 @@ export const enum VerticalRevealType { CenterIfOutsideViewport = 2, Top = 3, Bottom = 4, - Definition = 5, + NearTop = 5, } export class ViewRevealRangeRequestEvent { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 3e480beee35..32e1852b2fb 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2175,7 +2175,7 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal a line close to the top of the viewport, * optimized for viewing a code definition. */ - revealLineAtDefinition(lineNumber: number, scrollType?: ScrollType): void; + revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a position. */ @@ -2192,7 +2192,7 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, * optimized for viewing a code definition. */ - revealPositionAtDefinition(position: IPosition, scrollType?: ScrollType): void; + revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void; /** * Returns the primary selection of the editor. */ @@ -2242,7 +2242,7 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal lines close to the top of the viewport, * optimized for viewing a code definition. */ - revealLinesAtDefinition(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a range. */ @@ -2263,7 +2263,7 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, * optimized for viewing a code definition. */ - revealRangeAtDefinition(range: IRange, scrollType?: ScrollType): void; + revealRangeNearTop(range: IRange, scrollType?: ScrollType): void; /** * Directly trigger a handler or an editor action. * @param source The source of the call. diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index d56f9a069e2..f6018b7bd19 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -227,7 +227,7 @@ export const enum TextEditorSelectionRevealType { /** * Option to scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, but not quite at the top. */ - Definition = 2, + NearTop = 2, } export interface ITextEditorOptions extends IEditorOptions { diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 98c8d4f35d4..579b413c3a6 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -1202,8 +1202,8 @@ export class TextEditorOptions extends EditorOptions implements ITextEditorOptio editor.setSelection(range); - if (this.selectionRevealType === TextEditorSelectionRevealType.Definition) { - editor.revealRangeAtDefinition(range, scrollType); + if (this.selectionRevealType === TextEditorSelectionRevealType.NearTop) { + editor.revealRangeNearTop(range, scrollType); } else if (this.selectionRevealType === TextEditorSelectionRevealType.CenterIfOutsideViewport) { editor.revealRangeInCenterIfOutsideViewport(range, scrollType); } else { diff --git a/src/vs/workbench/contrib/outline/browser/outlinePane.ts b/src/vs/workbench/contrib/outline/browser/outlinePane.ts index d453097768d..15fe25144de 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePane.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePane.ts @@ -630,7 +630,7 @@ export class OutlinePane extends ViewPane { options: { preserveFocus: !focus, selection: Range.collapseToStart(element.symbol.selectionRange), - selectionRevealType: TextEditorSelectionRevealType.Definition, + selectionRevealType: TextEditorSelectionRevealType.NearTop, } } as IResourceInput, aside ? SIDE_GROUP : ACTIVE_GROUP); } From 154c56def8013ceadd054067d6d5470f0b0a1def Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 11:39:06 +0100 Subject: [PATCH 216/624] adopt to new multiplex channel --- src/vs/base/parts/ipc/common/ipc.ts | 27 ++++++++++--------- src/vs/base/parts/ipc/test/node/ipc.test.ts | 2 +- .../sharedProcess/sharedProcessMain.ts | 8 ++---- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index dc558a4bbc0..8dea0ab03da 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -10,6 +10,7 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cance import * as errors from 'vs/base/common/errors'; import { VSBuffer } from 'vs/base/common/buffer'; import { getRandomElement } from 'vs/base/common/arrays'; +import { isFunction } from 'vs/base/common/types'; /** * An `IChannel` is an abstraction over a collection of commands. @@ -707,24 +708,26 @@ export class IPCServer implements IChannelServer, I * be selected and when listening without a router, every client * will be listened to. */ - getChannel(channelName: string, router?: IClientRouter): T { + getChannel(channelName: string, router: IClientRouter): T; + getChannel(channelName: string, clientFilter: (client: Client) => boolean): T; + getChannel(channelName: string, routerOrClientFilter: IClientRouter | ((client: Client) => boolean)): T { const that = this; return { call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { let connectionPromise: Promise>; - if (router) { - connectionPromise = router.routeCall(that, command, arg); - } else { + if (isFunction(routerOrClientFilter)) { // when no router is provided, we go random client picking - let connection = getRandomElement(that.connections); + let connection = getRandomElement(that.connections.filter(routerOrClientFilter)); connectionPromise = connection // if we found a client, let's call on it ? Promise.resolve(connection) // else, let's wait for a client to come along - : Event.toPromise(that.onDidAddConnection); + : Event.toPromise(Event.filter(that.onDidAddConnection, routerOrClientFilter)); + } else { + connectionPromise = routerOrClientFilter.routeCall(that, command, arg); } const channelPromise = connectionPromise @@ -734,11 +737,11 @@ export class IPCServer implements IChannelServer, I .call(command, arg, cancellationToken); }, listen(event: string, arg: any): Event { - if (!router) { - return that.getMulticastEvent(channelName, event, arg); + if (isFunction(routerOrClientFilter)) { + return that.getMulticastEvent(channelName, routerOrClientFilter, event, arg); } - const channelPromise = router.routeEvent(that, event, arg) + const channelPromise = routerOrClientFilter.routeEvent(that, event, arg) .then(connection => (connection as Connection).channelClient.getChannel(channelName)); return getDelayedChannel(channelPromise) @@ -747,7 +750,7 @@ export class IPCServer implements IChannelServer, I } as T; } - private getMulticastEvent(channelName: string, eventName: string, arg: any): Event { + private getMulticastEvent(channelName: string, clientFilter: (client: Client) => boolean, eventName: string, arg: any): Event { const that = this; let disposables = new DisposableStore(); @@ -784,8 +787,8 @@ export class IPCServer implements IChannelServer, I map.delete(connection); }; - that.connections.forEach(onDidAddConnection); - that.onDidAddConnection(onDidAddConnection, undefined, disposables); + that.connections.filter(clientFilter).forEach(onDidAddConnection); + Event.filter(that.onDidAddConnection, clientFilter)(onDidAddConnection, undefined, disposables); that.onDidRemoveConnection(onDidRemoveConnection, undefined, disposables); eventMultiplexer.event(emitter.fire, emitter, disposables); diff --git a/src/vs/base/parts/ipc/test/node/ipc.test.ts b/src/vs/base/parts/ipc/test/node/ipc.test.ts index 5839c45dab7..3539f5dea8c 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.test.ts @@ -454,7 +454,7 @@ suite('Base IPC', function () { client1.registerChannel('channel', clientChannel1); const pings: string[] = []; - const channel = server.getChannel('channel'); + const channel = server.getChannel('channel', () => true); const service = new TestChannelClient(channel); service.onPong(msg => pings.push(msg)); diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 710fdb817c1..3418ece001e 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -26,7 +26,6 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper import { TelemetryAppenderChannel } from 'vs/platform/telemetry/node/telemetryIpc'; import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService'; import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender'; -import { ActiveWindowManager } from 'vs/code/node/activeWindowTracker'; import { ipcRenderer } from 'electron'; import { ILogService, LogLevel, ILoggerService } from 'vs/platform/log/common/log'; import { LoggerChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc'; @@ -131,9 +130,6 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat const electronService = createChannelSender(mainProcessService.getChannel('electron'), { context: configuration.windowId }); services.set(IElectronService, electronService); - const activeWindowManager = new ActiveWindowManager(electronService); - const activeWindowRouter = new StaticRouter(ctx => activeWindowManager.getActiveClientId().then(id => ctx === id)); - // Files const fileService = new FileService(logService); services.set(IFileService, fileService); @@ -184,8 +180,8 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat services.set(ICredentialsService, new SyncDescriptor(KeytarCredentialsService)); services.set(IUserDataAuthTokenService, new SyncDescriptor(UserDataAuthTokenService)); services.set(IUserDataSyncLogService, new SyncDescriptor(UserDataSyncLogService)); - services.set(IUserDataSyncUtilService, new UserDataSyncUtilServiceClient(server.getChannel('userDataSyncUtil', activeWindowRouter))); - services.set(IGlobalExtensionEnablementService, new GlobalExtensionEnablementServiceClient(server.getChannel('globalExtensionEnablement', activeWindowRouter))); + services.set(IUserDataSyncUtilService, new UserDataSyncUtilServiceClient(server.getChannel('userDataSyncUtil', client => client.ctx !== 'main'))); + services.set(IGlobalExtensionEnablementService, new GlobalExtensionEnablementServiceClient(server.getChannel('globalExtensionEnablement', client => client.ctx !== 'main'))); services.set(IUserDataSyncStoreService, new SyncDescriptor(UserDataSyncStoreService)); services.set(ISettingsSyncService, new SyncDescriptor(SettingsSynchroniser)); services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService)); From 9f1885959dc648f757a92ac76eb5fabd18171f58 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 12:49:18 +0100 Subject: [PATCH 217/624] #90020 Use IViewsService in markers view --- .../browser/parts/views/viewPaneContainer.ts | 4 + src/vs/workbench/browser/parts/views/views.ts | 61 +++++++++++---- src/vs/workbench/common/views.ts | 2 +- .../contrib/debug/browser/debugTaskRunner.ts | 8 +- .../contrib/markers/browser/constants.ts | 15 ++-- .../markers/browser/markers.contribution.ts | 76 +++++++++---------- .../contrib/markers/browser/markers.ts | 2 +- .../contrib/markers/browser/markersView.ts | 14 +--- .../markers/browser/markersViewActions.ts | 8 +- .../tasks/browser/abstractTaskService.ts | 18 ++--- .../tasks/browser/terminalTaskSystem.ts | 8 +- 11 files changed, 118 insertions(+), 98 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts index ff494235a74..4235bf53368 100644 --- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts +++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts @@ -310,6 +310,10 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { return this.paneItems.map(i => i.pane); } + get views(): IView[] { + return this.panes; + } + get length(): number { return this.paneItems.length; } diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 566e186ca84..751b8b5c819 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -9,7 +9,7 @@ import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainers import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; import { firstIndex, move } from 'vs/base/common/arrays'; import { isUndefinedOrNull, isUndefined, isString } from 'vs/base/common/types'; @@ -464,15 +464,19 @@ export class ViewsService extends Disposable implements IViewsService { private readonly _onDidChangeViewVisibility: Emitter<{ id: string, visible: boolean }> = this._register(new Emitter<{ id: string, visible: boolean }>()); readonly onDidChangeViewVisibility: Event<{ id: string, visible: boolean }> = this._onDidChangeViewVisibility.event; + private readonly visibleViewContextKeys: Map>; + constructor( @IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService, @IPanelService private readonly panelService: IPanelService, - @IViewletService private readonly viewletService: IViewletService + @IViewletService private readonly viewletService: IViewletService, + @IContextKeyService private readonly contextKeyService: IContextKeyService, ) { super(); this.viewContainersRegistry = Registry.as(ViewExtensions.ViewContainersRegistry); this.viewDisposable = new Map(); + this.visibleViewContextKeys = new Map>(); this._register(toDisposable(() => { this.viewDisposable.forEach(disposable => disposable.dispose()); @@ -483,16 +487,50 @@ export class ViewsService extends Disposable implements IViewsService { this._register(this.viewContainersRegistry.onDidRegister(({ viewContainer, viewContainerLocation }) => this.onDidRegisterViewContainer(viewContainer, viewContainerLocation))); } + registerViewPaneContainer(viewPaneContainer: ViewPaneContainer): ViewPaneContainer { + this._register(viewPaneContainer.onDidAddViews(views => this.onViewsAdded(views))); + this._register(viewPaneContainer.onDidChangeViewVisibility(view => this.onViewsVisibilityChanged(view, view.isBodyVisible()))); + this._register(viewPaneContainer.onDidRemoveViews(views => this.onViewsRemoved(views))); + return viewPaneContainer; + } + + private onViewsAdded(added: IView[]): void { + for (const view of added) { + this.onViewsVisibilityChanged(view, view.isBodyVisible()); + } + } + + private onViewsVisibilityChanged(view: IView, visible: boolean): void { + this.getOrCreateActiveViewContextKey(view).set(visible); + this._onDidChangeViewVisibility.fire({ id: view.id, visible: visible }); + } + + private onViewsRemoved(removed: IView[]): void { + for (const view of removed) { + this.onViewsVisibilityChanged(view, false); + } + } + + private getOrCreateActiveViewContextKey(view: IView): IContextKey { + const visibleContextKeyId = `${view.id}.visible`; + let contextKey = this.visibleViewContextKeys.get(visibleContextKeyId); + if (!contextKey) { + contextKey = new RawContextKey(visibleContextKeyId, false).bindTo(this.contextKeyService); + this.visibleViewContextKeys.set(visibleContextKeyId, contextKey); + } + return contextKey; + } + private onDidRegisterViewContainer(viewContainer: ViewContainer, location: ViewContainerLocation): void { const viewDescriptorCollection = this.viewDescriptorService.getViewDescriptors(viewContainer); - this.onViewsAdded(viewDescriptorCollection.allViewDescriptors, viewContainer); + this.onViewDescriptorsAdded(viewDescriptorCollection.allViewDescriptors, viewContainer); this._register(viewDescriptorCollection.onDidChangeViews(({ added, removed }) => { - this.onViewsAdded(added, viewContainer); - this.onViewsRemoved(removed); + this.onViewDescriptorsAdded(added, viewContainer); + this.onViewDescriptorsRemoved(removed); })); } - private onViewsAdded(views: IViewDescriptor[], container: ViewContainer): void { + private onViewDescriptorsAdded(views: IViewDescriptor[], container: ViewContainer): void { const location = this.viewContainersRegistry.getViewContainerLocation(container); if (location === undefined) { return; @@ -561,7 +599,7 @@ export class ViewsService extends Disposable implements IViewsService { } } - private onViewsRemoved(views: IViewDescriptor[]): void { + private onViewDescriptorsRemoved(views: IViewDescriptor[]): void { for (const view of views) { const disposable = this.viewDisposable.get(view); if (disposable) { @@ -629,7 +667,7 @@ export class ViewsService extends Disposable implements IViewsService { if (activeViewPaneContainer) { const view = activeViewPaneContainer.getView(id); if (view) { - if (activeViewPaneContainer.length === 1) { + if (activeViewPaneContainer.views.length === 1) { const location = this.viewContainersRegistry.getViewContainerLocation(viewContainer); if (location === ViewContainerLocation.Sidebar) { this.viewletService.hideActiveViewlet(); @@ -661,13 +699,6 @@ export class ViewsService extends Disposable implements IViewsService { return null; } - - registerViewPaneContainer(viewPaneContainer: ViewPaneContainer): ViewPaneContainer { - this._register(viewPaneContainer.onDidAddViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() })))); - this._register(viewPaneContainer.onDidChangeViewVisibility(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: view.isBodyVisible() }))); - this._register(viewPaneContainer.onDidRemoveViews(views => views.forEach(view => this._onDidChangeViewVisibility.fire({ id: view.id, visible: false })))); - return viewPaneContainer; - } } export function createFileIconThemableTreeContainerScope(container: HTMLElement, themeService: IWorkbenchThemeService): IDisposable { diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 59bfebf08c8..25c8d926946 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -529,7 +529,7 @@ export interface IViewPaneContainer { onDidRemoveViews: Event; onDidChangeViewVisibility: Event; - readonly length: number; + readonly views: IView[]; setVisible(visible: boolean): void; isVisible(): boolean; diff --git a/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts b/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts index ce8d83b187b..87549aaf25c 100644 --- a/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts +++ b/src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts @@ -8,7 +8,6 @@ import severity from 'vs/base/common/severity'; import { Event } from 'vs/base/common/event'; import Constants from 'vs/workbench/contrib/markers/browser/constants'; import { ITaskService, ITaskSummary } from 'vs/workbench/contrib/tasks/common/taskService'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkspaceFolder, IWorkspace } from 'vs/platform/workspace/common/workspace'; import { TaskEvent, TaskEventKind, TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks'; @@ -18,6 +17,7 @@ import { withUndefinedAsNull } from 'vs/base/common/types'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; +import { IViewsService } from 'vs/workbench/common/views'; function once(match: (e: TaskEvent) => boolean, event: Event): Event { return (listener, thisArgs = null, disposables?) => { @@ -44,7 +44,7 @@ export class DebugTaskRunner { @ITaskService private readonly taskService: ITaskService, @IMarkerService private readonly markerService: IMarkerService, @IConfigurationService private readonly configurationService: IConfigurationService, - @IPanelService private readonly panelService: IPanelService, + @IViewsService private readonly viewsService: IViewsService, @IDialogService private readonly dialogService: IDialogService, ) { } @@ -68,7 +68,7 @@ export class DebugTaskRunner { return TaskRunResult.Success; } if (onTaskErrors === 'showErrors') { - await this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + await this.viewsService.openView(Constants.MARKERS_VIEW_ID); return Promise.resolve(TaskRunResult.Failure); } @@ -97,7 +97,7 @@ export class DebugTaskRunner { return TaskRunResult.Success; } - await this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + await this.viewsService.openView(Constants.MARKERS_VIEW_ID); return Promise.resolve(TaskRunResult.Failure); } catch (err) { await onError(err.message, [this.taskService.configureAction()]); diff --git a/src/vs/workbench/contrib/markers/browser/constants.ts b/src/vs/workbench/contrib/markers/browser/constants.ts index 470a762569e..6a06908d88a 100644 --- a/src/vs/workbench/contrib/markers/browser/constants.ts +++ b/src/vs/workbench/contrib/markers/browser/constants.ts @@ -6,22 +6,23 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; export default { - MARKERS_PANEL_ID: 'workbench.panel.markers', - MARKERS_PANEL_STORAGE_ID: 'workbench.panel.markers', + MARKERS_CONTAINER_ID: 'workbench.panel.markers', MARKERS_VIEW_ID: 'workbench.panel.markers.view', + MARKERS_VIEW_STORAGE_ID: 'workbench.panel.markers', MARKER_COPY_ACTION_ID: 'problems.action.copy', MARKER_COPY_MESSAGE_ACTION_ID: 'problems.action.copyMessage', RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID: 'problems.action.copyRelatedInformationMessage', FOCUS_PROBLEMS_FROM_FILTER: 'problems.action.focusProblemsFromFilter', - MARKERS_PANEL_FOCUS_FILTER: 'problems.action.focusFilter', - MARKERS_PANEL_SHOW_MULTILINE_MESSAGE: 'problems.action.showMultilineMessage', - MARKERS_PANEL_SHOW_SINGLELINE_MESSAGE: 'problems.action.showSinglelineMessage', + MARKERS_VIEW_FOCUS_FILTER: 'problems.action.focusFilter', + MARKERS_VIEW_SHOW_MULTILINE_MESSAGE: 'problems.action.showMultilineMessage', + MARKERS_VIEW_SHOW_SINGLELINE_MESSAGE: 'problems.action.showSinglelineMessage', MARKER_OPEN_SIDE_ACTION_ID: 'problems.action.openToSide', MARKER_SHOW_PANEL_ID: 'workbench.action.showErrorsWarnings', MARKER_SHOW_QUICK_FIX: 'problems.action.showQuickFixes', + TOGGLE_MARKERS_VIEW_ACTION_ID: 'workbench.actions.view.toggleProblems', - MarkerPanelFocusContextKey: new RawContextKey('problemsViewFocus', false), + MarkerViewFocusContextKey: new RawContextKey('problemsViewFocus', false), MarkerFocusContextKey: new RawContextKey('problemFocus', false), - MarkerPanelFilterFocusContextKey: new RawContextKey('problemsFilterFocus', false), + MarkerViewFilterFocusContextKey: new RawContextKey('problemsFilterFocus', false), RelatedInformationFocusContextKey: new RawContextKey('relatedInformationFocus', false) }; diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index 728ec69438b..2966f1a8986 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -12,7 +12,7 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { localize } from 'vs/nls'; import { Marker, RelatedInformation } from 'vs/workbench/contrib/markers/browser/markersModel'; -import { MarkersView, getMarkersView } from 'vs/workbench/contrib/markers/browser/markersView'; +import { MarkersView } from 'vs/workbench/contrib/markers/browser/markersView'; import { MenuId, MenuRegistry, SyncActionDescriptor, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; import { TogglePanelAction } from 'vs/workbench/browser/panel'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -24,12 +24,11 @@ import { IMarkersWorkbenchService, MarkersWorkbenchService, ActivityUpdater } fr import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ActivePanelContext } from 'vs/workbench/common/panel'; import { Disposable } from 'vs/base/common/lifecycle'; import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from 'vs/workbench/services/statusbar/common/statusbar'; import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry } from 'vs/workbench/common/views'; +import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, IViewsService } from 'vs/workbench/common/views'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; @@ -46,7 +45,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ primary: KeyMod.WinCtrl | KeyCode.Enter }, handler: (accessor, args: any) => { - const markersView = getMarkersView(accessor.get(IPanelService))!; + const markersView = accessor.get(IViewsService).getActiveViewWithId(Constants.MARKERS_VIEW_ID)!; markersView.openFileAtElement(markersView.getFocusElement(), false, true, true); } }); @@ -57,7 +56,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ when: undefined, primary: undefined, handler: async (accessor, args: any) => { - await accessor.get(IPanelService).openPanel(Constants.MARKERS_PANEL_ID); + await accessor.get(IViewsService).openView(Constants.MARKERS_VIEW_ID); } }); @@ -67,7 +66,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ when: Constants.MarkerFocusContextKey, primary: KeyMod.CtrlCmd | KeyCode.US_DOT, handler: (accessor, args: any) => { - const markersView = getMarkersView(accessor.get(IPanelService))!; + const markersView = accessor.get(IViewsService).getActiveViewWithId(Constants.MARKERS_VIEW_ID)!; const focusedElement = markersView.getFocusElement(); if (focusedElement instanceof Marker) { markersView.showQuickFixes(focusedElement); @@ -104,15 +103,15 @@ class ToggleMarkersPanelAction extends TogglePanelAction { @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @IPanelService panelService: IPanelService ) { - super(id, label, Constants.MARKERS_PANEL_ID, panelService, layoutService); + super(id, label, Constants.MARKERS_CONTAINER_ID, panelService, layoutService); } } // markers view container const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ - id: Constants.MARKERS_PANEL_ID, + id: Constants.MARKERS_CONTAINER_ID, name: Messages.MARKERS_PANEL_TITLE_PROBLEMS, - ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [Constants.MARKERS_PANEL_ID, Constants.MARKERS_PANEL_STORAGE_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]), + ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [Constants.MARKERS_CONTAINER_ID, Constants.MARKERS_VIEW_STORAGE_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]), focusCommand: { id: ToggleMarkersPanelAction.ID, keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M @@ -155,7 +154,7 @@ registerAction2(class extends Action2 { }); } async run(accessor: ServicesAccessor) { - await copyMarker(accessor.get(IPanelService), accessor.get(IClipboardService)); + await copyMarker(accessor.get(IViewsService), accessor.get(IClipboardService)); } }); registerAction2(class extends Action2 { @@ -171,7 +170,7 @@ registerAction2(class extends Action2 { }); } async run(accessor: ServicesAccessor) { - await copyMessage(accessor.get(IPanelService), accessor.get(IClipboardService)); + await copyMessage(accessor.get(IViewsService), accessor.get(IClipboardService)); } }); registerAction2(class extends Action2 { @@ -187,7 +186,7 @@ registerAction2(class extends Action2 { }); } async run(accessor: ServicesAccessor) { - await copyRelatedInformationMessage(accessor.get(IPanelService), accessor.get(IClipboardService)); + await copyRelatedInformationMessage(accessor.get(IViewsService), accessor.get(IClipboardService)); } }); registerAction2(class extends Action2 { @@ -196,46 +195,46 @@ registerAction2(class extends Action2 { id: Constants.FOCUS_PROBLEMS_FROM_FILTER, title: localize('focusProblemsList', "Focus problems view"), keybinding: { - when: Constants.MarkerPanelFilterFocusContextKey, + when: Constants.MarkerViewFilterFocusContextKey, weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.CtrlCmd | KeyCode.DownArrow } }); } run(accessor: ServicesAccessor) { - focusProblemsView(accessor.get(IPanelService)); + focusProblemsView(accessor.get(IViewsService)); } }); registerAction2(class extends Action2 { constructor() { super({ - id: Constants.MARKERS_PANEL_FOCUS_FILTER, + id: Constants.MARKERS_VIEW_FOCUS_FILTER, title: localize('focusProblemsFilter', "Focus problems filter"), keybinding: { - when: Constants.MarkerPanelFocusContextKey, + when: Constants.MarkerViewFocusContextKey, weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.CtrlCmd | KeyCode.KEY_F } }); } run(accessor: ServicesAccessor) { - focusProblemsFilter(accessor.get(IPanelService)); + focusProblemsFilter(accessor.get(IViewsService)); } }); registerAction2(class extends Action2 { constructor() { super({ - id: Constants.MARKERS_PANEL_SHOW_MULTILINE_MESSAGE, + id: Constants.MARKERS_VIEW_SHOW_MULTILINE_MESSAGE, title: { value: localize('show multiline', "Show message in multiple lines"), original: 'Problems: Show message in multiple lines' }, category: localize('problems', "Problems"), menu: { id: MenuId.CommandPalette, - when: ActivePanelContext.isEqualTo(Constants.MARKERS_PANEL_ID) + when: ContextKeyExpr.has(`${Constants.MARKERS_VIEW_ID}.visible`) } }); } run(accessor: ServicesAccessor) { - const markersView = getMarkersView(accessor.get(IPanelService)); + const markersView = accessor.get(IViewsService).getActiveViewWithId(Constants.MARKERS_VIEW_ID)!; if (markersView) { markersView.markersViewModel.multiline = true; } @@ -244,25 +243,25 @@ registerAction2(class extends Action2 { registerAction2(class extends Action2 { constructor() { super({ - id: Constants.MARKERS_PANEL_SHOW_SINGLELINE_MESSAGE, + id: Constants.MARKERS_VIEW_SHOW_SINGLELINE_MESSAGE, title: { value: localize('show singleline', "Show message in single line"), original: 'Problems: Show message in single line' }, category: localize('problems', "Problems"), menu: { id: MenuId.CommandPalette, - when: ActivePanelContext.isEqualTo(Constants.MARKERS_PANEL_ID) + when: ContextKeyExpr.has(`${Constants.MARKERS_VIEW_ID}.visible`) } }); } run(accessor: ServicesAccessor) { - const markersView = getMarkersView(accessor.get(IPanelService)); + const markersView = accessor.get(IViewsService).getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { markersView.markersViewModel.multiline = false; } } }); -async function copyMarker(panelService: IPanelService, clipboardService: IClipboardService) { - const markersView = getMarkersView(panelService); +async function copyMarker(viewsService: IViewsService, clipboardService: IClipboardService) { + const markersView = viewsService.getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { const element = markersView.getFocusElement(); if (element instanceof Marker) { @@ -271,8 +270,8 @@ async function copyMarker(panelService: IPanelService, clipboardService: IClipbo } } -async function copyMessage(panelService: IPanelService, clipboardService: IClipboardService) { - const markersView = getMarkersView(panelService); +async function copyMessage(viewsService: IViewsService, clipboardService: IClipboardService) { + const markersView = viewsService.getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { const element = markersView.getFocusElement(); if (element instanceof Marker) { @@ -281,8 +280,8 @@ async function copyMessage(panelService: IPanelService, clipboardService: IClipb } } -async function copyRelatedInformationMessage(panelService: IPanelService, clipboardService: IClipboardService) { - const markersView = getMarkersView(panelService); +async function copyRelatedInformationMessage(viewsService: IViewsService, clipboardService: IClipboardService) { + const markersView = viewsService.getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { const element = markersView.getFocusElement(); if (element instanceof RelatedInformation) { @@ -291,15 +290,15 @@ async function copyRelatedInformationMessage(panelService: IPanelService, clipbo } } -function focusProblemsView(panelService: IPanelService) { - const markersView = getMarkersView(panelService); +function focusProblemsView(viewsService: IViewsService) { + const markersView = viewsService.getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { markersView.focus(); } } -function focusProblemsFilter(panelService: IPanelService): void { - const markersView = getMarkersView(panelService); +function focusProblemsFilter(viewsService: IViewsService): void { + const markersView = viewsService.getActiveViewWithId(Constants.MARKERS_VIEW_ID); if (markersView) { markersView.focusFilter(); } @@ -314,13 +313,12 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { order: 4 }); -CommandsRegistry.registerCommand('workbench.actions.view.toggleProblems', async (accessor) => { - const panelService = accessor.get(IPanelService); - const panel = accessor.get(IPanelService).getActivePanel(); - if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { - panelService.hideActivePanel(); +CommandsRegistry.registerCommand(Constants.TOGGLE_MARKERS_VIEW_ACTION_ID, async (accessor) => { + const viewsService = accessor.get(IViewsService); + if (viewsService.isViewVisible(Constants.MARKERS_VIEW_ID)) { + viewsService.closeView(Constants.MARKERS_VIEW_ID); } else { - await panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + viewsService.openView(Constants.MARKERS_VIEW_ID, true); } }); diff --git a/src/vs/workbench/contrib/markers/browser/markers.ts b/src/vs/workbench/contrib/markers/browser/markers.ts index cdcf72b64cd..cd1fdf7c351 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.ts @@ -70,6 +70,6 @@ export class ActivityUpdater extends Disposable implements IWorkbenchContributio const { errors, warnings, infos } = this.markerService.getStatistics(); const total = errors + warnings + infos; const message = localize('totalProblems', 'Total {0} Problems', total); - this.activity.value = this.activityService.showActivity(Constants.MARKERS_PANEL_ID, new NumberBadge(total, () => message)); + this.activity.value = this.activityService.showActivity(Constants.MARKERS_CONTAINER_ID, new NumberBadge(total, () => message)); } } diff --git a/src/vs/workbench/contrib/markers/browser/markersView.ts b/src/vs/workbench/contrib/markers/browser/markersView.ts index 95398693f7e..32dff982d89 100644 --- a/src/vs/workbench/contrib/markers/browser/markersView.ts +++ b/src/vs/workbench/contrib/markers/browser/markersView.ts @@ -9,7 +9,6 @@ import { URI } from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; import { IAction, IActionViewItem, Action } from 'vs/base/common/actions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { PaneCompositePanel } from 'vs/workbench/browser/panel'; import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import Constants from 'vs/workbench/contrib/markers/browser/constants'; import { Marker, ResourceMarkers, RelatedInformation, MarkerChangesEvent } from 'vs/workbench/contrib/markers/browser/markersModel'; @@ -49,17 +48,8 @@ import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; import { KeyCode } from 'vs/base/common/keyCodes'; import { editorLightBulbForeground, editorLightBulbAutoFixForeground } from 'vs/platform/theme/common/colorRegistry'; import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewDescriptorService } from 'vs/workbench/common/views'; -export function getMarkersView(panelService: IPanelService): MarkersView | undefined { - const activePanel = panelService.getActivePanel(); - if (activePanel instanceof PaneCompositePanel) { - return activePanel.getViewPaneContainer().getView(Constants.MARKERS_VIEW_ID); - } - return undefined; -} - function createResourceMarkersIterator(resourceMarkers: ResourceMarkers): Iterator> { const markersIt = Iterator.fromArray(resourceMarkers.markers); @@ -116,8 +106,8 @@ export class MarkersView extends ViewPane implements IMarkerFilterController { @IStorageService storageService: IStorageService, ) { super({ ...(options as IViewPaneOptions), id: Constants.MARKERS_VIEW_ID, ariaHeaderLabel: Messages.MARKERS_PANEL_TITLE_PROBLEMS }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService); - this.panelFoucusContextKey = Constants.MarkerPanelFocusContextKey.bindTo(contextKeyService); - this.panelState = new Memento(Constants.MARKERS_PANEL_STORAGE_ID, storageService).getMemento(StorageScope.WORKSPACE); + this.panelFoucusContextKey = Constants.MarkerViewFocusContextKey.bindTo(contextKeyService); + this.panelState = new Memento(Constants.MARKERS_VIEW_STORAGE_ID, storageService).getMemento(StorageScope.WORKSPACE); this.markersViewModel = this._register(instantiationService.createInstance(MarkersViewModel, this.panelState['multiline'])); this._register(this.markersViewModel.onDidChange(marker => this.onDidChangeViewState(marker))); this.setCurrentActiveEditor(); diff --git a/src/vs/workbench/contrib/markers/browser/markersViewActions.ts b/src/vs/workbench/contrib/markers/browser/markersViewActions.ts index e8b570efdbe..3130ecaee2e 100644 --- a/src/vs/workbench/contrib/markers/browser/markersViewActions.ts +++ b/src/vs/workbench/contrib/markers/browser/markersViewActions.ts @@ -12,7 +12,6 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import Messages from 'vs/workbench/contrib/markers/browser/messages'; import Constants from 'vs/workbench/contrib/markers/browser/constants'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IThemeService, registerThemingParticipant, ICssStyleCollector, ITheme } from 'vs/platform/theme/common/themeService'; import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { toDisposable } from 'vs/base/common/lifecycle'; @@ -27,6 +26,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { FilterOptions } from 'vs/workbench/contrib/markers/browser/markersFilterOptions'; import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdown'; import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; +import { IViewsService } from 'vs/workbench/common/views'; export class ShowProblemsPanelAction extends Action { @@ -34,13 +34,13 @@ export class ShowProblemsPanelAction extends Action { public static readonly LABEL = Messages.MARKERS_PANEL_SHOW_LABEL; constructor(id: string, label: string, - @IPanelService private readonly panelService: IPanelService + @IViewsService private readonly viewsService: IViewsService ) { super(id, label); } public run(): Promise { - return this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + return this.viewsService.openView(Constants.MARKERS_VIEW_ID, true); } } @@ -271,7 +271,7 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem { @IContextKeyService contextKeyService: IContextKeyService ) { super(null, action); - this.focusContextKey = Constants.MarkerPanelFilterFocusContextKey.bindTo(contextKeyService); + this.focusContextKey = Constants.MarkerViewFilterFocusContextKey.bindTo(contextKeyService); this.delayedFilterUpdate = new Delayer(200); this._register(toDisposable(() => this.delayedFilterUpdate.cancel())); this._register(action.onFocus(() => this.focus())); diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 65fcf406eaa..282a0fd4f57 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -27,7 +27,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IFileService, IFileStat } from 'vs/platform/files/common/files'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; import { ProblemMatcherRegistry, NamedProblemMatcher } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IProgressService, IProgressOptions, ProgressLocation } from 'vs/platform/progress/common/progress'; @@ -41,7 +41,6 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import Constants from 'vs/workbench/contrib/markers/browser/constants'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder, IWorkspace } from 'vs/platform/workspace/common/workspace'; @@ -80,6 +79,7 @@ import { ITextEditorSelection, TextEditorSelectionRevealType } from 'vs/platform import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { find } from 'vs/base/common/arrays'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; +import { IViewsService } from 'vs/workbench/common/views'; const QUICKOPEN_HISTORY_LIMIT_CONFIG = 'task.quickOpen.history'; const QUICKOPEN_DETAIL_CONFIG = 'task.quickOpen.detail'; @@ -238,6 +238,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer @IMarkerService protected readonly markerService: IMarkerService, @IOutputService protected readonly outputService: IOutputService, @IPanelService private readonly panelService: IPanelService, + @IViewsService private readonly viewsService: IViewsService, + @ICommandService private readonly commandService: ICommandService, @IEditorService private readonly editorService: IEditorService, @IFileService protected readonly fileService: IFileService, @IWorkspaceContextService protected readonly contextService: IWorkspaceContextService, @@ -257,7 +259,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer @INotificationService private readonly notificationService: INotificationService, @IContextKeyService contextKeyService: IContextKeyService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, - @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, @ITerminalInstanceService private readonly terminalInstanceService: ITerminalInstanceService, @IRemotePathService private readonly remotePathService: IRemotePathService, @ITextModelService private readonly textModelResolverService: ITextModelService, @@ -413,14 +414,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer return this.runShowTasks(); }); - CommandsRegistry.registerCommand('workbench.action.tasks.toggleProblems', async () => { - const panel = this.panelService.getActivePanel(); - if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { - this.layoutService.setPanelHidden(true); - } else { - await this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); - } - }); + CommandsRegistry.registerCommand('workbench.action.tasks.toggleProblems', () => this.commandService.executeCommand(Constants.TOGGLE_MARKERS_VIEW_ACTION_ID)); CommandsRegistry.registerCommand('workbench.action.tasks.openUserTasks', async () => { const resource = this.getResourceForKind(TaskSourceKind.User); @@ -1336,7 +1330,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer protected createTerminalTaskSystem(): ITaskSystem { return new TerminalTaskSystem( - this.terminalService, this.outputService, this.panelService, this.markerService, + this.terminalService, this.outputService, this.panelService, this.viewsService, this.markerService, this.modelService, this.configurationResolverService, this.telemetryService, this.contextService, this.environmentService, AbstractTaskService.OutputChannelId, this.fileService, this.terminalInstanceService, diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 9a17b4e2cf9..32b3e307552 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -45,6 +45,7 @@ import { Schemas } from 'vs/base/common/network'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService'; import { env as processEnv, cwd as processCwd } from 'vs/base/common/process'; +import { IViewsService } from 'vs/workbench/common/views'; interface TerminalData { terminal: ITerminalInstance; @@ -170,6 +171,7 @@ export class TerminalTaskSystem implements ITaskSystem { private terminalService: ITerminalService, private outputService: IOutputService, private panelService: IPanelService, + private viewsService: IViewsService, private markerService: IMarkerService, private modelService: IModelService, private configurationResolverService: IConfigurationResolverService, private telemetryService: ITelemetryService, @@ -619,7 +621,7 @@ export class TerminalTaskSystem implements ITaskSystem { let reveal = task.command.presentation!.reveal; let revealProblems = task.command.presentation!.revealProblems; if (revealProblems === RevealProblemKind.OnProblem) { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + this.viewsService.openView(Constants.MARKERS_VIEW_ID, true); } else if (reveal === RevealKind.Silent) { this.terminalService.setActiveInstance(terminal!); this.terminalService.showPanel(false); @@ -768,7 +770,7 @@ export class TerminalTaskSystem implements ITaskSystem { let revealProblems = task.command.presentation!.revealProblems; let revealProblemPanel = terminal && (revealProblems === RevealProblemKind.OnProblem) && (startStopProblemMatcher.numberOfMatches > 0); if (revealProblemPanel) { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + this.viewsService.openView(Constants.MARKERS_VIEW_ID); } else if (terminal && (reveal === RevealKind.Silent) && ((exitCode !== 0) || (startStopProblemMatcher.numberOfMatches > 0) && startStopProblemMatcher.maxMarkerSeverity && (startStopProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error))) { this.terminalService.setActiveInstance(terminal); @@ -799,7 +801,7 @@ export class TerminalTaskSystem implements ITaskSystem { let showProblemPanel = task.command.presentation && (task.command.presentation.revealProblems === RevealProblemKind.Always); if (showProblemPanel) { - this.panelService.openPanel(Constants.MARKERS_PANEL_ID); + this.viewsService.openView(Constants.MARKERS_VIEW_ID); } else if (task.command.presentation && (task.command.presentation.reveal === RevealKind.Always)) { this.terminalService.setActiveInstance(terminal); this.terminalService.showPanel(task.command.presentation.focus); From 24de3c0faccc710b848de32af5b63f6bdaeda8e3 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 12:55:24 +0100 Subject: [PATCH 218/624] #90020 util function to get visible view context key --- src/vs/workbench/browser/parts/views/views.ts | 4 ++-- src/vs/workbench/common/views.ts | 8 +++++++- .../contrib/markers/browser/markers.contribution.ts | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/views.ts b/src/vs/workbench/browser/parts/views/views.ts index 751b8b5c819..97167ee9659 100644 --- a/src/vs/workbench/browser/parts/views/views.ts +++ b/src/vs/workbench/browser/parts/views/views.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/views'; import { Disposable, IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainersRegistry, Extensions as ViewExtensions, IView, ViewContainerLocation, IViewsService, IViewPaneContainer } from 'vs/workbench/common/views'; +import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainersRegistry, Extensions as ViewExtensions, IView, ViewContainerLocation, IViewsService, IViewPaneContainer, getVisbileViewContextKey } from 'vs/workbench/common/views'; import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -512,7 +512,7 @@ export class ViewsService extends Disposable implements IViewsService { } private getOrCreateActiveViewContextKey(view: IView): IContextKey { - const visibleContextKeyId = `${view.id}.visible`; + const visibleContextKeyId = getVisbileViewContextKey(view.id); let contextKey = this.visibleViewContextKeys.get(visibleContextKeyId); if (!contextKey) { contextKey = new RawContextKey(visibleContextKeyId, false).bindTo(this.contextKeyService); diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 25c8d926946..eab075361f5 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -21,7 +21,6 @@ import { flatten } from 'vs/base/common/arrays'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; export const TEST_VIEW_CONTAINER_ID = 'workbench.view.extension.test'; -export const FocusedViewContext = new RawContextKey('focusedView', ''); export namespace Extensions { export const ViewContainersRegistry = 'workbench.registry.view.containers'; @@ -358,6 +357,7 @@ export interface IViewsViewlet extends IViewlet { export const IViewsService = createDecorator('viewsService'); export interface IViewsService { + _serviceBrand: undefined; readonly onDidChangeViewVisibility: Event<{ id: string, visible: boolean }>; @@ -372,6 +372,12 @@ export interface IViewsService { } +/** + * View Contexts + */ +export const FocusedViewContext = new RawContextKey('focusedView', ''); +export function getVisbileViewContextKey(viewId: string): string { return `${viewId}.visible`; } + export const IViewDescriptorService = createDecorator('viewDescriptorService'); export interface IViewDescriptorService { diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index 2966f1a8986..30e05092dfe 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -28,7 +28,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from 'vs/workbench/services/statusbar/common/statusbar'; import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, IViewsService } from 'vs/workbench/common/views'; +import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, IViewsService, getVisbileViewContextKey } from 'vs/workbench/common/views'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; @@ -229,7 +229,7 @@ registerAction2(class extends Action2 { category: localize('problems', "Problems"), menu: { id: MenuId.CommandPalette, - when: ContextKeyExpr.has(`${Constants.MARKERS_VIEW_ID}.visible`) + when: ContextKeyExpr.has(getVisbileViewContextKey(Constants.MARKERS_VIEW_ID)) } }); } @@ -248,7 +248,7 @@ registerAction2(class extends Action2 { category: localize('problems', "Problems"), menu: { id: MenuId.CommandPalette, - when: ContextKeyExpr.has(`${Constants.MARKERS_VIEW_ID}.visible`) + when: ContextKeyExpr.has(getVisbileViewContextKey(Constants.MARKERS_VIEW_ID)) } }); } From e297e748d7fb8378117bb2246be775b6b65465ab Mon Sep 17 00:00:00 2001 From: alpalla <46252231+alpalla@users.noreply.github.com> Date: Wed, 5 Feb 2020 13:55:42 +0100 Subject: [PATCH 219/624] Allow N instances of the same task (#89872) Feature request implementation to allow multiple instances of the same task. Fixes #32264 Co-authored-by: Alex Ross --- .../tasks/browser/abstractTaskService.ts | 18 ++++- .../tasks/browser/terminalTaskSystem.ts | 74 +++++++++++++++++-- .../contrib/tasks/common/jsonSchema_v2.ts | 5 ++ .../contrib/tasks/common/taskConfiguration.ts | 4 +- .../contrib/tasks/common/taskSystem.ts | 1 + .../workbench/contrib/tasks/common/tasks.ts | 3 +- .../contrib/tasks/node/processTaskSystem.ts | 8 ++ 7 files changed, 101 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 282a0fd4f57..d5321cc6945 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -1277,14 +1277,15 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer if (active && active.same) { if (this._taskSystem?.isTaskVisible(executeResult.task)) { const message = nls.localize('TaskSystem.activeSame.noBackground', 'The task \'{0}\' is already active.', executeResult.task.getQualifiedLabel()); + let lastInstance = this.getTaskSystem().getLastInstance(executeResult.task) ?? executeResult.task; this.notificationService.prompt(Severity.Info, message, [{ label: nls.localize('terminateTask', "Terminate Task"), - run: () => this.terminate(executeResult.task) + run: () => this.terminate(lastInstance) }, { label: nls.localize('restartTask', "Restart Task"), - run: () => this.restart(executeResult.task) + run: () => this.restart(lastInstance) }], { sticky: true } ); @@ -1967,11 +1968,21 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer } private createTaskQuickPickEntries(tasks: Task[], group: boolean = false, sort: boolean = false, selectedEntry?: TaskQuickPickEntry): TaskQuickPickEntry[] { + let count: { [key: string]: number; } = {}; if (tasks === undefined || tasks === null || tasks.length === 0) { return []; } const TaskQuickPickEntry = (task: Task): TaskQuickPickEntry => { - return { label: task._label, description: this.getTaskDescription(task), task, detail: this.showDetail() ? task.configurationProperties.detail : undefined }; + let entryLabel = task._label; + let commonKey = task._id.split('|')[0]; + if (count[commonKey]) { + entryLabel = entryLabel + ' (' + count[commonKey].toString() + ')'; + count[commonKey]++; + } else { + count[commonKey] = 1; + } + return { label: entryLabel, description: this.getTaskDescription(task), task, detail: this.showDetail() ? task.configurationProperties.detail : undefined }; + }; function fillEntries(entries: QuickPickInput[], tasks: Task[], groupLabel: string): void { if (tasks.length) { @@ -2034,6 +2045,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer } entries = tasks.map(task => TaskQuickPickEntry(task)); } + count = {}; return entries; } diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 32b3e307552..b35ef9cc087 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -59,6 +59,25 @@ interface ActiveTerminalData { promise: Promise; } +class InstanceManager { + private _currentInstances: number = 0; + private _counter: number = 0; + + addInstance() { + this._currentInstances++; + this._counter++; + } + removeInstance() { + this._currentInstances--; + } + get instances() { + return this._currentInstances; + } + get counter() { + return this._counter; + } +} + class VariableResolver { constructor(public workspaceFolder: IWorkspaceFolder | undefined, public taskSystemInfo: TaskSystemInfo | undefined, private _values: Map, private _service: IConfigurationResolverService | undefined) { @@ -153,6 +172,7 @@ export class TerminalTaskSystem implements ITaskSystem { }; private activeTasks: IStringDictionary; + private instances: IStringDictionary; private busyTasks: IStringDictionary; private terminals: IStringDictionary; private idleTaskTerminals: LinkedMap; @@ -185,6 +205,7 @@ export class TerminalTaskSystem implements ITaskSystem { ) { this.activeTasks = Object.create(null); + this.instances = Object.create(null); this.busyTasks = Object.create(null); this.terminals = Object.create(null); this.idleTaskTerminals = new LinkedMap(); @@ -207,18 +228,32 @@ export class TerminalTaskSystem implements ITaskSystem { } public run(task: Task, resolver: ITaskResolver, trigger: string = Triggers.command): ITaskExecuteResult { + let commonKey = task._id.split('|')[0]; + let validInstance = task.runOptions && task.runOptions.instanceLimit && this.instances[commonKey] && this.instances[commonKey].instances < task.runOptions.instanceLimit; + let instance = this.instances[commonKey] ? this.instances[commonKey].instances : 0; this.currentTask = new VerifiedTask(task, resolver, trigger); - let terminalData = this.activeTasks[task.getMapKey()]; - if (terminalData && terminalData.promise) { + let taskClone = undefined; + if (instance > 0) { + taskClone = task.clone(); + taskClone._id += '|' + this.instances[commonKey].counter.toString(); + } + let taskToExecute = taskClone ?? task; + let lastTaskInstance = this.getLastInstance(task); + let terminalData = lastTaskInstance ? this.activeTasks[lastTaskInstance.getMapKey()] : undefined; + if (terminalData && terminalData.promise && !validInstance) { this.lastTask = this.currentTask; - return { kind: TaskExecuteKind.Active, task, active: { same: true, background: task.configurationProperties.isBackground! }, promise: terminalData.promise }; + return { kind: TaskExecuteKind.Active, task: terminalData.task, active: { same: true, background: task.configurationProperties.isBackground! }, promise: terminalData.promise }; } try { - const executeResult = { kind: TaskExecuteKind.Started, task, started: {}, promise: this.executeTask(task, resolver, trigger) }; + const executeResult = { kind: TaskExecuteKind.Started, task, started: {}, promise: this.executeTask(taskToExecute, resolver, trigger) }; executeResult.promise.then(summary => { this.lastTask = this.currentTask; }); + if (!this.instances[commonKey]) { + this.instances[commonKey] = new InstanceManager(); + } + this.instances[commonKey].addInstance(); return executeResult; } catch (error) { if (error instanceof TaskError) { @@ -304,6 +339,17 @@ export class TerminalTaskSystem implements ITaskSystem { return Object.keys(this.activeTasks).map(key => this.activeTasks[key].task); } + public getLastInstance(task: Task): Task | undefined { + let lastInstance = undefined; + let commonId = task._id.split('|')[0]; + Object.keys(this.activeTasks).forEach((key) => { + if (commonId === this.activeTasks[key].task._id.split('|')[0]) { + lastInstance = this.activeTasks[key].task; + } + }); + return lastInstance; + } + public getBusyTasks(): Task[] { return Object.keys(this.busyTasks).map(key => this.busyTasks[key]); } @@ -320,6 +366,20 @@ export class TerminalTaskSystem implements ITaskSystem { }); } + private removeFromActiveTasks(task: Task): void { + if (!this.activeTasks[task.getMapKey()]) { + return; + } + delete this.activeTasks[task.getMapKey()]; + let commonKey = task._id.split('|')[0]; + if (this.instances[commonKey]) { + this.instances[commonKey].removeInstance(); + if (this.instances[commonKey].instances === 0) { + delete this.instances[commonKey]; + } + } + } + public terminate(task: Task): Promise { let activeTerminal = this.activeTasks[task.getMapKey()]; if (!activeTerminal) { @@ -675,7 +735,7 @@ export class TerminalTaskSystem implements ITaskSystem { if (this.busyTasks[mapKey]) { delete this.busyTasks[mapKey]; } - delete this.activeTasks[key]; + this.removeFromActiveTasks(task); this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Changed)); if (exitCode !== undefined) { // Only keep a reference to the terminal if it is not being disposed. @@ -753,7 +813,7 @@ export class TerminalTaskSystem implements ITaskSystem { onData.dispose(); onExit.dispose(); let key = task.getMapKey(); - delete this.activeTasks[key]; + this.removeFromActiveTasks(task); this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Changed)); if (exitCode !== undefined) { // Only keep a reference to the terminal if it is not being disposed. @@ -1104,7 +1164,7 @@ export class TerminalTaskSystem implements ITaskSystem { // For correct terminal re-use, the task needs to be deleted immediately. // Note that this shouldn't be a problem anymore since user initiated terminal kills are now immediate. const mapKey = task.getMapKey(); - delete this.activeTasks[mapKey]; + this.removeFromActiveTasks(task); if (this.busyTasks[mapKey]) { delete this.busyTasks[mapKey]; } diff --git a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts index 840cfc8e52e..3f9ca21ede2 100644 --- a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts +++ b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts @@ -329,6 +329,11 @@ const runOptions: IJSONSchema = { description: nls.localize('JsonSchema.tasks.runOn', 'Configures when the task should be run. If set to folderOpen, then the task will be run automatically when the folder is opened.'), default: 'default' }, + instanceLimit: { + type: 'number', + description: nls.localize('JsonSchema.tasks.instanceLimit', 'The number of instances of the task that are allowed to run simultaneously.'), + default: 1 + }, }, description: nls.localize('JsonSchema.tasks.runOptions', 'The task\'s run related options') }; diff --git a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts index 2677f6bd2ce..5e6b05391ab 100644 --- a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts +++ b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts @@ -133,6 +133,7 @@ export interface PresentationOptionsConfig { export interface RunOptionsConfig { reevaluateOnRerun?: boolean; runOn?: string; + instanceLimit?: number; } export interface TaskIdentifier { @@ -681,7 +682,8 @@ export namespace RunOptions { export function fromConfiguration(value: RunOptionsConfig | undefined): Tasks.RunOptions { return { reevaluateOnRerun: value ? value.reevaluateOnRerun : true, - runOn: value ? RunOnOptions.fromString(value.runOn) : Tasks.RunOnOptions.default + runOn: value ? RunOnOptions.fromString(value.runOn) : Tasks.RunOnOptions.default, + instanceLimit: value ? value.instanceLimit : 1 }; } } diff --git a/src/vs/workbench/contrib/tasks/common/taskSystem.ts b/src/vs/workbench/contrib/tasks/common/taskSystem.ts index c6d2c0bc03e..888d79b912c 100644 --- a/src/vs/workbench/contrib/tasks/common/taskSystem.ts +++ b/src/vs/workbench/contrib/tasks/common/taskSystem.ts @@ -133,6 +133,7 @@ export interface ITaskSystem { isActive(): Promise; isActiveSync(): boolean; getActiveTasks(): Task[]; + getLastInstance(task: Task): Task | undefined; getBusyTasks(): Task[]; canAutoTerminate(): boolean; terminate(task: Task): Promise; diff --git a/src/vs/workbench/contrib/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts index 6cde38187b1..8130ab56092 100644 --- a/src/vs/workbench/contrib/tasks/common/tasks.ts +++ b/src/vs/workbench/contrib/tasks/common/tasks.ts @@ -523,10 +523,11 @@ export enum RunOnOptions { export interface RunOptions { reevaluateOnRerun?: boolean; runOn?: RunOnOptions; + instanceLimit?: number; } export namespace RunOptions { - export const defaults: RunOptions = { reevaluateOnRerun: true, runOn: RunOnOptions.default }; + export const defaults: RunOptions = { reevaluateOnRerun: true, runOn: RunOnOptions.default, instanceLimit: 1 }; } export abstract class CommonTask { diff --git a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts index 73d947db159..ebc9c929933 100644 --- a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts @@ -94,6 +94,14 @@ export class ProcessTaskSystem implements ITaskSystem { return result; } + public getLastInstance(task: Task): Task | undefined { + let result = undefined; + if (this.activeTask) { + result = this.activeTask; + } + return result; + } + public getBusyTasks(): Task[] { return []; } From dde577b23e1ee404303aa3e03a567757c9e84cee Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 15:02:59 +0100 Subject: [PATCH 220/624] activate git before smoke tests --- extensions/git/package.json | 9 --------- extensions/git/package.nls.json | 1 - extensions/git/src/commands.ts | 5 ----- extensions/git/src/test/smoke.test.ts | 5 +++-- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index a7f9e33f31d..c1cd8b5135c 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -26,11 +26,6 @@ }, "contributes": { "commands": [ - { - "command": "git.activate", - "title": "%command.activate%", - "category": "Git" - }, { "command": "git.setLogLevel", "title": "%command.setLogLevel%", @@ -456,10 +451,6 @@ ], "menus": { "commandPalette": [ - { - "command": "git.activate", - "when": "false" - }, { "command": "git.clone", "when": "config.git.enabled" diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 8cd65b4e477..f3d75519653 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -1,7 +1,6 @@ { "displayName": "Git", "description": "Git SCM Integration", - "command.activate": "Activate", "command.setLogLevel": "Set Log Level...", "command.clone": "Clone", "command.init": "Initialize Repository", diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 25090369b71..be0f5387d15 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -253,11 +253,6 @@ export class CommandCenter { }); } - @command('git.activate') - async activate(): Promise { - // noop - } - @command('git.setLogLevel') async setLogLevel(): Promise { const createItem = (logLevel: LogLevel) => ({ diff --git a/extensions/git/src/test/smoke.test.ts b/extensions/git/src/test/smoke.test.ts index ce99e15cfe2..9e0933776a3 100644 --- a/extensions/git/src/test/smoke.test.ts +++ b/extensions/git/src/test/smoke.test.ts @@ -49,8 +49,9 @@ suite('git smoke test', function () { cp.execSync('git commit -m "initial commit"', { cwd }); // make sure git is activated - await commands.executeCommand('git.activate'); - git = extensions.getExtension('vscode.git')!.exports.getAPI(1); + const ext = extensions.getExtension('vscode.git'); + await ext?.activate(); + git = ext!.exports.getAPI(1); if (git.repositories.length === 0) { await eventToPromise(git.onDidOpenRepository); From f016ba317fba6a2d5e5cfac9ce64539ccd3ae890 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 13:54:12 +0100 Subject: [PATCH 221/624] use real instantiation service, express dependencies --- .../api/extHostApiCommands.test.ts | 86 ++++++++++--------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index 3142b84cc1a..cdd10023315 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -5,7 +5,6 @@ import * as assert from 'assert'; import { setUnexpectedErrorHandler, errorHandler } from 'vs/base/common/errors'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { URI } from 'vs/base/common/uri'; import * as types from 'vs/workbench/api/common/extHostTypes'; import { TextModel as EditorModel } from 'vs/editor/common/model/textModel'; @@ -28,11 +27,26 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import 'vs/workbench/contrib/search/browser/search.contribution'; import { NullLogService } from 'vs/platform/log/common/log'; import { ITextModel } from 'vs/editor/common/model'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; +import { nullExtensionDescription, IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { dispose } from 'vs/base/common/lifecycle'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { NullApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; + +import 'vs/editor/contrib/codeAction/codeAction'; +import 'vs/editor/contrib/codelens/codelens'; +import 'vs/editor/contrib/colorPicker/color'; +import 'vs/editor/contrib/format/format'; +import 'vs/editor/contrib/gotoSymbol/goToCommands'; +import 'vs/editor/contrib/hover/getHover'; +import 'vs/editor/contrib/links/getLinks'; +import 'vs/editor/contrib/parameterHints/provideSignatureHelp'; +import 'vs/editor/contrib/quickOpen/quickOpen'; +import 'vs/editor/contrib/smartSelect/smartSelect'; +import 'vs/editor/contrib/suggest/suggest'; const defaultSelector = { scheme: 'far' }; const model: ITextModel = EditorModel.createFromString( @@ -64,42 +78,36 @@ suite('ExtHostLanguageFeatureCommands', function () { setUnexpectedErrorHandler(() => { }); // Use IInstantiationService to get typechecking when instantiating - let inst: IInstantiationService; - { - let instantiationService = new TestInstantiationService(); - rpcProtocol = new TestRPCProtocol(); - instantiationService.stub(ICommandService, { - _serviceBrand: undefined, - executeCommand(id: string, ...args: any): any { - const command = CommandsRegistry.getCommands().get(id); - if (!command) { - return Promise.reject(new Error(id + ' NOT known')); - } - const { handler } = command; - return Promise.resolve(instantiationService.invokeFunction(handler, ...args)); + let insta: IInstantiationService; + rpcProtocol = new TestRPCProtocol(); + const services = new ServiceCollection(); + services.set(IExtensionService, new class extends mock() { + async activateByEvent() { + + } + }); + services.set(ICommandService, new SyncDescriptor(class extends mock() { + + executeCommand(id: string, ...args: any): any { + const command = CommandsRegistry.getCommands().get(id); + if (!command) { + return Promise.reject(new Error(id + ' NOT known')); } - }); - instantiationService.stub(IMarkerService, new MarkerService()); - instantiationService.stub(IModelService, { - _serviceBrand: undefined, - getModel(): any { return model; }, - createModel() { throw new Error(); }, - updateModel() { throw new Error(); }, - setMode() { throw new Error(); }, - destroyModel() { throw new Error(); }, - getModels() { throw new Error(); }, - onModelAdded: undefined!, - onModelModeChanged: undefined!, - onModelRemoved: undefined!, - getCreationOptions() { throw new Error(); } - }); - instantiationService.stub(IEditorWorkerService, new class extends mock() { - async computeMoreMinimalEdits(_uri: any, edits: any) { - return edits || undefined; - } - }); - inst = instantiationService; - } + const { handler } = command; + return Promise.resolve(insta.invokeFunction(handler, ...args)); + } + })); + services.set(IMarkerService, new MarkerService()); + services.set(IModelService, new class extends mock() { + getModel() { return model; } + }); + services.set(IEditorWorkerService, new class extends mock() { + async computeMoreMinimalEdits(_uri: any, edits: any) { + return edits || undefined; + } + }); + + insta = new InstantiationService(services); const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(rpcProtocol, new NullLogService()); extHostDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ @@ -117,7 +125,7 @@ suite('ExtHostLanguageFeatureCommands', function () { commands = new ExtHostCommands(rpcProtocol, new NullLogService()); rpcProtocol.set(ExtHostContext.ExtHostCommands, commands); - rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol)); + rpcProtocol.set(MainContext.MainThreadCommands, insta.createInstance(MainThreadCommands, rpcProtocol)); ExtHostApiCommands.register(commands); const diagnostics = new ExtHostDiagnostics(rpcProtocol, new NullLogService()); @@ -126,7 +134,7 @@ suite('ExtHostLanguageFeatureCommands', function () { extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, diagnostics, new NullLogService(), NullApiDeprecationService); rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, extHost); - mainThread = rpcProtocol.set(MainContext.MainThreadLanguageFeatures, inst.createInstance(MainThreadLanguageFeatures, rpcProtocol)); + mainThread = rpcProtocol.set(MainContext.MainThreadLanguageFeatures, insta.createInstance(MainThreadLanguageFeatures, rpcProtocol)); return rpcProtocol.sync(); }); From d01c4cd10ef03fc934aae833171c578ca330a382 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 14:51:34 +0100 Subject: [PATCH 222/624] remove unused file --- test/browser/renderer.js | 219 --------------------------------------- 1 file changed, 219 deletions(-) delete mode 100644 test/browser/renderer.js diff --git a/test/browser/renderer.js b/test/browser/renderer.js deleted file mode 100644 index 16fd2568a73..00000000000 --- a/test/browser/renderer.js +++ /dev/null @@ -1,219 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/*eslint-env mocha*/ - -const { ipcRenderer } = require('electron'); -const assert = require('assert'); -const path = require('path'); -const glob = require('glob'); -const util = require('util'); -const bootstrap = require('../../src/bootstrap'); -const coverage = require('../coverage'); - -// Disabled custom inspect. See #38847 -if (util.inspect && util.inspect['defaultOptions']) { - util.inspect['defaultOptions'].customInspect = false; -} - -let _tests_glob = '**/test/**/*.test.js'; -let loader; -let _out; - -function initLoader(opts) { - let outdir = opts.build ? 'out-build' : 'out'; - _out = path.join(__dirname, `../../${outdir}`); - - // setup loader - loader = require(`${_out}/vs/loader`); - const loaderConfig = { - nodeRequire: require, - nodeMain: __filename, - catchError: true, - baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../src')), - paths: { - 'vs': `../${outdir}/vs`, - 'lib': `../${outdir}/lib`, - 'bootstrap-fork': `../${outdir}/bootstrap-fork` - } - }; - - if (opts.coverage) { - // initialize coverage if requested - coverage.initialize(loaderConfig); - } - - loader.require.config(loaderConfig); -} - -function loadTestModules(opts) { - - if (opts.run) { - const files = Array.isArray(opts.run) ? opts.run : [opts.run]; - const modules = files.map(file => { - file = file.replace(/^src/, 'out'); - file = file.replace(/\.ts$/, '.js'); - return path.relative(_out, file).replace(/\.js$/, ''); - }); - return new Promise((resolve, reject) => { - loader.require(modules, resolve, reject); - }); - } - - const pattern = opts.runGlob || _tests_glob; - - return new Promise((resolve, reject) => { - glob(pattern, { cwd: _out }, (err, files) => { - if (err) { - reject(err); - return; - } - const modules = files.map(file => file.replace(/\.js$/, '')); - resolve(modules); - }); - }).then(modules => { - return new Promise((resolve, reject) => { - loader.require(modules, resolve, reject); - }); - }); -} - -function loadTests(opts) { - - const _unexpectedErrors = []; - const _loaderErrors = []; - - // collect loader errors - loader.require.config({ - onError(err) { - _loaderErrors.push(err); - console.error(err); - } - }); - - // collect unexpected errors - loader.require(['vs/base/common/errors'], function (errors) { - errors.setUnexpectedErrorHandler(function (err) { - let stack = (err ? err.stack : null); - if (!stack) { - stack = new Error().stack; - } - - _unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + stack); - }); - }); - - loader.require([opts]) - - return loadTestModules(opts).then(() => { - suite('Unexpected Errors & Loader Errors', function () { - test('should not have unexpected errors', function () { - const errors = _unexpectedErrors.concat(_loaderErrors); - if (errors.length) { - errors.forEach(function (stack) { - console.error(''); - console.error(stack); - }); - assert.ok(false, errors); - } - }); - }); - }); -} - -function serializeSuite(suite) { - return { - root: suite.root, - suites: suite.suites.map(serializeSuite), - tests: suite.tests.map(serializeRunnable), - title: suite.title, - fullTitle: suite.fullTitle(), - timeout: suite.timeout(), - retries: suite.retries(), - enableTimeouts: suite.enableTimeouts(), - slow: suite.slow(), - bail: suite.bail() - }; -} - -function serializeRunnable(runnable) { - return { - title: runnable.title, - fullTitle: runnable.fullTitle(), - async: runnable.async, - slow: runnable.slow(), - speed: runnable.speed, - duration: runnable.duration - }; -} - -function serializeError(err) { - return { - message: err.message, - stack: err.stack, - actual: err.actual, - expected: err.expected, - uncaught: err.uncaught, - showDiff: err.showDiff, - inspect: typeof err.inspect === 'function' ? err.inspect() : '' - }; -} - -class IPCReporter { - - constructor(runner) { - runner.on('start', () => ipcRenderer.send('start')); - runner.on('end', () => ipcRenderer.send('end')); - runner.on('suite', suite => ipcRenderer.send('suite', serializeSuite(suite))); - runner.on('suite end', suite => ipcRenderer.send('suite end', serializeSuite(suite))); - runner.on('test', test => ipcRenderer.send('test', serializeRunnable(test))); - runner.on('test end', test => ipcRenderer.send('test end', serializeRunnable(test))); - runner.on('hook', hook => ipcRenderer.send('hook', serializeRunnable(hook))); - runner.on('hook end', hook => ipcRenderer.send('hook end', serializeRunnable(hook))); - runner.on('pass', test => ipcRenderer.send('pass', serializeRunnable(test))); - runner.on('fail', (test, err) => ipcRenderer.send('fail', serializeRunnable(test), serializeError(err))); - runner.on('pending', test => ipcRenderer.send('pending', serializeRunnable(test))); - } -} - -function runTests(opts) { - - return loadTests(opts).then(() => { - - if (opts.grep) { - mocha.grep(opts.grep); - } - - if (!opts.debug) { - mocha.reporter(IPCReporter); - } - - const runner = mocha.run(() => { - createCoverageReport(opts).then(() => { - ipcRenderer.send('all done'); - }); - }); - - if (opts.debug) { - runner.on('fail', (test, err) => { - - console.error(test.fullTitle()); - console.error(err.stack); - }); - } - }); -} - -ipcRenderer.on('run', (e, opts) => { - initLoader(opts); - runTests(opts).catch(err => { - if (typeof err !== 'string') { - err = JSON.stringify(err); - } - - console.error(err); - ipcRenderer.send('error', err); - }); -}); From b7ab10b8a80443be71230dac4d1aac5b4d8018cc Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 15:07:58 +0100 Subject: [PATCH 223/624] move most API tests to browser-layer --- .eslintrc.json | 4 ++++ .../api/extHost.api.impl.test.ts | 0 .../api/extHostApiCommands.test.ts | 3 ++- .../api/extHostCommands.test.ts | 2 +- .../api/extHostConfiguration.test.ts | 2 +- .../api/extHostDiagnostics.test.ts | 2 +- .../api/extHostDocumentData.test.ts | 2 +- .../api/extHostDocumentSaveParticipant.test.ts | 2 +- .../api/extHostDocumentsAndEditors.test.ts | 2 +- .../api/extHostFileSystemEventService.test.ts | 0 .../api/extHostLanguageFeatures.test.ts | 2 +- .../api/extHostMessagerService.test.ts | 5 +++-- .../api/extHostTextEditor.test.ts | 2 +- .../api/extHostTextEditors.test.ts | 4 ++-- .../api/extHostTreeViews.test.ts | 2 +- .../api/extHostTypeConverter.test.ts | 0 .../{electron-browser => browser}/api/extHostTypes.test.ts | 0 .../{electron-browser => browser}/api/extHostWebview.test.ts | 4 ++-- .../api/extHostWorkspace.test.ts | 2 +- .../api/mainThreadCommands.test.ts | 2 +- .../api/mainThreadConfiguration.test.ts | 0 .../api/mainThreadDiagnostics.test.ts | 0 .../api/mainThreadDocumentContentProviders.test.ts | 4 ++-- .../api/mainThreadDocuments.test.ts | 0 .../api/mainThreadDocumentsAndEditors.test.ts | 2 +- .../api/mainThreadEditors.test.ts | 2 +- .../workbench/test/{electron-browser => browser}/api/mock.ts | 0 .../{electron-browser => browser}/api/testRPCProtocol.ts | 0 .../test/electron-browser/api/extHostSearch.test.ts | 4 ++-- .../test/electron-browser/api/mainThreadWorkspace.test.ts | 2 +- 30 files changed, 31 insertions(+), 25 deletions(-) rename src/vs/workbench/test/{electron-browser => browser}/api/extHost.api.impl.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostApiCommands.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostCommands.test.ts (97%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostConfiguration.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostDiagnostics.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostDocumentData.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostDocumentSaveParticipant.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostDocumentsAndEditors.test.ts (94%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostFileSystemEventService.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostLanguageFeatures.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostMessagerService.test.ts (96%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostTextEditor.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostTextEditors.test.ts (95%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostTreeViews.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostTypeConverter.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostTypes.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostWebview.test.ts (98%) rename src/vs/workbench/test/{electron-browser => browser}/api/extHostWorkspace.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadCommands.test.ts (97%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadConfiguration.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadDiagnostics.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadDocumentContentProviders.test.ts (92%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadDocuments.test.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadDocumentsAndEditors.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/mainThreadEditors.test.ts (99%) rename src/vs/workbench/test/{electron-browser => browser}/api/mock.ts (100%) rename src/vs/workbench/test/{electron-browser => browser}/api/testRPCProtocol.ts (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 2a086870704..e7506985bd3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -614,6 +614,10 @@ "*" ] }, + { + "target": "{**/api/**.test.ts,}", + "restrictions": "{**/vs/**,assert,sinon,crypto,vscode}" + }, { "target": "{**/**.test.ts,**/test/**}", "restrictions": "{**/vs/**,assert,sinon,crypto}" diff --git a/src/vs/workbench/test/electron-browser/api/extHost.api.impl.test.ts b/src/vs/workbench/test/browser/api/extHost.api.impl.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/extHost.api.impl.test.ts rename to src/vs/workbench/test/browser/api/extHost.api.impl.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/browser/api/extHostApiCommands.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts rename to src/vs/workbench/test/browser/api/extHostApiCommands.test.ts index cdd10023315..523742542a2 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/browser/api/extHostApiCommands.test.ts @@ -30,7 +30,7 @@ import { ITextModel } from 'vs/editor/common/model'; import { nullExtensionDescription, IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { dispose } from 'vs/base/common/lifecycle'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { NullApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; @@ -85,6 +85,7 @@ suite('ExtHostLanguageFeatureCommands', function () { async activateByEvent() { } + }); services.set(ICommandService, new SyncDescriptor(class extends mock() { diff --git a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts b/src/vs/workbench/test/browser/api/extHostCommands.test.ts similarity index 97% rename from src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts rename to src/vs/workbench/test/browser/api/extHostCommands.test.ts index 94dee4ef4d3..b20a56ba1f1 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts +++ b/src/vs/workbench/test/browser/api/extHostCommands.test.ts @@ -8,7 +8,7 @@ import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import { MainThreadCommandsShape } from 'vs/workbench/api/common/extHost.protocol'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { SingleProxyRPCProtocol } from './testRPCProtocol'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { NullLogService } from 'vs/platform/log/common/log'; suite('ExtHostCommands', function () { diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/browser/api/extHostConfiguration.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts rename to src/vs/workbench/test/browser/api/extHostConfiguration.test.ts index 69bba733204..31e2b101394 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/browser/api/extHostConfiguration.test.ts @@ -10,7 +10,7 @@ import { ExtHostConfigProvider } from 'vs/workbench/api/common/extHostConfigurat import { MainThreadConfigurationShape, IConfigurationInitData } from 'vs/workbench/api/common/extHost.protocol'; import { ConfigurationModel, ConfigurationModelParser } from 'vs/platform/configuration/common/configurationModels'; import { TestRPCProtocol } from './testRPCProtocol'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { ConfigurationTarget, IConfigurationModel, IConfigurationChange } from 'vs/platform/configuration/common/configuration'; import { NullLogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts b/src/vs/workbench/test/browser/api/extHostDiagnostics.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts rename to src/vs/workbench/test/browser/api/extHostDiagnostics.test.ts index 1a3f95ea4c3..4930298a384 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts +++ b/src/vs/workbench/test/browser/api/extHostDiagnostics.test.ts @@ -9,7 +9,7 @@ import { DiagnosticCollection, ExtHostDiagnostics } from 'vs/workbench/api/commo import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Location } from 'vs/workbench/api/common/extHostTypes'; import { MainThreadDiagnosticsShape, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { Emitter, Event } from 'vs/base/common/event'; import { NullLogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts b/src/vs/workbench/test/browser/api/extHostDocumentData.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts rename to src/vs/workbench/test/browser/api/extHostDocumentData.test.ts index 2610d0241bb..16a25b86b02 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts +++ b/src/vs/workbench/test/browser/api/extHostDocumentData.test.ts @@ -10,7 +10,7 @@ import { Position } from 'vs/workbench/api/common/extHostTypes'; import { Range } from 'vs/editor/common/core/range'; import { MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; suite('ExtHostDocumentData', () => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts b/src/vs/workbench/test/browser/api/extHostDocumentSaveParticipant.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts rename to src/vs/workbench/test/browser/api/extHostDocumentSaveParticipant.test.ts index 5ee65cfa30c..89743a073e5 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts +++ b/src/vs/workbench/test/browser/api/extHostDocumentSaveParticipant.test.ts @@ -12,7 +12,7 @@ import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/common/extHostD import { SingleProxyRPCProtocol } from './testRPCProtocol'; import { SaveReason } from 'vs/workbench/common/editor'; import type * as vscode from 'vscode'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { NullLogService } from 'vs/platform/log/common/log'; import { timeout } from 'vs/base/common/async'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts b/src/vs/workbench/test/browser/api/extHostDocumentsAndEditors.test.ts similarity index 94% rename from src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts rename to src/vs/workbench/test/browser/api/extHostDocumentsAndEditors.test.ts index 6cd64c2c976..e3f031a03b2 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/browser/api/extHostDocumentsAndEditors.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; +import { TestRPCProtocol } from 'vs/workbench/test/browser/api/testRPCProtocol'; import { NullLogService } from 'vs/platform/log/common/log'; suite('ExtHostDocumentsAndEditors', () => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts b/src/vs/workbench/test/browser/api/extHostFileSystemEventService.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts rename to src/vs/workbench/test/browser/api/extHostFileSystemEventService.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/browser/api/extHostLanguageFeatures.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts rename to src/vs/workbench/test/browser/api/extHostLanguageFeatures.test.ts index f00d6eec6c6..1471cd6e4ef 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/browser/api/extHostLanguageFeatures.test.ts @@ -43,7 +43,7 @@ import { getColors } from 'vs/editor/contrib/colorPicker/color'; import { CancellationToken } from 'vs/base/common/cancellation'; import { nullExtensionDescription as defaultExtension } from 'vs/workbench/services/extensions/common/extensions'; import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/smartSelect'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { dispose } from 'vs/base/common/lifecycle'; import { withNullAsUndefined } from 'vs/base/common/types'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/browser/api/extHostMessagerService.test.ts similarity index 96% rename from src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts rename to src/vs/workbench/test/browser/api/extHostMessagerService.test.ts index 64105b9c089..004b4258742 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/browser/api/extHostMessagerService.test.ts @@ -8,8 +8,9 @@ import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMes import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions, NotificationsFilter } from 'vs/platform/notification/common/notification'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; +import * as platform from 'vs/base/common/platform'; const emptyDialogService = new class implements IDialogService { _serviceBrand: undefined; @@ -97,7 +98,7 @@ suite('ExtHostMessageService', function () { let service = new MainThreadMessageService(null!, new EmptyNotificationService(notification => { assert.equal(notification.actions!.primary!.length, 1); - setImmediate(() => notification.actions!.primary![0].run()); + platform.setImmediate(() => notification.actions!.primary![0].run()); }), emptyCommandService, emptyDialogService); const handle = await service.$showMessage(1, 'h', {}, [{ handle: 42, title: 'a thing', isCloseAffordance: true }]); diff --git a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts b/src/vs/workbench/test/browser/api/extHostTextEditor.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts rename to src/vs/workbench/test/browser/api/extHostTextEditor.test.ts index b783bf6984f..aee71d8b8dd 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts +++ b/src/vs/workbench/test/browser/api/extHostTextEditor.test.ts @@ -9,7 +9,7 @@ import { MainThreadTextEditorsShape, IResolvedTextEditorConfiguration, ITextEdit import { ExtHostTextEditorOptions, ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor'; import { ExtHostDocumentData } from 'vs/workbench/api/common/extHostDocumentData'; import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { NullLogService } from 'vs/platform/log/common/log'; suite('ExtHostTextEditor', () => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts b/src/vs/workbench/test/browser/api/extHostTextEditors.test.ts similarity index 95% rename from src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts rename to src/vs/workbench/test/browser/api/extHostTextEditors.test.ts index eae86a47ac7..035cdeb9957 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts +++ b/src/vs/workbench/test/browser/api/extHostTextEditors.test.ts @@ -6,9 +6,9 @@ import * as assert from 'assert'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; import { MainContext, MainThreadTextEditorsShape, IWorkspaceEditDto } from 'vs/workbench/api/common/extHost.protocol'; import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { SingleProxyRPCProtocol, TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; +import { SingleProxyRPCProtocol, TestRPCProtocol } from 'vs/workbench/test/browser/api/testRPCProtocol'; import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors'; import { WorkspaceTextEdit } from 'vs/editor/common/modes'; import { NullLogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts b/src/vs/workbench/test/browser/api/extHostTreeViews.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts rename to src/vs/workbench/test/browser/api/extHostTreeViews.test.ts index 236d753dc54..887d20ea7ca 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts +++ b/src/vs/workbench/test/browser/api/extHostTreeViews.test.ts @@ -14,7 +14,7 @@ import { TestRPCProtocol } from './testRPCProtocol'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { TreeItemCollapsibleState, ITreeItem } from 'vs/workbench/common/views'; import { NullLogService } from 'vs/platform/log/common/log'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostTypeConverter.test.ts b/src/vs/workbench/test/browser/api/extHostTypeConverter.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/extHostTypeConverter.test.ts rename to src/vs/workbench/test/browser/api/extHostTypeConverter.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts b/src/vs/workbench/test/browser/api/extHostTypes.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts rename to src/vs/workbench/test/browser/api/extHostTypes.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts b/src/vs/workbench/test/browser/api/extHostWebview.test.ts similarity index 98% rename from src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts rename to src/vs/workbench/test/browser/api/extHostWebview.test.ts index 3828c1f7811..f08947b6b03 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts +++ b/src/vs/workbench/test/browser/api/extHostWebview.test.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import type * as vscode from 'vscode'; import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; @@ -10,8 +11,7 @@ import { NullLogService } from 'vs/platform/log/common/log'; import { MainThreadWebviews } from 'vs/workbench/api/browser/mainThreadWebview'; import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview'; import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; -import type * as vscode from 'vscode'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { SingleProxyRPCProtocol } from './testRPCProtocol'; suite('ExtHostWebview', () => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts b/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts rename to src/vs/workbench/test/browser/api/extHostWorkspace.test.ts index c05a1d72fd8..deae2eab0fe 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts +++ b/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts @@ -14,7 +14,7 @@ import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspac import { IMainContext, IWorkspaceData, MainContext, ITextSearchComplete } from 'vs/workbench/api/common/extHost.protocol'; import { RelativePattern } from 'vs/workbench/api/common/extHostTypes'; import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { TestRPCProtocol } from './testRPCProtocol'; import { ExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts b/src/vs/workbench/test/browser/api/mainThreadCommands.test.ts similarity index 97% rename from src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts rename to src/vs/workbench/test/browser/api/mainThreadCommands.test.ts index 8e1f8ac0fcb..cf5f3583914 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts +++ b/src/vs/workbench/test/browser/api/mainThreadCommands.test.ts @@ -8,7 +8,7 @@ import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands' import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; import { SingleProxyRPCProtocol } from './testRPCProtocol'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; suite('MainThreadCommands', function () { diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadConfiguration.test.ts b/src/vs/workbench/test/browser/api/mainThreadConfiguration.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/mainThreadConfiguration.test.ts rename to src/vs/workbench/test/browser/api/mainThreadConfiguration.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts b/src/vs/workbench/test/browser/api/mainThreadDiagnostics.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts rename to src/vs/workbench/test/browser/api/mainThreadDiagnostics.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentContentProviders.test.ts b/src/vs/workbench/test/browser/api/mainThreadDocumentContentProviders.test.ts similarity index 92% rename from src/vs/workbench/test/electron-browser/api/mainThreadDocumentContentProviders.test.ts rename to src/vs/workbench/test/browser/api/mainThreadDocumentContentProviders.test.ts index e77be2cb572..dfef5fee0f5 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentContentProviders.test.ts +++ b/src/vs/workbench/test/browser/api/mainThreadDocumentContentProviders.test.ts @@ -7,10 +7,10 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { MainThreadDocumentContentProviders } from 'vs/workbench/api/browser/mainThreadDocumentContentProviders'; import { TextModel } from 'vs/editor/common/model/textModel'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; +import { TestRPCProtocol } from 'vs/workbench/test/browser/api/testRPCProtocol'; import { TextEdit } from 'vs/editor/common/modes'; suite('MainThreadDocumentContentProviders', function () { diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts b/src/vs/workbench/test/browser/api/mainThreadDocuments.test.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts rename to src/vs/workbench/test/browser/api/mainThreadDocuments.test.ts diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/browser/api/mainThreadDocumentsAndEditors.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts rename to src/vs/workbench/test/browser/api/mainThreadDocumentsAndEditors.test.ts index 04fc91a7a76..2f7c6a1f2b6 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/browser/api/mainThreadDocumentsAndEditors.test.ts @@ -12,7 +12,7 @@ import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta } from 'vs/workbench/api/common/extHost.protocol'; import { createTestCodeEditor, TestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService, TestEnvironmentService } from 'vs/workbench/test/browser/workbenchTestServices'; import { Event } from 'vs/base/common/event'; import { ITextModel } from 'vs/editor/common/model'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts b/src/vs/workbench/test/browser/api/mainThreadEditors.test.ts similarity index 99% rename from src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts rename to src/vs/workbench/test/browser/api/mainThreadEditors.test.ts index 27d399d79da..dedc04cf8d3 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts +++ b/src/vs/workbench/test/browser/api/mainThreadEditors.test.ts @@ -11,7 +11,7 @@ import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ExtHostDocumentsAndEditorsShape, ExtHostContext, ExtHostDocumentsShape, IWorkspaceTextEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { Event } from 'vs/base/common/event'; import { MainThreadTextEditors } from 'vs/workbench/api/browser/mainThreadEditors'; import { URI } from 'vs/base/common/uri'; diff --git a/src/vs/workbench/test/electron-browser/api/mock.ts b/src/vs/workbench/test/browser/api/mock.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/mock.ts rename to src/vs/workbench/test/browser/api/mock.ts diff --git a/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts b/src/vs/workbench/test/browser/api/testRPCProtocol.ts similarity index 100% rename from src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts rename to src/vs/workbench/test/browser/api/testRPCProtocol.ts diff --git a/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts b/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts index ab0b20cdd86..342a63637b7 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts @@ -15,11 +15,11 @@ import { MainContext, MainThreadSearchShape } from 'vs/workbench/api/common/extH import { NativeExtHostSearch } from 'vs/workbench/api/node/extHostSearch'; import { Range } from 'vs/workbench/api/common/extHostTypes'; import { IFileMatch, IFileQuery, IPatternInfo, IRawFileMatch2, ISearchCompleteStats, ISearchQuery, ITextQuery, QueryType, resultIsMatch } from 'vs/workbench/services/search/common/search'; -import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; +import { TestRPCProtocol } from 'vs/workbench/test/browser/api/testRPCProtocol'; import type * as vscode from 'vscode'; import { NullLogService } from 'vs/platform/log/common/log'; import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { mock } from 'vs/workbench/test/browser/api/mock'; import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; import { TextSearchManager } from 'vs/workbench/services/search/common/textSearchManager'; import { NativeTextSearchManager } from 'vs/workbench/services/search/node/textSearchManager'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts index 62188e87d43..39a0ace843c 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadWorkspace.test.ts @@ -8,7 +8,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { ISearchService, IFileQuery } from 'vs/workbench/services/search/common/search'; import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspace'; import * as assert from 'assert'; -import { SingleProxyRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; +import { SingleProxyRPCProtocol } from 'vs/workbench/test/browser/api/testRPCProtocol'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; From f96a99a5776ccdfe0d423e5708ade945f0da8883 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 15:22:02 +0100 Subject: [PATCH 224/624] add "manual" test mode --- test/browser/renderer.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/browser/renderer.html b/test/browser/renderer.html index f1815653511..b08371cdbae 100644 --- a/test/browser/renderer.html +++ b/test/browser/renderer.html @@ -102,7 +102,7 @@ runner.on('pending', test => window.mocha_report('pending', serializeRunnable(test))); }; - window.loadAndRun = async function (modules) { + window.loadAndRun = async function loadAndRun (modules, manual = false) { // load // await Promise.all(modules.map(module => new Promise((resolve, reject) =>{ // require([module], resolve, err => { @@ -120,10 +120,20 @@ // run return new Promise((resolve, reject) => { - mocha.reporter(PlaywrightReporter); + if(!manual) { + mocha.reporter(PlaywrightReporter); + } mocha.run(failCount => resolve(failCount === 0)); }); } + + + const modules = new URL(window.location.href).searchParams.getAll('m'); + if(Array.isArray(modules) && modules.length > 0){ + console.log('MANUALLY running tests', modules); + + loadAndRun(modules, true).then(() => console.log('done'), err => console.log(err)); + } From aaa3c3e26c0a4b5039c917384cabca93d66d5510 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 15:39:17 +0100 Subject: [PATCH 225/624] Files - deal with dangling symbolic links (fix #90075) --- src/vs/base/node/config.ts | 4 +- src/vs/base/node/pfs.ts | 46 ++++++++++++----- src/vs/base/test/node/pfs/pfs.test.ts | 32 ++++++++++-- .../files/node/diskFileSystemProvider.ts | 38 +++++++------- .../node/watcher/nodejs/watcherService.ts | 4 +- .../files/test/node/diskFileService.test.ts | 49 ++++++++++++++++++- 6 files changed, 134 insertions(+), 39 deletions(-) diff --git a/src/vs/base/node/config.ts b/src/vs/base/node/config.ts index 6fac5849f96..6c97609d875 100644 --- a/src/vs/base/node/config.ts +++ b/src/vs/base/node/config.ts @@ -126,8 +126,8 @@ export class ConfigWatcher extends Disposable implements IConfigWatcher { } private async handleSymbolicLink(): Promise { - const { stat, isSymbolicLink } = await statLink(this._path); - if (isSymbolicLink && !stat.isDirectory()) { + const { stat, symbolicLink } = await statLink(this._path); + if (symbolicLink && !stat.isDirectory()) { const realPath = await realpath(this._path); this.watch(realPath, false); diff --git a/src/vs/base/node/pfs.ts b/src/vs/base/node/pfs.ts index 1b294073eed..5d09a037d73 100644 --- a/src/vs/base/node/pfs.ts +++ b/src/vs/base/node/pfs.ts @@ -178,30 +178,52 @@ export function stat(path: string): Promise { } export interface IStatAndLink { + + // The stats of the file. If the file is a symbolic + // link, the stats will be of that target file and + // not the link itself. + // If the file is a symbolic link pointing to a non + // existing file, the stat will be of the link and + // the `dangling` flag will indicate this. stat: fs.Stats; - isSymbolicLink: boolean; + + // Will be provided if the resource is a symbolic link + // on disk. Use the `dangling` flag to find out if it + // points to a resource that does not exist on disk. + symbolicLink?: { dangling: boolean }; } export async function statLink(path: string): Promise { // First stat the link - let linkStat: fs.Stats | undefined; - let linkStatError: NodeJS.ErrnoException | undefined; + let lstats: fs.Stats | undefined; try { - linkStat = await lstat(path); + lstats = await lstat(path); + + // Return early if the stat is not a symbolic link at all + if (!lstats.isSymbolicLink()) { + return { stat: lstats }; + } } catch (error) { - linkStatError = error; + /* ignore - use stat() instead */ } - // Then stat the target and return that - const isLink = !!(linkStat && linkStat.isSymbolicLink()); - if (linkStatError || isLink) { - const fileStat = await stat(path); + // If the stat is a symbolic link or failed to stat, use fs.stat() + // which for symbolic links will stat the target they point to + try { + const stats = await stat(path); - return { stat: fileStat, isSymbolicLink: isLink }; + return { stat: stats, symbolicLink: lstats?.isSymbolicLink() ? { dangling: false } : undefined }; + } catch (error) { + + // If the link points to a non-existing file we still want + // to return it as result while setting dangling: true flag + if (error.code === 'ENOENT' && lstats) { + return { stat: lstats, symbolicLink: { dangling: true } }; + } + + throw error; } - - return { stat: linkStat!, isSymbolicLink: false }; } export function lstat(path: string): Promise { diff --git a/src/vs/base/test/node/pfs/pfs.test.ts b/src/vs/base/test/node/pfs/pfs.test.ts index aa4ca198eb0..13ff45194c4 100644 --- a/src/vs/base/test/node/pfs/pfs.test.ts +++ b/src/vs/base/test/node/pfs/pfs.test.ts @@ -334,7 +334,7 @@ suite('PFS', function () { test('stat link', async () => { if (isWindows) { - return Promise.resolve(); // Symlinks are not the same on win, and we can not create them programitically without admin privileges + return; // Symlinks are not the same on win, and we can not create them programitically without admin privileges } const id1 = uuid.generateUuid(); @@ -349,14 +349,38 @@ suite('PFS', function () { fs.symlinkSync(directory, symbolicLink); let statAndIsLink = await pfs.statLink(directory); - assert.ok(!statAndIsLink!.isSymbolicLink); + assert.ok(!statAndIsLink?.symbolicLink); statAndIsLink = await pfs.statLink(symbolicLink); - assert.ok(statAndIsLink!.isSymbolicLink); + assert.ok(statAndIsLink?.symbolicLink); + assert.ok(!statAndIsLink?.symbolicLink?.dangling); pfs.rimrafSync(directory); }); + test('stat link (non existing target)', async () => { + if (isWindows) { + return; // Symlinks are not the same on win, and we can not create them programitically without admin privileges + } + + const id1 = uuid.generateUuid(); + const parentDir = path.join(os.tmpdir(), 'vsctests', id1); + const directory = path.join(parentDir, 'pfs', id1); + + const id2 = uuid.generateUuid(); + const symbolicLink = path.join(parentDir, 'pfs', id2); + + await pfs.mkdirp(directory, 493); + + fs.symlinkSync(directory, symbolicLink); + + pfs.rimrafSync(directory); + + const statAndIsLink = await pfs.statLink(symbolicLink); + assert.ok(statAndIsLink?.symbolicLink); + assert.ok(statAndIsLink?.symbolicLink?.dangling); + }); + test('readdir', async () => { if (canNormalize && typeof process.versions['electron'] !== 'undefined' /* needs electron */) { const id = uuid.generateUuid(); @@ -546,7 +570,7 @@ suite('PFS', function () { test('writeFile (stream, error handling EACCES)', async () => { if (isLinux) { - return Promise.resolve(); // somehow this test fails on Linux in our TFS builds + return; // somehow this test fails on Linux in our TFS builds } const id = uuid.generateUuid(); diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index bccd1c8d1b0..9382fd31225 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -76,10 +76,10 @@ export class DiskFileSystemProvider extends Disposable implements async stat(resource: URI): Promise { try { - const { stat, isSymbolicLink } = await statLink(this.toFilePath(resource)); // cannot use fs.stat() here to support links properly + const { stat, symbolicLink } = await statLink(this.toFilePath(resource)); // cannot use fs.stat() here to support links properly return { - type: this.toType(stat, isSymbolicLink), + type: this.toType(stat, symbolicLink), ctime: stat.birthtime.getTime(), // intentionally not using ctime here, we want the creation time mtime: stat.mtime.getTime(), size: stat.size @@ -98,18 +98,7 @@ export class DiskFileSystemProvider extends Disposable implements try { let type: FileType; if (child.isSymbolicLink()) { - try { - type = (await this.stat(joinPath(resource, child.name))).type; // always resolve target the link points to if any - } catch (error) { - if (error.code !== FileSystemProviderErrorCode.FileNotFound) { - throw error; // any error that is not file not found is unexpected - } - - // a symbolic link can point to a target that does - // not exist on the file system. in that case we - // still want to return the element as UNKNOWN. - type = FileType.SymbolicLink | FileType.Unknown; - } + type = (await this.stat(joinPath(resource, child.name))).type; // always resolve target the link points to if any } else { type = this.toType(child); } @@ -126,9 +115,24 @@ export class DiskFileSystemProvider extends Disposable implements } } - private toType(entry: Stats | Dirent, isSymbolicLink = entry.isSymbolicLink()): FileType { - let type = entry.isFile() ? FileType.File : entry.isDirectory() ? FileType.Directory : FileType.Unknown; - if (isSymbolicLink) { + private toType(entry: Stats | Dirent, symbolicLink?: { dangling: boolean }): FileType { + + // Signal file type by checking for file / directory, except: + // - symbolic links pointing to non-existing files are FileType.Unknown + // - files that are neither file nor directory are FileType.Unknown + let type: FileType; + if (symbolicLink?.dangling) { + type = FileType.Unknown; + } else if (entry.isFile()) { + type = FileType.File; + } else if (entry.isDirectory()) { + type = FileType.Directory; + } else { + type = FileType.Unknown; + } + + // Always signal symbolic link as file type additionally + if (symbolicLink) { type |= FileType.SymbolicLink; } diff --git a/src/vs/platform/files/node/watcher/nodejs/watcherService.ts b/src/vs/platform/files/node/watcher/nodejs/watcherService.ts index b2bf3498400..b25613a2146 100644 --- a/src/vs/platform/files/node/watcher/nodejs/watcherService.ts +++ b/src/vs/platform/files/node/watcher/nodejs/watcherService.ts @@ -35,14 +35,14 @@ export class FileWatcher extends Disposable { private async startWatching(): Promise { try { - const { stat, isSymbolicLink } = await statLink(this.path); + const { stat, symbolicLink } = await statLink(this.path); if (this.isDisposed) { return; } let pathToWatch = this.path; - if (isSymbolicLink) { + if (symbolicLink) { try { pathToWatch = await realpath(pathToWatch); } catch (error) { diff --git a/src/vs/platform/files/test/node/diskFileService.test.ts b/src/vs/platform/files/test/node/diskFileService.test.ts index c58e7045e14..ad0f3d22529 100644 --- a/src/vs/platform/files/test/node/diskFileService.test.ts +++ b/src/vs/platform/files/test/node/diskFileService.test.ts @@ -445,8 +445,7 @@ suite('Disk File Service', function () { return; // not reliable on windows } - const link = URI.file(join(testDir, 'foo')); - await symlink(link.fsPath, join(testDir, 'bar')); + await symlink(join(testDir, 'foo'), join(testDir, 'bar')); const resolved = await service.resolve(URI.file(testDir)); assert.equal(resolved.isDirectory, true); @@ -485,6 +484,52 @@ suite('Disk File Service', function () { assert.equal((error).fileOperationResult, FileOperationResult.FILE_NOT_FOUND); }); + test('deleteFile - symbolic link (exists)', async () => { + if (isWindows) { + return; // not reliable on windows + } + + const target = URI.file(join(testDir, 'lorem.txt')); + const link = URI.file(join(testDir, 'lorem.txt-linked')); + await symlink(target.fsPath, link.fsPath); + + const source = await service.resolve(link); + + let event: FileOperationEvent; + disposables.add(service.onAfterOperation(e => event = e)); + + await service.del(source.resource); + + assert.equal(existsSync(source.resource.fsPath), false); + + assert.ok(event!); + assert.equal(event!.resource.fsPath, link.fsPath); + assert.equal(event!.operation, FileOperation.DELETE); + + assert.equal(existsSync(target.fsPath), true); // target the link pointed to is never deleted + }); + + test('deleteFile - symbolic link (pointing to non-existing file)', async () => { + if (isWindows) { + return; // not reliable on windows + } + + const target = URI.file(join(testDir, 'foo')); + const link = URI.file(join(testDir, 'bar')); + await symlink(target.fsPath, link.fsPath); + + let event: FileOperationEvent; + disposables.add(service.onAfterOperation(e => event = e)); + + await service.del(link); + + assert.equal(existsSync(link.fsPath), false); + + assert.ok(event!); + assert.equal(event!.resource.fsPath, link.fsPath); + assert.equal(event!.operation, FileOperation.DELETE); + }); + test('deleteFolder (recursive)', async () => { let event: FileOperationEvent; disposables.add(service.onAfterOperation(e => event = e)); From 93379d00b1a42ae2e00215fd3075dfe9e915da78 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 5 Feb 2020 15:44:35 +0100 Subject: [PATCH 226/624] print manual debug instructions when test fail --- test/browser/index.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/browser/index.js b/test/browser/index.js index 19471196973..5421bf9de0d 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -111,6 +111,21 @@ async function runTestsInBrowser(testModules, browserType) { withReporter(new EchoRunner(emitter, browserType.toUpperCase())); + // collection failures for console printing + const fails = []; + emitter.on('fail', (test, err) => { + if (err.stack) { + const regex = /(vs\/.*\.test)\.js/; + for (let line of String(err.stack).split('\n')) { + const match = regex.exec(line); + if (match) { + fails.push(match[1]); + break; + } + } + } + }); + try { // @ts-ignore await page.evaluate(modules => loadAndRun(modules), testModules); @@ -118,6 +133,10 @@ async function runTestsInBrowser(testModules, browserType) { console.error(err); } await browser.close(); + + if (fails.length > 0) { + return `to DEBUG, open ${browserType.toUpperCase()} and navigate to ${target.href}?${fails.map(module => `m=${module}`).join('&')}`; + } } class EchoRunner extends events.EventEmitter { @@ -174,7 +193,13 @@ testModules.then(async modules => { const browserTypes = Array.isArray(argv.browser) ? argv.browser : [argv.browser]; const promises = browserTypes.map(browserType => runTestsInBrowser(modules, browserType)); - await Promise.all(promises); + const messages = await Promise.all(promises); + + for (let msg of messages) { + if (msg) { + console.log(msg); + } + } }).catch(err => { console.error(err); From 4deae50c7dd43961c4525b3753faa954bcd7bb67 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 15:53:25 +0100 Subject: [PATCH 227/624] fixes #89815 --- src/vs/workbench/contrib/files/browser/fileActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 6cdee12a156..43503864a71 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -1025,7 +1025,7 @@ const downloadFileHandler = (accessor: ServicesAccessor) => { triggerDownload(bufferOrUri, s.name); } } else { - let defaultUri = s.isDirectory ? fileDialogService.defaultFolderPath() : fileDialogService.defaultFilePath(); + let defaultUri = s.isDirectory ? fileDialogService.defaultFolderPath(Schemas.file) : fileDialogService.defaultFilePath(Schemas.file); if (defaultUri) { defaultUri = resources.joinPath(defaultUri, s.name); } From ed6fae916ca47f5f2077fc41c1b2be7f06d95ca0 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 16:03:59 +0100 Subject: [PATCH 228/624] Cannot use RegExp.lastIndex to -1 because it will not find any matches afterwards on Safari (#90063) --- src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts index ac23e98889c..05d11060137 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts @@ -670,7 +670,7 @@ export class PieceTreeBase { if (searcher._wordSeparators) { searchText = buffer.buffer.substring(start, end); offsetInBuffer = (offset: number) => offset + start; - searcher.reset(-1); + searcher.reset(0); } else { searchText = buffer.buffer; offsetInBuffer = (offset: number) => offset; From d0d1df690e96c3002f09e0239ee0884e7d7191c3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 16:16:58 +0100 Subject: [PATCH 229/624] upgrade ESRPClient --- build/azure-pipelines/win32/ESRPClient/packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/win32/ESRPClient/packages.config b/build/azure-pipelines/win32/ESRPClient/packages.config index d7a6f144f47..61bb3478bdc 100644 --- a/build/azure-pipelines/win32/ESRPClient/packages.config +++ b/build/azure-pipelines/win32/ESRPClient/packages.config @@ -1,4 +1,4 @@ - + From f647e122015f17594f0a2d63fa151d6b1c84403d Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 16:20:01 +0100 Subject: [PATCH 230/624] debug: do not massage whitespace anymore fixes #73845 --- .../contrib/debug/browser/baseDebugView.ts | 18 +++++------------- .../contrib/debug/browser/debugHover.ts | 5 ++--- .../contrib/debug/browser/replViewer.ts | 2 -- .../debug/browser/watchExpressionsView.ts | 1 - .../debug/test/browser/baseDebugView.test.ts | 11 ++--------- 5 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts index 3d6eafae60a..bce03d9de63 100644 --- a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts +++ b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts @@ -27,7 +27,6 @@ const stringRegex = /^(['"]).*\1$/; const $ = dom.$; export interface IRenderValueOptions { - preserveWhitespace?: boolean; showChanged?: boolean; maxValueLength?: number; showHover?: boolean; @@ -49,11 +48,6 @@ export function renderViewTree(container: HTMLElement): HTMLElement { return treeContainer; } -export function replaceWhitespace(value: string): string { - const map: { [x: string]: string } = { '\n': '\\n', '\r': '\\r', '\t': '\\t' }; - return value.replace(/[\n\r\t]/g, char => map[char]); -} - export function renderExpressionValue(expressionOrValue: IExpressionContainer | string, container: HTMLElement, options: IRenderValueOptions): void { let value = typeof expressionOrValue === 'string' ? expressionOrValue : expressionOrValue.value; @@ -86,11 +80,10 @@ export function renderExpressionValue(expressionOrValue: IExpressionContainer | if (options.maxValueLength && value && value.length > options.maxValueLength) { value = value.substr(0, options.maxValueLength) + '...'; } - if (value && !options.preserveWhitespace) { - value = replaceWhitespace(value); - } else { - value = value || ''; + if (!value) { + value = ''; } + if (options.linkDetector) { container.textContent = ''; const session = (expressionOrValue instanceof ExpressionContainer) ? expressionOrValue.getSession() : undefined; @@ -105,7 +98,7 @@ export function renderExpressionValue(expressionOrValue: IExpressionContainer | export function renderVariable(variable: Variable, data: IVariableTemplateData, showChanged: boolean, highlights: IHighlight[], linkDetector?: LinkDetector): void { if (variable.available) { - let text = replaceWhitespace(variable.name); + let text = variable.name; if (variable.value && typeof variable.name === 'string') { text += ':'; } @@ -118,7 +111,6 @@ export function renderVariable(variable: Variable, data: IVariableTemplateData, renderExpressionValue(variable, data.value, { showChanged, maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET, - preserveWhitespace: false, showHover: true, colorize: true, linkDetector @@ -185,7 +177,7 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer, index: number, templateData: IReplEvaluationResultTemplateData): void { const expression = element.element; renderExpressionValue(expression, templateData.value, { - preserveWhitespace: !expression.hasChildren, showHover: false, colorize: true, linkDetector: this.linkDetector @@ -230,7 +229,6 @@ export class ReplRawObjectsRenderer implements ITreeRenderer { linkDetector = instantiationService.createInstance(LinkDetector); }); - test('replace whitespace', () => { - assert.equal(replaceWhitespace('hey there'), 'hey there'); - assert.equal(replaceWhitespace('hey there\n'), 'hey there\\n'); - assert.equal(replaceWhitespace('hey \r there\n\t'), 'hey \\r there\\n\\t'); - assert.equal(replaceWhitespace('hey \r\t\n\t\t\n there'), 'hey \\r\\t\\n\\t\\t\\n there'); - }); - test('render view tree', () => { const container = $('.container'); const treeContainer = renderViewTree(container); @@ -48,7 +41,7 @@ suite('Debug - Base Debug View', () => { test('render expression value', () => { let container = $('.container'); - renderExpressionValue('render \n me', container, { showHover: true, preserveWhitespace: true }); + renderExpressionValue('render \n me', container, { showHover: true }); assert.equal(container.className, 'value'); assert.equal(container.title, 'render \n me'); assert.equal(container.textContent, 'render \n me'); From 830e2aaaa811bae28eb6e3d5d580a1fb18f98ede Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 16:25:47 +0100 Subject: [PATCH 231/624] simple file dialog - add files to recently opened (#89994) --- .../browser/abstractFileDialogService.ts | 17 ++++++++++++++--- .../electron-browser/fileDialogService.ts | 8 ++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts b/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts index aa6dd31e2de..d481f2ee6ff 100644 --- a/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts +++ b/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import { IWindowOpenable } from 'vs/platform/windows/common/windows'; +import { IWindowOpenable, isWorkspaceToOpen, isFileToOpen } from 'vs/platform/windows/common/windows'; import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, FileFilter, IFileDialogService, IDialogService, ConfirmResult, getFileNamesMessage } from 'vs/platform/dialogs/common/dialogs'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; @@ -14,7 +14,7 @@ import { Schemas } from 'vs/base/common/network'; import * as resources from 'vs/base/common/resources'; import { IInstantiationService, } from 'vs/platform/instantiation/common/instantiation'; import { SimpleFileDialog } from 'vs/workbench/services/dialogs/browser/simpleFileDialog'; -import { WORKSPACE_EXTENSION, isUntitledWorkspace } from 'vs/platform/workspaces/common/workspaces'; +import { WORKSPACE_EXTENSION, isUntitledWorkspace, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFileService } from 'vs/platform/files/common/files'; @@ -24,6 +24,7 @@ import Severity from 'vs/base/common/severity'; import { coalesce } from 'vs/base/common/arrays'; import { trim } from 'vs/base/common/strings'; import { IModeService } from 'vs/editor/common/services/modeService'; +import { ILabelService } from 'vs/platform/label/common/label'; export abstract class AbstractFileDialogService implements IFileDialogService { @@ -39,7 +40,9 @@ export abstract class AbstractFileDialogService implements IFileDialogService { @IFileService protected readonly fileService: IFileService, @IOpenerService protected readonly openerService: IOpenerService, @IDialogService private readonly dialogService: IDialogService, - @IModeService private readonly modeService: IModeService + @IModeService private readonly modeService: IModeService, + @IWorkspacesService private readonly workspacesService: IWorkspacesService, + @ILabelService private readonly labelService: ILabelService ) { } defaultFilePath(schemeFilter = this.getSchemeFilterForWindow()): URI | undefined { @@ -132,6 +135,11 @@ export abstract class AbstractFileDialogService implements IFileDialogService { const stat = await this.fileService.resolve(uri); const toOpen: IWindowOpenable = stat.isDirectory ? { folderUri: uri } : { fileUri: uri }; + if (!isWorkspaceToOpen(toOpen) && isFileToOpen(toOpen)) { + // add the picked file into the list of recently opened + this.workspacesService.addRecentlyOpened([{ fileUri: toOpen.fileUri, label: this.labelService.getUriLabel(toOpen.fileUri) }]); + } + if (stat.isDirectory || options.forceNewWindow || preferNewWindow) { return this.hostService.openWindow([toOpen], { forceNewWindow: options.forceNewWindow }); } else { @@ -146,6 +154,9 @@ export abstract class AbstractFileDialogService implements IFileDialogService { const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems }); if (uri) { + // add the picked file into the list of recently opened + this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri) }]); + if (options.forceNewWindow || preferNewWindow) { return this.hostService.openWindow([{ fileUri: uri }], { forceNewWindow: options.forceNewWindow }); } else { diff --git a/src/vs/workbench/services/dialogs/electron-browser/fileDialogService.ts b/src/vs/workbench/services/dialogs/electron-browser/fileDialogService.ts index a91c1ed01c8..14b4f05f932 100644 --- a/src/vs/workbench/services/dialogs/electron-browser/fileDialogService.ts +++ b/src/vs/workbench/services/dialogs/electron-browser/fileDialogService.ts @@ -20,6 +20,8 @@ import { IElectronService } from 'vs/platform/electron/node/electron'; import { AbstractFileDialogService } from 'vs/workbench/services/dialogs/browser/abstractFileDialogService'; import { Schemas } from 'vs/base/common/network'; import { IModeService } from 'vs/editor/common/services/modeService'; +import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; +import { ILabelService } from 'vs/platform/label/common/label'; export class FileDialogService extends AbstractFileDialogService implements IFileDialogService { @@ -36,9 +38,11 @@ export class FileDialogService extends AbstractFileDialogService implements IFil @IOpenerService openerService: IOpenerService, @IElectronService private readonly electronService: IElectronService, @IDialogService dialogService: IDialogService, - @IModeService modeService: IModeService + @IModeService modeService: IModeService, + @IWorkspacesService workspacesService: IWorkspacesService, + @ILabelService labelService: ILabelService ) { - super(hostService, contextService, historyService, environmentService, instantiationService, configurationService, fileService, openerService, dialogService, modeService); + super(hostService, contextService, historyService, environmentService, instantiationService, configurationService, fileService, openerService, dialogService, modeService, workspacesService, labelService); } private toNativeOpenDialogOptions(options: IPickAndOpenOptions): INativeOpenDialogOptions { From dd0e03961bf8668c6287b1addf44758c7a2c0bc1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 16:28:35 +0100 Subject: [PATCH 232/624] fixes #88065 --- build/azure-pipelines/common/createAsset.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build/azure-pipelines/common/createAsset.ts b/build/azure-pipelines/common/createAsset.ts index 619c92a0412..53c15a28fcf 100644 --- a/build/azure-pipelines/common/createAsset.ts +++ b/build/azure-pipelines/common/createAsset.ts @@ -44,15 +44,16 @@ async function doesAssetExist(blobService: azure.BlobService, quality: string, b return existsResult.exists; } -async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise { +async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, filePath: string, fileName: string): Promise { const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = { contentSettings: { - contentType: mime.lookup(file), + contentType: mime.lookup(filePath), + contentDisposition: `attachment; filename="${fileName}"`, cacheControl: 'max-age=31536000, public' } }; - await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c())); + await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, filePath, blobOptions, err => err ? e(err) : c())); } function getEnv(name: string): string { @@ -66,24 +67,24 @@ function getEnv(name: string): string { } async function main(): Promise { - const [, , platform, type, name, file] = process.argv; + const [, , platform, type, fileName, filePath] = process.argv; const quality = getEnv('VSCODE_QUALITY'); const commit = getEnv('BUILD_SOURCEVERSION'); console.log('Creating asset...'); - const stat = await new Promise((c, e) => fs.stat(file, (err, stat) => err ? e(err) : c(stat))); + const stat = await new Promise((c, e) => fs.stat(filePath, (err, stat) => err ? e(err) : c(stat))); const size = stat.size; console.log('Size:', size); - const stream = fs.createReadStream(file); + const stream = fs.createReadStream(filePath); const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]); console.log('SHA1:', sha1hash); console.log('SHA256:', sha256hash); - const blobName = commit + '/' + name; + const blobName = commit + '/' + fileName; const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!; const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!) @@ -98,7 +99,7 @@ async function main(): Promise { console.log('Uploading blobs to Azure storage...'); - await uploadBlob(blobService, quality, blobName, file); + await uploadBlob(blobService, quality, blobName, filePath, fileName); console.log('Blobs successfully uploaded.'); From cbe897b38d335715f84a204ddd85d60f2915cccc Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 16:34:07 +0100 Subject: [PATCH 233/624] Explorer: decorate files of type "unknown" fixes #90077 --- .../browser/views/explorerDecorationsProvider.ts | 16 +++++++++++++--- .../contrib/files/common/explorerModel.ts | 7 ++++++- .../files/test/browser/explorerView.test.ts | 9 +++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts b/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts index 2eb3bdbff82..86e932e6290 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.ts @@ -14,15 +14,21 @@ import { IExplorerService } from 'vs/workbench/contrib/files/common/files'; import { explorerRootErrorEmitter } from 'vs/workbench/contrib/files/browser/views/explorerViewer'; import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; -export function provideDecorations(fileStat: ExplorerItem | null): IDecorationData | undefined { - if (fileStat && fileStat.isRoot && fileStat.isError) { +export function provideDecorations(fileStat: ExplorerItem): IDecorationData | undefined { + if (fileStat.isRoot && fileStat.isError) { return { tooltip: localize('canNotResolve', "Can not resolve workspace folder"), letter: '!', color: listInvalidItemForeground, }; } - if (fileStat && fileStat.isSymbolicLink) { + if (fileStat.isUnknown) { + return { + tooltip: localize('unknown', "Unknown resource"), + letter: '?' + }; + } + if (fileStat.isSymbolicLink && !fileStat.isUnknown) { return { tooltip: localize('symbolicLlink', "Symbolic Link"), letter: '\u2937' @@ -61,6 +67,10 @@ export class ExplorerDecorationsProvider implements IDecorationsProvider { provideDecorations(resource: URI): IDecorationData | undefined { const fileStat = this.explorerService.findClosest(resource); + if (!fileStat) { + return undefined; + } + return provideDecorations(fileStat); } diff --git a/src/vs/workbench/contrib/files/common/explorerModel.ts b/src/vs/workbench/contrib/files/common/explorerModel.ts index fd01f455765..89873e5ebb6 100644 --- a/src/vs/workbench/contrib/files/common/explorerModel.ts +++ b/src/vs/workbench/contrib/files/common/explorerModel.ts @@ -89,6 +89,7 @@ export class ExplorerItem { private _isSymbolicLink?: boolean, private _name: string = basenameOrAuthority(resource), private _mtime?: number, + private _unknown = false ) { this._isDirectoryResolved = false; this._isDisposed = false; @@ -122,6 +123,10 @@ export class ExplorerItem { return this._name; } + get isUnknown(): boolean { + return this._unknown; + } + get parent(): ExplorerItem | undefined { return this._parent; } @@ -158,7 +163,7 @@ export class ExplorerItem { } static create(fileService: IFileService, raw: IFileStat, parent: ExplorerItem | undefined, resolveTo?: readonly URI[]): ExplorerItem { - const stat = new ExplorerItem(raw.resource, fileService, parent, raw.isDirectory, raw.isSymbolicLink, raw.name, raw.mtime); + const stat = new ExplorerItem(raw.resource, fileService, parent, raw.isDirectory, raw.isSymbolicLink, raw.name, raw.mtime, !raw.isFile && !raw.isDirectory); // Recursively add children if present if (stat.isDirectory) { diff --git a/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts b/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts index 2c40a917185..85a8835d914 100644 --- a/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/explorerView.test.ts @@ -18,8 +18,8 @@ const $ = dom.$; const fileService = new TestFileService(); -function createStat(this: any, path: string, name: string, isFolder: boolean, hasChildren: boolean, size: number, mtime: number, isSymLink = false): ExplorerItem { - return new ExplorerItem(toResource.call(this, path), fileService, undefined, isFolder, isSymLink, name, mtime); +function createStat(this: any, path: string, name: string, isFolder: boolean, hasChildren: boolean, size: number, mtime: number, isSymLink = false, isUnknown = false): ExplorerItem { + return new ExplorerItem(toResource.call(this, path), fileService, undefined, isFolder, isSymLink, name, mtime, isUnknown); } suite('Files - ExplorerView', () => { @@ -56,6 +56,11 @@ suite('Files - ExplorerView', () => { color: listInvalidItemForeground }); + const unknown = createStat.call(this, '/path/to/stat', 'stat', false, false, 8096, d, true, true); + assert.deepEqual(provideDecorations(unknown), { + tooltip: 'Unknown resource', + letter: '?' + }); }); test('compressed navigation controller', async function () { From 6cf823c63f1e4867c5362038986404552f26d13f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 16:38:17 +0100 Subject: [PATCH 234/624] Fix tests on Safari (fixes #90063) --- .../services/decorationRenderOptions.test.ts | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts index 962bbe2d677..cd596ff6a77 100644 --- a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -5,6 +5,7 @@ import * as assert from 'assert'; import * as dom from 'vs/base/browser/dom'; +import * as platform from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl'; @@ -59,6 +60,7 @@ suite('Decoration Render Options', () => { assert( sheet.indexOf('background: url(\'https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png\') center center no-repeat;') > 0 || sheet.indexOf('background: url("https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png") center center / contain no-repeat;') > 0 + || sheet.indexOf('background-image: url("https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png"); background-size: contain; background-position: center center; background-repeat: no-repeat no-repeat;') > 0 ); assert(sheet.indexOf('border-color: yellow;') > 0); assert(sheet.indexOf('background-color: red;') > 0); @@ -139,17 +141,22 @@ suite('Decoration Render Options', () => { assert( sheet.indexOf('background: url(\'file:///Users/foo/bar.png\') center center no-repeat;') > 0 || sheet.indexOf('background: url("file:///Users/foo/bar.png") center center no-repeat;') > 0 + || sheet.indexOf('background-image: url("file:///Users/foo/bar.png"); background-position: center center; background-repeat: no-repeat no-repeat;') > 0 ); + s.removeDecorationType('example'); // windows file path (used as string) - s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); - s.registerDecorationType('example', { gutterIconPath: URI.file('c:\\files\\miles\\more.png') }); - sheet = readStyleSheet(styleSheet); - // TODO@Alex test fails - // assert( - // sheet.indexOf('background: url(\'file:///c%3A/files/miles/more.png\') center center no-repeat;') > 0 - // || sheet.indexOf('background: url("file:///c%3A/files/miles/more.png") center center no-repeat;') > 0 - // ); + if (platform.isWindows) { + s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); + s.registerDecorationType('example', { gutterIconPath: URI.file('c:\\files\\miles\\more.png') }); + sheet = readStyleSheet(styleSheet); + // TODO@Alex test fails + // assert( + // sheet.indexOf('background: url(\'file:///c%3A/files/miles/more.png\') center center no-repeat;') > 0 + // || sheet.indexOf('background: url("file:///c%3A/files/miles/more.png") center center no-repeat;') > 0 + // ); + s.removeDecorationType('example'); + } // URI, only minimal encoding s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); @@ -158,7 +165,9 @@ suite('Decoration Render Options', () => { assert( sheet.indexOf('background: url(\'data:image/svg+xml;base64,PHN2ZyB4b+\') center center no-repeat;') > 0 || sheet.indexOf('background: url("data:image/svg+xml;base64,PHN2ZyB4b+") center center no-repeat;') > 0 + || sheet.indexOf('background-image: url("data:image/svg+xml;base64,PHN2ZyB4b+"); background-position: center center; background-repeat: no-repeat no-repeat;') > 0 ); + s.removeDecorationType('example'); // single quote must always be escaped/encoded s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); @@ -167,7 +176,9 @@ suite('Decoration Render Options', () => { assert( sheet.indexOf('background: url(\'file:///Users/foo/b%27ar.png\') center center no-repeat;') > 0 || sheet.indexOf('background: url("file:///Users/foo/b%27ar.png") center center no-repeat;') > 0 + || sheet.indexOf('background-image: url("file:///Users/foo/b%27ar.png"); background-position: center center; background-repeat: no-repeat no-repeat;') > 0 ); + s.removeDecorationType('example'); s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: URI.parse('http://test/pa\'th') }); @@ -175,6 +186,8 @@ suite('Decoration Render Options', () => { assert( sheet.indexOf('background: url(\'http://test/pa%27th\') center center no-repeat;') > 0 || sheet.indexOf('background: url("http://test/pa%27th") center center no-repeat;') > 0 + || sheet.indexOf('background-image: url("http://test/pa%27th"); background-position: center center; background-repeat: no-repeat no-repeat;') > 0 ); + s.removeDecorationType('example'); }); }); From 317eee1d1a7b9ceeacc6768dba7e1b3b6426a664 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 5 Feb 2020 07:41:47 -0800 Subject: [PATCH 235/624] readd search.location as deprecated --- .../contrib/search/browser/search.contribution.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index 1f641e6366c..901615aa5c4 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -775,6 +775,13 @@ configurationRegistry.registerConfiguration({ description: nls.localize('search.globalFindClipboard', "Controls whether the search view should read or modify the shared find clipboard on macOS."), included: platform.isMacintosh }, + 'search.location': { + type: 'string', + enum: ['sidebar', 'panel'], + default: 'sidebar', + description: nls.localize('search.location', "Controls whether the search will be shown as a view in the sidebar or as a panel in the panel area for more horizontal space."), + deprecationMessage: nls.localize('search.location.deprecationMessage', "This setting is deprecated. Please use the search view's context menu instead.") + }, 'search.collapseResults': { type: 'string', enum: ['auto', 'alwaysCollapse', 'alwaysExpand'], From fb594e362cb2c27cbd74cd987eac35364b6c795c Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 16:46:08 +0100 Subject: [PATCH 236/624] #89665 --- src/vs/workbench/contrib/debug/browser/media/repl.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/media/repl.css b/src/vs/workbench/contrib/debug/browser/media/repl.css index 5295ad89d43..ba2bbf5bccc 100644 --- a/src/vs/workbench/contrib/debug/browser/media/repl.css +++ b/src/vs/workbench/contrib/debug/browser/media/repl.css @@ -30,10 +30,6 @@ cursor: pointer; } -.monaco-workbench.mac .repl .repl-tree .monaco-tl-twistie { - padding-right: 2px; -} - .repl .repl-tree .output.expression.value-and-source { display: flex; } @@ -63,10 +59,6 @@ cursor: text; } -.repl .repl-tree .monaco-list-rows > .monaco-list-row .monaco-tl-twistie.collapsible { - padding-left: 18px !important; -} - .repl .repl-tree .output.expression > .value, .repl .repl-tree .evaluation-result.expression > .value { margin-left: 0px; From 6fe85cd9e194cee4cbc5a9045b17e3ea2380925d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 16:48:05 +0100 Subject: [PATCH 237/624] Fix test --- .../browser/services/decorationRenderOptions.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts index cd596ff6a77..d61207f384e 100644 --- a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -150,11 +150,11 @@ suite('Decoration Render Options', () => { s = new TestCodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: URI.file('c:\\files\\miles\\more.png') }); sheet = readStyleSheet(styleSheet); - // TODO@Alex test fails - // assert( - // sheet.indexOf('background: url(\'file:///c%3A/files/miles/more.png\') center center no-repeat;') > 0 - // || sheet.indexOf('background: url("file:///c%3A/files/miles/more.png") center center no-repeat;') > 0 - // ); + assert( + sheet.indexOf('background: url(\'file:///c%3A/files/miles/more.png\') center center no-repeat;') > 0 + || sheet.indexOf('background: url("file:///c%3A/files/miles/more.png") center center no-repeat;') > 0 + || sheet.indexOf('background: url("file:///c:/files/miles/more.png") center center no-repeat;') > 0 + ); s.removeDecorationType('example'); } From f84d9850e7c49f41dc545c23b30b85446e91cc5c Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 16:52:01 +0100 Subject: [PATCH 238/624] debug: fix integration tests --- .../vscode-api-tests/src/singlefolder-tests/debug.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts index e55c3e3d2a5..57fe86cb82f 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -72,8 +72,7 @@ suite('Debug', function () { const capabilitiesPromise = new Promise(resolve => capabilitiesReceived = resolve); const initializedPromise = new Promise(resolve => initializedReceived = resolve); const configurationDonePromise = new Promise(resolve => configurationDoneReceived = resolve); - const success = await debug.startDebugging(workspace.workspaceFolders![0], 'Launch debug.js'); - assert.equal(success, true); + await commands.executeCommand('workbench.action.debug.start'); await capabilitiesPromise; await initializedPromise; await configurationDonePromise; From b1697ff23deabc3717d07cf1f7668bbf3a15387f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 5 Feb 2020 17:01:35 +0100 Subject: [PATCH 239/624] Revert "upgrade ESRPClient" This reverts commit d0d1df690e96c3002f09e0239ee0884e7d7191c3. --- build/azure-pipelines/win32/ESRPClient/packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/win32/ESRPClient/packages.config b/build/azure-pipelines/win32/ESRPClient/packages.config index 61bb3478bdc..d7a6f144f47 100644 --- a/build/azure-pipelines/win32/ESRPClient/packages.config +++ b/build/azure-pipelines/win32/ESRPClient/packages.config @@ -1,4 +1,4 @@ - + From 35b26f49b7f7de8267ee34387a9df65f2942d8d3 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 5 Feb 2020 08:06:43 -0800 Subject: [PATCH 240/624] use viewsservice over panelservice --- .../bulkEdit/browser/bulkEdit.contribution.ts | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts index 9b9c46fa78c..da9b4d80af1 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEdit.contribution.ts @@ -10,10 +10,9 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; import { WorkspaceEdit } from 'vs/editor/common/modes'; import { BulkEditPane } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditPane'; -import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, FocusedViewContext } from 'vs/workbench/common/views'; +import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry, FocusedViewContext, IViewsService } from 'vs/workbench/common/views'; import { localize } from 'vs/nls'; -import { ViewPaneContainer, ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { PaneCompositePanel } from 'vs/workbench/browser/panel'; +import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { RawContextKey, IContextKeyService, IContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; @@ -28,12 +27,8 @@ import { IEditorInput } from 'vs/workbench/common/editor'; import type { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; -async function getBulkEditPane(panelService: IPanelService): Promise { - let view: ViewPane | undefined; - const activePanel = await panelService.openPanel(BulkEditPane.ID, true); - if (activePanel instanceof PaneCompositePanel) { - view = activePanel.getViewPaneContainer().getView(BulkEditPane.ID); - } +async function getBulkEditPane(viewsService: IViewsService): Promise { + const view = await viewsService.openView(BulkEditPane.ID, true); if (view instanceof BulkEditPane) { return view; } @@ -101,6 +96,7 @@ class BulkEditPreviewContribution { constructor( @IPanelService private readonly _panelService: IPanelService, + @IViewsService private readonly _viewsService: IViewsService, @IEditorGroupsService private readonly _editorGroupsService: IEditorGroupsService, @IBulkEditService bulkEditService: IBulkEditService, @IContextKeyService contextKeyService: IContextKeyService, @@ -124,7 +120,7 @@ class BulkEditPreviewContribution { // the actual work... try { - const view = await getBulkEditPane(this._panelService); + const view = await getBulkEditPane(this._viewsService); if (!view) { return edit; } @@ -175,8 +171,8 @@ registerAction2(class ApplyAction extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.accept(); } @@ -204,8 +200,8 @@ registerAction2(class DiscardAction extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.discard(); } @@ -235,8 +231,8 @@ registerAction2(class ToggleAction extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.toggleChecked(); } @@ -264,8 +260,8 @@ registerAction2(class GroupByFile extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.groupByFile(); } @@ -291,8 +287,8 @@ registerAction2(class GroupByType extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.groupByType(); } @@ -317,8 +313,8 @@ registerAction2(class ToggleGrouping extends Action2 { } async run(accessor: ServicesAccessor): Promise { - const panelService = accessor.get(IPanelService); - const view = await getBulkEditPane(panelService); + const viewsService = accessor.get(IViewsService); + const view = await getBulkEditPane(viewsService); if (view) { view.toggleGrouping(); } From 18f94a526bddcc4758bfa7cc786c0df16238cf74 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 5 Feb 2020 17:22:51 +0100 Subject: [PATCH 241/624] :lipstick: comment --- src/vs/code/electron-main/app.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 712d6f05c5b..f7eaab3895a 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -595,8 +595,6 @@ export class CodeApplication extends Disposable { // Catch file URLs if (uri.authority === Schemas.file && !!uri.path) { const cli = assign(Object.create(null), environmentService.args); - - // hey Ben, we need to convert this `code://file` URI into a `file://` URI const urisToOpen = [{ fileUri: URI.file(uri.fsPath) }]; windowsMainService.open({ context: OpenContext.API, cli, urisToOpen, gotoLineMode: true }); From 58345c6709803d915a9bc4b29418132c1e4004f1 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 5 Feb 2020 17:29:02 +0100 Subject: [PATCH 242/624] [theme] only autoswitch theme with single ext under dev. Fixes #88169 --- .../themes/browser/fileIconThemeStore.ts | 19 +++++++++-------- .../themes/browser/workbenchThemeService.ts | 8 +++---- .../services/themes/common/colorThemeStore.ts | 21 ++++++++++--------- .../themes/common/workbenchThemeService.ts | 2 ++ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/vs/workbench/services/themes/browser/fileIconThemeStore.ts b/src/vs/workbench/services/themes/browser/fileIconThemeStore.ts index 0afad15ee6c..213986a9839 100644 --- a/src/vs/workbench/services/themes/browser/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/browser/fileIconThemeStore.ts @@ -74,9 +74,10 @@ export class FileIconThemeStore extends Disposable { extensionId: ext.description.identifier.value, extensionPublisher: ext.description.publisher, extensionName: ext.description.name, - extensionIsBuiltin: ext.description.isBuiltin + extensionIsBuiltin: ext.description.isBuiltin, + extensionLocation: ext.description.extensionLocation }; - this.onIconThemes(ext.description.extensionLocation, extensionData, ext.value, ext.collector); + this.onIconThemes(extensionData, ext.value, ext.collector); } for (const theme of this.knownIconThemes) { if (!previousIds[theme.id]) { @@ -87,7 +88,7 @@ export class FileIconThemeStore extends Disposable { }); } - private onIconThemes(extensionLocation: URI, extensionData: ExtensionData, iconThemes: IThemeExtensionPoint[], collector: ExtensionMessageCollector): void { + private onIconThemes(extensionData: ExtensionData, iconThemes: IThemeExtensionPoint[], collector: ExtensionMessageCollector): void { if (!Array.isArray(iconThemes)) { collector.error(nls.localize( 'reqarray', @@ -116,9 +117,9 @@ export class FileIconThemeStore extends Disposable { return; } - const iconThemeLocation = resources.joinPath(extensionLocation, iconTheme.path); - if (!resources.isEqualOrParent(iconThemeLocation, extensionLocation)) { - collector.warn(nls.localize('invalid.path.1', "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", iconThemeExtPoint.name, iconThemeLocation.path, extensionLocation.path)); + const iconThemeLocation = resources.joinPath(extensionData.extensionLocation, iconTheme.path); + if (!resources.isEqualOrParent(iconThemeLocation, extensionData.extensionLocation)) { + collector.warn(nls.localize('invalid.path.1', "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", iconThemeExtPoint.name, iconThemeLocation.path, extensionData.extensionLocation.path)); } let themeData = FileIconThemeData.fromExtensionTheme(iconTheme, iconThemeLocation, extensionData); @@ -145,10 +146,10 @@ export class FileIconThemeStore extends Disposable { }); } - public findThemeDataByParentLocation(parentLocation: URI | undefined): Promise { - if (parentLocation) { + public findThemeDataByExtensionLocation(extLocation: URI | undefined): Promise { + if (extLocation) { return this.getFileIconThemes().then(allThemes => { - return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); + return allThemes.filter(t => t.extensionData && resources.isEqualOrParent(t.extensionData.extensionLocation, extLocation)); }); } return Promise.resolve([]); diff --git a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index a3b675c68cc..c2d10bf8442 100644 --- a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -285,8 +285,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { const extDevLocs = this.environmentService.extensionDevelopmentLocationURI; const initializeColorTheme = async () => { - if (extDevLocs && extDevLocs.length > 0) { // in dev mode, switch to a theme provided by the extension under dev. - const devThemes = await this.colorThemeStore.findThemeDataByParentLocation(extDevLocs[0]); + if (extDevLocs && extDevLocs.length === 1) { // in dev mode, switch to a theme provided by the extension under dev. + const devThemes = await this.colorThemeStore.findThemeDataByExtensionLocation(extDevLocs[0]); if (devThemes.length) { return this.setColorTheme(devThemes[0].id, ConfigurationTarget.MEMORY); } @@ -302,8 +302,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { }; const initializeIconTheme = async () => { - if (extDevLocs && extDevLocs.length > 0) { // in dev mode, switch to a theme provided by the extension under dev. - const devThemes = await this.iconThemeStore.findThemeDataByParentLocation(extDevLocs[0]); + if (extDevLocs && extDevLocs.length === 1) { // in dev mode, switch to a theme provided by the extension under dev. + const devThemes = await this.iconThemeStore.findThemeDataByExtensionLocation(extDevLocs[0]); if (devThemes.length) { return this.setFileIconTheme(devThemes[0].id, ConfigurationTarget.MEMORY); } diff --git a/src/vs/workbench/services/themes/common/colorThemeStore.ts b/src/vs/workbench/services/themes/common/colorThemeStore.ts index 7253ada3afd..32dc2ad1d2f 100644 --- a/src/vs/workbench/services/themes/common/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/common/colorThemeStore.ts @@ -71,13 +71,14 @@ export class ColorThemeStore { } this.extensionsColorThemes.length = 0; for (let ext of extensions) { - let extensionData = { + let extensionData: ExtensionData = { extensionId: ext.description.identifier.value, extensionPublisher: ext.description.publisher, extensionName: ext.description.name, - extensionIsBuiltin: ext.description.isBuiltin + extensionIsBuiltin: ext.description.isBuiltin, + extensionLocation: ext.description.extensionLocation }; - this.onThemes(ext.description.extensionLocation, extensionData, ext.value, ext.collector); + this.onThemes(extensionData, ext.value, ext.collector); } for (const theme of this.extensionsColorThemes) { if (!previousIds[theme.id]) { @@ -88,7 +89,7 @@ export class ColorThemeStore { }); } - private onThemes(extensionLocation: URI, extensionData: ExtensionData, themes: IThemeExtensionPoint[], collector: ExtensionMessageCollector): void { + private onThemes(extensionData: ExtensionData, themes: IThemeExtensionPoint[], collector: ExtensionMessageCollector): void { if (!Array.isArray(themes)) { collector.error(nls.localize( 'reqarray', @@ -108,9 +109,9 @@ export class ColorThemeStore { return; } - const colorThemeLocation = resources.joinPath(extensionLocation, theme.path); - if (!resources.isEqualOrParent(colorThemeLocation, extensionLocation)) { - collector.warn(nls.localize('invalid.path.1', "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", themesExtPoint.name, colorThemeLocation.path, extensionLocation.path)); + const colorThemeLocation = resources.joinPath(extensionData.extensionLocation, theme.path); + if (!resources.isEqualOrParent(colorThemeLocation, extensionData.extensionLocation)) { + collector.warn(nls.localize('invalid.path.1', "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", themesExtPoint.name, colorThemeLocation.path, extensionData.extensionLocation.path)); } let themeData = ColorThemeData.fromExtensionTheme(theme, colorThemeLocation, extensionData); @@ -148,10 +149,10 @@ export class ColorThemeStore { }); } - public findThemeDataByParentLocation(parentLocation: URI | undefined): Promise { - if (parentLocation) { + public findThemeDataByExtensionLocation(extLocation: URI | undefined): Promise { + if (extLocation) { return this.getColorThemes().then(allThemes => { - return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); + return allThemes.filter(t => t.extensionData && resources.isEqual(t.extensionData.extensionLocation, extLocation)); }); } return Promise.resolve([]); diff --git a/src/vs/workbench/services/themes/common/workbenchThemeService.ts b/src/vs/workbench/services/themes/common/workbenchThemeService.ts index 4756204b595..16765a13851 100644 --- a/src/vs/workbench/services/themes/common/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/common/workbenchThemeService.ts @@ -8,6 +8,7 @@ import { Event } from 'vs/base/common/event'; import { Color } from 'vs/base/common/color'; import { ITheme, IThemeService, IIconTheme } from 'vs/platform/theme/common/themeService'; import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; +import { URI } from 'vs/base/common/uri'; export const IWorkbenchThemeService = createDecorator('themeService'); @@ -101,6 +102,7 @@ export interface ExtensionData { extensionPublisher: string; extensionName: string; extensionIsBuiltin: boolean; + extensionLocation: URI; } export interface IThemeExtensionPoint { From f344894fea87fa20353773872dc09a739971289e Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 5 Feb 2020 17:40:20 +0100 Subject: [PATCH 243/624] Don't open bottom panel when code is opened from WSL2. Fixes #88135 --- .../contrib/remote/electron-browser/remote.contribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index 69209fe8950..755d1d14ebc 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -348,8 +348,8 @@ class RemoteEmptyWorkbenchPresentation extends Disposable implements IWorkbenchC return shouldShowExplorer(); } - const { remoteAuthority, folderUri, workspace } = environmentService.configuration; - if (remoteAuthority && !folderUri && !workspace) { + const { remoteAuthority, folderUri, workspace, filesToDiff, filesToOpenOrCreate, filesToWait } = environmentService.configuration; + if (remoteAuthority && !folderUri && !workspace && !filesToDiff?.length && !filesToOpenOrCreate?.length && !filesToWait) { remoteAuthorityResolverService.resolveAuthority(remoteAuthority).then(() => { if (shouldShowExplorer()) { commandService.executeCommand('workbench.view.explorer'); From a101d32ff6fcce3a0a1c196b35c18ae6d15ba953 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 5 Feb 2020 18:15:26 +0100 Subject: [PATCH 244/624] temporarily disable start debuggin test since it is flaky --- .../src/singlefolder-tests/debug.test.ts | 143 +++++++++--------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts index 57fe86cb82f..cc45c029717 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/debug.test.ts @@ -4,8 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { debug, workspace, commands, window, Disposable } from 'vscode'; -import { basename } from 'path'; +import { debug, workspace, Disposable } from 'vscode'; import { disposeAll } from '../utils'; suite('Debug', function () { @@ -37,86 +36,86 @@ suite('Debug', function () { disposeAll(toDispose); }); - test('start debugging', async function () { - assert.equal(debug.activeDebugSession, undefined); - let stoppedEvents = 0; - let variablesReceived: () => void; - let capabilitiesReceived: () => void; - let initializedReceived: () => void; - let configurationDoneReceived: () => void; + // test('start debugging', async function () { + // assert.equal(debug.activeDebugSession, undefined); + // let stoppedEvents = 0; + // let variablesReceived: () => void; + // let capabilitiesReceived: () => void; + // let initializedReceived: () => void; + // let configurationDoneReceived: () => void; - const firstVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); - const toDispose: Disposable[] = []; - toDispose.push(debug.registerDebugAdapterTrackerFactory('node2', { - createDebugAdapterTracker: () => ({ - onDidSendMessage: m => { - if (m.event === 'stopped') { - stoppedEvents++; - } - if (m.type === 'response' && m.command === 'variables') { - variablesReceived(); - } - if (m.event === 'capabilities') { - capabilitiesReceived(); - } - if (m.event === 'initialized') { - initializedReceived(); - } - if (m.command === 'configurationDone') { - configurationDoneReceived(); - } - } - }) - })); + // const firstVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); + // const toDispose: Disposable[] = []; + // toDispose.push(debug.registerDebugAdapterTrackerFactory('node2', { + // createDebugAdapterTracker: () => ({ + // onDidSendMessage: m => { + // if (m.event === 'stopped') { + // stoppedEvents++; + // } + // if (m.type === 'response' && m.command === 'variables') { + // variablesReceived(); + // } + // if (m.event === 'capabilities') { + // capabilitiesReceived(); + // } + // if (m.event === 'initialized') { + // initializedReceived(); + // } + // if (m.command === 'configurationDone') { + // configurationDoneReceived(); + // } + // } + // }) + // })); - const capabilitiesPromise = new Promise(resolve => capabilitiesReceived = resolve); - const initializedPromise = new Promise(resolve => initializedReceived = resolve); - const configurationDonePromise = new Promise(resolve => configurationDoneReceived = resolve); - await commands.executeCommand('workbench.action.debug.start'); - await capabilitiesPromise; - await initializedPromise; - await configurationDonePromise; + // const capabilitiesPromise = new Promise(resolve => capabilitiesReceived = resolve); + // const initializedPromise = new Promise(resolve => initializedReceived = resolve); + // const configurationDonePromise = new Promise(resolve => configurationDoneReceived = resolve); + // await commands.executeCommand('workbench.action.debug.start'); + // await capabilitiesPromise; + // await initializedPromise; + // await configurationDonePromise; - assert.notEqual(debug.activeDebugSession, undefined); - assert.equal(debug.activeDebugSession?.name, 'Launch debug.js'); + // assert.notEqual(debug.activeDebugSession, undefined); + // assert.equal(debug.activeDebugSession?.name, 'Launch debug.js'); - await firstVariablesRetrieved; - assert.equal(stoppedEvents, 1); + // await firstVariablesRetrieved; + // assert.equal(stoppedEvents, 1); - const secondVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); - await commands.executeCommand('workbench.action.debug.stepOver'); - await secondVariablesRetrieved; - assert.equal(stoppedEvents, 2); - const editor = window.activeTextEditor; - assert.notEqual(editor, undefined); - assert.equal(basename(editor!.document.fileName), 'debug.js'); + // const secondVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); + // await commands.executeCommand('workbench.action.debug.stepOver'); + // await secondVariablesRetrieved; + // assert.equal(stoppedEvents, 2); + // const editor = window.activeTextEditor; + // assert.notEqual(editor, undefined); + // assert.equal(basename(editor!.document.fileName), 'debug.js'); - const thirdVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); - await commands.executeCommand('workbench.action.debug.stepOver'); - await thirdVariablesRetrieved; - assert.equal(stoppedEvents, 3); + // const thirdVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); + // await commands.executeCommand('workbench.action.debug.stepOver'); + // await thirdVariablesRetrieved; + // assert.equal(stoppedEvents, 3); - const fourthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); - await commands.executeCommand('workbench.action.debug.stepInto'); - await fourthVariablesRetrieved; - assert.equal(stoppedEvents, 4); + // const fourthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); + // await commands.executeCommand('workbench.action.debug.stepInto'); + // await fourthVariablesRetrieved; + // assert.equal(stoppedEvents, 4); - const fifthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); - await commands.executeCommand('workbench.action.debug.stepOut'); - await fifthVariablesRetrieved; - assert.equal(stoppedEvents, 5); + // const fifthVariablesRetrieved = new Promise(resolve => variablesReceived = resolve); + // await commands.executeCommand('workbench.action.debug.stepOut'); + // await fifthVariablesRetrieved; + // assert.equal(stoppedEvents, 5); - let sessionTerminated: () => void; - toDispose.push(debug.onDidTerminateDebugSession(() => { - sessionTerminated(); - })); - const sessionTerminatedPromise = new Promise(resolve => sessionTerminated = resolve); - await commands.executeCommand('workbench.action.debug.stop'); - await sessionTerminatedPromise; - assert.equal(debug.activeDebugSession, undefined); + // let sessionTerminated: () => void; + // toDispose.push(debug.onDidTerminateDebugSession(() => { + // sessionTerminated(); + // })); + // const sessionTerminatedPromise = new Promise(resolve => sessionTerminated = resolve); + // await commands.executeCommand('workbench.action.debug.stop'); + // await sessionTerminatedPromise; + // assert.equal(debug.activeDebugSession, undefined); - disposeAll(toDispose); - }); + // disposeAll(toDispose); + // }); test('start debugging failure', async function () { let errorCount = 0; From 3e500bb935ff3f5254a40aeca511ba0f71fd6b01 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 5 Feb 2020 18:23:38 +0100 Subject: [PATCH 245/624] Add minimap.background color and honour it and its opacity --- .../browser/viewParts/minimap/minimap.ts | 39 ++++++++++++------- src/vs/editor/common/core/rgba.ts | 9 +++++ src/vs/platform/theme/common/colorRegistry.ts | 3 +- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index f0a3db7ae6e..12bcc84b237 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -25,8 +25,8 @@ import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/v import { ViewContext } from 'vs/editor/common/view/viewContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; -import { minimapOpacity, minimapSelection, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { minimapSelection, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, minimapBackground } from 'vs/platform/theme/common/colorRegistry'; +import { registerThemingParticipant, ITheme } from 'vs/platform/theme/common/themeService'; import { ModelDecorationMinimapOptions } from 'vs/editor/common/model/textModel'; import { Selection } from 'vs/editor/common/core/selection'; import { Color } from 'vs/base/common/color'; @@ -107,7 +107,9 @@ class MinimapOptions { */ public readonly canvasOuterHeight: number; - constructor(configuration: IConfiguration) { + public readonly backgroundColor: RGBA8; + + constructor(configuration: IConfiguration, theme: ITheme, tokensColorTracker: MinimapTokensColorTracker) { const options = configuration.options; const pixelRatio = options.get(EditorOption.pixelRatio); const layoutInfo = options.get(EditorOption.layoutInfo); @@ -131,6 +133,16 @@ class MinimapOptions { this.canvasOuterWidth = this.canvasInnerWidth / pixelRatio; this.canvasOuterHeight = this.canvasInnerHeight / pixelRatio; + + this.backgroundColor = MinimapOptions._getMinimapBackground(theme, tokensColorTracker); + } + + private static _getMinimapBackground(theme: ITheme, tokensColorTracker: MinimapTokensColorTracker): RGBA8 { + const themeColor = theme.getColor(minimapBackground); + if (themeColor) { + return new RGBA8(themeColor.rgba.r, themeColor.rgba.g, themeColor.rgba.b, themeColor.rgba.a); + } + return tokensColorTracker.getColor(ColorId.DefaultBackground); } public equals(other: MinimapOptions): boolean { @@ -148,6 +160,7 @@ class MinimapOptions { && this.canvasInnerHeight === other.canvasInnerHeight && this.canvasOuterWidth === other.canvasOuterWidth && this.canvasOuterHeight === other.canvasOuterHeight + && this.backgroundColor.equals(other.backgroundColor) ); } } @@ -447,13 +460,13 @@ class MinimapBuffers { export class Minimap extends ViewPart { + private readonly _tokensColorTracker: MinimapTokensColorTracker; private readonly _domNode: FastDomNode; private readonly _shadow: FastDomNode; private readonly _canvas: FastDomNode; private readonly _decorationsCanvas: FastDomNode; private readonly _slider: FastDomNode; private readonly _sliderHorizontal: FastDomNode; - private readonly _tokensColorTracker: MinimapTokensColorTracker; private readonly _mouseDownListener: IDisposable; private readonly _sliderMouseMoveMonitor: GlobalMouseMoveMonitor; private readonly _sliderMouseDownListener: IDisposable; @@ -473,7 +486,8 @@ export class Minimap extends ViewPart { constructor(context: ViewContext) { super(context); - this._options = new MinimapOptions(this._context.configuration); + this._tokensColorTracker = MinimapTokensColorTracker.getInstance(); + this._options = new MinimapOptions(this._context.configuration, this._context.theme, this._tokensColorTracker); this._lastRenderData = null; this._buffers = null; this._selectionColor = this._context.theme.getColor(minimapSelection); @@ -512,8 +526,6 @@ export class Minimap extends ViewPart { this._sliderHorizontal.setClassName('minimap-slider-horizontal'); this._slider.appendChild(this._sliderHorizontal); - this._tokensColorTracker = MinimapTokensColorTracker.getInstance(); - this._applyLayout(); this._mouseDownListener = dom.addStandardDisposableListener(this._domNode.domNode, 'mousedown', (e) => { @@ -664,7 +676,7 @@ export class Minimap extends ViewPart { this._canvas.domNode.getContext('2d')!, this._options.canvasInnerWidth, this._options.canvasInnerHeight, - this._tokensColorTracker.getColor(ColorId.DefaultBackground) + this._options.backgroundColor ); } } @@ -672,7 +684,7 @@ export class Minimap extends ViewPart { } private _onOptionsMaybeChanged(): boolean { - const opts = new MinimapOptions(this._context.configuration); + const opts = new MinimapOptions(this._context.configuration, this._context.theme, this._tokensColorTracker); if (this._options.equals(opts)) { return false; } @@ -745,6 +757,7 @@ export class Minimap extends ViewPart { this._context.model.invalidateMinimapColorCache(); this._selectionColor = this._context.theme.getColor(minimapSelection); this._renderDecorations = true; + this._onOptionsMaybeChanged(); return true; } @@ -942,7 +955,7 @@ export class Minimap extends ViewPart { // Fetch rendering info from view model for rest of lines that need rendering. const lineInfo = this._context.model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed); const tabSize = lineInfo.tabSize; - const background = this._tokensColorTracker.getColor(ColorId.DefaultBackground); + const background = this._options.backgroundColor; const useLighterFont = this._tokensColorTracker.backgroundIsLight(); // Render the rest of lines @@ -1141,9 +1154,9 @@ export class Minimap extends ViewPart { } registerThemingParticipant((theme, collector) => { - const minimapOpacityValue = theme.getColor(minimapOpacity); - if (minimapOpacityValue) { - collector.addRule(`.monaco-editor .minimap { opacity: ${minimapOpacityValue.rgba.a}; will-change: opacity; }`); + const minimapBackgroundValue = theme.getColor(minimapBackground); + if (minimapBackgroundValue) { + collector.addRule(`.monaco-editor .minimap > canvas { opacity: ${minimapBackgroundValue.rgba.a}; will-change: opacity; }`); } const sliderBackground = theme.getColor(scrollbarSliderBackground); if (sliderBackground) { diff --git a/src/vs/editor/common/core/rgba.ts b/src/vs/editor/common/core/rgba.ts index 3a19425bc4d..3cfbf4e0488 100644 --- a/src/vs/editor/common/core/rgba.ts +++ b/src/vs/editor/common/core/rgba.ts @@ -36,6 +36,15 @@ export class RGBA8 { this.a = RGBA8._clamp(a); } + public equals(other: RGBA8): boolean { + return ( + this.r === other.r + && this.g === other.g + && this.b === other.b + && this.a === other.a + ); + } + private static _clamp(c: number): number { if (c < 0) { return 0; diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 2b47be46c7c..2b47b768fb7 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -238,8 +238,6 @@ export const buttonHoverBackground = registerColor('button.hoverBackground', { d export const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hc: Color.black }, nls.localize('badgeBackground', "Badge background color. Badges are small information labels, e.g. for search results count.")); export const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: '#333', hc: Color.white }, nls.localize('badgeForeground', "Badge foreground color. Badges are small information labels, e.g. for search results count.")); -export const minimapOpacity = registerColor('minimapOpacity', { dark: null, light: null, hc: null }, nls.localize('minimapOpacity', "Opacity of minimap in hex. Color data is ignored.")); - export const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hc: null }, nls.localize('scrollbarShadow', "Scrollbar shadow to indicate that the view is scrolled.")); export const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hc: transparent(contrastBorder, 0.6) }, nls.localize('scrollbarSliderBackground', "Scrollbar slider background color.")); export const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hc: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', "Scrollbar slider background color when hovering.")); @@ -426,6 +424,7 @@ export const minimapFindMatch = registerColor('minimap.findMatchHighlight', { li export const minimapSelection = registerColor('minimap.selectionHighlight', { light: '#ADD6FF', dark: '#264F78', hc: '#ffffff' }, nls.localize('minimapSelectionHighlight', 'Minimap marker color for the editor selection.'), true); export const minimapError = registerColor('minimap.errorHighlight', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('minimapError', 'Minimap marker color for errors.')); export const minimapWarning = registerColor('minimap.warningHighlight', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Minimap marker color for warnings.')); +export const minimapBackground = registerColor('minimap.background', { dark: null, light: null, hc: null }, nls.localize('minimapBackground', "Minimap background color.")); export const problemsErrorIconForeground = registerColor('problemsErrorIcon.foreground', { dark: editorErrorForeground, light: editorErrorForeground, hc: editorErrorForeground }, nls.localize('problemsErrorIconForeground', "The color used for the problems error icon.")); export const problemsWarningIconForeground = registerColor('problemsWarningIcon.foreground', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningForeground }, nls.localize('problemsWarningIconForeground', "The color used for the problems warning icon.")); From 96ac038ffb482f1d54b5fe6cee17bcdbc85de393 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 5 Feb 2020 10:57:26 -0800 Subject: [PATCH 246/624] Remove editor Command usage in terminal Part of #89348 --- .../terminal/browser/terminal.contribution.ts | 121 ++++++++++-------- .../terminal/browser/terminalActions.ts | 14 +- 2 files changed, 73 insertions(+), 62 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index 233193db124..fe60ea195e6 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -10,7 +10,7 @@ import 'vs/css!./media/terminal'; import 'vs/css!./media/widgets'; import 'vs/css!./media/xterm'; import * as nls from 'vs/nls'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { SyncActionDescriptor, registerAction2 } from 'vs/platform/actions/common/actions'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -20,7 +20,7 @@ import * as panel from 'vs/workbench/browser/panel'; import { getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen'; import { Extensions as QuickOpenExtensions, IQuickOpenRegistry, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; -import { ClearSelectionTerminalAction, ClearTerminalAction, CopyTerminalSelectionAction, CreateNewInActiveWorkspaceTerminalAction, CreateNewTerminalAction, DeleteToLineStartTerminalAction, DeleteWordLeftTerminalAction, DeleteWordRightTerminalAction, FindNext, FindPrevious, FocusActiveTerminalAction, FocusNextPaneTerminalAction, FocusNextTerminalAction, FocusPreviousPaneTerminalAction, FocusPreviousTerminalAction, FocusTerminalFindWidgetAction, HideTerminalFindWidgetAction, KillTerminalAction, MoveToLineEndTerminalAction, MoveToLineStartTerminalAction, QuickOpenActionTermContributor, QuickOpenTermAction, RenameTerminalAction, ResizePaneDownTerminalAction, ResizePaneLeftTerminalAction, ResizePaneRightTerminalAction, ResizePaneUpTerminalAction, RunActiveFileInTerminalAction, RunSelectedTextInTerminalAction, ScrollDownPageTerminalAction, ScrollDownTerminalAction, ScrollToBottomTerminalAction, ScrollToNextCommandAction, ScrollToPreviousCommandAction, ScrollToTopTerminalAction, ScrollUpPageTerminalAction, ScrollUpTerminalAction, SelectAllTerminalAction, SelectDefaultShellWindowsTerminalAction, SelectToNextCommandAction, SelectToNextLineAction, SelectToPreviousCommandAction, SelectToPreviousLineAction, SendSequenceTerminalCommand, SplitInActiveWorkspaceTerminalAction, SplitTerminalAction, TerminalPasteAction, TERMINAL_PICKER_PREFIX, ToggleCaseSensitiveCommand, ToggleEscapeSequenceLoggingAction, ToggleRegexCommand, ToggleTerminalAction, ToggleWholeWordCommand, NavigationModeFocusPreviousTerminalAction, NavigationModeFocusNextTerminalAction, NavigationModeExitTerminalAction, ManageWorkspaceShellPermissionsTerminalCommand, CreateNewWithCwdTerminalCommand, RenameWithArgTerminalCommand } from 'vs/workbench/contrib/terminal/browser/terminalActions'; +import { ClearSelectionTerminalAction, ClearTerminalAction, CopyTerminalSelectionAction, CreateNewInActiveWorkspaceTerminalAction, CreateNewTerminalAction, DeleteToLineStartTerminalAction, DeleteWordLeftTerminalAction, DeleteWordRightTerminalAction, FindNext, FindPrevious, FocusActiveTerminalAction, FocusNextPaneTerminalAction, FocusNextTerminalAction, FocusPreviousPaneTerminalAction, FocusPreviousTerminalAction, FocusTerminalFindWidgetAction, HideTerminalFindWidgetAction, KillTerminalAction, MoveToLineEndTerminalAction, MoveToLineStartTerminalAction, QuickOpenActionTermContributor, QuickOpenTermAction, RenameTerminalAction, ResizePaneDownTerminalAction, ResizePaneLeftTerminalAction, ResizePaneRightTerminalAction, ResizePaneUpTerminalAction, RunActiveFileInTerminalAction, RunSelectedTextInTerminalAction, ScrollDownPageTerminalAction, ScrollDownTerminalAction, ScrollToBottomTerminalAction, ScrollToNextCommandAction, ScrollToPreviousCommandAction, ScrollToTopTerminalAction, ScrollUpPageTerminalAction, ScrollUpTerminalAction, SelectAllTerminalAction, SelectDefaultShellWindowsTerminalAction, SelectToNextCommandAction, SelectToNextLineAction, SelectToPreviousCommandAction, SelectToPreviousLineAction, SplitInActiveWorkspaceTerminalAction, SplitTerminalAction, TerminalPasteAction, TERMINAL_PICKER_PREFIX, ToggleCaseSensitiveCommand, ToggleEscapeSequenceLoggingAction, ToggleRegexCommand, ToggleTerminalAction, ToggleWholeWordCommand, NavigationModeFocusPreviousTerminalAction, NavigationModeFocusNextTerminalAction, NavigationModeExitTerminalAction, ManageWorkspaceShellPermissionsTerminalCommand, CreateNewWithCwdTerminalAction, RenameWithArgTerminalAction, SendSequenceTerminalAction } from 'vs/workbench/contrib/terminal/browser/terminalActions'; import { TerminalPanel } from 'vs/workbench/contrib/terminal/browser/terminalPanel'; import { TerminalPickerHandler } from 'vs/workbench/contrib/terminal/browser/terminalQuickOpen'; import { KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, TerminalCursorStyle, TERMINAL_ACTION_CATEGORY, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; @@ -598,66 +598,77 @@ if (BrowserFeatures.clipboard.readText) { linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_V } }, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Paste into Active Terminal', category); } -(new SendSequenceTerminalCommand({ - id: SendSequenceTerminalCommand.ID, - precondition: undefined, - description: { - description: SendSequenceTerminalCommand.LABEL, - args: [{ - name: 'args', - schema: { - type: 'object', - required: ['text'], - properties: { - text: { type: 'string' } - }, - } - }] - } -})).register(); -(new CreateNewWithCwdTerminalCommand({ - id: CreateNewWithCwdTerminalCommand.ID, - precondition: undefined, - description: { - description: CreateNewWithCwdTerminalCommand.LABEL, - args: [{ - name: 'args', - schema: { - type: 'object', - required: ['cwd'], - properties: { - cwd: { - description: CreateNewWithCwdTerminalCommand.CWD_ARG_LABEL, - type: 'string' +registerAction2(class extends SendSequenceTerminalAction { + constructor() { + super({ + id: SendSequenceTerminalAction.ID, + title: SendSequenceTerminalAction.LABEL, + description: { + description: SendSequenceTerminalAction.LABEL, + args: [{ + name: 'args', + schema: { + type: 'object', + required: ['text'], + properties: { + text: { type: 'string' } + }, } - }, + }] } - }] + }); } -})).register(); - -(new RenameWithArgTerminalCommand({ - id: RenameWithArgTerminalCommand.ID, - precondition: undefined, - description: { - description: RenameWithArgTerminalCommand.LABEL, - args: [{ - name: 'args', - schema: { - type: 'object', - required: ['name'], - properties: { - name: { - description: RenameWithArgTerminalCommand.NAME_ARG_LABEL, - type: 'string', - minLength: 1 +}); +registerAction2(class extends CreateNewWithCwdTerminalAction { + constructor() { + super({ + id: CreateNewWithCwdTerminalAction.ID, + title: CreateNewWithCwdTerminalAction.LABEL, + description: { + description: CreateNewWithCwdTerminalAction.LABEL, + args: [{ + name: 'args', + schema: { + type: 'object', + required: ['cwd'], + properties: { + cwd: { + description: CreateNewWithCwdTerminalAction.CWD_ARG_LABEL, + type: 'string' + } + }, } - } + }] } - }] + }); } -})).register(); +}); +registerAction2(class extends RenameWithArgTerminalAction { + constructor() { + super({ + id: RenameWithArgTerminalAction.ID, + title: RenameWithArgTerminalAction.LABEL, + description: { + description: RenameWithArgTerminalAction.LABEL, + args: [{ + name: 'args', + schema: { + type: 'object', + required: ['name'], + properties: { + name: { + description: RenameWithArgTerminalAction.NAME_ARG_LABEL, + type: 'string', + minLength: 1 + } + } + } + }] + } + }); + } +}); setupTerminalCommands(); setupTerminalMenu(); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index fc626858a4a..be68a737b4e 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -24,7 +24,6 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { Command } from 'vs/editor/browser/editorExtensions'; import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; @@ -35,6 +34,7 @@ import { URI } from 'vs/base/common/uri'; import { isWindows } from 'vs/base/common/platform'; import { withNullAsUndefined } from 'vs/base/common/types'; import { ITerminalInstance, ITerminalService, Direction } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { Action2 } from 'vs/platform/actions/common/actions'; export const TERMINAL_PICKER_PREFIX = 'term '; @@ -278,11 +278,11 @@ export class MoveToLineEndTerminalAction extends BaseSendTextTerminalAction { } } -export class SendSequenceTerminalCommand extends Command { +export class SendSequenceTerminalAction extends Action2 { public static readonly ID = TERMINAL_COMMAND_ID.SEND_SEQUENCE; public static readonly LABEL = nls.localize('workbench.action.terminal.sendSequence', "Send Custom Sequence To Terminal"); - public runCommand(accessor: ServicesAccessor, args: any): void { + public run(accessor: ServicesAccessor, args: any): void { const terminalInstance = accessor.get(ITerminalService).getActiveInstance(); if (!terminalInstance) { return; @@ -298,12 +298,12 @@ export class SendSequenceTerminalCommand extends Command { } } -export class CreateNewWithCwdTerminalCommand extends Command { +export class CreateNewWithCwdTerminalAction extends Action2 { public static readonly ID = TERMINAL_COMMAND_ID.NEW_WITH_CWD; public static readonly LABEL = nls.localize('workbench.action.terminal.newWithCwd', "Create New Integrated Terminal Starting in a Custom Working Directory"); public static readonly CWD_ARG_LABEL = nls.localize('workbench.action.terminal.newWithCwd.cwd', "The directory to start the terminal at"); - public runCommand(accessor: ServicesAccessor, args: { cwd: string } | undefined): Promise { + public run(accessor: ServicesAccessor, args: { cwd: string } | undefined): Promise { const terminalService = accessor.get(ITerminalService); const instance = terminalService.createTerminal({ cwd: args?.cwd }); if (!instance) { @@ -1055,12 +1055,12 @@ export class RenameTerminalAction extends Action { }); } } -export class RenameWithArgTerminalCommand extends Command { +export class RenameWithArgTerminalAction extends Action2 { public static readonly ID = TERMINAL_COMMAND_ID.RENAME_WITH_ARG; public static readonly LABEL = nls.localize('workbench.action.terminal.renameWithArg', "Rename the Currently Active Terminal"); public static readonly NAME_ARG_LABEL = nls.localize('workbench.action.terminal.renameWithArg.name', "The new name for the terminal"); - public runCommand( + public run( accessor: ServicesAccessor, args?: { name?: string } ): void { From 6fb482dca116ff15146ad5620e6595b3cada226a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 5 Feb 2020 20:21:03 +0100 Subject: [PATCH 247/624] Fix #89610 --- .../userDataSync/common/extensionsSync.ts | 2 +- .../userDataSync/common/globalStateSync.ts | 2 +- .../userDataSync/common/keybindingsSync.ts | 2 +- .../userDataSync/common/settingsSync.ts | 108 +++++++++--------- .../userDataSync/common/userDataSync.ts | 8 +- .../userDataSync/common/userDataSyncIpc.ts | 8 +- .../common/userDataSyncService.ts | 22 ++-- .../userDataSync/browser/userDataSync.ts | 51 +++++---- .../electron-browser/settingsSyncService.ts | 8 +- .../electron-browser/userDataSyncService.ts | 8 +- 10 files changed, 112 insertions(+), 107 deletions(-) diff --git a/src/vs/platform/userDataSync/common/extensionsSync.ts b/src/vs/platform/userDataSync/common/extensionsSync.ts index cfd1668c471..5724540aa1f 100644 --- a/src/vs/platform/userDataSync/common/extensionsSync.ts +++ b/src/vs/platform/userDataSync/common/extensionsSync.ts @@ -152,7 +152,7 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse throw new Error('Extensions: Conflicts should not occur'); } - resolveConflicts(content: string, remote: boolean): Promise { + accept(content: string): Promise { throw new Error('Extensions: Conflicts should not occur'); } diff --git a/src/vs/platform/userDataSync/common/globalStateSync.ts b/src/vs/platform/userDataSync/common/globalStateSync.ts index 6556d7539c3..c20024d1f20 100644 --- a/src/vs/platform/userDataSync/common/globalStateSync.ts +++ b/src/vs/platform/userDataSync/common/globalStateSync.ts @@ -133,7 +133,7 @@ export class GlobalStateSynchroniser extends AbstractSynchroniser implements IUs throw new Error('UI State: Conflicts should not occur'); } - resolveConflicts(content: string, remote: boolean): Promise { + accept(content: string): Promise { throw new Error('UI State: Conflicts should not occur'); } diff --git a/src/vs/platform/userDataSync/common/keybindingsSync.ts b/src/vs/platform/userDataSync/common/keybindingsSync.ts index b1df87e1c73..76083e2a537 100644 --- a/src/vs/platform/userDataSync/common/keybindingsSync.ts +++ b/src/vs/platform/userDataSync/common/keybindingsSync.ts @@ -170,7 +170,7 @@ export class KeybindingsSynchroniser extends AbstractFileSynchroniser implements } } - async resolveConflicts(content: string, remote: boolean): Promise { + async accept(content: string): Promise { if (this.status === SyncStatus.HasConflicts) { try { await this.apply(content, true); diff --git a/src/vs/platform/userDataSync/common/settingsSync.ts b/src/vs/platform/userDataSync/common/settingsSync.ts index cc43d787469..bd702546688 100644 --- a/src/vs/platform/userDataSync/common/settingsSync.ts +++ b/src/vs/platform/userDataSync/common/settingsSync.ts @@ -17,7 +17,7 @@ import { updateIgnoredSettings, merge, getIgnoredSettings } from 'vs/platform/us import { FormattingOptions } from 'vs/base/common/jsonFormatter'; import * as arrays from 'vs/base/common/arrays'; import * as objects from 'vs/base/common/objects'; -import { isEmptyObject } from 'vs/base/common/types'; +import { isEmptyObject, isUndefinedOrNull } from 'vs/base/common/types'; import { edit } from 'vs/platform/userDataSync/common/content'; import { AbstractFileSynchroniser } from 'vs/platform/userDataSync/common/abstractSynchronizer'; @@ -25,8 +25,9 @@ interface ISyncPreviewResult { readonly fileContent: IFileContent | null; readonly remoteUserData: IUserData; readonly lastSyncUserData: IUserData | null; - readonly localContent: string | null; - readonly remoteContent: string | null; + readonly content: string | null; + readonly hasLocalChanged: boolean; + readonly hasRemoteChanged: boolean; readonly hasConflicts: boolean; readonly conflictSettings: IConflictSetting[]; } @@ -89,18 +90,17 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS if (remoteUserData.content !== null) { const fileContent = await this.getLocalFileContent(); const formatUtils = await this.getFormattingOptions(); - // Update ignored settings - const localContent = updateIgnoredSettings(remoteUserData.content, fileContent ? fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); - await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(localContent)); - + // Update ignored settings from local file content + const content = updateIgnoredSettings(remoteUserData.content, fileContent ? fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); this.syncPreviewResultPromise = createCancelablePromise(() => Promise.resolve({ - hasConflicts: false, - conflictSettings: [], fileContent, - localContent, - remoteContent: null, remoteUserData, lastSyncUserData, + content, + hasLocalChanged: true, + hasRemoteChanged: false, + hasConflicts: false, + conflictSettings: [], })); await this.apply(); @@ -135,21 +135,21 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const formatUtils = await this.getFormattingOptions(); // Remove ignored settings const content = updateIgnoredSettings(fileContent.value.toString(), '{}', getIgnoredSettings(this.configurationService), formatUtils); - await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(content)); const lastSyncUserData = await this.getLastSyncUserData(); const remoteUserData = await this.getRemoteUserData(lastSyncUserData); this.syncPreviewResultPromise = createCancelablePromise(() => Promise.resolve({ - conflictSettings: [], - hasConflicts: false, fileContent, - localContent: null, - remoteContent: content, remoteUserData, lastSyncUserData, + content, + hasRemoteChanged: true, + hasLocalChanged: false, + hasConflicts: false, + conflictSettings: [], })); - await this.apply(undefined, true); + await this.apply(true); } // No local exists to push @@ -208,7 +208,7 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS return false; } - async getRemoteContent(): Promise { + async getRemoteContent(preview?: boolean): Promise { let content: string | null | undefined = null; if (this.syncPreviewResultPromise) { const preview = await this.syncPreviewResultPromise; @@ -218,6 +218,11 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const remoteUserData = await this.getRemoteUserData(lastSyncData); content = remoteUserData.content; } + if (preview && !isUndefinedOrNull(content)) { + const formatUtils = await this.getFormattingOptions(); + // remove ignored settings from the remote content for preview + content = updateIgnoredSettings(content, '{}', getIgnoredSettings(this.configurationService), formatUtils); + } return content !== undefined ? content : null; } @@ -229,16 +234,15 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } } - async resolveConflicts(content: string, remote: boolean): Promise { + async accept(content: string): Promise { if (this.status === SyncStatus.HasConflicts) { try { - if (remote) { - const { fileContent } = await this.syncPreviewResultPromise!; - const formatUtils = await this.getFormattingOptions(); - // Update ignored settings - content = updateIgnoredSettings(content, fileContent ? fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); - } - await this.apply(content, true); + const preview = await this.syncPreviewResultPromise!; + const formatUtils = await this.getFormattingOptions(); + // Add ignored settings from local file content + content = updateIgnoredSettings(content, preview.fileContent ? preview.fileContent.value.toString() : '{}', getIgnoredSettings(this.configurationService), formatUtils); + this.syncPreviewResultPromise = createCancelablePromise(async () => ({ ...preview, content })); + await this.apply(true); this.setStatus(SyncStatus.Idle); } catch (e) { this.logService.error(e); @@ -291,21 +295,14 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS } } - private async apply(content?: string, forcePush?: boolean): Promise { + private async apply(forcePush?: boolean): Promise { if (!this.syncPreviewResultPromise) { return; } - let { fileContent, remoteUserData, lastSyncUserData, localContent, remoteContent } = await this.syncPreviewResultPromise; + let { fileContent, remoteUserData, lastSyncUserData, content, hasLocalChanged, hasRemoteChanged } = await this.syncPreviewResultPromise; - if (content === undefined) { - if (await this.fileService.exists(this.environmentService.settingsSyncPreviewResource)) { - const settingsPreivew = await this.fileService.readFile(this.environmentService.settingsSyncPreviewResource); - content = settingsPreivew.value.toString(); - } - } - - if (content !== undefined) { + if (content !== null) { if (this.hasErrors(content)) { const error = new Error(localize('errorInvalidSettings', "Unable to sync settings. Please resolve conflicts without any errors/warnings and try again.")); @@ -313,15 +310,13 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS throw error; } - if (localContent === null && remoteContent === null) { - this.logService.trace('Settings: No changes found during synchronizing settings.'); - } - if (localContent !== null) { + if (hasLocalChanged) { this.logService.info('Settings: Updating local settings'); await this.updateLocalFileContent(content, fileContent); } - if (remoteContent !== null) { + if (hasRemoteChanged) { const formatUtils = await this.getFormattingOptions(); + // Update ignored settings from remote content = updateIgnoredSettings(content, remoteUserData.content || '{}', getIgnoredSettings(this.configurationService, content), formatUtils); this.logService.info('Settings: Updating remote settings'); const ref = await this.updateRemoteUserData(content, forcePush ? null : remoteUserData.ref); @@ -360,45 +355,48 @@ export class SettingsSynchroniser extends AbstractFileSynchroniser implements IS const remoteUserData = await this.getRemoteUserData(lastSyncUserData); // Get file content last to get the latest const fileContent = await this.getLocalFileContent(); - let localContent: string | null = null; - let remoteContent: string | null = null; + const formatUtils = await this.getFormattingOptions(); + + let content: string | null = null; + let hasLocalChanged: boolean = false; + let hasRemoteChanged: boolean = false; let hasConflicts: boolean = false; let conflictSettings: IConflictSetting[] = []; - let previewContent: string | null = null; if (remoteUserData.content) { - const content: string = fileContent ? fileContent.value.toString() : '{}'; + const localContent: string = fileContent ? fileContent.value.toString() : '{}'; // No action when there are errors - if (this.hasErrors(content)) { + if (this.hasErrors(localContent)) { this.logService.error('Settings: Unable to sync settings as there are errors/warning in settings file.'); } else { this.logService.trace('Settings: Merging remote settings with local settings...'); - const formatUtils = await this.getFormattingOptions(); - const result = merge(content, remoteUserData.content, lastSyncUserData ? lastSyncUserData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); + const result = merge(localContent, remoteUserData.content, lastSyncUserData ? lastSyncUserData.content : null, getIgnoredSettings(this.configurationService), resolvedConflicts, formatUtils); + content = result.localContent || result.remoteContent; + hasLocalChanged = result.localContent !== null; + hasRemoteChanged = result.remoteContent !== null; hasConflicts = result.hasConflicts; conflictSettings = result.conflictsSettings; - localContent = result.localContent; - remoteContent = result.remoteContent; - previewContent = result.localContent || result.remoteContent; } } // First time syncing to remote else if (fileContent) { this.logService.trace('Settings: Remote settings does not exist. Synchronizing settings for the first time.'); - previewContent = fileContent.value.toString(); - remoteContent = fileContent.value.toString(); + content = fileContent.value.toString(); + hasRemoteChanged = true; } - if (previewContent && !token.isCancellationRequested) { + if (content && !token.isCancellationRequested) { + // Remove the ignored settings from the preview. + const previewContent = updateIgnoredSettings(content, '{}', getIgnoredSettings(this.configurationService), formatUtils); await this.fileService.writeFile(this.environmentService.settingsSyncPreviewResource, VSBuffer.fromString(previewContent)); } this.setConflicts(conflictSettings); - return { fileContent, remoteUserData, lastSyncUserData, remoteContent, localContent, conflictSettings, hasConflicts }; + return { fileContent, remoteUserData, lastSyncUserData, content, hasLocalChanged, hasRemoteChanged, conflictSettings, hasConflicts }; } private _formattingOptions: Promise | undefined = undefined; diff --git a/src/vs/platform/userDataSync/common/userDataSync.ts b/src/vs/platform/userDataSync/common/userDataSync.ts index e6ada97aafd..8fae77dfaf7 100644 --- a/src/vs/platform/userDataSync/common/userDataSync.ts +++ b/src/vs/platform/userDataSync/common/userDataSync.ts @@ -204,8 +204,8 @@ export interface ISynchroniser { export interface IUserDataSynchroniser extends ISynchroniser { readonly source: SyncSource; - getRemoteContent(): Promise; - resolveConflicts(content: string, remote: boolean): Promise; + getRemoteContent(preivew?: boolean): Promise; + accept(content: string): Promise; } export const IUserDataSyncService = createDecorator('IUserDataSyncService'); @@ -215,8 +215,8 @@ export interface IUserDataSyncService extends ISynchroniser { isFirstTimeSyncAndHasUserData(): Promise; reset(): Promise; resetLocal(): Promise; - getRemoteContent(source: SyncSource): Promise; - resolveConflictsAndContinueSync(content: string, remote: boolean): Promise; + getRemoteContent(source: SyncSource, preview: boolean): Promise; + accept(source: SyncSource, content: string): Promise; } export const IUserDataAutoSyncService = createDecorator('IUserDataAutoSyncService'); diff --git a/src/vs/platform/userDataSync/common/userDataSyncIpc.ts b/src/vs/platform/userDataSync/common/userDataSyncIpc.ts index e60d4530646..f8d3414a198 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncIpc.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncIpc.ts @@ -25,7 +25,7 @@ export class UserDataSyncChannel implements IServerChannel { call(context: any, command: string, args?: any): Promise { switch (command) { case 'sync': return this.service.sync(); - case 'resolveConflictsAndContinueSync': return this.service.resolveConflictsAndContinueSync(args[0], args[1]); + case 'accept': return this.service.accept(args[0], args[1]); case 'pull': return this.service.pull(); case 'push': return this.service.push(); case '_getInitialStatus': return Promise.resolve(this.service.status); @@ -37,7 +37,7 @@ export class UserDataSyncChannel implements IServerChannel { case 'hasPreviouslySynced': return this.service.hasPreviouslySynced(); case 'hasRemoteData': return this.service.hasRemoteData(); case 'hasLocalData': return this.service.hasLocalData(); - case 'getRemoteContent': return this.service.getRemoteContent(args[0]); + case 'getRemoteContent': return this.service.getRemoteContent(args[0], args[1]); case 'isFirstTimeSyncAndHasUserData': return this.service.isFirstTimeSyncAndHasUserData(); } throw new Error('Invalid call'); @@ -60,7 +60,7 @@ export class SettingsSyncChannel implements IServerChannel { call(context: any, command: string, args?: any): Promise { switch (command) { case 'sync': return this.service.sync(); - case 'resolveConflicts': return this.service.resolveConflicts(args[0], args[1]); + case 'accept': return this.service.accept(args[0]); case 'pull': return this.service.pull(); case 'push': return this.service.push(); case 'restart': return this.service.restart().then(() => this.service.status); @@ -72,7 +72,7 @@ export class SettingsSyncChannel implements IServerChannel { case 'hasRemoteData': return this.service.hasRemoteData(); case 'hasLocalData': return this.service.hasLocalData(); case 'resolveSettingsConflicts': return this.service.resolveSettingsConflicts(args[0]); - case 'getRemoteContent': return this.service.getRemoteContent(); + case 'getRemoteContent': return this.service.getRemoteContent(args[0]); } throw new Error('Invalid call'); } diff --git a/src/vs/platform/userDataSync/common/userDataSyncService.ts b/src/vs/platform/userDataSync/common/userDataSyncService.ts index 688c11d1813..9d67caea8bb 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncService.ts @@ -123,12 +123,9 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ this.logService.trace(`Finished Syncing. Took ${new Date().getTime() - startTime}ms`); } - async resolveConflictsAndContinueSync(content: string, remote: boolean): Promise { - const synchroniser = this.getSynchroniserInConflicts(); - if (!synchroniser) { - throw new Error(localize('no synchroniser with conflicts', "No conflicts detected.")); - } - await synchroniser.resolveConflicts(content, remote); + async accept(source: SyncSource, content: string): Promise { + const synchroniser = this.getSynchroniser(source); + await synchroniser.accept(content); if (synchroniser.status !== SyncStatus.HasConflicts) { await this.sync(); } @@ -199,10 +196,10 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return false; } - async getRemoteContent(source: SyncSource): Promise { + async getRemoteContent(source: SyncSource, preview: boolean): Promise { for (const synchroniser of this.synchronisers) { if (synchroniser.source === source) { - return synchroniser.getRemoteContent(); + return synchroniser.getRemoteContent(preview); } } return null; @@ -313,6 +310,15 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return SyncSource.GlobalState; } + private getSynchroniser(source: SyncSource): IUserDataSynchroniser { + switch (source) { + case SyncSource.Settings: return this.settingsSynchroniser; + case SyncSource.Keybindings: return this.keybindingsSynchroniser; + case SyncSource.Extensions: return this.extensionsSynchroniser; + case SyncSource.GlobalState: return this.globalStateSynchroniser; + } + } + private onDidChangeAuthTokenStatus(token: string | undefined): void { if (!token) { this.stop(); diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 06bb75cbc76..e32e4a9f64c 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -688,10 +688,10 @@ class UserDataRemoteContentProvider implements ITextModelContentProvider { provideTextContent(uri: URI): Promise | null { let promise: Promise | undefined; if (isEqual(uri, toRemoteContentResource(SyncSource.Settings))) { - promise = this.userDataSyncService.getRemoteContent(SyncSource.Settings); + promise = this.userDataSyncService.getRemoteContent(SyncSource.Settings, true); } if (isEqual(uri, toRemoteContentResource(SyncSource.Keybindings))) { - promise = this.userDataSyncService.getRemoteContent(SyncSource.Keybindings); + promise = this.userDataSyncService.getRemoteContent(SyncSource.Keybindings, true); } if (promise) { return promise.then(content => this.modelService.createModel(content || '', this.modeService.create('jsonc'), uri)); @@ -776,36 +776,37 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio private createAcceptChangesWidgetRenderer(): void { if (!this.acceptChangesButton) { - const replaceLabel = localize('accept remote', "Replace (Overwrite Local)"); - const applyLabel = localize('accept local', "Apply"); - this.acceptChangesButton = this.instantiationService.createInstance(FloatingClickWidget, this.editor, getSyncSourceFromRemoteContentResource(this.editor.getModel()!.uri) !== undefined ? replaceLabel : applyLabel, null); + const acceptRemoteLabel = localize('accept remote', "Accept Remote"); + const acceptLocalLabel = localize('accept local', "Accept Local"); + this.acceptChangesButton = this.instantiationService.createInstance(FloatingClickWidget, this.editor, getSyncSourceFromRemoteContentResource(this.editor.getModel()!.uri) !== undefined ? acceptRemoteLabel : acceptLocalLabel, null); this._register(this.acceptChangesButton.onClick(async () => { const model = this.editor.getModel(); if (model) { const conflictsSource = this.userDataSyncService.conflictsSource; const syncSource = getSyncSourceFromRemoteContentResource(model.uri); - this.telemetryService.publicLog2<{ source: string, action: string }, SyncConflictsClassification>('sync/handleConflicts', { source: conflictsSource!, action: syncSource !== undefined ? 'replaceLocal' : 'apply' }); - if (syncSource !== undefined) { - const syncAreaLabel = getSyncAreaLabel(syncSource); - const result = await this.dialogService.confirm({ - type: 'info', - title: localize('Sync overwrite local', "Sync: {0}", replaceLabel), - message: localize('confirm replace and overwrite local', "Would you like to replace Local {0} with Remote {1}?", syncAreaLabel, syncAreaLabel), - primaryButton: replaceLabel - }); - if (!result.confirmed) { - return; + this.telemetryService.publicLog2<{ source: string, action: string }, SyncConflictsClassification>('sync/handleConflicts', { source: conflictsSource!, action: syncSource !== undefined ? 'acceptRemote' : 'acceptLocal' }); + const syncAreaLabel = getSyncAreaLabel(conflictsSource!); + const result = await this.dialogService.confirm({ + type: 'info', + title: syncSource !== undefined + ? localize('Sync accept remote', "Sync: {0}", acceptRemoteLabel) + : localize('Sync accept local', "Sync: {0}", acceptLocalLabel), + message: syncSource !== undefined + ? localize('confirm replace and overwrite local', "Would you like to accept Remote {0} and replace Local {1}?", syncAreaLabel, syncAreaLabel) + : localize('confirm replace and overwrite remote', "Would you like to accept Local {0} and replace Remote {1}?", syncAreaLabel, syncAreaLabel), + primaryButton: syncSource !== undefined ? acceptRemoteLabel : acceptLocalLabel + }); + if (result.confirmed) { + try { + await this.userDataSyncService.accept(conflictsSource!, model.getValue()); + } catch (e) { + this.userDataSyncService.restart().then(() => { + if (conflictsSource === this.userDataSyncService.conflictsSource) { + this.notificationService.warn(localize('update conflicts', "Could not resolve conflicts as there is new local version available. Please try again.")); + } + }); } } - try { - await this.userDataSyncService.resolveConflictsAndContinueSync(model.getValue(), syncSource !== undefined); - } catch (e) { - this.userDataSyncService.restart().then(() => { - if (conflictsSource === this.userDataSyncService.conflictsSource) { - this.notificationService.warn(localize('update conflicts', "Could not resolve conflicts as there is new local version available. Please try again.")); - } - }); - } } })); diff --git a/src/vs/workbench/services/userDataSync/electron-browser/settingsSyncService.ts b/src/vs/workbench/services/userDataSync/electron-browser/settingsSyncService.ts index 9b7f7dc0a44..bdce1889a7e 100644 --- a/src/vs/workbench/services/userDataSync/electron-browser/settingsSyncService.ts +++ b/src/vs/workbench/services/userDataSync/electron-browser/settingsSyncService.ts @@ -84,16 +84,16 @@ export class SettingsSyncService extends Disposable implements ISettingsSyncServ return this.channel.call('hasLocalData'); } - resolveConflicts(content: string, remote: boolean): Promise { - return this.channel.call('resolveConflicts', [content, remote]); + accept(content: string): Promise { + return this.channel.call('accept', [content]); } resolveSettingsConflicts(conflicts: { key: string, value: any | undefined }[]): Promise { return this.channel.call('resolveConflicts', [conflicts]); } - getRemoteContent(): Promise { - return this.channel.call('getRemoteContent'); + getRemoteContent(preview?: boolean): Promise { + return this.channel.call('getRemoteContent', [!!preview]); } private async updateStatus(status: SyncStatus): Promise { diff --git a/src/vs/workbench/services/userDataSync/electron-browser/userDataSyncService.ts b/src/vs/workbench/services/userDataSync/electron-browser/userDataSyncService.ts index 37403a6f7a3..09f62bc9082 100644 --- a/src/vs/workbench/services/userDataSync/electron-browser/userDataSyncService.ts +++ b/src/vs/workbench/services/userDataSync/electron-browser/userDataSyncService.ts @@ -49,8 +49,8 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return this.channel.call('sync'); } - resolveConflictsAndContinueSync(content: string, remote: boolean): Promise { - return this.channel.call('resolveConflictsAndContinueSync', [content, remote]); + accept(source: SyncSource, content: string): Promise { + return this.channel.call('accept', [source, content]); } reset(): Promise { @@ -82,8 +82,8 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return this.channel.call('hasLocalData'); } - getRemoteContent(source: SyncSource): Promise { - return this.channel.call('getRemoteContent', [source]); + getRemoteContent(source: SyncSource, preview: boolean): Promise { + return this.channel.call('getRemoteContent', [source, preview]); } isFirstTimeSyncAndHasUserData(): Promise { From 3a35fae761e2d4fc8ef7c23871913cf369d35226 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 5 Feb 2020 11:32:26 -0800 Subject: [PATCH 248/624] Remove browser/terminalNativeService Fixes #81988 --- .../terminal/browser/terminalNativeService.ts | 34 ------------------- .../terminal/browser/terminalService.ts | 27 +++++++++------ src/vs/workbench/workbench.web.main.ts | 1 - 3 files changed, 17 insertions(+), 45 deletions(-) delete mode 100644 src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts diff --git a/src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts b/src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts deleted file mode 100644 index 5e9bec56438..00000000000 --- a/src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { IOpenFileRequest } from 'vs/platform/windows/common/windows'; -import { ITerminalNativeService, LinuxDistro } from 'vs/workbench/contrib/terminal/common/terminal'; -import { Emitter, Event } from 'vs/base/common/event'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; - -export class TerminalNativeService implements ITerminalNativeService { - public _serviceBrand: undefined; - - public get linuxDistro(): LinuxDistro { return LinuxDistro.Unknown; } - - private readonly _onOpenFileRequest = new Emitter(); - public get onOpenFileRequest(): Event { return this._onOpenFileRequest.event; } - private readonly _onOsResume = new Emitter(); - public get onOsResume(): Event { return this._onOsResume.event; } - - public whenFileDeleted(): Promise { - throw new Error('Not implemented'); - } - - public getWslPath(): Promise { - throw new Error('Not implemented'); - } - - public getWindowsBuildNumber(): number { - throw new Error('Not implemented'); - } -} - -registerSingleton(ITerminalNativeService, TerminalNativeService, true); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index b84718415f1..78e242801bd 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import { TERMINAL_PANEL_ID, IShellLaunchConfig, ITerminalConfigHelper, ITerminalNativeService, ISpawnExtHostProcessRequest, IStartExtensionTerminalRequest, IAvailableShellsRequest, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, ITerminalProcessExtHostProxy, IShellDefinition } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TERMINAL_PANEL_ID, IShellLaunchConfig, ITerminalConfigHelper, ITerminalNativeService, ISpawnExtHostProcessRequest, IStartExtensionTerminalRequest, IAvailableShellsRequest, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, ITerminalProcessExtHostProxy, IShellDefinition, LinuxDistro } from 'vs/workbench/contrib/terminal/common/terminal'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; @@ -12,7 +12,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { TerminalPanel } from 'vs/workbench/contrib/terminal/browser/terminalPanel'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { TerminalTab } from 'vs/workbench/contrib/terminal/browser/terminalTab'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance'; @@ -86,6 +86,8 @@ export class TerminalService implements ITerminalService { protected readonly _onRequestAvailableShells = new Emitter(); public get onRequestAvailableShells(): Event { return this._onRequestAvailableShells.event; } + private readonly _terminalNativeService: ITerminalNativeService | undefined; + constructor( @IContextKeyService private _contextKeyService: IContextKeyService, @IPanelService private _panelService: IPanelService, @@ -96,20 +98,25 @@ export class TerminalService implements ITerminalService { @IExtensionService private _extensionService: IExtensionService, @IFileService private _fileService: IFileService, @IRemoteAgentService private _remoteAgentService: IRemoteAgentService, - @ITerminalNativeService private _terminalNativeService: ITerminalNativeService, @IQuickInputService private _quickInputService: IQuickInputService, - @IConfigurationService private _configurationService: IConfigurationService + @IConfigurationService private _configurationService: IConfigurationService, + @optional(ITerminalNativeService) terminalNativeService: ITerminalNativeService ) { + // @optional could give undefined and properly typing it breaks service registration + this._terminalNativeService = terminalNativeService as ITerminalNativeService | undefined; + this._activeTabIndex = 0; this._isShuttingDown = false; this._findState = new FindReplaceState(); lifecycleService.onBeforeShutdown(event => event.veto(this._onBeforeShutdown())); lifecycleService.onShutdown(() => this._onShutdown()); - this._terminalNativeService.onOpenFileRequest(e => this._onOpenFileRequest(e)); - this._terminalNativeService.onOsResume(() => this._onOsResume()); + if (this._terminalNativeService) { + this._terminalNativeService.onOpenFileRequest(e => this._onOpenFileRequest(e)); + this._terminalNativeService.onOsResume(() => this._onOsResume()); + } this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this._contextKeyService); this._findWidgetVisible = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); - this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper, this._terminalNativeService.linuxDistro); + this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper, this._terminalNativeService?.linuxDistro || LinuxDistro.Unknown); this.onTabDisposed(tab => this._removeTab(tab)); this.onActiveTabChanged(() => { const instance = this.getActiveInstance(); @@ -201,7 +208,7 @@ export class TerminalService implements ITerminalService { // marker file to get deleted and then focus back to the integrated terminal. if (request.termProgram === 'vscode' && request.filesToWait) { const waitMarkerFileUri = URI.revive(request.filesToWait.waitMarkerFileUri); - this._terminalNativeService.whenFileDeleted(waitMarkerFileUri).then(() => { + this._terminalNativeService?.whenFileDeleted(waitMarkerFileUri).then(() => { if (this.terminalInstances.length > 0) { const terminal = this.getActiveInstance(); if (terminal) { @@ -533,7 +540,7 @@ export class TerminalService implements ITerminalService { return; } else if (shellType === WindowsShellType.Wsl) { - if (this._terminalNativeService.getWindowsBuildNumber() >= 17063) { + if (this._terminalNativeService && this._terminalNativeService.getWindowsBuildNumber() >= 17063) { c(this._terminalNativeService.getWslPath(originalPath)); } else { c(originalPath.replace(/\\/g, '/')); @@ -548,7 +555,7 @@ export class TerminalService implements ITerminalService { } } else { const lowerExecutable = executable.toLowerCase(); - if (this._terminalNativeService.getWindowsBuildNumber() >= 17063 && + if (this._terminalNativeService && this._terminalNativeService.getWindowsBuildNumber() >= 17063 && (lowerExecutable.indexOf('wsl') !== -1 || (lowerExecutable.indexOf('bash.exe') !== -1 && lowerExecutable.toLowerCase().indexOf('git') === -1))) { c(this._terminalNativeService.getWslPath(originalPath)); return; diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 28e0750d950..edc6c71b218 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -108,7 +108,6 @@ import 'vs/workbench/contrib/webview/browser/webviewService'; import 'vs/workbench/contrib/webview/browser/webviewWorkbenchService'; // Terminal -import 'vs/workbench/contrib/terminal/browser/terminalNativeService'; import 'vs/workbench/contrib/terminal/browser/terminalInstanceService'; // Tasks From 1db20bbb60330c528212c152d19185cddce86456 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 5 Feb 2020 11:36:45 -0800 Subject: [PATCH 249/624] Update outdated display illustration --- src/vs/editor/contrib/suggest/suggestWidget.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index f53c62e3542..553b6e2a55e 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -51,8 +51,8 @@ interface ISuggestionTemplateData { /** * Flexbox - * < ------- left ------- > < -------- right -------- > - *