From 52771b92e2ea28299a7be4880faa096c24031bfb Mon Sep 17 00:00:00 2001 From: tisilent Date: Thu, 6 Apr 2023 23:33:52 +0800 Subject: [PATCH 01/13] Fix #178135 --- .../browser/find/simpleFindWidget.css | 11 ++++ .../browser/find/simpleFindWidget.ts | 52 ++++++++++++++++++- .../find/browser/terminalFindWidget.ts | 6 ++- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css index e15ab55dacb..5d6ea3106c3 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css +++ b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css @@ -99,3 +99,14 @@ div.simple-find-part-wrapper div.button:hover:not(.disabled) { outline: 1px dashed var(--vscode-toolbar-hoverOutline); outline-offset: -1px; } + +.monaco-workbench .simple-find-part .monaco-sash { + left: 0 !important; + border-left: 1px solid; + border-bottom-left-radius: 4px; +} + +.monaco-workbench .simple-find-part .monaco-sash.vertical:before{ + width: 2px; + left: calc(50% - (var(--vscode-sash-hover-size) / 4)); +} diff --git a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts index a59a6decbd5..3bdb003f59f 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts @@ -17,12 +17,15 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { ContextScopedFindInput } from 'vs/platform/history/browser/contextScopedHistoryWidget'; import { widgetClose } from 'vs/platform/theme/common/iconRegistry'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import * as strings from 'vs/base/common/strings'; import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { showHistoryKeybindingHint } from 'vs/platform/history/browser/historyWidgetKeybindingHint'; import { alert as alertFn } from 'vs/base/browser/ui/aria/aria'; import { defaultInputBoxStyles, defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles'; +import { ISashEvent, IVerticalSashLayoutProvider, Orientation, Sash } from 'vs/base/browser/ui/sash/sash'; +import { registerColor } from 'vs/platform/theme/common/colorRegistry'; const NLS_FIND_INPUT_LABEL = nls.localize('label.find', "Find"); const NLS_FIND_INPUT_PLACEHOLDER = nls.localize('placeholder.find', "Find (\u21C5 for history)"); @@ -38,12 +41,14 @@ interface IFindOptions { appendRegexLabel?: string; appendWholeWordsLabel?: string; type?: 'Terminal' | 'Webview'; + initialWidth?: number; + disableSash?: boolean; } const SIMPLE_FIND_WIDGET_INITIAL_WIDTH = 310; const MATCHES_COUNT_WIDTH = 68; -export abstract class SimpleFindWidget extends Widget { +export abstract class SimpleFindWidget extends Widget implements IVerticalSashLayoutProvider { private readonly _findInput: FindInput; private readonly _domNode: HTMLElement; private readonly _innerDomNode: HTMLElement; @@ -197,6 +202,42 @@ export abstract class SimpleFindWidget extends Widget { this._delayedUpdateHistory(); })); } + + if (options?.initialWidth) { + this._domNode.style.width = `${options.initialWidth}px`; + } + + if (options?.disableSash) { + const initialMinWidth = options?.initialWidth ?? SIMPLE_FIND_WIDGET_INITIAL_WIDTH; + let originalWidth = dom.getTotalWidth(this._domNode); + + // sash + const resizeSash = new Sash(this._innerDomNode, this, { orientation: Orientation.VERTICAL, size: 1 }); + this._register(resizeSash.onDidStart(() => { + originalWidth = parseFloat(dom.getComputedStyle(this._domNode).width); + })); + + this._register(resizeSash.onDidChange((e: ISashEvent) => { + const width = originalWidth + e.startX - e.currentX; + if (width < initialMinWidth) { + return; + } + this._domNode.style.width = `${width}px`; + })); + + this._register(resizeSash.onDidReset(e => { + const currentWidth = parseFloat(dom.getComputedStyle(this._domNode).width); + if (currentWidth === initialMinWidth) { + this._domNode.style.width = '100%'; + } else { + this._domNode.style.width = `${initialMinWidth}px`; + } + })); + } + } + + public getVerticalSashLeft(_sash: Sash): number { + return 0; } public abstract find(previous: boolean): void; @@ -363,6 +404,8 @@ export abstract class SimpleFindWidget extends Widget { } } else if (count?.resultCount) { label = strings.format(NLS_MATCHES_LOCATION, count.resultIndex + 1, count?.resultCount); + } else { + label = NLS_NO_RESULTS; } alertFn(this._announceSearchResults(label, this.inputValue)); this._matchesCount.appendChild(document.createTextNode(label)); @@ -387,3 +430,10 @@ export abstract class SimpleFindWidget extends Widget { return nls.localize('ariaSearchNoResultWithLineNumNoCurrentMatch', "{0} found for '{1}'", label, searchString); } } + +export const simpleFindWidgetSashBorder = registerColor('simpleFindWidget.sashBorder', { dark: '#454545', light: '#C8C8C8', hcDark: '6FC3DF', hcLight: '0F4A85' }, nls.localize('simpleFindWidget.sashBorder', 'Border color of the sash border.')); + +registerThemingParticipant((theme, collector) => { + const resizeBorderBackground = theme.getColor(simpleFindWidgetSashBorder); + collector.addRule(`.monaco-workbench .simple-find-part .monaco-sash { background-color: ${resizeBorderBackground}; border-color: ${resizeBorderBackground} }`); +}); diff --git a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts index 8a7d706834c..bcea9177225 100644 --- a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts +++ b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts @@ -14,6 +14,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { Event } from 'vs/base/common/event'; import { ISearchOptions } from 'xterm-addon-search'; +const TERMINAL_FIND_WIDGET_INITIAL_WIDTH = 419; + export class TerminalFindWidget extends SimpleFindWidget { private _findInputFocused: IContextKey; private _findWidgetFocused: IContextKey; @@ -27,7 +29,7 @@ export class TerminalFindWidget extends SimpleFindWidget { @IThemeService private readonly _themeService: IThemeService, @IConfigurationService private readonly _configurationService: IConfigurationService ) { - super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal' }, _contextViewService, _contextKeyService, keybindingService); + super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal', initialWidth: TERMINAL_FIND_WIDGET_INITIAL_WIDTH, disableSash: true }, _contextViewService, _contextKeyService, keybindingService); this._register(this.state.onFindReplaceStateChange(() => { this.show(); @@ -45,6 +47,8 @@ export class TerminalFindWidget extends SimpleFindWidget { this.find(true, true); } })); + + this.updateResultCount(); } find(previous: boolean, update?: boolean) { From 0676fe42b1daab8dd7e39fc56bfee798d45061d8 Mon Sep 17 00:00:00 2001 From: tisilent Date: Fri, 7 Apr 2023 14:36:22 +0800 Subject: [PATCH 02/13] Rename enableSash --- .../browser/find/simpleFindWidget.ts | 20 ++++++++++--------- .../find/browser/terminalFindWidget.ts | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts index 3bdb003f59f..3181551d61d 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts @@ -42,7 +42,7 @@ interface IFindOptions { appendWholeWordsLabel?: string; type?: 'Terminal' | 'Webview'; initialWidth?: number; - disableSash?: boolean; + enableSash?: boolean; } const SIMPLE_FIND_WIDGET_INITIAL_WIDTH = 310; @@ -203,13 +203,15 @@ export abstract class SimpleFindWidget extends Widget implements IVerticalSashLa })); } - if (options?.initialWidth) { - this._domNode.style.width = `${options.initialWidth}px`; + let initialMinWidth = options?.initialWidth; + if (initialMinWidth) { + initialMinWidth = initialMinWidth < SIMPLE_FIND_WIDGET_INITIAL_WIDTH ? SIMPLE_FIND_WIDGET_INITIAL_WIDTH : initialMinWidth; + this._domNode.style.width = `${initialMinWidth}px`; } - if (options?.disableSash) { - const initialMinWidth = options?.initialWidth ?? SIMPLE_FIND_WIDGET_INITIAL_WIDTH; - let originalWidth = dom.getTotalWidth(this._domNode); + if (options?.enableSash) { + const _initialMinWidth = initialMinWidth ?? SIMPLE_FIND_WIDGET_INITIAL_WIDTH; + let originalWidth = _initialMinWidth; // sash const resizeSash = new Sash(this._innerDomNode, this, { orientation: Orientation.VERTICAL, size: 1 }); @@ -219,7 +221,7 @@ export abstract class SimpleFindWidget extends Widget implements IVerticalSashLa this._register(resizeSash.onDidChange((e: ISashEvent) => { const width = originalWidth + e.startX - e.currentX; - if (width < initialMinWidth) { + if (width < _initialMinWidth) { return; } this._domNode.style.width = `${width}px`; @@ -227,10 +229,10 @@ export abstract class SimpleFindWidget extends Widget implements IVerticalSashLa this._register(resizeSash.onDidReset(e => { const currentWidth = parseFloat(dom.getComputedStyle(this._domNode).width); - if (currentWidth === initialMinWidth) { + if (currentWidth === _initialMinWidth) { this._domNode.style.width = '100%'; } else { - this._domNode.style.width = `${initialMinWidth}px`; + this._domNode.style.width = `${_initialMinWidth}px`; } })); } diff --git a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts index bcea9177225..bb781e33070 100644 --- a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts +++ b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts @@ -29,7 +29,7 @@ export class TerminalFindWidget extends SimpleFindWidget { @IThemeService private readonly _themeService: IThemeService, @IConfigurationService private readonly _configurationService: IConfigurationService ) { - super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal', initialWidth: TERMINAL_FIND_WIDGET_INITIAL_WIDTH, disableSash: true }, _contextViewService, _contextKeyService, keybindingService); + super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal', initialWidth: TERMINAL_FIND_WIDGET_INITIAL_WIDTH, enableSash: true }, _contextViewService, _contextKeyService, keybindingService); this._register(this.state.onFindReplaceStateChange(() => { this.show(); From 01586a4d44779ff7f0cbed7976ab6654bbbd08c3 Mon Sep 17 00:00:00 2001 From: tisilent Date: Fri, 7 Apr 2023 17:59:06 +0800 Subject: [PATCH 03/13] fix color --- .../contrib/codeEditor/browser/find/simpleFindWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts index 3181551d61d..93828af2c52 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts @@ -433,7 +433,7 @@ export abstract class SimpleFindWidget extends Widget implements IVerticalSashLa } } -export const simpleFindWidgetSashBorder = registerColor('simpleFindWidget.sashBorder', { dark: '#454545', light: '#C8C8C8', hcDark: '6FC3DF', hcLight: '0F4A85' }, nls.localize('simpleFindWidget.sashBorder', 'Border color of the sash border.')); +export const simpleFindWidgetSashBorder = registerColor('simpleFindWidget.sashBorder', { dark: '#454545', light: '#C8C8C8', hcDark: '#6FC3DF', hcLight: '#0F4A85' }, nls.localize('simpleFindWidget.sashBorder', 'Border color of the sash border.')); registerThemingParticipant((theme, collector) => { const resizeBorderBackground = theme.getColor(simpleFindWidgetSashBorder); From 85586bd1f4858870568b4e1c5c40e9213c0d9b9c Mon Sep 17 00:00:00 2001 From: Jean Pierre Date: Mon, 8 May 2023 12:49:36 -0500 Subject: [PATCH 04/13] Fix continuation #175107 when the remote takes more than 20s to resolve, e.g. codespaces --- .../browser/terminalProfileService.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts index 73efd09b3f7..d161a40cb6e 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts @@ -31,7 +31,8 @@ export class TerminalProfileService implements ITerminalProfileService { declare _serviceBrand: undefined; private _webExtensionContributedProfileContextKey: IContextKey; - private _profilesReadyBarrier: AutoOpenBarrier; + private _profilesReadyBarrier: AutoOpenBarrier | undefined; + private _profilesReadyPromise: Promise; private _availableProfiles: ITerminalProfile[] | undefined; private _contributedProfiles: IExtensionTerminalProfile[] = []; private _defaultProfileName?: string; @@ -41,7 +42,7 @@ export class TerminalProfileService implements ITerminalProfileService { private readonly _onDidChangeAvailableProfiles = new Emitter(); get onDidChangeAvailableProfiles(): Event { return this._onDidChangeAvailableProfiles.event; } - get profilesReady(): Promise { return this._profilesReadyBarrier.wait().then(() => { }); } + get profilesReady(): Promise { return this._profilesReadyPromise; } get availableProfiles(): ITerminalProfile[] { if (!this._platformConfigJustRefreshed) { this.refreshAvailableProfiles(); @@ -67,10 +68,14 @@ export class TerminalProfileService implements ITerminalProfileService { this._webExtensionContributedProfileContextKey = TerminalContextKeys.webExtensionContributedProfile.bindTo(this._contextKeyService); this._updateWebContextKey(); - // Wait up to 5 seconds for profiles to be ready so it's assured that we know the actual - // default terminal before launching the first terminal. This isn't expected to ever take - // this long. - this._profilesReadyBarrier = new AutoOpenBarrier(20000); + this._profilesReadyPromise = this._remoteAgentService.getEnvironment() + .then(() => { + // Wait up to 20 seconds for profiles to be ready so it's assured that we know the actual + // default terminal before launching the first terminal. This isn't expected to ever take + // this long. + this._profilesReadyBarrier = new AutoOpenBarrier(20000); + return this._profilesReadyBarrier.wait().then(() => { }); + }); this.refreshAvailableProfiles(); this._setupConfigListener(); } @@ -138,7 +143,7 @@ export class TerminalProfileService implements ITerminalProfileService { if (profilesChanged || contributedProfilesChanged) { this._availableProfiles = profiles; this._onDidChangeAvailableProfiles.fire(this._availableProfiles); - this._profilesReadyBarrier.open(); + this._profilesReadyBarrier!.open(); this._updateWebContextKey(); await this._refreshPlatformConfig(this._availableProfiles); } From 040c5df8702d64125a719ec9cfca9adadc620d7b Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 3 Aug 2023 19:36:26 -0700 Subject: [PATCH 05/13] Add missing , after merge --- .../contrib/terminalContrib/find/browser/terminalFindWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts index d2091ba2418..780540bc02b 100644 --- a/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts +++ b/src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts @@ -35,7 +35,7 @@ export class TerminalFindWidget extends SimpleFindWidget { checkImeCompletionState: true, showResultCount: true, initialWidth: TERMINAL_FIND_WIDGET_INITIAL_WIDTH, - enableSash: true + enableSash: true, appendCaseSensitiveActionId: TerminalCommandId.ToggleFindCaseSensitive, appendRegexActionId: TerminalCommandId.ToggleFindRegex, appendWholeWordsActionId: TerminalCommandId.ToggleFindWholeWord, From 036a3d773c388d4e8e6d5602a40462f1f292c7bd Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 4 Aug 2023 15:52:25 +0200 Subject: [PATCH 06/13] Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4530 (#189630) --- .../widget/diffEditorWidget2/lineAlignment.ts | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts b/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts index 4111988779b..92fb780d62c 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts @@ -69,8 +69,12 @@ export class ViewZoneManager extends Disposable { this._register(this._editors.original.onDidChangeViewZones((_args) => { if (!isChangingViewZones && !this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } })); this._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!isChangingViewZones && !this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } })); - this._register(this._editors.original.onDidChangeConfiguration((args) => { if (args.hasChanged(EditorOption.wrappingInfo)) { updateImmediately.schedule(); } })); - this._register(this._editors.modified.onDidChangeConfiguration((args) => { if (args.hasChanged(EditorOption.wrappingInfo)) { updateImmediately.schedule(); } })); + this._register(this._editors.original.onDidChangeConfiguration((args) => { + if (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); } + })); + this._register(this._editors.modified.onDidChangeConfiguration((args) => { + if (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); } + })); const originalModelTokenizationCompleted = this._diffModel.map(m => m ? observableFromEvent(m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined @@ -87,7 +91,14 @@ export class ViewZoneManager extends Disposable { state.read(reader); const renderSideBySide = this._options.renderSideBySide.read(reader); const innerHunkAlignment = renderSideBySide; - return computeRangeAlignment(this._editors.original, this._editors.modified, diff.mappings, alignmentViewZoneIdsOrig, alignmentViewZoneIdsMod, innerHunkAlignment); + return computeRangeAlignment( + this._editors.original, + this._editors.modified, + diff.mappings, + alignmentViewZoneIdsOrig, + alignmentViewZoneIdsMod, + innerHunkAlignment + ); }); const alignmentsSyncedMovedText = derived((reader) => { @@ -97,7 +108,14 @@ export class ViewZoneManager extends Disposable { state.read(reader); const mappings = syncedMovedText.changes.map(c => new DiffMapping(c)); // TODO dont include alignments outside syncedMovedText - return computeRangeAlignment(this._editors.original, this._editors.modified, mappings, alignmentViewZoneIdsOrig, alignmentViewZoneIdsMod, true); + return computeRangeAlignment( + this._editors.original, + this._editors.modified, + mappings, + alignmentViewZoneIdsOrig, + alignmentViewZoneIdsMod, + true + ); }); function createFakeLinesDiv(): HTMLElement { From 7180079f64ff20f1422bbc47c716c421055fb0aa Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 4 Aug 2023 15:52:56 +0200 Subject: [PATCH 07/13] Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4528 (#189631) --- .../mergeEditor/browser/model/diffComputer.ts | 31 +++++++++++++++++++ .../mergeEditor/browser/model/mapping.ts | 27 ---------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts b/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts index 0e3d81bca1d..cc1be27460f 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts @@ -65,6 +65,37 @@ export class MergeDiffComputer implements IMergeDiffComputer { ); assertFn(() => { + for (const c of changes) { + const inputRange = c.inputRange; + const outputRange = c.outputRange; + const inputTextModel = c.inputTextModel; + const outputTextModel = c.outputTextModel; + + for (const map of c.rangeMappings) { + let inputRangesValid = inputRange.startLineNumber - 1 <= map.inputRange.startLineNumber + && map.inputRange.endLineNumber <= inputRange.endLineNumberExclusive; + if (inputRangesValid && map.inputRange.startLineNumber === inputRange.startLineNumber - 1) { + inputRangesValid = map.inputRange.endColumn >= inputTextModel.getLineMaxColumn(map.inputRange.startLineNumber); + } + if (inputRangesValid && map.inputRange.endLineNumber === inputRange.endLineNumberExclusive) { + inputRangesValid = map.inputRange.endColumn === 1; + } + + let outputRangesValid = outputRange.startLineNumber - 1 <= map.outputRange.startLineNumber + && map.outputRange.endLineNumber <= outputRange.endLineNumberExclusive; + if (outputRangesValid && map.outputRange.startLineNumber === outputRange.startLineNumber - 1) { + outputRangesValid = map.outputRange.endColumn >= outputTextModel.getLineMaxColumn(map.outputRange.endLineNumber); + } + if (outputRangesValid && map.outputRange.endLineNumber === outputRange.endLineNumberExclusive) { + outputRangesValid = map.outputRange.endColumn === 1; + } + + if (!inputRangesValid || !outputRangesValid) { + return false; + } + } + } + return changes.length === 0 || (changes[0].inputRange.startLineNumber === changes[0].outputRange.startLineNumber && checkAdjacentItems(changes, (m1, m2) => m2.inputRange.startLineNumber - m1.inputRange.endLineNumberExclusive === m2.outputRange.startLineNumber - m1.outputRange.endLineNumberExclusive && diff --git a/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts b/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts index c5dff0cdf5e..1f1bb9258b6 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts @@ -237,33 +237,6 @@ export class DetailedLineRangeMapping extends LineRangeMapping { super(inputRange, outputRange); this.rangeMappings = rangeMappings || [new RangeMapping(this.inputRange.toRange(), this.outputRange.toRange())]; - - assertFn(() => { - for (const map of this.rangeMappings) { - let inputRangesValid = inputRange.startLineNumber - 1 <= map.inputRange.startLineNumber - && map.inputRange.endLineNumber <= inputRange.endLineNumberExclusive; - if (inputRangesValid && map.inputRange.startLineNumber === inputRange.startLineNumber - 1) { - inputRangesValid = map.inputRange.endColumn >= inputTextModel.getLineMaxColumn(map.inputRange.startLineNumber); - } - if (inputRangesValid && map.inputRange.endLineNumber === inputRange.endLineNumberExclusive) { - inputRangesValid = map.inputRange.endColumn === 1; - } - - let outputRangesValid = outputRange.startLineNumber - 1 <= map.outputRange.startLineNumber - && map.outputRange.endLineNumber <= outputRange.endLineNumberExclusive; - if (outputRangesValid && map.outputRange.startLineNumber === outputRange.startLineNumber - 1) { - outputRangesValid = map.outputRange.endColumn >= outputTextModel.getLineMaxColumn(map.outputRange.startLineNumber); - } - if (outputRangesValid && map.outputRange.endLineNumber === outputRange.endLineNumberExclusive) { - outputRangesValid = map.outputRange.endColumn === 1; - } - - if (!inputRangesValid || !outputRangesValid) { - return false; - } - } - return true; - }); } public override addOutputLineDelta(delta: number): DetailedLineRangeMapping { From 642045cd509ab6c3e0aec6ec05b1c27edc5d7b11 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 4 Aug 2023 07:36:17 -0700 Subject: [PATCH 08/13] Fix unfocused view opacity in terminal find and terminal editors Fixes #189599 --- .../browser/unfocusedViewDimmingContribution.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts index 25ec3cdd73e..3b89b06d0e3 100644 --- a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts +++ b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts @@ -42,9 +42,11 @@ export class UnfocusedViewDimmingContribution extends Disposable implements IWor // Terminal tabs rules.add(`.monaco-workbench .pane-body.integrated-terminal:not(:focus-within) .tabs-container { ${filterRule} }`); // Terminals - rules.add(`.monaco-workbench .pane-body.integrated-terminal .xterm:not(.focus) { ${filterRule} }`); - // Editors + rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`); + // Text editors rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor { ${filterRule} }`); + // Terminal editors + rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .terminal-wrapper { ${filterRule} }`); } elStyle.textContent = [...rules].join('\n'); From b117ff4c3b09cb38ce8fc2456b6bb6a51c5c64ab Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 4 Aug 2023 07:36:43 -0700 Subject: [PATCH 09/13] Tidy up setting css --- .../unfocusedViewDimmingContribution.ts | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts index 3b89b06d0e3..e865074afda 100644 --- a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts +++ b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts @@ -34,22 +34,26 @@ export class UnfocusedViewDimmingContribution extends Disposable implements IWor opacity = clamp(opacityConfig, 0.2, 1); } - const rules = new Set(); + let cssTextContent = ''; // Only add the styles if the feature is used if (opacity !== 1) { - const filterRule = `filter: opacity(${opacity});`; - // Terminal tabs - rules.add(`.monaco-workbench .pane-body.integrated-terminal:not(:focus-within) .tabs-container { ${filterRule} }`); - // Terminals - rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`); - // Text editors - rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor { ${filterRule} }`); - // Terminal editors - rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .terminal-wrapper { ${filterRule} }`); + const rules = new Set(); + if (opacity !== 1) { + const filterRule = `filter: opacity(${opacity});`; + // Terminal tabs + rules.add(`.monaco-workbench .pane-body.integrated-terminal:not(:focus-within) .tabs-container { ${filterRule} }`); + // Terminals + rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`); + // Text editors + rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor { ${filterRule} }`); + // Terminal editors + rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .terminal-wrapper { ${filterRule} }`); + } + cssTextContent = [...rules].join('\n'); } - elStyle.textContent = [...rules].join('\n'); + elStyle.textContent = cssTextContent; })); } } From ada755e4de8a083deaccd9c9e5d12f729fd3e829 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Fri, 4 Aug 2023 08:05:56 -0700 Subject: [PATCH 10/13] Record telemetry for when the explorer fails to enter edit mode (#189653) --- .../contrib/files/browser/explorerService.ts | 51 ++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/explorerService.ts b/src/vs/workbench/contrib/files/browser/explorerService.ts index 00ecb1ce0bd..8d184d071a0 100644 --- a/src/vs/workbench/contrib/files/browser/explorerService.ts +++ b/src/vs/workbench/contrib/files/browser/explorerService.ts @@ -26,6 +26,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IExpression } from 'vs/base/common/glob'; import { ResourceGlobMatcher } from 'vs/workbench/common/resources'; import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; export const UNDO_REDO_SOURCE = new UndoRedoSource(); @@ -54,7 +55,8 @@ export class ExplorerService implements IExplorerService { @IBulkEditService private readonly bulkEditService: IBulkEditService, @IProgressService private readonly progressService: IProgressService, @IHostService hostService: IHostService, - @IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService + @IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService, + @ITelemetryService private readonly telemetryService: ITelemetryService ) { this.config = this.configurationService.getValue('explorer'); @@ -228,7 +230,52 @@ export class ExplorerService implements IExplorerService { this.editable = { stat, data }; } const isEditing = this.isEditable(stat); - await this.view.setEditable(stat, isEditing); + try { + await this.view.setEditable(stat, isEditing); + } catch { + const parent = stat.parent; + type ExplorerViewEditableErrorData = { + parentIsDirectory: boolean | undefined; + isDirectory: boolean | undefined; + isReadonly: boolean | undefined; + parentIsReadonly: boolean | undefined; + parentIsExcluded: boolean | undefined; + isExcluded: boolean | undefined; + parentIsRoot: boolean | undefined; + isRoot: boolean | undefined; + parentHasNests: boolean | undefined; + hasNests: boolean | undefined; + }; + type ExplorerViewEditableErrorClassification = { + owner: 'lramos15'; + comment: 'Helps gain a broard understanding of why users are unable to edit files in the explorer'; + parentIsDirectory: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the parent of the editable element is a directory' }; + isDirectory: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the editable element is a directory' }; + isReadonly: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the editable element is readonly' }; + parentIsReadonly: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the parent of the editable element is readonly' }; + parentIsExcluded: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the parent of the editable element is excluded from being shown in the explorer' }; + isExcluded: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the editable element is excluded from being shown in the explorer' }; + parentIsRoot: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the parent of the editable element is a root' }; + isRoot: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the editable element is a root' }; + parentHasNests: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the parent of the editable element has nested children' }; + hasNests: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the editable element has nested children' }; + }; + const errorData = { + parentIsDirectory: parent?.isDirectory, + isDirectory: stat.isDirectory, + isReadonly: !!stat.isReadonly, + parentIsReadonly: !!parent?.isReadonly, + parentIsExcluded: parent?.isExcluded, + isExcluded: stat.isExcluded, + parentIsRoot: parent?.isRoot, + isRoot: stat.isRoot, + parentHasNests: parent?.hasNests, + hasNests: stat.hasNests, + }; + this.telemetryService.publicLogError2('explorerView.setEditableError', errorData); + return; + } + if (!this.editable && this.fileChangeEvents.length && !this.onFileChangesScheduler.isScheduled()) { this.onFileChangesScheduler.schedule(); From 1eb0fa9593a4a84d4590c466fb514b799d259757 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 4 Aug 2023 08:20:18 -0700 Subject: [PATCH 11/13] Don't enable smooth scroll when trackpad is used Fixes #187283 --- .../terminal/browser/xterm/xtermTerminal.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index ce8b46bb9c3..d5acf93a0d8 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -41,6 +41,8 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c import { TerminalContextKeys } from 'vs/workbench/contrib/terminal/common/terminalContextKey'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { debounce } from 'vs/base/common/decorators'; +import { MouseWheelClassifier } from 'vs/base/browser/ui/scrollbar/scrollableElement'; +import { IMouseWheelEvent, StandardWheelEvent } from 'vs/base/browser/mouseEvent'; const enum RenderConstants { /** @@ -119,6 +121,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID private _core: IXtermCore; private static _suggestedRendererType: 'canvas' | 'dom' | undefined = undefined; private _attached?: { container: HTMLElement; options: IXtermAttachToElementOptions }; + private _isPhysicalMouseWheel = MouseWheelClassifier.INSTANCE.isPhysicalMouseWheel(); // Always on addons private _markNavigationAddon: MarkNavigationAddon; @@ -234,9 +237,9 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID scrollSensitivity: config.mouseWheelScrollSensitivity, wordSeparator: config.wordSeparators, overviewRulerWidth: 10, - smoothScrollDuration: config.smoothScrolling ? RenderConstants.SmoothScrollDuration : 0, ignoreBracketedPasteMode: config.ignoreBracketedPasteMode })); + this._updateSmoothScrolling(); this._core = (this.raw as any)._core as IXtermCore; this.add(this._configurationService.onDidChangeConfiguration(async e => { @@ -353,6 +356,18 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID ad.add(dom.addDisposableListener(this.raw.textarea, 'blur', () => this._setFocused(false))); ad.add(dom.addDisposableListener(this.raw.textarea, 'focusout', () => this._setFocused(false))); + // Track wheel events in mouse wheel classifier and update smoothScrolling when it changes + // as it must be disabled when a trackpad is used + ad.add(dom.addDisposableListener(this.raw.element!, dom.EventType.MOUSE_WHEEL, (e: IMouseWheelEvent) => { + const classifier = MouseWheelClassifier.INSTANCE; + classifier.acceptStandardWheelEvent(new StandardWheelEvent(e)); + const value = classifier.isPhysicalMouseWheel(); + if (value !== this._isPhysicalMouseWheel) { + this._isPhysicalMouseWheel = value; + this._updateSmoothScrolling(); + } + }, { passive: true })); + this._suggestAddon?.setContainer(container); this._attached = { container, options }; @@ -393,8 +408,8 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID this.raw.options.rightClickSelectsWord = config.rightClickBehavior === 'selectWord'; this.raw.options.wordSeparator = config.wordSeparators; this.raw.options.customGlyphs = config.customGlyphs; - this.raw.options.smoothScrollDuration = config.smoothScrolling ? RenderConstants.SmoothScrollDuration : 0; this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode; + this._updateSmoothScrolling(); if (this._attached?.options.enableGpu) { if (this._shouldLoadWebgl()) { this._enableWebglRenderer(); @@ -409,6 +424,10 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID } } + private _updateSmoothScrolling() { + this.raw.options.smoothScrollDuration = this._configHelper.config.smoothScrolling && this._isPhysicalMouseWheel ? RenderConstants.SmoothScrollDuration : 0; + } + private _shouldLoadWebgl(): boolean { return !isSafari && (this._configHelper.config.gpuAcceleration === 'auto' && XtermTerminal._suggestedRendererType === undefined) || this._configHelper.config.gpuAcceleration === 'on'; } From 15cac803d1149e5da94e9fce8c757d2e6665a82a Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 4 Aug 2023 17:31:40 +0200 Subject: [PATCH 12/13] Fixes #131091 (#189655) --- .../common/diff/algorithms/diffAlgorithm.ts | 7 ++++++ .../diff/algorithms/joinSequenceDiffs.ts | 6 ++--- .../common/diff/standardLinesDiffComputer.ts | 8 +++++++ .../advanced.expected.diff.json | 22 +++---------------- .../indentation/advanced.expected.diff.json | 10 +++------ .../issue-185779/advanced.expected.diff.json | 10 +++------ 6 files changed, 26 insertions(+), 37 deletions(-) diff --git a/src/vs/editor/common/diff/algorithms/diffAlgorithm.ts b/src/vs/editor/common/diff/algorithms/diffAlgorithm.ts index 8628534a514..ce23a58ceb3 100644 --- a/src/vs/editor/common/diff/algorithms/diffAlgorithm.ts +++ b/src/vs/editor/common/diff/algorithms/diffAlgorithm.ts @@ -68,6 +68,13 @@ export interface ISequence { * Must not be negative. */ getBoundaryScore?(length: number): number; + + /** + * For line sequences, getElement returns a number representing trimmed lines. + * This however checks equality for the original lines. + * It prevents shifting to less matching lines. + */ + isStronglyEqual(offset1: number, offset2: number): boolean; } export interface ITimeout { diff --git a/src/vs/editor/common/diff/algorithms/joinSequenceDiffs.ts b/src/vs/editor/common/diff/algorithms/joinSequenceDiffs.ts index cc718830098..b76c82d371b 100644 --- a/src/vs/editor/common/diff/algorithms/joinSequenceDiffs.ts +++ b/src/vs/editor/common/diff/algorithms/joinSequenceDiffs.ts @@ -293,8 +293,7 @@ function shiftDiffToBetterPosition(diff: SequenceDiff, sequence1: ISequence, seq while ( diff.seq1Range.start - deltaBefore >= seq1ValidRange.start && diff.seq2Range.start - deltaBefore >= seq2ValidRange.start && - sequence2.getElement(diff.seq2Range.start - deltaBefore) === - sequence2.getElement(diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit + sequence2.isStronglyEqual(diff.seq2Range.start - deltaBefore, diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit ) { deltaBefore++; } @@ -304,8 +303,7 @@ function shiftDiffToBetterPosition(diff: SequenceDiff, sequence1: ISequence, seq while ( diff.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive && diff.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive && - sequence2.getElement(diff.seq2Range.start + deltaAfter) === - sequence2.getElement(diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit + sequence2.isStronglyEqual(diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit ) { deltaAfter++; } diff --git a/src/vs/editor/common/diff/standardLinesDiffComputer.ts b/src/vs/editor/common/diff/standardLinesDiffComputer.ts index 79d20885d8a..f9a4b4a4540 100644 --- a/src/vs/editor/common/diff/standardLinesDiffComputer.ts +++ b/src/vs/editor/common/diff/standardLinesDiffComputer.ts @@ -640,6 +640,10 @@ export class LineSequence implements ISequence { getText(range: OffsetRange): string { return this.lines.slice(range.start, range.endExclusive).join('\n'); } + + isStronglyEqual(offset1: number, offset2: number): boolean { + return this.lines[offset1] === this.lines[offset2]; + } } function getIndentation(str: string): number { @@ -800,6 +804,10 @@ export class LinesSliceCharSequence implements ISequence { public countLinesIn(range: OffsetRange): number { return this.translateOffset(range.endExclusive).lineNumber - this.translateOffset(range.start).lineNumber; } + + isStronglyEqual(offset1: number, offset2: number): boolean { + return this.elements[offset1] === this.elements[offset2]; + } } function isWordChar(charCode: number): boolean { diff --git a/src/vs/editor/test/node/diffing/fixtures/bracket-aligning/advanced.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/bracket-aligning/advanced.expected.diff.json index 18845aa6ccd..85083dedd28 100644 --- a/src/vs/editor/test/node/diffing/fixtures/bracket-aligning/advanced.expected.diff.json +++ b/src/vs/editor/test/node/diffing/fixtures/bracket-aligning/advanced.expected.diff.json @@ -67,8 +67,8 @@ ] }, { - "originalRange": "[86,99)", - "modifiedRange": "[88,102)", + "originalRange": "[86,95)", + "modifiedRange": "[88,98)", "innerChanges": [ { "originalRange": "[86,1 -> 86,1]", @@ -108,23 +108,7 @@ }, { "originalRange": "[95,1 -> 95,1]", - "modifiedRange": "[97,1 -> 97,2]" - }, - { - "originalRange": "[96,1 -> 96,1]", - "modifiedRange": "[98,1 -> 98,2]" - }, - { - "originalRange": "[97,1 -> 97,1]", - "modifiedRange": "[99,1 -> 99,2]" - }, - { - "originalRange": "[98,1 -> 98,1]", - "modifiedRange": "[100,1 -> 100,2]" - }, - { - "originalRange": "[99,1 -> 99,1]", - "modifiedRange": "[101,1 -> 102,1]" + "modifiedRange": "[97,1 -> 98,1]" } ] } diff --git a/src/vs/editor/test/node/diffing/fixtures/indentation/advanced.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/indentation/advanced.expected.diff.json index 2e7031437fa..43176254538 100644 --- a/src/vs/editor/test/node/diffing/fixtures/indentation/advanced.expected.diff.json +++ b/src/vs/editor/test/node/diffing/fixtures/indentation/advanced.expected.diff.json @@ -27,8 +27,8 @@ ] }, { - "originalRange": "[12,24)", - "modifiedRange": "[13,26)", + "originalRange": "[12,23)", + "modifiedRange": "[13,25)", "innerChanges": [ { "originalRange": "[12,1 -> 12,1]", @@ -76,11 +76,7 @@ }, { "originalRange": "[23,1 -> 23,1]", - "modifiedRange": "[24,1 -> 24,2]" - }, - { - "originalRange": "[24,1 -> 24,1]", - "modifiedRange": "[25,1 -> 26,1]" + "modifiedRange": "[24,1 -> 25,1]" } ] } diff --git a/src/vs/editor/test/node/diffing/fixtures/issue-185779/advanced.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/issue-185779/advanced.expected.diff.json index d3a24ad44f2..a7ea515c057 100644 --- a/src/vs/editor/test/node/diffing/fixtures/issue-185779/advanced.expected.diff.json +++ b/src/vs/editor/test/node/diffing/fixtures/issue-185779/advanced.expected.diff.json @@ -9,8 +9,8 @@ }, "diffs": [ { - "originalRange": "[26,33)", - "modifiedRange": "[26,43)", + "originalRange": "[26,32)", + "modifiedRange": "[26,42)", "innerChanges": [ { "originalRange": "[26,10 -> 26,10]", @@ -38,11 +38,7 @@ }, { "originalRange": "[32,1 -> 32,1]", - "modifiedRange": "[41,1 -> 41,2]" - }, - { - "originalRange": "[33,1 -> 33,1]", - "modifiedRange": "[42,1 -> 43,1]" + "modifiedRange": "[41,1 -> 42,1]" } ] } From 51525fc6aabc63dca108be7346cbc7591dbd1570 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Fri, 4 Aug 2023 08:37:23 -0700 Subject: [PATCH 13/13] fix #189658 --- .../contrib/accessibility/browser/accessibleView.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts b/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts index 976563aaafa..cda3fa23913 100644 --- a/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts +++ b/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts @@ -501,6 +501,12 @@ class AccessibleViewSymbolQuickPick { quickPick.onDidAccept(() => { this._accessibleView.showSymbol(provider, quickPick.selectedItems[0]); }); + quickPick.onDidHide(() => { + if (quickPick.selectedItems.length === 0) { + // this was escaped, so refocus the accessible view + this._accessibleView.show(provider); + } + }); } }