From c7d66ad931048987603233729305a91d17548f51 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Thu, 17 Aug 2023 17:55:04 +0200 Subject: [PATCH 01/50] first version of the code which makes the hover hide after 500 ms, not working quite well right now, there appears to be an error, because does not hide even after 500 ms --- .../contrib/hover/browser/contentHover.ts | 2 ++ src/vs/editor/contrib/hover/browser/hover.ts | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index c06e6bac4a7..24011620f10 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -215,6 +215,7 @@ export class ContentHoverController extends Disposable { } public hide(): void { + console.log('Inside of hide of controller'); this._computer.anchor = null; this._hoverOperation.cancel(); this._setCurrentResult(null); @@ -792,6 +793,7 @@ export class ContentHoverWidget extends ResizableContentWidget { } public hide(): void { + console.log('Inside of hide'); if (!this._visibleData) { return; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 2c1e2b2611e..b5e772da6b3 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -213,6 +213,7 @@ export class ModesHoverController implements IEditorContribution { } if (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.position) { + console.log('Before this._contentWidget?.hide() in _onEditorMouseMove'); this._contentWidget?.hide(); if (!this._glyphWidget) { this._glyphWidget = new MarginHoverWidget(this._editor, this._languageService, this._openerService); @@ -223,7 +224,19 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - this._hideWidgets(); + console.log('Before very last _hideWidgets inside of _onEditorMouseMove'); + let mouseMoveEvent: IEditorMouseEvent | undefined; + const mouseMoveDisposable = this._editor.onMouseMove((e) => { + mouseMoveEvent = e; + }); + setTimeout(() => { + // Find appropriate conditions + console.log('mouseMoveEvent : ', mouseMoveEvent); + if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) { + this._hideWidgets(); + } + mouseMoveDisposable.dispose(); + }, 500); } private _onKeyDown(e: IKeyboardEvent): void { @@ -243,6 +256,7 @@ export class ModesHoverController implements IEditorContribution { } private _hideWidgets(): void { + console.log('Inside of _hideWidgets at ', new Date()); if (_sticky) { return; } @@ -252,6 +266,7 @@ export class ModesHoverController implements IEditorContribution { this._hoverActivatedByColorDecoratorClick = false; this._hoverClicked = false; this._glyphWidget?.hide(); + console.log('Before this._contentWidget?.hide() in _hideWidgets'); this._contentWidget?.hide(); } From cd256bbee7e18a2f02c2782081df2ccef2841cf9 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 09:52:13 +0200 Subject: [PATCH 02/50] adding some console logs, need to figure out why the hide widgets does not exactly behave as expected --- src/vs/editor/contrib/hover/browser/contentHover.ts | 4 ++-- src/vs/editor/contrib/hover/browser/hover.ts | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 24011620f10..d363b38fcf1 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -215,7 +215,7 @@ export class ContentHoverController extends Disposable { } public hide(): void { - console.log('Inside of hide of controller'); + console.log('Inside of hide of hover controller'); this._computer.anchor = null; this._hoverOperation.cancel(); this._setCurrentResult(null); @@ -793,7 +793,7 @@ export class ContentHoverWidget extends ResizableContentWidget { } public hide(): void { - console.log('Inside of hide'); + console.log('Inside of hide of content hover widget'); if (!this._visibleData) { return; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index b5e772da6b3..92d2603d855 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -213,7 +213,7 @@ export class ModesHoverController implements IEditorContribution { } if (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.position) { - console.log('Before this._contentWidget?.hide() in _onEditorMouseMove'); + console.log('Before this._contentWidget.hide() in _onEditorMouseMove'); this._contentWidget?.hide(); if (!this._glyphWidget) { this._glyphWidget = new MarginHoverWidget(this._editor, this._languageService, this._openerService); @@ -224,15 +224,15 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - console.log('Before very last _hideWidgets inside of _onEditorMouseMove'); let mouseMoveEvent: IEditorMouseEvent | undefined; const mouseMoveDisposable = this._editor.onMouseMove((e) => { mouseMoveEvent = e; }); setTimeout(() => { - // Find appropriate conditions + // TODO: Find appropriate conditions console.log('mouseMoveEvent : ', mouseMoveEvent); if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) { + console.log('Before very last _hideWidgets() inside of _onEditorMouseMove'); this._hideWidgets(); } mouseMoveDisposable.dispose(); @@ -256,7 +256,6 @@ export class ModesHoverController implements IEditorContribution { } private _hideWidgets(): void { - console.log('Inside of _hideWidgets at ', new Date()); if (_sticky) { return; } @@ -266,7 +265,6 @@ export class ModesHoverController implements IEditorContribution { this._hoverActivatedByColorDecoratorClick = false; this._hoverClicked = false; this._glyphWidget?.hide(); - console.log('Before this._contentWidget?.hide() in _hideWidgets'); this._contentWidget?.hide(); } From b750429907535951df084a3519386c4eb7114ae5 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 14:32:31 +0200 Subject: [PATCH 03/50] adding an additional variable which prevents the widget from disappearing when the calculation is done of whether it should or not disappear --- .../contrib/hover/browser/contentHover.ts | 4 +- src/vs/editor/contrib/hover/browser/hover.ts | 105 ++++++++++++------ 2 files changed, 72 insertions(+), 37 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index d363b38fcf1..96b0e5860fe 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -215,7 +215,7 @@ export class ContentHoverController extends Disposable { } public hide(): void { - console.log('Inside of hide of hover controller'); + console.log('Inside of hide of hover controller at : ', new Date()); this._computer.anchor = null; this._hoverOperation.cancel(); this._setCurrentResult(null); @@ -793,7 +793,7 @@ export class ContentHoverWidget extends ResizableContentWidget { } public hide(): void { - console.log('Inside of hide of content hover widget'); + console.log('Inside of hide of content hover widget at : ', new Date()); if (!this._visibleData) { return; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 92d2603d855..b213a6dcb97 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -55,6 +55,8 @@ export class ModesHoverController implements IEditorContribution { private _isHoverEnabled!: boolean; private _isHoverSticky!: boolean; private _hoverActivatedByColorDecoratorClick: boolean = false; + private _mouseMovedOnTop: boolean = false; + private _calculatingIfShouldDisappear: boolean = false; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -152,46 +154,65 @@ export class ModesHoverController implements IEditorContribution { } } - private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + private _mouseMovedOnTopOfWidget(mouseEvent: IEditorMouseEvent): boolean { const target = mouseEvent.target; - - if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { - return; - } - - if (this._isMouseDown && this._hoverClicked) { - return; - } - - if (this._isHoverSticky && target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) { - // mouse moved on top of content hover widget - return; - } - - if (this._isHoverSticky && this._contentWidget?.containsNode(mouseEvent.event.browserEvent.view?.document.activeElement) && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed) { - // selected text within content hover widget - return; - } - if ( - !this._isHoverSticky && target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID + this._isHoverSticky + && target.type === MouseTargetType.CONTENT_WIDGET + && target.detail === ContentHoverWidget.ID + ) { + // mouse moved on top of content hover widget + return true; + } + if ( + this._isHoverSticky + && this._contentWidget?.containsNode(mouseEvent.event.browserEvent.view?.document.activeElement) + && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed + ) { + // selected text within content hover widget + return true; + } + if ( + !this._isHoverSticky + && target.type === MouseTargetType.CONTENT_WIDGET + && target.detail === ContentHoverWidget.ID && this._contentWidget?.isColorPickerVisible ) { // though the hover is not sticky, the color picker needs to. - return; + return true; } - - if (this._isHoverSticky && target.type === MouseTargetType.OVERLAY_WIDGET && target.detail === MarginHoverWidget.ID) { + if (this._isHoverSticky + && target.type === MouseTargetType.OVERLAY_WIDGET + && target.detail === MarginHoverWidget.ID + ) { // mouse moved on top of overlay hover widget + return true; + } + return false; + } + + private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + const target = mouseEvent.target; + if (this._calculatingIfShouldDisappear || this._contentWidget?.isFocused || this._contentWidget?.isResizing) { + return; + } + if (this._isMouseDown && this._hoverClicked) { return; } - if (this._isHoverSticky && this._contentWidget?.isVisibleFromKeyboard) { // Sticky mode is on and the hover has been shown via keyboard // so moving the mouse has no effect return; } + const mouseMovedOnTopOfWidget = this._mouseMovedOnTopOfWidget(mouseEvent); + console.log('mouseMovedOnTopOfWidget : ', mouseMovedOnTopOfWidget); + if (mouseMovedOnTopOfWidget && this._mouseMovedOnTop !== mouseMovedOnTopOfWidget) { + console.log('updating mouse move on top'); + this._mouseMovedOnTop = mouseMovedOnTopOfWidget; + return; + } + const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); @@ -213,7 +234,7 @@ export class ModesHoverController implements IEditorContribution { } if (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.position) { - console.log('Before this._contentWidget.hide() in _onEditorMouseMove'); + console.log('Before this._contentWidget.hide() in _onEditorMouseMove at : ', new Date()); this._contentWidget?.hide(); if (!this._glyphWidget) { this._glyphWidget = new MarginHoverWidget(this._editor, this._languageService, this._openerService); @@ -228,15 +249,29 @@ export class ModesHoverController implements IEditorContribution { const mouseMoveDisposable = this._editor.onMouseMove((e) => { mouseMoveEvent = e; }); - setTimeout(() => { - // TODO: Find appropriate conditions - console.log('mouseMoveEvent : ', mouseMoveEvent); - if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) { - console.log('Before very last _hideWidgets() inside of _onEditorMouseMove'); - this._hideWidgets(); - } - mouseMoveDisposable.dispose(); - }, 500); + + console.log('this._mouseMovedOnTop : ', this._mouseMovedOnTop); + if (this._mouseMovedOnTop) { + this._calculatingIfShouldDisappear = true; + setTimeout(() => { + // TODO: Find appropriate conditions + console.log('mouseMoveEvent after 500 ms : ', mouseMoveEvent, ' at : ', new Date()); + const targetTimetout = mouseMoveEvent?.target; + console.log('targetTimetout : ', targetTimetout); + console.log('targetTimetout.type : ', targetTimetout?.type); + + if (!mouseMoveEvent || !this._mouseMovedOnTopOfWidget(mouseMoveEvent)) { + console.log('*** Before _hideWidgets() inside of _onEditorMouseMove'); + this._hideWidgets(); + } + mouseMoveDisposable.dispose(); + this._calculatingIfShouldDisappear = false; + }, 1000); + this._mouseMovedOnTop = false; + } else { + console.log('Before final hide widgets'); + this._hideWidgets(); + } } private _onKeyDown(e: IKeyboardEvent): void { From f01ebc2f32f9be7d6385c810370cf4cad543e8c4 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 15:41:09 +0200 Subject: [PATCH 04/50] changing the code so that the timeout is reset when you hover once again over the widget --- src/vs/editor/contrib/hover/browser/hover.ts | 31 +++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index b213a6dcb97..5be74becf1f 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -57,6 +57,7 @@ export class ModesHoverController implements IEditorContribution { private _hoverActivatedByColorDecoratorClick: boolean = false; private _mouseMovedOnTop: boolean = false; private _calculatingIfShouldDisappear: boolean = false; + private _hideWidgetHoveredOutside: NodeJS.Timeout | undefined; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -193,7 +194,7 @@ export class ModesHoverController implements IEditorContribution { private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { const target = mouseEvent.target; - if (this._calculatingIfShouldDisappear || this._contentWidget?.isFocused || this._contentWidget?.isResizing) { + if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { return; } if (this._isMouseDown && this._hoverClicked) { @@ -206,6 +207,15 @@ export class ModesHoverController implements IEditorContribution { } const mouseMovedOnTopOfWidget = this._mouseMovedOnTopOfWidget(mouseEvent); + if (mouseMovedOnTopOfWidget && this._calculatingIfShouldDisappear) { + console.log('before clearing the timeout'); + clearTimeout(this._hideWidgetHoveredOutside); + this._calculatingIfShouldDisappear = false; + this._mouseMovedOnTop = false; + } + if (this._calculatingIfShouldDisappear) { + return; + } console.log('mouseMovedOnTopOfWidget : ', mouseMovedOnTopOfWidget); if (mouseMovedOnTopOfWidget && this._mouseMovedOnTop !== mouseMovedOnTopOfWidget) { console.log('updating mouse move on top'); @@ -245,25 +255,26 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - let mouseMoveEvent: IEditorMouseEvent | undefined; - const mouseMoveDisposable = this._editor.onMouseMove((e) => { - mouseMoveEvent = e; - }); console.log('this._mouseMovedOnTop : ', this._mouseMovedOnTop); + console.log('mouseEvent : ', mouseEvent); + if (this._mouseMovedOnTop) { this._calculatingIfShouldDisappear = true; - setTimeout(() => { + + let mouseMoveEvent: IEditorMouseEvent | undefined; + const mouseMoveDisposable = this._editor.onMouseMove((e) => { + mouseMoveEvent = e; + }); + + this._hideWidgetHoveredOutside = setTimeout(() => { // TODO: Find appropriate conditions console.log('mouseMoveEvent after 500 ms : ', mouseMoveEvent, ' at : ', new Date()); const targetTimetout = mouseMoveEvent?.target; console.log('targetTimetout : ', targetTimetout); console.log('targetTimetout.type : ', targetTimetout?.type); - if (!mouseMoveEvent || !this._mouseMovedOnTopOfWidget(mouseMoveEvent)) { - console.log('*** Before _hideWidgets() inside of _onEditorMouseMove'); - this._hideWidgets(); - } + this._hideWidgets(); mouseMoveDisposable.dispose(); this._calculatingIfShouldDisappear = false; }, 1000); From ac8cc2c8e4f304e78ba463a2404c87127187e1c8 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 15:45:20 +0200 Subject: [PATCH 05/50] cleaning the code --- .../contrib/hover/browser/contentHover.ts | 2 -- src/vs/editor/contrib/hover/browser/hover.ts | 26 ++----------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 96b0e5860fe..c06e6bac4a7 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -215,7 +215,6 @@ export class ContentHoverController extends Disposable { } public hide(): void { - console.log('Inside of hide of hover controller at : ', new Date()); this._computer.anchor = null; this._hoverOperation.cancel(); this._setCurrentResult(null); @@ -793,7 +792,6 @@ export class ContentHoverWidget extends ResizableContentWidget { } public hide(): void { - console.log('Inside of hide of content hover widget at : ', new Date()); if (!this._visibleData) { return; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 5be74becf1f..b00cc17c499 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -155,7 +155,7 @@ export class ModesHoverController implements IEditorContribution { } } - private _mouseMovedOnTopOfWidget(mouseEvent: IEditorMouseEvent): boolean { + private _mouseMovedOverWidget(mouseEvent: IEditorMouseEvent): boolean { const target = mouseEvent.target; if ( this._isHoverSticky @@ -206,9 +206,8 @@ export class ModesHoverController implements IEditorContribution { return; } - const mouseMovedOnTopOfWidget = this._mouseMovedOnTopOfWidget(mouseEvent); + const mouseMovedOnTopOfWidget = this._mouseMovedOverWidget(mouseEvent); if (mouseMovedOnTopOfWidget && this._calculatingIfShouldDisappear) { - console.log('before clearing the timeout'); clearTimeout(this._hideWidgetHoveredOutside); this._calculatingIfShouldDisappear = false; this._mouseMovedOnTop = false; @@ -216,9 +215,7 @@ export class ModesHoverController implements IEditorContribution { if (this._calculatingIfShouldDisappear) { return; } - console.log('mouseMovedOnTopOfWidget : ', mouseMovedOnTopOfWidget); if (mouseMovedOnTopOfWidget && this._mouseMovedOnTop !== mouseMovedOnTopOfWidget) { - console.log('updating mouse move on top'); this._mouseMovedOnTop = mouseMovedOnTopOfWidget; return; } @@ -244,7 +241,6 @@ export class ModesHoverController implements IEditorContribution { } if (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.position) { - console.log('Before this._contentWidget.hide() in _onEditorMouseMove at : ', new Date()); this._contentWidget?.hide(); if (!this._glyphWidget) { this._glyphWidget = new MarginHoverWidget(this._editor, this._languageService, this._openerService); @@ -255,32 +251,14 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - - console.log('this._mouseMovedOnTop : ', this._mouseMovedOnTop); - console.log('mouseEvent : ', mouseEvent); - if (this._mouseMovedOnTop) { this._calculatingIfShouldDisappear = true; - - let mouseMoveEvent: IEditorMouseEvent | undefined; - const mouseMoveDisposable = this._editor.onMouseMove((e) => { - mouseMoveEvent = e; - }); - this._hideWidgetHoveredOutside = setTimeout(() => { - // TODO: Find appropriate conditions - console.log('mouseMoveEvent after 500 ms : ', mouseMoveEvent, ' at : ', new Date()); - const targetTimetout = mouseMoveEvent?.target; - console.log('targetTimetout : ', targetTimetout); - console.log('targetTimetout.type : ', targetTimetout?.type); - this._hideWidgets(); - mouseMoveDisposable.dispose(); this._calculatingIfShouldDisappear = false; }, 1000); this._mouseMovedOnTop = false; } else { - console.log('Before final hide widgets'); this._hideWidgets(); } } From c61dbc1a71355ea7b847fdf1d96fefa47c149196 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 16:44:39 +0200 Subject: [PATCH 06/50] cleaning the code --- src/vs/editor/contrib/hover/browser/hover.ts | 35 ++++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index b00cc17c499..f8685fe7310 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -55,9 +55,8 @@ export class ModesHoverController implements IEditorContribution { private _isHoverEnabled!: boolean; private _isHoverSticky!: boolean; private _hoverActivatedByColorDecoratorClick: boolean = false; - private _mouseMovedOnTop: boolean = false; - private _calculatingIfShouldDisappear: boolean = false; - private _hideWidgetHoveredOutside: NodeJS.Timeout | undefined; + private _mouseWasOverWidget: boolean = false; + private _hideWidgetsTimeout: NodeJS.Timeout | undefined; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -155,7 +154,7 @@ export class ModesHoverController implements IEditorContribution { } } - private _mouseMovedOverWidget(mouseEvent: IEditorMouseEvent): boolean { + private _isMouseOverWidget(mouseEvent: IEditorMouseEvent): boolean { const target = mouseEvent.target; if ( this._isHoverSticky @@ -206,17 +205,16 @@ export class ModesHoverController implements IEditorContribution { return; } - const mouseMovedOnTopOfWidget = this._mouseMovedOverWidget(mouseEvent); - if (mouseMovedOnTopOfWidget && this._calculatingIfShouldDisappear) { - clearTimeout(this._hideWidgetHoveredOutside); - this._calculatingIfShouldDisappear = false; - this._mouseMovedOnTop = false; - } - if (this._calculatingIfShouldDisappear) { + const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); + if (mouseIsOverWidget) { + if (this._hideWidgetsTimeout) { + clearTimeout(this._hideWidgetsTimeout); + this._hideWidgetsTimeout = undefined; + } + this._mouseWasOverWidget = mouseIsOverWidget; return; } - if (mouseMovedOnTopOfWidget && this._mouseMovedOnTop !== mouseMovedOnTopOfWidget) { - this._mouseMovedOnTop = mouseMovedOnTopOfWidget; + if (this._hideWidgetsTimeout) { return; } @@ -251,13 +249,14 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - if (this._mouseMovedOnTop) { - this._calculatingIfShouldDisappear = true; - this._hideWidgetHoveredOutside = setTimeout(() => { + if (this._mouseWasOverWidget) { + // The mouse just left the content widget and a timeout is trigerred to hide the widget + // This timeout will be cancelled if the mouse re-enters the content widget + this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); - this._calculatingIfShouldDisappear = false; + this._hideWidgetsTimeout = undefined; }, 1000); - this._mouseMovedOnTop = false; + this._mouseWasOverWidget = false; } else { this._hideWidgets(); } From a9e67cddfed3673be4e91dbe71f31cc3e7456d55 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 17:06:34 +0200 Subject: [PATCH 07/50] adding a setting in order to be able to control the hiding timeout delay --- src/vs/editor/common/config/editorOptions.ts | 13 +++++++++++++ src/vs/editor/contrib/hover/browser/hover.ts | 4 +++- src/vs/monaco.d.ts | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index eee7baf03c6..b9a7019a0ff 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2031,6 +2031,11 @@ export interface IEditorHoverOptions { * Defaults to true. */ sticky?: boolean; + /** + * Controls how long the hover is visible after you hovered out of it. + * Require sticky setting to be true. + */ + hidingTimeout?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. @@ -2049,6 +2054,7 @@ class EditorHover extends BaseEditorOption this._onEditorMouseDown(e))); this._toUnhook.add(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e))); @@ -255,7 +257,7 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; - }, 1000); + }, this._hidingTimeoutDelay); this._mouseWasOverWidget = false; } else { this._hideWidgets(); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 8fbfcd493ae..15d7529a5e3 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4168,6 +4168,11 @@ declare namespace monaco.editor { * Defaults to true. */ sticky?: boolean; + /** + * Controls how long the hover is visible after you hovered out of it. + * Require sticky setting to be true. + */ + hidingTimeout?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. From 6bbdb146d256e4ee1f09a23c01007fe4098350fd Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 17:09:15 +0200 Subject: [PATCH 08/50] renaming to hiding delay --- src/vs/editor/common/config/editorOptions.ts | 12 ++++++------ src/vs/editor/contrib/hover/browser/hover.ts | 6 +++--- src/vs/monaco.d.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index b9a7019a0ff..50740770537 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2035,7 +2035,7 @@ export interface IEditorHoverOptions { * Controls how long the hover is visible after you hovered out of it. * Require sticky setting to be true. */ - hidingTimeout?: number; + hidingDelay?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. @@ -2054,7 +2054,7 @@ class EditorHover extends BaseEditorOption this._onEditorMouseDown(e))); this._toUnhook.add(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e))); @@ -257,7 +257,7 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; - }, this._hidingTimeoutDelay); + }, this._hidingDelay); this._mouseWasOverWidget = false; } else { this._hideWidgets(); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 15d7529a5e3..9770e7c34a5 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4172,7 +4172,7 @@ declare namespace monaco.editor { * Controls how long the hover is visible after you hovered out of it. * Require sticky setting to be true. */ - hidingTimeout?: number; + hidingDelay?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. From 61975f4b674b516b8e20a5617a6013e8c5e6a87c Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 17:11:01 +0200 Subject: [PATCH 09/50] changing the text to mirror the text for delay --- 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 50740770537..1f7ba29f272 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2082,7 +2082,7 @@ class EditorHover extends BaseEditorOption Date: Fri, 18 Aug 2023 17:12:37 +0200 Subject: [PATCH 10/50] changing the hiding delay to 500 ms --- 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 1f7ba29f272..ef0c0db791e 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2054,7 +2054,7 @@ class EditorHover extends BaseEditorOption Date: Fri, 18 Aug 2023 17:18:21 +0200 Subject: [PATCH 11/50] changed the type of the timeout to any because nodejs module is not recognized on the ci --- src/vs/editor/contrib/hover/browser/hover.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 45050cdee06..6db69e6db79 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -57,7 +57,7 @@ export class ModesHoverController implements IEditorContribution { private _hidingDelay!: number; private _hoverActivatedByColorDecoratorClick: boolean = false; private _mouseWasOverWidget: boolean = false; - private _hideWidgetsTimeout: NodeJS.Timeout | undefined; + private _hideWidgetsTimeout: any; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); From a19c7b689385d8bcf66a10b4bd1217ef3ffabafc Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 17:22:00 +0200 Subject: [PATCH 12/50] placing on a separate line --- src/vs/editor/contrib/hover/browser/hover.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 6db69e6db79..64c3e3d4c1a 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -183,7 +183,8 @@ export class ModesHoverController implements IEditorContribution { // though the hover is not sticky, the color picker needs to. return true; } - if (this._isHoverSticky + if ( + this._isHoverSticky && target.type === MouseTargetType.OVERLAY_WIDGET && target.detail === MarginHoverWidget.ID ) { From 82f86a7f4527801072d319c5928b60b977fce50b Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 28 Aug 2023 17:32:02 +0200 Subject: [PATCH 13/50] adding changes --- .../editor/contrib/hover/browser/contentHover.ts | 5 ++++- src/vs/editor/contrib/hover/browser/hover.ts | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index c06e6bac4a7..94981c8f4ad 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -94,7 +94,10 @@ export class ContentHoverController extends Disposable { /** * Returns true if the hover shows now or will show. */ - public maybeShowAt(mouseEvent: IEditorMouseEvent): boolean { + public maybeShowAt(mouseEvent: IEditorMouseEvent | undefined): boolean { + if (!mouseEvent) { + return false; + } if (this._widget.isResizing) { return true; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 64c3e3d4c1a..f7be5da70ce 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -42,7 +42,7 @@ export class ModesHoverController implements IEditorContribution { public static readonly ID = 'editor.contrib.hover'; private readonly _toUnhook = new DisposableStore(); - private readonly _didChangeConfigurationHandler: IDisposable; + private readonly _editorListenerStore: DisposableStore = new DisposableStore(); private _contentWidget: ContentHoverController | null; @@ -58,6 +58,7 @@ export class ModesHoverController implements IEditorContribution { private _hoverActivatedByColorDecoratorClick: boolean = false; private _mouseWasOverWidget: boolean = false; private _hideWidgetsTimeout: any; + private _mouseMoveEvent: IEditorMouseEvent | undefined; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -76,12 +77,15 @@ export class ModesHoverController implements IEditorContribution { this._hookEvents(); - this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._editorListenerStore.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.hover)) { this._unhookEvents(); this._hookEvents(); } - }); + })); + this._editorListenerStore.add(this._editor.onMouseLeave(() => { + this._mouseMoveEvent = undefined; + })); } private _hookEvents(): void { @@ -195,6 +199,7 @@ export class ModesHoverController implements IEditorContribution { } private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + this._mouseMoveEvent = mouseEvent; const target = mouseEvent.target; if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { return; @@ -258,6 +263,7 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; + contentWidget.maybeShowAt(this._mouseMoveEvent); }, this._hidingDelay); this._mouseWasOverWidget = false; } else { @@ -353,7 +359,7 @@ export class ModesHoverController implements IEditorContribution { public dispose(): void { this._unhookEvents(); this._toUnhook.dispose(); - this._didChangeConfigurationHandler.dispose(); + this._editorListenerStore.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); } From d772a19984f3d9edc76f687cb7d640077a056a89 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 28 Aug 2023 17:35:15 +0200 Subject: [PATCH 14/50] renaming to store --- src/vs/editor/contrib/hover/browser/hover.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index f7be5da70ce..82cefc7f5fc 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -42,7 +42,7 @@ export class ModesHoverController implements IEditorContribution { public static readonly ID = 'editor.contrib.hover'; private readonly _toUnhook = new DisposableStore(); - private readonly _editorListenerStore: DisposableStore = new DisposableStore(); + private readonly _store: DisposableStore = new DisposableStore(); private _contentWidget: ContentHoverController | null; @@ -77,13 +77,13 @@ export class ModesHoverController implements IEditorContribution { this._hookEvents(); - this._editorListenerStore.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._store.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.hover)) { this._unhookEvents(); this._hookEvents(); } })); - this._editorListenerStore.add(this._editor.onMouseLeave(() => { + this._store.add(this._editor.onMouseLeave(() => { this._mouseMoveEvent = undefined; })); } @@ -359,7 +359,7 @@ export class ModesHoverController implements IEditorContribution { public dispose(): void { this._unhookEvents(); this._toUnhook.dispose(); - this._editorListenerStore.dispose(); + this._store.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); } From f59113c430beecd03597f5e2d37c9e39cd7b7b44 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 28 Aug 2023 17:44:19 +0200 Subject: [PATCH 15/50] removing a useless import --- src/vs/editor/contrib/hover/browser/hover.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 82cefc7f5fc..d38b3b4705b 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -5,7 +5,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; +import { DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; From 86ccd65557365fe38f14c393dd65134e4589961e Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 13:07:40 +0200 Subject: [PATCH 16/50] returning early instead of setting to null --- src/vs/editor/contrib/hover/browser/contentHover.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 94981c8f4ad..89897e9c170 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -207,7 +207,7 @@ export class ContentHoverController extends Disposable { return; } if (hoverResult && hoverResult.messages.length === 0) { - hoverResult = null; + return; } this._currentResult = hoverResult; if (this._currentResult) { From c590f7934b7da1cf6fc5a76878e536c446aabb0d Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 13:53:38 +0200 Subject: [PATCH 17/50] placing the code block in the beginning, makes more sense --- src/vs/editor/contrib/hover/browser/hover.ts | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index d38b3b4705b..99509930737 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -200,7 +200,20 @@ export class ModesHoverController implements IEditorContribution { private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { this._mouseMoveEvent = mouseEvent; - const target = mouseEvent.target; + const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); + // If the mouse is over the widget and the hiding timeout is defined, then cancel it + if (mouseIsOverWidget) { + if (this._hideWidgetsTimeout) { + clearTimeout(this._hideWidgetsTimeout); + this._hideWidgetsTimeout = undefined; + } + this._mouseWasOverWidget = mouseIsOverWidget; + return; + } + // If the mouse is not over the widget and the hiding timeout is defined, then do an early return + if (this._hideWidgetsTimeout) { + return; + } if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { return; } @@ -213,19 +226,7 @@ export class ModesHoverController implements IEditorContribution { return; } - const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); - if (mouseIsOverWidget) { - if (this._hideWidgetsTimeout) { - clearTimeout(this._hideWidgetsTimeout); - this._hideWidgetsTimeout = undefined; - } - this._mouseWasOverWidget = mouseIsOverWidget; - return; - } - if (this._hideWidgetsTimeout) { - return; - } - + const target = mouseEvent.target; const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); From 2ab18236b68ab989065f8a6d38fefffca76af533 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 14:01:43 +0200 Subject: [PATCH 18/50] no longer need maybeShowAt --- src/vs/editor/contrib/hover/browser/hover.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 99509930737..900c2da7c5b 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -264,7 +264,6 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; - contentWidget.maybeShowAt(this._mouseMoveEvent); }, this._hidingDelay); this._mouseWasOverWidget = false; } else { From 9ff71daecaf7c8da555b2f7de35403eb9570135e Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 14:03:49 +0200 Subject: [PATCH 19/50] removing mouse event which is not needed --- src/vs/editor/contrib/hover/browser/hover.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 900c2da7c5b..a536b905d48 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -58,7 +58,6 @@ export class ModesHoverController implements IEditorContribution { private _hoverActivatedByColorDecoratorClick: boolean = false; private _mouseWasOverWidget: boolean = false; private _hideWidgetsTimeout: any; - private _mouseMoveEvent: IEditorMouseEvent | undefined; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -83,9 +82,6 @@ export class ModesHoverController implements IEditorContribution { this._hookEvents(); } })); - this._store.add(this._editor.onMouseLeave(() => { - this._mouseMoveEvent = undefined; - })); } private _hookEvents(): void { @@ -199,7 +195,6 @@ export class ModesHoverController implements IEditorContribution { } private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { - this._mouseMoveEvent = mouseEvent; const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); // If the mouse is over the widget and the hiding timeout is defined, then cancel it if (mouseIsOverWidget) { From 32df695b47c525b43f3a58cea76ffc0a116afd72 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 14:04:27 +0200 Subject: [PATCH 20/50] resetting part of the code to what it was --- src/vs/editor/contrib/hover/browser/contentHover.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 89897e9c170..9e0b0c08838 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -94,10 +94,7 @@ export class ContentHoverController extends Disposable { /** * Returns true if the hover shows now or will show. */ - public maybeShowAt(mouseEvent: IEditorMouseEvent | undefined): boolean { - if (!mouseEvent) { - return false; - } + public maybeShowAt(mouseEvent: IEditorMouseEvent): boolean { if (this._widget.isResizing) { return true; } From 6f9505cad363388e023a3fe3b7053984ba1cca8b Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 14:05:48 +0200 Subject: [PATCH 21/50] resetting to using the variable from before, store not needed --- src/vs/editor/contrib/hover/browser/hover.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index a536b905d48..4929864bcee 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -5,7 +5,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; @@ -42,7 +42,7 @@ export class ModesHoverController implements IEditorContribution { public static readonly ID = 'editor.contrib.hover'; private readonly _toUnhook = new DisposableStore(); - private readonly _store: DisposableStore = new DisposableStore(); + private readonly _didChangeConfigurationHandler: IDisposable; private _contentWidget: ContentHoverController | null; @@ -76,12 +76,12 @@ export class ModesHoverController implements IEditorContribution { this._hookEvents(); - this._store.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.hover)) { this._unhookEvents(); this._hookEvents(); } - })); + }); } private _hookEvents(): void { @@ -354,7 +354,7 @@ export class ModesHoverController implements IEditorContribution { public dispose(): void { this._unhookEvents(); this._toUnhook.dispose(); - this._store.dispose(); + this._didChangeConfigurationHandler.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); } From a5127c66af1e624d07be16498e35efd288721af2 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 30 Aug 2023 14:24:34 +0200 Subject: [PATCH 22/50] adding back changes --- .../contrib/hover/browser/contentHover.ts | 5 ++++- src/vs/editor/contrib/hover/browser/hover.ts | 17 +++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 9e0b0c08838..89897e9c170 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -94,7 +94,10 @@ export class ContentHoverController extends Disposable { /** * Returns true if the hover shows now or will show. */ - public maybeShowAt(mouseEvent: IEditorMouseEvent): boolean { + public maybeShowAt(mouseEvent: IEditorMouseEvent | undefined): boolean { + if (!mouseEvent) { + return false; + } if (this._widget.isResizing) { return true; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 4929864bcee..514f08731b7 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -5,7 +5,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; +import { DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; @@ -42,7 +42,7 @@ export class ModesHoverController implements IEditorContribution { public static readonly ID = 'editor.contrib.hover'; private readonly _toUnhook = new DisposableStore(); - private readonly _didChangeConfigurationHandler: IDisposable; + private readonly _store: DisposableStore = new DisposableStore(); private _contentWidget: ContentHoverController | null; @@ -58,6 +58,7 @@ export class ModesHoverController implements IEditorContribution { private _hoverActivatedByColorDecoratorClick: boolean = false; private _mouseWasOverWidget: boolean = false; private _hideWidgetsTimeout: any; + private _mouseMoveEvent: IEditorMouseEvent | undefined; static get(editor: ICodeEditor): ModesHoverController | null { return editor.getContribution(ModesHoverController.ID); @@ -75,13 +76,15 @@ export class ModesHoverController implements IEditorContribution { this._glyphWidget = null; this._hookEvents(); - - this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._store.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.hover)) { this._unhookEvents(); this._hookEvents(); } - }); + })); + this._store.add(this._editor.onMouseLeave(() => { + this._mouseMoveEvent = undefined; + })); } private _hookEvents(): void { @@ -157,6 +160,7 @@ export class ModesHoverController implements IEditorContribution { } private _isMouseOverWidget(mouseEvent: IEditorMouseEvent): boolean { + this._mouseMoveEvent = mouseEvent; const target = mouseEvent.target; if ( this._isHoverSticky @@ -259,6 +263,7 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; + contentWidget.maybeShowAt(this._mouseMoveEvent); }, this._hidingDelay); this._mouseWasOverWidget = false; } else { @@ -354,7 +359,7 @@ export class ModesHoverController implements IEditorContribution { public dispose(): void { this._unhookEvents(); this._toUnhook.dispose(); - this._didChangeConfigurationHandler.dispose(); + this._store.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); } From 8a036cb7823adae935e1945f151bddaf801faaae Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Aug 2023 15:42:40 +0200 Subject: [PATCH 23/50] Undo changes --- .../contrib/hover/browser/contentHover.ts | 2 +- src/vs/editor/contrib/hover/browser/hover.ts | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 89897e9c170..94981c8f4ad 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -207,7 +207,7 @@ export class ContentHoverController extends Disposable { return; } if (hoverResult && hoverResult.messages.length === 0) { - return; + hoverResult = null; } this._currentResult = hoverResult; if (this._currentResult) { diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 514f08731b7..07c5fbe1584 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -160,7 +160,6 @@ export class ModesHoverController implements IEditorContribution { } private _isMouseOverWidget(mouseEvent: IEditorMouseEvent): boolean { - this._mouseMoveEvent = mouseEvent; const target = mouseEvent.target; if ( this._isHoverSticky @@ -199,6 +198,20 @@ export class ModesHoverController implements IEditorContribution { } private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + this._mouseMoveEvent = mouseEvent; + const target = mouseEvent.target; + if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { + return; + } + if (this._isMouseDown && this._hoverClicked) { + return; + } + if (this._isHoverSticky && this._contentWidget?.isVisibleFromKeyboard) { + // Sticky mode is on and the hover has been shown via keyboard + // so moving the mouse has no effect + return; + } + const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); // If the mouse is over the widget and the hiding timeout is defined, then cancel it if (mouseIsOverWidget) { @@ -213,19 +226,7 @@ export class ModesHoverController implements IEditorContribution { if (this._hideWidgetsTimeout) { return; } - if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { - return; - } - if (this._isMouseDown && this._hoverClicked) { - return; - } - if (this._isHoverSticky && this._contentWidget?.isVisibleFromKeyboard) { - // Sticky mode is on and the hover has been shown via keyboard - // so moving the mouse has no effect - return; - } - const target = mouseEvent.target; const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); From 3d0f21e32231e3c598d115151166c1fac773a39b Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Aug 2023 16:06:27 +0200 Subject: [PATCH 24/50] Delay reacting to the mouse move event by the configured hidingDelay --- src/vs/editor/common/config/editorOptions.ts | 2 +- src/vs/editor/contrib/hover/browser/hover.ts | 45 +++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index ef0c0db791e..59c933b7c47 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2054,7 +2054,7 @@ class EditorHover extends BaseEditorOption 0) { + if (!this._reactToEditorMouseMoveTimeout) { + this._reactToEditorMouseMoveTimeout = setTimeout(() => { + this._reactToEditorMouseMoveTimeout = undefined; + this._reactToEditorMouseMove(this._mouseMoveEvent); + }, this._hidingDelay); + } return; } + this._reactToEditorMouseMove(mouseEvent); + } + + private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent | undefined): void { + if (!mouseEvent) { + return; + } + + const target = mouseEvent.target; const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); @@ -258,18 +272,7 @@ export class ModesHoverController implements IEditorContribution { if (_sticky) { return; } - if (this._mouseWasOverWidget) { - // The mouse just left the content widget and a timeout is trigerred to hide the widget - // This timeout will be cancelled if the mouse re-enters the content widget - this._hideWidgetsTimeout = setTimeout(() => { - this._hideWidgets(); - this._hideWidgetsTimeout = undefined; - contentWidget.maybeShowAt(this._mouseMoveEvent); - }, this._hidingDelay); - this._mouseWasOverWidget = false; - } else { - this._hideWidgets(); - } + this._hideWidgets(); } private _onKeyDown(e: IKeyboardEvent): void { From a558d6ee63e19301b645fe1a4b1752e7569362c9 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Aug 2023 16:10:36 +0200 Subject: [PATCH 25/50] Clear the process mouse event timeout correctly --- src/vs/editor/contrib/hover/browser/contentHover.ts | 5 +---- src/vs/editor/contrib/hover/browser/hover.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index 94981c8f4ad..c06e6bac4a7 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -94,10 +94,7 @@ export class ContentHoverController extends Disposable { /** * Returns true if the hover shows now or will show. */ - public maybeShowAt(mouseEvent: IEditorMouseEvent | undefined): boolean { - if (!mouseEvent) { - return false; - } + public maybeShowAt(mouseEvent: IEditorMouseEvent): boolean { if (this._widget.isResizing) { return true; } diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 1995e790722..7b55c0d77dd 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -83,6 +83,10 @@ export class ModesHoverController implements IEditorContribution { })); this._store.add(this._editor.onMouseLeave(() => { this._mouseMoveEvent = undefined; + if (this._reactToEditorMouseMoveTimeout) { + clearTimeout(this._reactToEditorMouseMoveTimeout); + this._reactToEditorMouseMoveTimeout = undefined; + } })); } @@ -366,6 +370,10 @@ export class ModesHoverController implements IEditorContribution { this._store.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); + if (this._reactToEditorMouseMoveTimeout) { + clearTimeout(this._reactToEditorMouseMoveTimeout); + this._reactToEditorMouseMoveTimeout = undefined; + } } } From fc4b56643b988dbc222e3cfcc11f198ee1d28cac Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Aug 2023 16:16:31 +0200 Subject: [PATCH 26/50] Adopt RunOnceScheduler --- src/vs/editor/contrib/hover/browser/hover.ts | 39 +++++++------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 7b55c0d77dd..d6353807346 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -5,7 +5,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; @@ -31,18 +31,18 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; import * as nls from 'vs/nls'; import 'vs/css!./hover'; +import { RunOnceScheduler } from 'vs/base/common/async'; // sticky hover widget which doesn't disappear on focus out and such const _sticky = false // || Boolean("true") // done "weirdly" so that a lint warning prevents you from pushing this ; -export class ModesHoverController implements IEditorContribution { +export class ModesHoverController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.hover'; private readonly _toUnhook = new DisposableStore(); - private readonly _store: DisposableStore = new DisposableStore(); private _contentWidget: ContentHoverController | null; @@ -56,7 +56,7 @@ export class ModesHoverController implements IEditorContribution { private _isHoverSticky!: boolean; private _hidingDelay!: number; private _hoverActivatedByColorDecoratorClick: boolean = false; - private _reactToEditorMouseMoveTimeout: any; + private _reactToEditorMouseMoveRunner: RunOnceScheduler; private _mouseMoveEvent: IEditorMouseEvent | undefined; static get(editor: ICodeEditor): ModesHoverController | null { @@ -69,24 +69,23 @@ export class ModesHoverController implements IEditorContribution { @ILanguageService private readonly _languageService: ILanguageService, @IKeybindingService private readonly _keybindingService: IKeybindingService ) { + super(); this._isMouseDown = false; this._hoverClicked = false; this._contentWidget = null; this._glyphWidget = null; + this._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(() => this._reactToEditorMouseMove(this._mouseMoveEvent), 0)); this._hookEvents(); - this._store.add(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { if (e.hasChanged(EditorOption.hover)) { this._unhookEvents(); this._hookEvents(); } })); - this._store.add(this._editor.onMouseLeave(() => { + this._register(this._editor.onMouseLeave(() => { this._mouseMoveEvent = undefined; - if (this._reactToEditorMouseMoveTimeout) { - clearTimeout(this._reactToEditorMouseMoveTimeout); - this._reactToEditorMouseMoveTimeout = undefined; - } + this._reactToEditorMouseMoveRunner.cancel(); })); } @@ -217,21 +216,15 @@ export class ModesHoverController implements IEditorContribution { const mouseIsOverWidget = this._isMouseOverWidget(mouseEvent); // If the mouse is over the widget and the hiding timeout is defined, then cancel it if (mouseIsOverWidget) { - if (this._reactToEditorMouseMoveTimeout) { - clearTimeout(this._reactToEditorMouseMoveTimeout); - this._reactToEditorMouseMoveTimeout = undefined; - } + this._reactToEditorMouseMoveRunner.cancel(); return; } // If the mouse is not over the widget, and if sticky is on, // then give it a grace period before reacting to the mouse event if (this._contentWidget?.isVisible && this._isHoverSticky && this._hidingDelay > 0) { - if (!this._reactToEditorMouseMoveTimeout) { - this._reactToEditorMouseMoveTimeout = setTimeout(() => { - this._reactToEditorMouseMoveTimeout = undefined; - this._reactToEditorMouseMove(this._mouseMoveEvent); - }, this._hidingDelay); + if (!this._reactToEditorMouseMoveRunner.isScheduled()) { + this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay); } return; } @@ -364,16 +357,12 @@ export class ModesHoverController implements IEditorContribution { return this._contentWidget?.isVisible; } - public dispose(): void { + public override dispose(): void { + super.dispose(); this._unhookEvents(); this._toUnhook.dispose(); - this._store.dispose(); this._glyphWidget?.dispose(); this._contentWidget?.dispose(); - if (this._reactToEditorMouseMoveTimeout) { - clearTimeout(this._reactToEditorMouseMoveTimeout); - this._reactToEditorMouseMoveTimeout = undefined; - } } } From 2856e2dd0800b47407ee7fb2882060af90ab0612 Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 11 Sep 2023 16:22:44 +0200 Subject: [PATCH 27/50] chore - small cleanup of the inline chat API proposal --- src/vs/workbench/api/common/extHost.api.impl.ts | 4 ++-- .../workbench/api/common/extHostInlineChat.ts | 6 +++--- src/vscode-dts/vscode.proposed.interactive.d.ts | 17 +++++++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 95d016287a2..fcc80b4cacc 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1298,9 +1298,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // this needs to be updated whenever the API proposal changes _version: 1, - registerInteractiveEditorSessionProvider(provider: vscode.InteractiveEditorSessionProvider) { + registerInteractiveEditorSessionProvider(provider: vscode.InteractiveEditorSessionProvider, metadata?: vscode.InteractiveEditorSessionProviderMetadata) { checkProposedApiEnabled(extension, 'interactive'); - return extHostInteractiveEditor.registerProvider(extension, provider); + return extHostInteractiveEditor.registerProvider(extension, provider, metadata = { label: provider.label ?? extension.displayName ?? extension.name }); }, registerInteractiveSessionProvider(id: string, provider: vscode.InteractiveSessionProvider) { checkProposedApiEnabled(extension, 'interactive'); diff --git a/src/vs/workbench/api/common/extHostInlineChat.ts b/src/vs/workbench/api/common/extHostInlineChat.ts index d46e67243fc..65260f369cb 100644 --- a/src/vs/workbench/api/common/extHostInlineChat.ts +++ b/src/vs/workbench/api/common/extHostInlineChat.ts @@ -92,10 +92,10 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape { )); } - registerProvider(extension: Readonly, provider: vscode.InteractiveEditorSessionProvider): vscode.Disposable { + registerProvider(extension: Readonly, provider: vscode.InteractiveEditorSessionProvider, metadata: vscode.InteractiveEditorSessionProviderMetadata): vscode.Disposable { const wrapper = new ProviderWrapper(extension, provider); this._inputProvider.set(wrapper.handle, wrapper); - this._proxy.$registerInteractiveEditorProvider(wrapper.handle, provider.label, extension.identifier.value, typeof provider.handleInteractiveEditorResponseFeedback === 'function'); + this._proxy.$registerInteractiveEditorProvider(wrapper.handle, metadata.label, extension.identifier.value, typeof provider.handleInteractiveEditorResponseFeedback === 'function'); return toDisposable(() => { this._proxy.$unregisterInteractiveEditorProvider(wrapper.handle); this._inputProvider.delete(wrapper.handle); @@ -173,7 +173,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape { const task = typeof entry.provider.provideInteractiveEditorResponse2 === 'function' ? entry.provider.provideInteractiveEditorResponse2(apiRequest, progress, token) - : entry.provider.provideInteractiveEditorResponse(apiRequest, token); + : entry.provider.provideInteractiveEditorResponse(apiRequest.session, apiRequest, progress, token); Promise.resolve(task).finally(() => done = true); diff --git a/src/vscode-dts/vscode.proposed.interactive.d.ts b/src/vscode-dts/vscode.proposed.interactive.d.ts index 39e1e22e191..63e1429c82e 100644 --- a/src/vscode-dts/vscode.proposed.interactive.d.ts +++ b/src/vscode-dts/vscode.proposed.interactive.d.ts @@ -60,22 +60,31 @@ declare module 'vscode' { export interface TextDocumentContext { document: TextDocument; selection: Selection; - action?: string; + } + + export interface InteractiveEditorSessionProviderMetadata { + label: string; } export interface InteractiveEditorSessionProvider { + /** + * @deprecated + */ label: string; // Create a session. The lifetime of this session is the duration of the editing session with the input mode widget. prepareInteractiveEditorSession(context: TextDocumentContext, token: CancellationToken): ProviderResult; - provideInteractiveEditorResponse(request: InteractiveEditorRequest, token: CancellationToken): ProviderResult; + provideInteractiveEditorResponse(session: S, request: Omit, progress: Progress<{ message: string; edits: TextEdit[] }>, token: CancellationToken): ProviderResult; + + /** + * @deprecated + */ provideInteractiveEditorResponse2?(request: InteractiveEditorRequest, progress: Progress<{ message: string; edits: TextEdit[] }>, token: CancellationToken): ProviderResult; // eslint-disable-next-line local/vscode-dts-provider-naming releaseInteractiveEditorSession?(session: S): any; - // todo@API use enum instead of boolean // eslint-disable-next-line local/vscode-dts-provider-naming handleInteractiveEditorResponseFeedback?(session: S, response: R, kind: InteractiveEditorResponseFeedbackKind): void; } @@ -210,7 +219,7 @@ declare module 'vscode' { export function sendInteractiveRequestToProvider(providerId: string, message: InteractiveSessionDynamicRequest): void; - export function registerInteractiveEditorSessionProvider(provider: InteractiveEditorSessionProvider): Disposable; + export function registerInteractiveEditorSessionProvider(provider: InteractiveEditorSessionProvider, metadata?: InteractiveEditorSessionProviderMetadata): Disposable; export function transferChatSession(session: InteractiveSession, toWorkspace: Uri): void; } From 4bbd95ab64939df6faf6d54902e47eaa536d7175 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Mon, 11 Sep 2023 14:58:10 -0500 Subject: [PATCH 28/50] fix #192812 --- .../accessibility/browser/terminalAccessibleBufferProvider.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts b/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts index 3cf2dfac396..62ce7309584 100644 --- a/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts +++ b/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts @@ -52,6 +52,7 @@ export class TerminalAccessibleBufferProvider extends DisposableStore implements } this._xterm.raw.onWriteParsed(async () => { if (this._xterm!.raw.buffer.active.baseY === 0) { + this._bufferTracker.update(); this._accessibleViewService.show(this); } }); From 9c160f9f960984d722280e4dc35e9a15e78dc277 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Mon, 11 Sep 2023 15:20:02 -0500 Subject: [PATCH 29/50] add language --- .../accessibility/browser/terminalAccessibleBufferProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts b/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts index 62ce7309584..c4ba54d12a6 100644 --- a/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts +++ b/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBufferProvider.ts @@ -18,7 +18,7 @@ import type { Terminal } from 'xterm'; import { Event } from 'vs/base/common/event'; export class TerminalAccessibleBufferProvider extends DisposableStore implements IAccessibleContentProvider { - options: IAccessibleViewOptions = { type: AccessibleViewType.View }; + options: IAccessibleViewOptions = { type: AccessibleViewType.View, language: 'terminal' }; verbositySettingKey = AccessibilityVerbositySettingId.Terminal; private _xterm: IXtermTerminal & { raw: Terminal } | undefined; constructor( From e4c97ea18eca37e5c58cfce8c089c9ea01618612 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 11 Sep 2023 14:07:07 -0700 Subject: [PATCH 30/50] Pick up latest TS for building VS Code (#192819) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0d49646b08e..9608a109672 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "ts-loader": "^9.4.2", "ts-node": "^10.9.1", "tsec": "0.2.7", - "typescript": "^5.3.0-dev.20230905", + "typescript": "^5.3.0-dev.20230911", "typescript-formatter": "7.1.0", "underscore": "^1.12.1", "util": "^0.12.4", diff --git a/yarn.lock b/yarn.lock index 9f94f8de6bb..bcba41352f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10008,10 +10008,10 @@ typescript@^4.7.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== -typescript@^5.3.0-dev.20230905: - version "5.3.0-dev.20230905" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.0-dev.20230905.tgz#b88de602ef4afcc3a80a9c38023df82b7529e42a" - integrity sha512-Nl9MoKWN0YYlCvQnw850L4ZgqdmqwVGCi9cAoQDw4PsqRGaWAi9HKizS9xu0q4qgKKsEKetWCZHT8dBtJTGaMg== +typescript@^5.3.0-dev.20230911: + version "5.3.0-dev.20230911" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.0-dev.20230911.tgz#7f60e82ee86e381655ddc63141408eb90b6ca31d" + integrity sha512-2iI2l7OuGvU668gBje+JQKE8bsf7SH8w8ScwUkENHCcrbaDpXa/Oqfuwq5gdFM7SfVfp5p6c8kHZRMvL+kabJg== typical@^4.0.0: version "4.0.0" From 17015750a346e26d5933b0374ccef0c296e710e2 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 11 Sep 2023 15:44:14 -0700 Subject: [PATCH 31/50] cli: update openssl (#192825) * cli: update openssl * make multi-threaded * use mt windows versions --- .../azure-pipelines/alpine/cli-build-alpine.yml | 4 ++-- .../azure-pipelines/darwin/cli-build-darwin.yml | 4 ++-- build/azure-pipelines/linux/cli-build-linux.yml | 4 ++-- build/azure-pipelines/win32/cli-build-win32.yml | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/azure-pipelines/alpine/cli-build-alpine.yml b/build/azure-pipelines/alpine/cli-build-alpine.yml index 3fb6234cbcf..8b5303f5785 100644 --- a/build/azure-pipelines/alpine/cli-build-alpine.yml +++ b/build/azure-pipelines/alpine/cli-build-alpine.yml @@ -34,7 +34,7 @@ steps: displayName: Download openssl prebuilt inputs: command: custom - customCommand: pack @vscode-internal/openssl-prebuilt@0.0.8 + customCommand: pack @vscode-internal/openssl-prebuilt@0.0.10 customRegistry: useFeed customFeed: "Monaco/openssl-prebuilt" workingDir: $(Build.ArtifactStagingDirectory) @@ -42,7 +42,7 @@ steps: - script: | set -e mkdir $(Build.ArtifactStagingDirectory)/openssl - tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.8.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl + tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.10.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl displayName: Extract openssl prebuilt # inspired by: https://github.com/emk/rust-musl-builder/blob/main/Dockerfile diff --git a/build/azure-pipelines/darwin/cli-build-darwin.yml b/build/azure-pipelines/darwin/cli-build-darwin.yml index ae8f0e84652..f090c811a34 100644 --- a/build/azure-pipelines/darwin/cli-build-darwin.yml +++ b/build/azure-pipelines/darwin/cli-build-darwin.yml @@ -23,7 +23,7 @@ steps: displayName: Download openssl prebuilt inputs: command: custom - customCommand: pack @vscode-internal/openssl-prebuilt@0.0.8 + customCommand: pack @vscode-internal/openssl-prebuilt@0.0.10 customRegistry: useFeed customFeed: "Monaco/openssl-prebuilt" workingDir: $(Build.ArtifactStagingDirectory) @@ -31,7 +31,7 @@ steps: - script: | set -e mkdir $(Build.ArtifactStagingDirectory)/openssl - tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.8.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl + tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.10.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl displayName: Extract openssl prebuilt - template: ../cli/install-rust-posix.yml diff --git a/build/azure-pipelines/linux/cli-build-linux.yml b/build/azure-pipelines/linux/cli-build-linux.yml index b77b78aa1a8..098829eeb5f 100644 --- a/build/azure-pipelines/linux/cli-build-linux.yml +++ b/build/azure-pipelines/linux/cli-build-linux.yml @@ -26,7 +26,7 @@ steps: displayName: Download openssl prebuilt inputs: command: custom - customCommand: pack @vscode-internal/openssl-prebuilt@0.0.8 + customCommand: pack @vscode-internal/openssl-prebuilt@0.0.10 customRegistry: useFeed customFeed: "Monaco/openssl-prebuilt" workingDir: $(Build.ArtifactStagingDirectory) @@ -34,7 +34,7 @@ steps: - script: | set -e mkdir $(Build.ArtifactStagingDirectory)/openssl - tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.8.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl + tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.10.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl displayName: Extract openssl prebuilt - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true) }}: diff --git a/build/azure-pipelines/win32/cli-build-win32.yml b/build/azure-pipelines/win32/cli-build-win32.yml index 6eb5ac41f5c..3d2c08dcf5a 100644 --- a/build/azure-pipelines/win32/cli-build-win32.yml +++ b/build/azure-pipelines/win32/cli-build-win32.yml @@ -26,14 +26,14 @@ steps: displayName: Download openssl prebuilt inputs: command: custom - customCommand: pack @vscode-internal/openssl-prebuilt@0.0.8 + customCommand: pack @vscode-internal/openssl-prebuilt@0.0.10 customRegistry: useFeed customFeed: "Monaco/openssl-prebuilt" workingDir: $(Build.ArtifactStagingDirectory) - powershell: | mkdir $(Build.ArtifactStagingDirectory)/openssl - tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.8.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl + tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.10.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl displayName: Extract openssl prebuilt - template: ../cli/install-rust-win32.yml @@ -54,8 +54,8 @@ steps: VSCODE_CLI_ARTIFACT: unsigned_vscode_cli_win32_x64_cli VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }} VSCODE_CLI_ENV: - OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-windows-static-md/lib - OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-windows-static-md/include + OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-windows-static/lib + OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-windows-static/include RUSTFLAGS: "-C target-feature=+crt-static" - ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}: @@ -66,8 +66,8 @@ steps: VSCODE_CLI_ARTIFACT: unsigned_vscode_cli_win32_arm64_cli VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }} VSCODE_CLI_ENV: - OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-windows-static-md/lib - OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-windows-static-md/include + OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-windows-static/lib + OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-windows-static/include RUSTFLAGS: "-C target-feature=+crt-static" - ${{ if eq(parameters.VSCODE_BUILD_WIN32_32BIT, true) }}: @@ -78,6 +78,6 @@ steps: VSCODE_CLI_ARTIFACT: unsigned_vscode_cli_win32_ia32_cli VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }} VSCODE_CLI_ENV: - OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x86-windows-static-md/lib - OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x86-windows-static-md/include + OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x86-windows-static/lib + OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x86-windows-static/include RUSTFLAGS: "-C target-feature=+crt-static" From 35425d369ada2ba625304f9adb626332f13d1753 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 11 Sep 2023 15:45:39 -0700 Subject: [PATCH 32/50] cli: propagate server closing (#192824) Previously this was never needed since the connection was only used for the ext host, which never closed. Part 1 of fixing #192521 --- cli/src/tunnels/protocol.rs | 6 ++++++ cli/src/tunnels/server_bridge.rs | 1 + cli/src/tunnels/socket_signal.rs | 30 ++++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cli/src/tunnels/protocol.rs b/cli/src/tunnels/protocol.rs index 316e3672ba6..5665714fed9 100644 --- a/cli/src/tunnels/protocol.rs +++ b/cli/src/tunnels/protocol.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; #[allow(non_camel_case_types)] pub enum ClientRequestMethod<'a> { servermsg(RefServerMessageParams<'a>), + serverclose(ServerClosedParams), serverlog(ServerLog<'a>), makehttpreq(HttpRequestParams<'a>), version(VersionResponse), @@ -89,6 +90,11 @@ pub struct ServerMessageParams { pub body: Vec, } +#[derive(Serialize, Debug)] +pub struct ServerClosedParams { + pub i: u16, +} + #[derive(Serialize, Debug)] pub struct RefServerMessageParams<'a> { pub i: u16, diff --git a/cli/src/tunnels/server_bridge.rs b/cli/src/tunnels/server_bridge.rs index 50dde8e7303..f1a358279af 100644 --- a/cli/src/tunnels/server_bridge.rs +++ b/cli/src/tunnels/server_bridge.rs @@ -32,6 +32,7 @@ impl ServerBridge { match read.read(&mut read_buf).await { Err(_) => return, Ok(0) => { + let _ = target.server_closed().await; return; // EOF } Ok(s) => { diff --git a/cli/src/tunnels/socket_signal.rs b/cli/src/tunnels/socket_signal.rs index 53e6cd51567..9036c6ae3f9 100644 --- a/cli/src/tunnels/socket_signal.rs +++ b/cli/src/tunnels/socket_signal.rs @@ -9,7 +9,7 @@ use tokio::sync::mpsc; use crate::msgpack_rpc::MsgPackCaller; use super::{ - protocol::{ClientRequestMethod, RefServerMessageParams, ToClientRequest}, + protocol::{ClientRequestMethod, RefServerMessageParams, ServerClosedParams, ToClientRequest}, server_multiplexer::ServerMultiplexer, }; @@ -81,25 +81,43 @@ impl ServerMessageSink { } } + pub async fn server_closed(&mut self) -> Result<(), mpsc::error::SendError> { + self.server_message_or_closed(None).await + } + pub async fn server_message( &mut self, body: &[u8], ) -> Result<(), mpsc::error::SendError> { - let id = self.id; + self.server_message_or_closed(Some(body)).await + } + + async fn server_message_or_closed( + &mut self, + body: Option<&[u8]>, + ) -> Result<(), mpsc::error::SendError> { + let i = self.id; let mut tx = self.tx.take().unwrap(); - let body = self.get_server_msg_content(body); - let msg = RefServerMessageParams { i: id, body }; + let msg = body + .map(|b| self.get_server_msg_content(b)) + .map(|body| RefServerMessageParams { i, body }); let r = match &mut tx { ServerMessageDestination::Channel(tx) => { tx.send(SocketSignal::from_message(&ToClientRequest { id: None, - params: ClientRequestMethod::servermsg(msg), + params: match msg { + Some(msg) => ClientRequestMethod::servermsg(msg), + None => ClientRequestMethod::serverclose(ServerClosedParams { i }), + }, })) .await } ServerMessageDestination::Rpc(caller) => { - caller.notify("servermsg", msg); + match msg { + Some(msg) => caller.notify("servermsg", msg), + None => caller.notify("serverclose", ServerClosedParams { i }), + }; Ok(()) } }; From 1c6c16946ede72b043f498c76bc2093a141dc737 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 12 Sep 2023 09:00:03 +0200 Subject: [PATCH 33/50] debt - address some todos (#192845) --- .../electron-sandbox/desktop.contribution.ts | 6 ----- .../electron-sandbox/contextmenuService.ts | 27 +++---------------- .../browser/storedFileWorkingCopy.test.ts | 2 +- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/vs/workbench/electron-sandbox/desktop.contribution.ts b/src/vs/workbench/electron-sandbox/desktop.contribution.ts index 7ae54948297..fda561a69e5 100644 --- a/src/vs/workbench/electron-sandbox/desktop.contribution.ts +++ b/src/vs/workbench/electron-sandbox/desktop.contribution.ts @@ -222,12 +222,6 @@ import { applicationConfigurationNodeBase } from 'vs/workbench/common/configurat 'scope': ConfigurationScope.APPLICATION, 'description': localize('titleBarStyle', "Adjust the appearance of the window title bar. On Linux and Windows, this setting also affects the application and context menu appearances. Changes require a full restart to apply.") }, - 'window.experimental.nativeContextMenuLocation': { // TODO@bpasero remove me eventually - 'type': 'boolean', - 'default': true, - 'scope': ConfigurationScope.APPLICATION, - 'description': localize('nativeContextMenuLocation', "Let the OS handle positioning of the context menu in cases where it should appear under the mouse.") - }, 'window.dialogStyle': { 'type': 'string', 'enum': ['native', 'custom'], diff --git a/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts b/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts index 66b9fb03b19..e05e7d2519c 100644 --- a/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts +++ b/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts @@ -54,7 +54,7 @@ export class ContextMenuService implements IContextMenuService { // Native context menu: otherwise else { - this.impl = new NativeContextMenuService(notificationService, telemetryService, keybindingService, menuService, contextKeyService, configurationService); + this.impl = new NativeContextMenuService(notificationService, telemetryService, keybindingService, menuService, contextKeyService); } } @@ -77,28 +77,14 @@ class NativeContextMenuService extends Disposable implements IContextMenuService private readonly _onDidHideContextMenu = this._store.add(new Emitter()); readonly onDidHideContextMenu = this._onDidHideContextMenu.event; - private useNativeContextMenuLocation = false; - constructor( @INotificationService private readonly notificationService: INotificationService, @ITelemetryService private readonly telemetryService: ITelemetryService, @IKeybindingService private readonly keybindingService: IKeybindingService, @IMenuService private readonly menuService: IMenuService, - @IContextKeyService private readonly contextKeyService: IContextKeyService, - @IConfigurationService private readonly configurationService: IConfigurationService + @IContextKeyService private readonly contextKeyService: IContextKeyService ) { super(); - - this.updateUseNativeContextMenuLocation(); - this._register(this.configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration('window.experimental.nativeContextMenuLocation')) { - this.updateUseNativeContextMenuLocation(); - } - })); - } - - private updateUseNativeContextMenuLocation(): void { - this.useNativeContextMenuLocation = this.configurationService.getValue('window.experimental.nativeContextMenuLocation') === true; } showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void { @@ -173,13 +159,8 @@ class NativeContextMenuService extends Disposable implements IContextMenuService x = anchor.x; y = anchor.y; } else { - if (this.useNativeContextMenuLocation) { - // We leave x/y undefined in this case which will result in - // Electron taking care of opening the menu at the cursor position. - } else { - x = anchor.posx + 1; // prevent first item from being selected automatically under mouse - y = anchor.posy; - } + // We leave x/y undefined in this case which will result in + // Electron taking care of opening the menu at the cursor position. } if (typeof x === 'number') { diff --git a/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts b/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts index 5aa5d8e1c9e..17cfba00f84 100644 --- a/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts +++ b/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts @@ -724,7 +724,7 @@ suite('StoredFileWorkingCopy', function () { }); }); - test.skip('save (errors)', async () => { // TODO@bpasero enable again + test('save (errors)', async () => { let savedCounter = 0; disposables.add(workingCopy.onDidSave(reason => { savedCounter++; From bbbd8da393b6bddf480988b5579efa74706cb9e6 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 12 Sep 2023 10:14:45 +0200 Subject: [PATCH 34/50] adopt ensureNoDisposablesAreLeakedInTestSuite (#192613) * #190503 adopt ensureNoDisposablesAreLeakedInTestSuite * handle disposing in async teardown --------- Co-authored-by: Benjamin Pasero --- .../extensionRecommendationNotificationService.ts | 2 +- .../extensionRecommendationsService.test.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts index 7aa8ac10873..e840bd9b331 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts @@ -361,7 +361,7 @@ export class ExtensionRecommendationNotificationService extends Disposable imple this.visibleNotification = { recommendationsNotification, source, from: Date.now() }; recommendationsNotification.show(); } - await raceCancellation(Event.toPromise(recommendationsNotification.onDidClose), token); + await raceCancellation(new Promise(c => disposables.add(Event.once(recommendationsNotification.onDidClose)(c))), token); return !recommendationsNotification.isCancelled(); } finally { disposables.dispose(); diff --git a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionRecommendationsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionRecommendationsService.test.ts index 82b0f4d4298..c644f0acb11 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionRecommendationsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionRecommendationsService.test.ts @@ -61,7 +61,9 @@ import { VSBuffer } from 'vs/base/common/buffer'; import { platform } from 'vs/base/common/platform'; import { arch } from 'vs/base/common/process'; import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; +import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; import { DisposableStore } from 'vs/base/common/lifecycle'; +import { timeout } from 'vs/base/common/async'; const mockExtensionGallery: IGalleryExtension[] = [ aGalleryExtension('MockExtension1', { @@ -181,7 +183,7 @@ function aGalleryExtension(name: string, properties: any = {}, galleryExtensionP } suite('ExtensionRecommendationsService Test', () => { - const disposableStore = new DisposableStore(); + let disposableStore: DisposableStore; let workspaceService: IWorkspaceContextService; let instantiationService: TestInstantiationService; let testConfigurationService: TestConfigurationService; @@ -194,7 +196,15 @@ suite('ExtensionRecommendationsService Test', () => { let promptedEmitter: Emitter; let onModelAddedEvent: Emitter; + teardown(async () => { + disposableStore.dispose(); + await timeout(0); // allow for async disposables to complete + }); + + ensureNoDisposablesAreLeakedInTestSuite(); + setup(() => { + disposableStore = new DisposableStore(); instantiationService = disposableStore.add(new TestInstantiationService()); promptedEmitter = disposableStore.add(new Emitter()); installEvent = disposableStore.add(new Emitter()); @@ -308,8 +318,6 @@ suite('ExtensionRecommendationsService Test', () => { }); }); - teardown(() => disposableStore.clear()); - function setUpFolderWorkspace(folderName: string, recommendedExtensions: string[], ignoredRecommendations: string[] = []): Promise { return setUpFolder(folderName, recommendedExtensions, ignoredRecommendations); } From 41c6343f84e12869e4f26ccd189c6e4b916d770a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 12 Sep 2023 10:49:08 +0200 Subject: [PATCH 35/50] debt - ensure to close state service (#192850) --- src/vs/platform/state/test/node/state.test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/state/test/node/state.test.ts b/src/vs/platform/state/test/node/state.test.ts index c77c3a86e3f..493d78d0e51 100644 --- a/src/vs/platform/state/test/node/state.test.ts +++ b/src/vs/platform/state/test/node/state.test.ts @@ -170,6 +170,8 @@ flakySuite('StateService', () => { assert.strictEqual(service.getItem('some.setItems.key3'), undefined); assert.strictEqual(service.getItem('some.setItems.key4'), undefined); assert.strictEqual(service.getItem('some.setItems.key5'), undefined); + + return service.close(); }); test('Multiple ops are buffered and applied', async function () { @@ -199,6 +201,8 @@ flakySuite('StateService', () => { assert.strictEqual(service.getItem('some.key2'), 'some.value2'); assert.strictEqual(service.getItem('some.key3'), 'some.value3'); assert.strictEqual(service.getItem('some.key4'), undefined); + + return service.close(); }); test('Multiple ops (Immediate Strategy)', async function () { @@ -228,6 +232,8 @@ flakySuite('StateService', () => { assert.strictEqual(service.getItem('some.key2'), 'some.value2'); assert.strictEqual(service.getItem('some.key3'), 'some.value3'); assert.strictEqual(service.getItem('some.key4'), undefined); + + return service.close(); }); test('Used before init', async function () { @@ -253,6 +259,8 @@ flakySuite('StateService', () => { assert.strictEqual(service.getItem('some.key2'), 'some.value2'); assert.strictEqual(service.getItem('some.key3'), 'some.value3'); assert.strictEqual(service.getItem('some.key4'), undefined); + + return service.close(); }); test('Used after close', async function () { @@ -276,7 +284,7 @@ flakySuite('StateService', () => { assert.ok(contents.includes('some.value1')); assert.ok(!contents.includes('some.marker')); - await service.close(); + return service.close(); }); test('Closed before init', async function () { From 8cb4a0bfacfa14f733e0789178bd4b579a17dc76 Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 12 Sep 2023 11:22:49 +0200 Subject: [PATCH 36/50] add failing test for `computeHumanReadableDiff` --- .../test/common/services/editorSimpleWorker.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vs/editor/test/common/services/editorSimpleWorker.test.ts b/src/vs/editor/test/common/services/editorSimpleWorker.test.ts index 9596c1225c6..ec383e8cca7 100644 --- a/src/vs/editor/test/common/services/editorSimpleWorker.test.ts +++ b/src/vs/editor/test/common/services/editorSimpleWorker.test.ts @@ -254,6 +254,15 @@ suite('EditorSimpleWorker', () => { ); }); + test.skip('[Bug] Getting Message "Overlapping ranges are not allowed" and nothing happens with Inline-Chat ', async function () { + await testEdits(("const API = require('../src/api');\n\ndescribe('API', () => {\n let api;\n let database;\n\n beforeAll(() => {\n database = {\n getAllBooks: jest.fn(),\n getBooksByAuthor: jest.fn(),\n getBooksByTitle: jest.fn(),\n };\n api = new API(database);\n });\n\n describe('GET /books', () => {\n it('should return all books', async () => {\n const mockBooks = [{ title: 'Book 1' }, { title: 'Book 2' }];\n database.getAllBooks.mockResolvedValue(mockBooks);\n\n const req = {};\n const res = {\n json: jest.fn(),\n };\n\n await api.register({\n get: (path, handler) => {\n if (path === '/books') {\n handler(req, res);\n }\n },\n });\n\n expect(database.getAllBooks).toHaveBeenCalled();\n expect(res.json).toHaveBeenCalledWith(mockBooks);\n });\n });\n\n describe('GET /books/author/:author', () => {\n it('should return books by author', async () => {\n const mockAuthor = 'John Doe';\n const mockBooks = [{ title: 'Book 1', author: mockAuthor }, { title: 'Book 2', author: mockAuthor }];\n database.getBooksByAuthor.mockResolvedValue(mockBooks);\n\n const req = {\n params: {\n author: mockAuthor,\n },\n };\n const res = {\n json: jest.fn(),\n };\n\n await api.register({\n get: (path, handler) => {\n if (path === `/books/author/${mockAuthor}`) {\n handler(req, res);\n }\n },\n });\n\n expect(database.getBooksByAuthor).toHaveBeenCalledWith(mockAuthor);\n expect(res.json).toHaveBeenCalledWith(mockBooks);\n });\n });\n\n describe('GET /books/title/:title', () => {\n it('should return books by title', async () => {\n const mockTitle = 'Book 1';\n const mockBooks = [{ title: mockTitle, author: 'John Doe' }];\n database.getBooksByTitle.mockResolvedValue(mockBooks);\n\n const req = {\n params: {\n title: mockTitle,\n },\n };\n const res = {\n json: jest.fn(),\n };\n\n await api.register({\n get: (path, handler) => {\n if (path === `/books/title/${mockTitle}`) {\n handler(req, res);\n }\n },\n });\n\n expect(database.getBooksByTitle).toHaveBeenCalledWith(mockTitle);\n expect(res.json).toHaveBeenCalledWith(mockBooks);\n });\n });\n});\n").split('\n'), + [{ + range: { startLineNumber: 1, startColumn: 1, endLineNumber: 96, endColumn: 1 }, + text: `const request = require('supertest');\nconst API = require('../src/api');\n\ndescribe('API', () => {\n let api;\n let database;\n\n beforeAll(() => {\n database = {\n getAllBooks: jest.fn(),\n getBooksByAuthor: jest.fn(),\n getBooksByTitle: jest.fn(),\n };\n api = new API(database);\n });\n\n describe('GET /books', () => {\n it('should return all books', async () => {\n const mockBooks = [{ title: 'Book 1' }, { title: 'Book 2' }];\n database.getAllBooks.mockResolvedValue(mockBooks);\n\n const response = await request(api.app).get('/books');\n\n expect(database.getAllBooks).toHaveBeenCalled();\n expect(response.status).toBe(200);\n expect(response.body).toEqual(mockBooks);\n });\n });\n\n describe('GET /books/author/:author', () => {\n it('should return books by author', async () => {\n const mockAuthor = 'John Doe';\n const mockBooks = [{ title: 'Book 1', author: mockAuthor }, { title: 'Book 2', author: mockAuthor }];\n database.getBooksByAuthor.mockResolvedValue(mockBooks);\n\n const response = await request(api.app).get(\`/books/author/\${mockAuthor}\`);\n\n expect(database.getBooksByAuthor).toHaveBeenCalledWith(mockAuthor);\n expect(response.status).toBe(200);\n expect(response.body).toEqual(mockBooks);\n });\n });\n\n describe('GET /books/title/:title', () => {\n it('should return books by title', async () => {\n const mockTitle = 'Book 1';\n const mockBooks = [{ title: mockTitle, author: 'John Doe' }];\n database.getBooksByTitle.mockResolvedValue(mockBooks);\n\n const response = await request(api.app).get(\`/books/title/\${mockTitle}\`);\n\n expect(database.getBooksByTitle).toHaveBeenCalledWith(mockTitle);\n expect(response.status).toBe(200);\n expect(response.body).toEqual(mockBooks);\n });\n });\n});\n`, + }] + ); + }); + test('ICommonModel#getValueInRange, issue #17424', function () { const model = worker.addModel([ From f0c36fbbf6e1ecb420e606c0009010a0b5d03a6c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 12 Sep 2023 11:39:41 +0200 Subject: [PATCH 37/50] fix #192333 (#192855) --- .../theme-abyss/themes/abyss-color-theme.json | 27 ------------------- .../themes/kimbie-dark-color-theme.json | 1 - .../tomorrow-night-blue-color-theme.json | 1 - 3 files changed, 29 deletions(-) diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index e81c3b9adca..f0e4d4bb352 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -278,18 +278,14 @@ } ], "colors": { - "editor.background": "#000c18", "editor.foreground": "#6688cc", - // Base // "foreground": "", "focusBorder": "#596F99", // "contrastActiveBorder": "", // "contrastBorder": "", - // "widget.shadow": "", - "input.background": "#181f2f", // "input.border": "", // "input.foreground": "", @@ -300,17 +296,13 @@ "inputValidation.warningBorder": "#5B7E7A", "inputValidation.errorBackground": "#A22D44", "inputValidation.errorBorder": "#AB395B", - "badge.background": "#0063a5", "progressBar.background": "#0063a5", - "dropdown.background": "#181f2f", // "dropdown.foreground": "", // "dropdown.border": "", - "button.background": "#2B3C5D", // "button.foreground": "", - "list.activeSelectionBackground": "#08286b", // "list.activeSelectionForeground": "", "quickInputList.focusBackground": "#08286b", @@ -318,12 +310,10 @@ "list.inactiveSelectionBackground": "#152037", "list.dropBackground": "#041D52", "list.highlightForeground": "#0063a5", - "scrollbar.shadow": "#515E91AA", "scrollbarSlider.activeBackground": "#3B3F5188", "scrollbarSlider.background": "#1F2230AA", "scrollbarSlider.hoverBackground": "#3B3F5188", - // Editor "editorWidget.background": "#262641", "editorCursor.foreground": "#ddbb88", @@ -350,14 +340,12 @@ // "editor.selectionHighlightBackground": "", // "editor.wordHighlightBackground": "", // "editor.wordHighlightStrongBackground": "", - // Editor: Suggest Widget // "editorSuggestWidget.background": "", // "editorSuggestWidget.border": "", // "editorSuggestWidget.foreground": "", // "editorSuggestWidget.highlightForeground": "", // "editorSuggestWidget.selectedBackground": "", - // Editor: Peek View "peekViewResult.background": "#060621", // "peekViewResult.lineForeground": "", @@ -371,7 +359,6 @@ "peekViewResult.matchHighlightBackground": "#eeeeee44", // "peekViewTitleLabel.foreground": "", // "peekViewTitleDescription.foreground": "", - // Ports "ports.iconRunningProcessForeground": "#80a2c2", // Editor: Diff @@ -379,23 +366,18 @@ // "diffEditor.insertedTextBorder": "", "diffEditor.removedTextBackground": "#892F4688", // "diffEditor.removedTextBorder": "", - - // Editor: Minimap "minimap.selectionHighlight": "#750000", - // Workbench: Title "titleBar.activeBackground": "#10192c", // "titleBar.activeForeground": "", // "titleBar.inactiveBackground": "", // "titleBar.inactiveForeground": "", - // Workbench: Editors // "editorGroupHeader.noTabsBackground": "", "editorGroup.border": "#2b2b4a", "editorGroup.dropBackground": "#25375daa", "editorGroupHeader.tabsBackground": "#1c1c2a", - // Workbench: Tabs "tab.border": "#2b2b4a", // "tab.activeBackground": "", @@ -403,26 +385,21 @@ // "tab.activeForeground": "", // "tab.inactiveForeground": "", "tab.lastPinnedBorder": "#2b3c5d", - // Workbench: Activity Bar "activityBar.background": "#051336", // "activityBar.foreground": "", // "activityBarBadge.background": "", // "activityBarBadge.foreground": "", - "activityBarItem.profilesBackground": "#082877", - // Workbench: Panel // "panel.background": "", "panel.border": "#2b2b4a", // "panelTitle.activeBorder": "", // "panelTitle.activeForeground": "", // "panelTitle.inactiveForeground": "", - // Workbench: Side Bar "sideBar.background": "#060621", // "sideBarTitle.foreground": "", "sideBarSectionHeader.background": "#10192c", - // Workbench: Status Bar "statusBar.background": "#10192c", "statusBar.noFolderBackground": "#10192c", @@ -433,20 +410,16 @@ "statusBarItem.prominentHoverBackground": "#0063a5dd", // "statusBarItem.activeBackground": "", // "statusBarItem.hoverBackground": "", - // Workbench: Debug "debugToolBar.background": "#051336", "debugExceptionWidget.background": "#051336", "debugExceptionWidget.border": "#AB395B", - // Workbench: Quick Open "pickerGroup.border": "#596F99", "pickerGroup.foreground": "#596F99", - // Workbench: Extensions "extensionButton.prominentBackground": "#5f8b3b", "extensionButton.prominentHoverBackground": "#5f8b3bbb", - // Workbench: Terminal "terminal.ansiBlack": "#111111", "terminal.ansiRed": "#ff9da4", diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index 3554c486209..cd16cc35be2 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -32,7 +32,6 @@ "ports.iconRunningProcessForeground": "#369432", "activityBar.background": "#221a0f", "activityBar.foreground": "#d3af86", - "activityBarItem.profilesBackground": "#47351d", "sideBar.background": "#362712", "menu.background": "#362712", "menu.foreground": "#CCCCCC", diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json index b0bdf8e90a9..840a1764bf1 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json @@ -36,7 +36,6 @@ "statusBar.noFolderBackground": "#001126", "statusBar.debuggingBackground": "#001126", "activityBar.background": "#001733", - "activityBarItem.profilesBackground": "#003271", "progressBar.background": "#bbdaffcc", "badge.background": "#bbdaffcc", "badge.foreground": "#001733", From c1f8cefbd24b9b25c069f29054ce14cf2661cd10 Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 12 Sep 2023 12:28:18 +0200 Subject: [PATCH 38/50] when disposing inline chat controller directly release session (don't wait for SM), enable leak checks in test re https://github.com/microsoft/vscode/issues/192356#issuecomment-1715428064 re https://github.com/microsoft/vscode/issues/190503 --- .../contrib/inlineChat/browser/inlineChatController.ts | 4 +++- .../inlineChat/test/browser/inlineChatController.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts index 69cdbcfca61..398a1482be0 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts @@ -151,7 +151,9 @@ export class InlineChatController implements IEditorContribution { dispose(): void { this._strategy?.dispose(); this._stashedSession.clear(); - this.finishExistingSession(); + if (this._activeSession) { + this._inlineChatSessionService.releaseSession(this._activeSession); + } this._store.dispose(); this._log('controller disposed'); } diff --git a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts index 2a69764cca9..806f24b91e4 100644 --- a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts +++ b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts @@ -8,6 +8,7 @@ import { equals } from 'vs/base/common/arrays'; import { Emitter, Event } from 'vs/base/common/event'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { mock } from 'vs/base/test/common/mock'; +import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; import { TestDiffProviderFactoryService } from 'vs/editor/browser/diff/testDiffProviderFactoryService'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IDiffProviderFactoryService } from 'vs/editor/browser/widget/diffEditor/diffProviderFactoryService'; @@ -147,8 +148,7 @@ suite('InteractiveChatController', function () { ctrl?.dispose(); }); - // todo: re-enable this when earlier tests are fixed - // ensureNoDisposablesAreLeakedInTestSuite(); + ensureNoDisposablesAreLeakedInTestSuite(); test('creation, not showing anything', function () { ctrl = instaService.createInstance(TestController, editor); From cc4775f55aff152db2417dfaaddc643ee90b31f9 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 12 Sep 2023 12:37:49 +0200 Subject: [PATCH 39/50] Update themes to accommodate C# grammar change (#192854) See https://github.com/dotnet/csharp-tmLanguage/issues/290 --- extensions/theme-defaults/themes/dark_plus.json | 1 + extensions/theme-defaults/themes/hc_black.json | 1 + extensions/theme-defaults/themes/hc_light.json | 1 + extensions/theme-defaults/themes/light_plus.json | 1 + .../themes/kimbie-dark-color-theme.json | 1 + .../themes/dimmed-monokai-color-theme.json | 1 + .../test/colorize-results/test_cs.json | 12 ++++++------ 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/extensions/theme-defaults/themes/dark_plus.json b/extensions/theme-defaults/themes/dark_plus.json index ed80b1785f6..5565e2dbec6 100644 --- a/extensions/theme-defaults/themes/dark_plus.json +++ b/extensions/theme-defaults/themes/dark_plus.json @@ -77,6 +77,7 @@ "source.cpp keyword.operator.new", "keyword.operator.delete", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator", "entity.name.operator" ], diff --git a/extensions/theme-defaults/themes/hc_black.json b/extensions/theme-defaults/themes/hc_black.json index 816fbf9395a..7b671065646 100644 --- a/extensions/theme-defaults/themes/hc_black.json +++ b/extensions/theme-defaults/themes/hc_black.json @@ -406,6 +406,7 @@ "source.cpp keyword.operator.new", "source.cpp keyword.operator.delete", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator" ], "settings": { diff --git a/extensions/theme-defaults/themes/hc_light.json b/extensions/theme-defaults/themes/hc_light.json index 17c1af9ef34..aaf0e2f9cf3 100644 --- a/extensions/theme-defaults/themes/hc_light.json +++ b/extensions/theme-defaults/themes/hc_light.json @@ -442,6 +442,7 @@ "source.cpp keyword.operator.new", "source.cpp keyword.operator.delete", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator", "entity.name.operator" ], diff --git a/extensions/theme-defaults/themes/light_plus.json b/extensions/theme-defaults/themes/light_plus.json index f73b79579f0..7f77883f3ee 100644 --- a/extensions/theme-defaults/themes/light_plus.json +++ b/extensions/theme-defaults/themes/light_plus.json @@ -77,6 +77,7 @@ "source.cpp keyword.operator.new", "source.cpp keyword.operator.delete", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator", "entity.name.operator" ], diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index cd16cc35be2..ec50a96586a 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -123,6 +123,7 @@ "keyword.operator.new.cpp", "keyword.operator.delete.cpp", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator" ], "settings": { diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json index 691680512a4..00ba8b3ace6 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json @@ -269,6 +269,7 @@ "keyword.operator.new.cpp", "keyword.operator.delete.cpp", "keyword.other.using", + "keyword.other.directive.using", "keyword.other.operator" ], "settings": { diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_cs.json b/extensions/vscode-colorize-tests/test/colorize-results/test_cs.json index eeb2646d417..e846aa23b4e 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_cs.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_cs.json @@ -3,14 +3,14 @@ "c": "using", "t": "source.cs keyword.other.directive.using.cs", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", + "dark_plus": "keyword.other.directive.using: #C586C0", + "light_plus": "keyword.other.directive.using: #AF00DB", "dark_vs": "keyword: #569CD6", "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6", - "dark_modern": "keyword: #569CD6", - "hc_light": "keyword: #0F4A85", - "light_modern": "keyword: #0000FF" + "hc_black": "keyword.other.directive.using: #C586C0", + "dark_modern": "keyword.other.directive.using: #C586C0", + "hc_light": "keyword.other.directive.using: #B5200D", + "light_modern": "keyword.other.directive.using: #AF00DB" } }, { From 07fcfc80c37e56fd35fc125e225c7dde7029f858 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 12 Sep 2023 14:58:01 +0200 Subject: [PATCH 40/50] update to latest jsonc-parser (#192872) --- extensions/configuration-editing/package.json | 2 +- extensions/configuration-editing/yarn.lock | 90 ++++++++++--------- extensions/extension-editing/package.json | 2 +- .../extension-editing/src/extensionLinter.ts | 2 +- extensions/extension-editing/yarn.lock | 14 +-- extensions/vscode-colorize-tests/package.json | 2 +- extensions/vscode-colorize-tests/yarn.lock | 8 +- 7 files changed, 65 insertions(+), 55 deletions(-) diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json index 520682059e1..b80a187e266 100644 --- a/extensions/configuration-editing/package.json +++ b/extensions/configuration-editing/package.json @@ -23,7 +23,7 @@ "watch": "gulp watch-extension:configuration-editing" }, "dependencies": { - "jsonc-parser": "^2.2.1", + "jsonc-parser": "^3.2.0", "@octokit/rest": "19.0.4", "tunnel": "^0.0.6" }, diff --git a/extensions/configuration-editing/yarn.lock b/extensions/configuration-editing/yarn.lock index 549c578a9ac..7672e88e7a4 100644 --- a/extensions/configuration-editing/yarn.lock +++ b/extensions/configuration-editing/yarn.lock @@ -3,41 +3,39 @@ "@octokit/auth-token@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.2.tgz#a0fc8de149fd15876e1ac78f6525c1c5ab48435f" - integrity sha512-pq7CwIMV1kmzkFTimdwjAINCXKTajZErLB4wMLYapR2nuB/Jpr66+05wOTZMSCBXP6n4DdDWT2W19Bm17vU69Q== - dependencies: - "@octokit/types" "^8.0.0" + version "3.0.4" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.4.tgz#70e941ba742bdd2b49bdb7393e821dea8520a3db" + integrity sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ== "@octokit/core@^4.0.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.1.0.tgz#b6b03a478f1716de92b3f4ec4fd64d05ba5a9251" - integrity sha512-Czz/59VefU+kKDy+ZfDwtOIYIkFjExOKf+HA92aiTZJ6EfWpFzYQWw0l54ji8bVmyhc+mGaLUbSUmXazG7z5OQ== + version "4.2.4" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.2.4.tgz#d8769ec2b43ff37cc3ea89ec4681a20ba58ef907" + integrity sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ== dependencies: "@octokit/auth-token" "^3.0.0" "@octokit/graphql" "^5.0.0" "@octokit/request" "^6.0.0" "@octokit/request-error" "^3.0.0" - "@octokit/types" "^8.0.0" + "@octokit/types" "^9.0.0" before-after-hook "^2.2.0" universal-user-agent "^6.0.0" "@octokit/endpoint@^7.0.0": - version "7.0.3" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.3.tgz#0b96035673a9e3bedf8bab8f7335de424a2147ed" - integrity sha512-57gRlb28bwTsdNXq+O3JTQ7ERmBTuik9+LelgcLIVfYwf235VHbN9QNo4kXExtp/h8T423cR5iJThKtFYxC7Lw== + version "7.0.6" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.6.tgz#791f65d3937555141fb6c08f91d618a7d645f1e2" + integrity sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg== dependencies: - "@octokit/types" "^8.0.0" + "@octokit/types" "^9.0.0" is-plain-object "^5.0.0" universal-user-agent "^6.0.0" "@octokit/graphql@^5.0.0": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.4.tgz#519dd5c05123868276f3ae4e50ad565ed7dff8c8" - integrity sha512-amO1M5QUQgYQo09aStR/XO7KAl13xpigcy/kI8/N1PnZYSS69fgte+xA4+c2DISKqUZfsh0wwjc2FaCt99L41A== + version "5.0.6" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.6.tgz#9eac411ac4353ccc5d3fca7d76736e6888c5d248" + integrity sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw== dependencies: "@octokit/request" "^6.0.0" - "@octokit/types" "^8.0.0" + "@octokit/types" "^9.0.0" universal-user-agent "^6.0.0" "@octokit/openapi-types@^13.11.0": @@ -50,6 +48,11 @@ resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-14.0.0.tgz#949c5019028c93f189abbc2fb42f333290f7134a" integrity sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw== +"@octokit/openapi-types@^18.0.0": + version "18.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69" + integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw== + "@octokit/plugin-paginate-rest@^4.0.0": version "4.3.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.3.1.tgz#553e653ee0318605acd23bf3a799c8bfafdedae3" @@ -63,30 +66,30 @@ integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^6.0.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.7.0.tgz#2f6f17f25b6babbc8b41d2bb0a95a8839672ce7c" - integrity sha512-orxQ0fAHA7IpYhG2flD2AygztPlGYNAdlzYz8yrD8NDgelPfOYoRPROfEyIe035PlxvbYrgkfUZIhSBKju/Cvw== + version "6.8.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.8.1.tgz#97391fda88949eb15f68dc291957ccbe1d3e8ad1" + integrity sha512-QrlaTm8Lyc/TbU7BL/8bO49vp+RZ6W3McxxmmQTgYxf2sWkO8ZKuj4dLhPNJD6VCUW1hetCmeIM0m6FTVpDiEg== dependencies: - "@octokit/types" "^8.0.0" + "@octokit/types" "^8.1.1" deprecation "^2.3.1" "@octokit/request-error@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.2.tgz#f74c0f163d19463b87528efe877216c41d6deb0a" - integrity sha512-WMNOFYrSaX8zXWoJg9u/pKgWPo94JXilMLb2VManNOby9EZxrQaBe/QSC4a1TzpAlpxofg2X/jMnCyZgL6y7eg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.3.tgz#ef3dd08b8e964e53e55d471acfe00baa892b9c69" + integrity sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ== dependencies: - "@octokit/types" "^8.0.0" + "@octokit/types" "^9.0.0" deprecation "^2.0.0" once "^1.4.0" "@octokit/request@^6.0.0": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.2.tgz#a2ba5ac22bddd5dcb3f539b618faa05115c5a255" - integrity sha512-6VDqgj0HMc2FUX2awIs+sM6OwLgwHvAi4KCK3mT2H2IKRt6oH9d0fej5LluF5mck1lRR/rFWN0YIDSYXYSylbw== + version "6.2.8" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.8.tgz#aaf480b32ab2b210e9dadd8271d187c93171d8eb" + integrity sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw== dependencies: "@octokit/endpoint" "^7.0.0" "@octokit/request-error" "^3.0.0" - "@octokit/types" "^8.0.0" + "@octokit/types" "^9.0.0" is-plain-object "^5.0.0" node-fetch "^2.6.7" universal-user-agent "^6.0.0" @@ -108,13 +111,20 @@ dependencies: "@octokit/openapi-types" "^13.11.0" -"@octokit/types@^8.0.0": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-8.1.1.tgz#92e304e0f00d563667dfdbe0ae6b52e70d5149bb" - integrity sha512-7tjk+6DyhYAmei8FOEwPfGKc0VE1x56CKPJ+eE44zhDbOyMT+9yan8apfQFxo8oEFsy+0O7PiBtH8w0Yo0Y9Kw== +"@octokit/types@^8.1.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-8.2.1.tgz#a6de091ae68b5541f8d4fcf9a12e32836d4648aa" + integrity sha512-8oWMUji8be66q2B9PmEIUyQm00VPDPun07umUWSaCwxmeaquFBro4Hcc3ruVoDo3zkQyZBlRvhIMEYS3pBhanw== dependencies: "@octokit/openapi-types" "^14.0.0" +"@octokit/types@^9.0.0": + version "9.3.2" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.3.2.tgz#3f5f89903b69f6a2d196d78ec35f888c0013cac5" + integrity sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA== + dependencies: + "@octokit/openapi-types" "^18.0.0" + "@types/node@18.x": version "18.15.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" @@ -135,15 +145,15 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -jsonc-parser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" - integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== node-fetch@^2.6.7: - version "2.6.8" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.8.tgz#a68d30b162bc1d8fd71a367e81b997e1f4d4937e" - integrity sha512-RZ6dBYuj8dRSfxpUSu+NsdF1dpPpluJxwOp+6IoDp/sH2QNDSvurYsAa+F1WxY2RjA1iP93xhcsUoYbF2XBqVg== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" diff --git a/extensions/extension-editing/package.json b/extensions/extension-editing/package.json index 5d6d342783f..f45105b99d4 100644 --- a/extensions/extension-editing/package.json +++ b/extensions/extension-editing/package.json @@ -26,7 +26,7 @@ "watch": "gulp watch-extension:extension-editing" }, "dependencies": { - "jsonc-parser": "^2.2.1", + "jsonc-parser": "^3.2.0", "markdown-it": "^12.3.2", "parse5": "^3.0.2" }, diff --git a/extensions/extension-editing/src/extensionLinter.ts b/extensions/extension-editing/src/extensionLinter.ts index 8f509e17e8d..8bb2a4640df 100644 --- a/extensions/extension-editing/src/extensionLinter.ts +++ b/extensions/extension-editing/src/extensionLinter.ts @@ -127,7 +127,7 @@ export class ExtensionLinter { const tree = parseTree(document.getText()); const info = this.readPackageJsonInfo(this.getUriFolder(document.uri), tree); - if (info.isExtension) { + if (tree && info.isExtension) { const icon = findNodeAtLocation(tree, ['icon']); if (icon && icon.type === 'string') { diff --git a/extensions/extension-editing/yarn.lock b/extensions/extension-editing/yarn.lock index ff42c956777..5456b3ec040 100644 --- a/extensions/extension-editing/yarn.lock +++ b/extensions/extension-editing/yarn.lock @@ -27,15 +27,15 @@ entities@~2.1.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== -jsonc-parser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" - integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== linkify-it@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" - integrity sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ== + version "3.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== dependencies: uc.micro "^1.0.1" diff --git a/extensions/vscode-colorize-tests/package.json b/extensions/vscode-colorize-tests/package.json index 8cb8442b6f2..eb72136ccf4 100644 --- a/extensions/vscode-colorize-tests/package.json +++ b/extensions/vscode-colorize-tests/package.json @@ -17,7 +17,7 @@ "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json" }, "dependencies": { - "jsonc-parser": "2.2.1" + "jsonc-parser": "^3.2.0" }, "devDependencies": { "@types/node": "18.x" diff --git a/extensions/vscode-colorize-tests/yarn.lock b/extensions/vscode-colorize-tests/yarn.lock index 4c166d0a3c8..a7a6fa446ca 100644 --- a/extensions/vscode-colorize-tests/yarn.lock +++ b/extensions/vscode-colorize-tests/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== -jsonc-parser@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" - integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== From 92d806dd79e2b58a01c8d2025aa5dec150d9dc7d Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 12 Sep 2023 15:45:03 +0200 Subject: [PATCH 41/50] don't show inline diff when nothing has changed --- .../browser/inlineChatLivePreviewWidget.ts | 12 +++++++++--- .../inlineChat/browser/inlineChatStrategies.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts index 0f153ca64da..2d2a2a7a5bb 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts @@ -170,9 +170,15 @@ export class InlineChatLivePreviewWidget extends ZoneWidget { return; } - // complex changes - this._logService.debug('[IE] livePreview-mode: full diff'); - this._renderChangesWithFullDiff(changes, range); + if (changes.length === 0 || this._session.textModel0.getValueLength() === 0) { + // no change or changes to an empty file + this._logService.debug('[IE] livePreview-mode: no diff'); + this._cleanupFullDiff(); + } else { + // complex changes + this._logService.debug('[IE] livePreview-mode: full diff'); + this._renderChangesWithFullDiff(changes, range); + } } // --- full diff diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts index 76944f5b38e..5ffa49b8217 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts @@ -409,7 +409,7 @@ export class LivePreviewStrategy extends LiveStrategy { } if (response.singleCreateFileEdit) { - this._previewZone.value.showCreation(this._session.wholeRange.value, response.singleCreateFileEdit.uri, await Promise.all(response.singleCreateFileEdit.edits)); + this._previewZone.value.showCreation(this._session.wholeRange.value.collapseToEnd(), response.singleCreateFileEdit.uri, await Promise.all(response.singleCreateFileEdit.edits)); } else { this._previewZone.value.hide(); } From 90046124d2b5fde098c692ef801cccff902e83d9 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 12 Sep 2023 15:30:59 +0200 Subject: [PATCH 42/50] Fixes diff editor menu context key conditions --- .../browser/widget/diffEditor/diffEditor.contribution.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts index f3a2b7789bf..9ccc307b2cd 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts @@ -27,6 +27,7 @@ export class ToggleCollapseUnchangedRegions extends Action2 { toggled: ContextKeyExpr.has('config.diffEditor.hideUnchangedRegions.enabled'), precondition: ContextKeyExpr.has('isInDiffEditor'), menu: { + when: ContextKeyExpr.has('isInDiffEditor'), id: MenuId.EditorTitle, order: 22, group: 'navigation', @@ -84,6 +85,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: new ToggleUseInlineViewWhenSpaceIsLimited().desc.id, title: localize('useInlineViewWhenSpaceIsLimited', "Use Inline View When Space Is Limited"), toggled: ContextKeyExpr.has('config.diffEditor.useInlineViewWhenSpaceIsLimited'), + precondition: ContextKeyExpr.has('isInDiffEditor'), }, order: 11, group: '1_diff', @@ -99,6 +101,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { title: localize('showMoves', "Show Moved Code Blocks"), icon: Codicon.move, toggled: ContextKeyEqualsExpr.create('config.diffEditor.experimental.showMoves', true), + precondition: ContextKeyExpr.has('isInDiffEditor'), }, order: 10, group: '1_diff', @@ -239,6 +242,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: AccessibleDiffViewerNext.id, title: localize('Open Accessible Diff Viewer', "Open Accessible Diff Viewer"), + precondition: ContextKeyExpr.has('isInDiffEditor'), }, order: 10, group: '2_diff', From ed1a8da946ae6ef94b49193758d282859350cdce Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 12 Sep 2023 16:20:16 +0200 Subject: [PATCH 43/50] Rename Perl6 to Raku (#192882) Fixes #168319 --- extensions/perl/package.json | 17 +- .../test/colorize-fixtures/test.p6 | 27 + .../test/colorize-results/test_p6.json | 1836 +++++++++++++++++ 3 files changed, 1874 insertions(+), 6 deletions(-) create mode 100644 extensions/vscode-colorize-tests/test/colorize-fixtures/test.p6 create mode 100644 extensions/vscode-colorize-tests/test/colorize-results/test_p6.json diff --git a/extensions/perl/package.json b/extensions/perl/package.json index 8e3fed18d0c..003ec922c32 100644 --- a/extensions/perl/package.json +++ b/extensions/perl/package.json @@ -31,18 +31,23 @@ "configuration": "./perl.language-configuration.json" }, { - "id": "perl6", + "id": "raku", "aliases": [ - "Perl 6", + "Raku", + "Perl6", "perl6" ], "extensions": [ + ".raku", + ".rakumod", + ".rakutest", + ".rakudoc", + ".nqp", ".p6", ".pl6", - ".pm6", - ".nqp" + ".pm6" ], - "firstLine": "(^#!.*\\bperl6\\b)|use\\s+v6", + "firstLine": "(^#!.*\\bperl6\\b)|use\\s+v6|raku|=begin\\spod|my\\sclass", "configuration": "./perl6.language-configuration.json" } ], @@ -56,7 +61,7 @@ ] }, { - "language": "perl6", + "language": "raku", "scopeName": "source.perl.6", "path": "./syntaxes/perl6.tmLanguage.json" } diff --git a/extensions/vscode-colorize-tests/test/colorize-fixtures/test.p6 b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.p6 new file mode 100644 index 00000000000..e8b55eb6f3d --- /dev/null +++ b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.p6 @@ -0,0 +1,27 @@ +# Example taken from https://en.wikipedia.org/wiki/Raku_(programming_language) +class Point is rw { + has $.x; + has $.y; + + method distance( Point $p ) { + sqrt(($!x - $p.x) ** 2 + ($!y - $p.y) ** 2) + } + + method distance-to-center { + self.distance: Point.new(x => 0, y => 0) + } +} + +my $point = Point.new( x => 1.2, y => -3.7 ); +say "Point's location: (", $point.x, ', ', $point.y, ')'; +# OUTPUT: Point's location: (1.2, -3.7) + +# Changing x and y (note methods "x" and "y" used as lvalues): +$point.x = 3; +$point.y = 4; +say "Point's location: (", $point.x, ', ', $point.y, ')'; +# OUTPUT: Point's location: (3, 4) + +my $other-point = Point.new(x => -5, y => 10); +$point.distance($other-point); #=> 10 +$point.distance-to-center; #=> 5 diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_p6.json b/extensions/vscode-colorize-tests/test/colorize-results/test_p6.json new file mode 100644 index 00000000000..c4c2106a171 --- /dev/null +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_p6.json @@ -0,0 +1,1836 @@ +[ + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": " Example taken from https://en.wikipedia.org/wiki/Raku_(programming_language)", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "class", + "t": "source.perl.6 meta.class.perl.6 storage.type.class.perl.6", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " ", + "t": "source.perl.6 meta.class.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "Point", + "t": "source.perl.6 meta.class.perl.6 entity.name.type.class.perl.6", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0", + "dark_modern": "entity.name.type: #4EC9B0", + "hc_light": "entity.name.type: #185E73", + "light_modern": "entity.name.type: #267F99" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "is", + "t": "source.perl.6 storage.modifier.type.constraints.perl", + "r": { + "dark_plus": "storage.modifier: #569CD6", + "light_plus": "storage.modifier: #0000FF", + "dark_vs": "storage.modifier: #569CD6", + "light_vs": "storage.modifier: #0000FF", + "hc_black": "storage.modifier: #569CD6", + "dark_modern": "storage.modifier: #569CD6", + "hc_light": "storage.modifier: #0F4A85", + "light_modern": "storage.modifier: #0000FF" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "rw", + "t": "source.perl.6 storage.modifier.perl", + "r": { + "dark_plus": "storage.modifier: #569CD6", + "light_plus": "storage.modifier: #0000FF", + "dark_vs": "storage.modifier: #569CD6", + "light_vs": "storage.modifier: #0000FF", + "hc_black": "storage.modifier: #569CD6", + "dark_modern": "storage.modifier: #569CD6", + "hc_light": "storage.modifier: #0F4A85", + "light_modern": "storage.modifier: #0000FF" + } + }, + { + "c": " {", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "has", + "t": "source.perl.6 storage.type.variable.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " $.", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": ";", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "has", + "t": "source.perl.6 storage.type.variable.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " $.y;", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "method", + "t": "source.perl.6 storage.type.declare.routine.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " distance( Point ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$p", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": " ) {", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "sqrt", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "((", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$!x", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": " - ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$p", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": ") ** 2 + (", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$!y", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": " - ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$p", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".y) ** 2)", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " }", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "method", + "t": "source.perl.6 storage.type.declare.routine.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " distance-", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "to", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "-center {", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "self", + "t": "source.perl.6 variable.language.perl", + "r": { + "dark_plus": "variable.language: #569CD6", + "light_plus": "variable.language: #0000FF", + "dark_vs": "variable.language: #569CD6", + "light_vs": "variable.language: #0000FF", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable.language: #569CD6", + "hc_light": "variable.language: #0F4A85", + "light_modern": "variable.language: #0000FF" + } + }, + { + "c": ".distance: Point.", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "new", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "(", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": " => 0, y => 0)", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " }", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "}", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "my", + "t": "source.perl.6 storage.type.variable.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": " = Point.", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "new", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "( ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": " => 1.2, y => -3.7 );", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "say", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "\"", + "t": "source.perl.6 string.quoted.double.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "Point's location: (", + "t": "source.perl.6 string.quoted.double.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "\"", + "t": "source.perl.6 string.quoted.double.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6 string.quoted.single.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".y, ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ")", + "t": "source.perl.6 string.quoted.single.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ";", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": " OUTPUT: Point's location: (1.2, -3.7)", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": " Changing x and y (note methods \"x\" and \"y\" used as lvalues):", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": " = 3;", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".y = 4;", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "say", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "\"", + "t": "source.perl.6 string.quoted.double.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "Point's location: (", + "t": "source.perl.6 string.quoted.double.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "\"", + "t": "source.perl.6 string.quoted.double.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6 string.quoted.single.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ", ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".y, ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.begin.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ")", + "t": "source.perl.6 string.quoted.single.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": "'", + "t": "source.perl.6 string.quoted.single.perl punctuation.definition.string.end.perl", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string: #0F4A85", + "light_modern": "string: #A31515" + } + }, + { + "c": ";", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": " OUTPUT: Point's location: (3, 4)", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "my", + "t": "source.perl.6 storage.type.variable.perl", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6", + "dark_modern": "storage.type: #569CD6", + "hc_light": "storage.type: #0F4A85", + "light_modern": "storage.type: #0000FF" + } + }, + { + "c": " ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$other-point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": " = Point.", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "new", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "(", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "x", + "t": "source.perl.6 keyword.operator.perl", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4", + "dark_modern": "keyword.operator: #D4D4D4", + "hc_light": "keyword.operator: #000000", + "light_modern": "keyword.operator: #000000" + } + }, + { + "c": " => -5, y => 10);", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".distance(", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "$other-point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": "); ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "=> 10", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "$point", + "t": "source.perl.6 variable.other.identifier.perl.6", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" + } + }, + { + "c": ".distance-", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "to", + "t": "source.perl.6 support.function.perl", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.function: #DCDCAA", + "dark_modern": "support.function: #DCDCAA", + "hc_light": "support.function: #5E2CBC", + "light_modern": "support.function: #795E26" + } + }, + { + "c": "-center; ", + "t": "source.perl.6", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "#", + "t": "source.perl.6 comment.line.number-sign.perl punctuation.definition.comment.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "=> 5", + "t": "source.perl.6 comment.line.number-sign.perl", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + } +] \ No newline at end of file From cf7daf08e32ae5e0187c130d4eddbb694735fc67 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 12 Sep 2023 08:03:59 -0700 Subject: [PATCH 44/50] Finalize env.onDidChangeShell Fixes #160694 --- src/vs/workbench/api/common/extHost.api.impl.ts | 1 - .../extensions/common/extensionsApiProposals.ts | 1 - src/vscode-dts/vscode.d.ts | 5 +++++ .../vscode.proposed.envShellEvent.d.ts | 16 ---------------- 4 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 src/vscode-dts/vscode.proposed.envShellEvent.d.ts diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index fcc80b4cacc..e8eed318caa 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -343,7 +343,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostTerminalService.getDefaultShell(false); }, get onDidChangeShell() { - checkProposedApiEnabled(extension, 'envShellEvent'); return extHostTerminalService.onDidChangeShell; }, get isTelemetryEnabled() { diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index 493a5d860a6..ad2039a68bf 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -40,7 +40,6 @@ export const allApiProposals = Object.freeze({ dropMetadata: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dropMetadata.d.ts', editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts', editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts', - envShellEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envShellEvent.d.ts', extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts', extensionsAny: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts', externalUriOpener: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts', diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 17ee7553c42..cb6a6cabf48 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -10000,6 +10000,11 @@ declare module 'vscode' { */ export const onDidChangeTelemetryEnabled: Event; + /** + * An {@link Event} which fires when the default shell changes. + */ + export const onDidChangeShell: Event; + /** * Creates a new {@link TelemetryLogger telemetry logger}. * diff --git a/src/vscode-dts/vscode.proposed.envShellEvent.d.ts b/src/vscode-dts/vscode.proposed.envShellEvent.d.ts deleted file mode 100644 index 8fed971ef71..00000000000 --- a/src/vscode-dts/vscode.proposed.envShellEvent.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - - // See https://github.com/microsoft/vscode/issues/160694 - export namespace env { - - /** - * An {@link Event} which fires when the default shell changes. - */ - export const onDidChangeShell: Event; - } -} From ab3fbd758c741efc0f241cc4266e435d32724fd6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 12 Sep 2023 17:39:39 +0200 Subject: [PATCH 45/50] debt - properly await `runWithFakedTimers` (#192887) * debt - properly await `runWithFakedTimers` * UI Overlap With `window.nativeTabs: false`, `window.commandCenter: true`, and Tab per Project (fix #192801) * Revert "UI Overlap With `window.nativeTabs: false`, `window.commandCenter: true`, and Tab per Project (fix #192801)" This reverts commit 31a191b8f0eebee5ff5b8f6e924b699287a173e7. --- .../workingCopy/test/browser/resourceWorkingCopy.test.ts | 2 +- .../test/browser/storedFileWorkingCopy.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/workingCopy/test/browser/resourceWorkingCopy.test.ts b/src/vs/workbench/services/workingCopy/test/browser/resourceWorkingCopy.test.ts index d4d9097c020..fee71d4e7d0 100644 --- a/src/vs/workbench/services/workingCopy/test/browser/resourceWorkingCopy.test.ts +++ b/src/vs/workbench/services/workingCopy/test/browser/resourceWorkingCopy.test.ts @@ -55,7 +55,7 @@ suite('ResourceWorkingCopy', function () { }); test('orphaned tracking', async () => { - runWithFakedTimers({}, async () => { + return runWithFakedTimers({}, async () => { assert.strictEqual(workingCopy.isOrphaned(), false); let onDidChangeOrphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned); diff --git a/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts b/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts index 17cfba00f84..ba5268aff39 100644 --- a/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts +++ b/src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts @@ -234,7 +234,7 @@ suite('StoredFileWorkingCopy', function () { }); test('orphaned tracking', async () => { - runWithFakedTimers({}, async () => { + return runWithFakedTimers({}, async () => { assert.strictEqual(workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN), false); let onDidChangeOrphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned); @@ -411,7 +411,7 @@ suite('StoredFileWorkingCopy', function () { }); test('resolve (with backup, preserves metadata and orphaned state)', async () => { - runWithFakedTimers({}, async () => { + return runWithFakedTimers({}, async () => { await workingCopy.resolve({ contents: bufferToStream(VSBuffer.fromString('hello backup')) }); const orphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned); @@ -440,7 +440,7 @@ suite('StoredFileWorkingCopy', function () { }); test('resolve (updates orphaned state accordingly)', async () => { - runWithFakedTimers({}, async () => { + return runWithFakedTimers({}, async () => { await workingCopy.resolve(); const orphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned); @@ -694,7 +694,7 @@ suite('StoredFileWorkingCopy', function () { }); test('save (no errors) - save clears orphaned', async () => { - runWithFakedTimers({}, async () => { + return runWithFakedTimers({}, async () => { let savedCounter = 0; disposables.add(workingCopy.onDidSave(e => { savedCounter++; From c065c66844552621cf6c3fe9354ca98de44251d1 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 12 Sep 2023 17:41:53 +0200 Subject: [PATCH 46/50] UI Overlap With `window.nativeTabs: false`, `window.commandCenter: true`, and Tab per Project (fix #192801) (#192889) --- .../electron-sandbox/actions/windowActions.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/vs/workbench/electron-sandbox/actions/windowActions.ts b/src/vs/workbench/electron-sandbox/actions/windowActions.ts index 7a348c60a35..352f575bc2d 100644 --- a/src/vs/workbench/electron-sandbox/actions/windowActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/windowActions.ts @@ -25,6 +25,7 @@ import { Action2, IAction2Options, MenuId } from 'vs/platform/actions/common/act import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { isMacintosh } from 'vs/base/common/platform'; export class CloseWindowAction extends Action2 { @@ -276,26 +277,59 @@ export class QuickSwitchWindowAction extends BaseSwitchWindow { } } +function canRunNativeTabsHandler(accessor: ServicesAccessor): boolean { + if (!isMacintosh) { + return false; + } + + const configurationService = accessor.get(IConfigurationService); + return configurationService.getValue('window.nativeTabs') === true; +} + export const NewWindowTabHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).newWindowTab(); }; export const ShowPreviousWindowTabHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).showPreviousWindowTab(); }; export const ShowNextWindowTabHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).showNextWindowTab(); }; export const MoveWindowTabToNewWindowHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).moveWindowTabToNewWindow(); }; export const MergeWindowTabsHandlerHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).mergeAllWindowTabs(); }; export const ToggleWindowTabsBarHandler: ICommandHandler = function (accessor: ServicesAccessor) { + if (!canRunNativeTabsHandler(accessor)) { + return; + } + return accessor.get(INativeHostService).toggleWindowTabsBar(); }; From 01f471f25c9df8848f86996c91fa02125278eb40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:04:53 -0700 Subject: [PATCH 47/50] Bump actions/checkout from 3 to 4 (#192764) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/author-verified.yml | 2 +- .github/workflows/bad-tag.yml | 2 +- .github/workflows/basic.yml | 6 +++--- .github/workflows/ci.yml | 8 ++++---- .github/workflows/deep-classifier-assign-monitor.yml | 2 +- .github/workflows/deep-classifier-runner.yml | 2 +- .github/workflows/deep-classifier-scraper.yml | 2 +- .github/workflows/deep-classifier-unassign-monitor.yml | 2 +- .github/workflows/devcontainer-cache.yml | 2 +- .github/workflows/english-please.yml | 2 +- .github/workflows/feature-request.yml | 2 +- .github/workflows/latest-release-monitor.yml | 2 +- .github/workflows/locker.yml | 2 +- .github/workflows/monaco-editor.yml | 2 +- .github/workflows/needs-more-info-closer.yml | 2 +- .github/workflows/on-comment.yml | 2 +- .github/workflows/on-label.yml | 2 +- .github/workflows/on-open.yml | 2 +- .github/workflows/release-pipeline-labeler.yml | 4 ++-- .github/workflows/telemetry.yml | 2 +- .github/workflows/test-plan-item-validator.yml | 2 +- 21 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/author-verified.yml b/.github/workflows/author-verified.yml index 7061cf3cdd2..f914be2f71b 100644 --- a/.github/workflows/author-verified.yml +++ b/.github/workflows/author-verified.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Actions if: contains(github.event.issue.labels.*.name, 'author-verification-requested') && contains(github.event.issue.labels.*.name, 'insiders-released') - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/bad-tag.yml b/.github/workflows/bad-tag.yml index ba4e0524ccc..bc964fb0582 100644 --- a/.github/workflows/bad-tag.yml +++ b/.github/workflows/bad-tag.yml @@ -8,7 +8,7 @@ jobs: if: github.event.ref == '1.999.0' steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 012c4247abe..605d73183d4 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -19,7 +19,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # TODO: rename azure-pipelines/linux/xvfb.init to github-actions - name: Setup Build Environment @@ -79,7 +79,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: @@ -141,7 +141,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf63d22e313..92f596fb9f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: CHILD_CONCURRENCY: "1" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: @@ -101,7 +101,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # TODO: rename azure-pipelines/linux/xvfb.init to github-actions - name: Setup Build Environment @@ -182,7 +182,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: @@ -254,7 +254,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/deep-classifier-assign-monitor.yml b/.github/workflows/deep-classifier-assign-monitor.yml index 97e375694e6..cfd9abc374a 100644 --- a/.github/workflows/deep-classifier-assign-monitor.yml +++ b/.github/workflows/deep-classifier-assign-monitor.yml @@ -9,7 +9,7 @@ jobs: if: ${{ contains(github.event.issue.labels.*.name, 'triage-needed') }} steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/deep-classifier-runner.yml b/.github/workflows/deep-classifier-runner.yml index 2d90770bd25..5ee7d048945 100644 --- a/.github/workflows/deep-classifier-runner.yml +++ b/.github/workflows/deep-classifier-runner.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/deep-classifier-scraper.yml b/.github/workflows/deep-classifier-scraper.yml index d58c02cad0f..e21061549d9 100644 --- a/.github/workflows/deep-classifier-scraper.yml +++ b/.github/workflows/deep-classifier-scraper.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/deep-classifier-unassign-monitor.yml b/.github/workflows/deep-classifier-unassign-monitor.yml index 6e9a2b13621..d0e14e936c2 100644 --- a/.github/workflows/deep-classifier-unassign-monitor.yml +++ b/.github/workflows/deep-classifier-unassign-monitor.yml @@ -9,7 +9,7 @@ jobs: if: ${{ ! contains(github.event.issue.labels.*.name, 'triage-needed') }} steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/devcontainer-cache.yml b/.github/workflows/devcontainer-cache.yml index eeccbdc958d..4e08944ea53 100644 --- a/.github/workflows/devcontainer-cache.yml +++ b/.github/workflows/devcontainer-cache.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout id: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Azure CLI login id: az_login diff --git a/.github/workflows/english-please.yml b/.github/workflows/english-please.yml index 2f24b039125..9e04d6d549c 100644 --- a/.github/workflows/english-please.yml +++ b/.github/workflows/english-please.yml @@ -10,7 +10,7 @@ jobs: if: contains(github.event.issue.labels.*.name, '*english-please') steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/feature-request.yml b/.github/workflows/feature-request.yml index 4e054c030eb..83c0a9705c5 100644 --- a/.github/workflows/feature-request.yml +++ b/.github/workflows/feature-request.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout Actions if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'feature-request') - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions diff --git a/.github/workflows/latest-release-monitor.yml b/.github/workflows/latest-release-monitor.yml index ac60450aa96..f7392dc24a8 100644 --- a/.github/workflows/latest-release-monitor.yml +++ b/.github/workflows/latest-release-monitor.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions diff --git a/.github/workflows/locker.yml b/.github/workflows/locker.yml index 8b515b58bd0..5860349a437 100644 --- a/.github/workflows/locker.yml +++ b/.github/workflows/locker.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions diff --git a/.github/workflows/monaco-editor.yml b/.github/workflows/monaco-editor.yml index a276604164e..df9138035cb 100644 --- a/.github/workflows/monaco-editor.yml +++ b/.github/workflows/monaco-editor.yml @@ -18,7 +18,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/needs-more-info-closer.yml b/.github/workflows/needs-more-info-closer.yml index 65805be0d51..8db8a4246a3 100644 --- a/.github/workflows/needs-more-info-closer.yml +++ b/.github/workflows/needs-more-info-closer.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions diff --git a/.github/workflows/on-comment.yml b/.github/workflows/on-comment.yml index 0db46b3f9b6..089aa77c1e7 100644 --- a/.github/workflows/on-comment.yml +++ b/.github/workflows/on-comment.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions diff --git a/.github/workflows/on-label.yml b/.github/workflows/on-label.yml index 9771860d437..da80bb54992 100644 --- a/.github/workflows/on-label.yml +++ b/.github/workflows/on-label.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/on-open.yml b/.github/workflows/on-open.yml index 8fef95d9e83..361ac11b946 100644 --- a/.github/workflows/on-open.yml +++ b/.github/workflows/on-open.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable diff --git a/.github/workflows/release-pipeline-labeler.yml b/.github/workflows/release-pipeline-labeler.yml index dbe6b966c6f..87e188a02ab 100644 --- a/.github/workflows/release-pipeline-labeler.yml +++ b/.github/workflows/release-pipeline-labeler.yml @@ -10,14 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" ref: stable path: ./actions - name: Checkout Repo if: github.event_name != 'issues' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ./repo fetch-depth: 0 diff --git a/.github/workflows/telemetry.yml b/.github/workflows/telemetry.yml index 3bfaf8117c8..ab1559d8fa6 100644 --- a/.github/workflows/telemetry.yml +++ b/.github/workflows/telemetry.yml @@ -7,7 +7,7 @@ jobs: runs-on: 'ubuntu-latest' steps: - - uses: 'actions/checkout@v3' + - uses: 'actions/checkout@v4' - uses: 'actions/setup-node@v3' with: diff --git a/.github/workflows/test-plan-item-validator.yml b/.github/workflows/test-plan-item-validator.yml index d3b9284f9ae..117eaf6908a 100644 --- a/.github/workflows/test-plan-item-validator.yml +++ b/.github/workflows/test-plan-item-validator.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Actions if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item') - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "microsoft/vscode-github-triage-actions" path: ./actions From 379d31d162c400d65ebd134697632dda4b606ab5 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 12 Sep 2023 09:13:33 -0700 Subject: [PATCH 48/50] Invoke session change emitter when session is created in getSession (#192828) fixes https://github.com/microsoft/vscode/issues/192806 --- extensions/microsoft-authentication/src/AADHelper.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/microsoft-authentication/src/AADHelper.ts b/extensions/microsoft-authentication/src/AADHelper.ts index 255162db8d0..5e72873b3ef 100644 --- a/extensions/microsoft-authentication/src/AADHelper.ts +++ b/extensions/microsoft-authentication/src/AADHelper.ts @@ -260,6 +260,7 @@ export class AzureActiveDirectoryService { this._logger.trace(`[${scopeData.scopeStr}] '${token.sessionId}' Found a matching token with a different scopes '${token.scope}'. Attempting to get a new session using the existing session.`); try { const itoken = await this.doRefreshToken(token.refreshToken, scopeData); + this._sessionChangeEmitter.fire({ added: [this.convertToSessionSync(itoken)], removed: [], changed: [] }); matchingTokens.push(itoken); } catch (err) { this._logger.error(`[${scopeData.scopeStr}] Attempted to get a new session using the existing session with scopes '${token.scope}' but it failed due to: ${err.message ?? err}`); From 6bb64ab400fbce21d5c65cbe25698c582e1fa06a Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Tue, 12 Sep 2023 09:16:11 -0700 Subject: [PATCH 49/50] Fix indentation (#191918) --- extensions/vscode-api-tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index ad2305f8a6a..4f9f2c1965d 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -45,7 +45,7 @@ "textSearchProvider", "timeline", "tokenInformation", - "treeViewActiveItem", + "treeViewActiveItem", "treeViewReveal", "workspaceTrust", "telemetry", From 1a323a474ddbdebdcd8517e5429afc60e61493fd Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 12 Sep 2023 18:21:59 +0200 Subject: [PATCH 50/50] debt - fix a leak in `DiskFileSystemProviderClient.readFileStream` (#192893) --- .../files/common/diskFileSystemProviderClient.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/files/common/diskFileSystemProviderClient.ts b/src/vs/platform/files/common/diskFileSystemProviderClient.ts index f277238bbd3..d3719ddd0e7 100644 --- a/src/vs/platform/files/common/diskFileSystemProviderClient.ts +++ b/src/vs/platform/files/common/diskFileSystemProviderClient.ts @@ -8,7 +8,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { canceled } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { newWriteableStream, ReadableStreamEventPayload, ReadableStreamEvents } from 'vs/base/common/stream'; import { URI, UriComponents } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; @@ -93,9 +93,10 @@ export class DiskFileSystemProviderClient extends Disposable implements readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents { const stream = newWriteableStream(data => VSBuffer.concat(data.map(data => VSBuffer.wrap(data))).buffer); + const disposables = new DisposableStore(); // Reading as file stream goes through an event to the remote side - const listener = this.channel.listen>('readFileStream', [resource, opts])(dataOrErrorOrEnd => { + disposables.add(this.channel.listen>('readFileStream', [resource, opts])(dataOrErrorOrEnd => { // data if (dataOrErrorOrEnd instanceof VSBuffer) { @@ -128,12 +129,12 @@ export class DiskFileSystemProviderClient extends Disposable implements } // Signal to the remote side that we no longer listen - listener.dispose(); + disposables.dispose(); } - }); + })); // Support cancellation - token.onCancellationRequested(() => { + disposables.add(token.onCancellationRequested(() => { // Ensure to end the stream properly with an error // to indicate the cancellation. @@ -143,8 +144,8 @@ export class DiskFileSystemProviderClient extends Disposable implements // Ensure to dispose the listener upon cancellation. This will // bubble through the remote side as event and allows to stop // reading the file. - listener.dispose(); - }); + disposables.dispose(); + })); return stream; }