From 4325b8ce0dfccf8a146211c83e8f39795096e415 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Sun, 15 Dec 2024 18:13:05 +0100 Subject: [PATCH 01/20] Use console.error and console.warn for errors and warnings (#236048) --- src/vs/platform/log/common/log.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/log/common/log.ts b/src/vs/platform/log/common/log.ts index e503417a554..7ce341461a4 100644 --- a/src/vs/platform/log/common/log.ts +++ b/src/vs/platform/log/common/log.ts @@ -432,7 +432,7 @@ export class ConsoleLogger extends AbstractLogger implements ILogger { warn(message: string | Error, ...args: any[]): void { if (this.canLog(LogLevel.Warning)) { if (this.useColors) { - console.log('%c WARN', 'color: #993', message, ...args); + console.warn('%c WARN', 'color: #993', message, ...args); } else { console.log(message, ...args); } @@ -442,7 +442,7 @@ export class ConsoleLogger extends AbstractLogger implements ILogger { error(message: string, ...args: any[]): void { if (this.canLog(LogLevel.Error)) { if (this.useColors) { - console.log('%c ERR', 'color: #f33', message, ...args); + console.error('%c ERR', 'color: #f33', message, ...args); } else { console.error(message, ...args); } From ce50bd4876af457f64d83cfd956bc916535285f4 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Sun, 15 Dec 2024 18:17:17 +0100 Subject: [PATCH 02/20] Remove unused showLocal proposal (#236032) * Remove unused showLocal proposal * No local build error?? --- .../common/extensionsApiProposals.ts | 3 --- .../api/browser/mainThreadDialogs.ts | 3 +-- .../workbench/api/common/extHost.api.impl.ts | 2 +- src/vs/workbench/api/common/extHostDialogs.ts | 7 +------ src/vscode-dts/vscode.proposed.showLocal.d.ts | 19 ------------------- 5 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 src/vscode-dts/vscode.proposed.showLocal.d.ts diff --git a/src/vs/platform/extensions/common/extensionsApiProposals.ts b/src/vs/platform/extensions/common/extensionsApiProposals.ts index 9a6636005b3..bd35500287e 100644 --- a/src/vs/platform/extensions/common/extensionsApiProposals.ts +++ b/src/vs/platform/extensions/common/extensionsApiProposals.ts @@ -319,9 +319,6 @@ const _allApiProposals = { shareProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts', }, - showLocal: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts', - }, speech: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts', }, diff --git a/src/vs/workbench/api/browser/mainThreadDialogs.ts b/src/vs/workbench/api/browser/mainThreadDialogs.ts index 4ab41cf2663..50f3a61b94d 100644 --- a/src/vs/workbench/api/browser/mainThreadDialogs.ts +++ b/src/vs/workbench/api/browser/mainThreadDialogs.ts @@ -7,7 +7,6 @@ import { URI } from '../../../base/common/uri.js'; import { MainThreadDiaglogsShape, MainContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../common/extHost.protocol.js'; import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; import { IFileDialogService, IOpenDialogOptions, ISaveDialogOptions } from '../../../platform/dialogs/common/dialogs.js'; -import { Schemas } from '../../../base/common/network.js'; @extHostNamedCustomer(MainContext.MainThreadDialogs) export class MainThreadDialogs implements MainThreadDiaglogsShape { @@ -47,7 +46,7 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape { canSelectMany: options?.canSelectMany, defaultUri: options?.defaultUri ? URI.revive(options.defaultUri) : undefined, title: options?.title || undefined, - availableFileSystems: options?.allowUIResources ? [Schemas.vscodeRemote, Schemas.file] : [] + availableFileSystems: [] }; if (options?.filters) { result.filters = []; diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 6e68860da3f..85ff1aa52b2 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -781,7 +781,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostQuickOpen.showInput(options, token); }, showOpenDialog(options) { - return extHostDialogs.showOpenDialog(extension, options); + return extHostDialogs.showOpenDialog(options); }, showSaveDialog(options) { return extHostDialogs.showSaveDialog(options); diff --git a/src/vs/workbench/api/common/extHostDialogs.ts b/src/vs/workbench/api/common/extHostDialogs.ts index 8e98769e19c..05b37776943 100644 --- a/src/vs/workbench/api/common/extHostDialogs.ts +++ b/src/vs/workbench/api/common/extHostDialogs.ts @@ -6,8 +6,6 @@ import type * as vscode from 'vscode'; import { URI } from '../../../base/common/uri.js'; import { MainContext, MainThreadDiaglogsShape, IMainContext } from './extHost.protocol.js'; -import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; -import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; export class ExtHostDialogs { @@ -17,10 +15,7 @@ export class ExtHostDialogs { this._proxy = mainContext.getProxy(MainContext.MainThreadDialogs); } - showOpenDialog(extension: IExtensionDescription, options?: vscode.OpenDialogOptions): Promise { - if (options?.allowUIResources) { - checkProposedApiEnabled(extension, 'showLocal'); - } + showOpenDialog(options?: vscode.OpenDialogOptions): Promise { return this._proxy.$showOpenDialog(options).then(filepaths => { return filepaths ? filepaths.map(p => URI.revive(p)) : undefined; }); diff --git a/src/vscode-dts/vscode.proposed.showLocal.d.ts b/src/vscode-dts/vscode.proposed.showLocal.d.ts deleted file mode 100644 index 9a9294f596b..00000000000 --- a/src/vscode-dts/vscode.proposed.showLocal.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// https://github.com/microsoft/vscode/issues/131138 - -declare module 'vscode' { - - export interface OpenDialogOptions { - /** - * Controls whether the dialog allows users to select local files via the "Show Local" button. - * Extensions that set this to `true` should check the scheme of the selected file. - * Resources with the `file` scheme come from the same extension host as the extension. - * Resources with the `vscode-local` scheme come from an extension host running in the same place as the UI. - */ - allowUIResources?: boolean; - } -} From 7432213b30d0c4a161d4fa8e934f21500bfbb990 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 16 Dec 2024 10:17:29 +0100 Subject: [PATCH 03/20] debt - remove home indicator (#236189) It was broken before and not shown, and there were no complains, so lets remove it for good. --- .../parts/titlebar/media/titlebarpart.css | 17 ------------- .../browser/parts/titlebar/titlebarPart.ts | 19 ++------------- src/vs/workbench/browser/web.api.ts | 24 ------------------- 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css b/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css index 0264e5460d4..d3c6da2f239 100644 --- a/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css +++ b/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css @@ -271,23 +271,6 @@ display: none; } -.monaco-workbench .part.titlebar > .titlebar-container .window-appicon > .home-bar-icon-badge { - position: absolute; - right: 9px; - bottom: 6px; - width: 8px; - height: 8px; - z-index: 1; - /* on top of home indicator */ - background-image: url('../../../media/code-icon.svg'); - background-repeat: no-repeat; - background-position: center center; - background-size: 8px; - pointer-events: none; - border-top: 1px solid transparent; - border-left: 1px solid transparent; -} - /* Window Controls Container */ .monaco-workbench .part.titlebar .window-controls-container { display: flex; diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 69342beb96a..93a798fa708 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -15,7 +15,6 @@ import { IConfigurationService, IConfigurationChangeEvent } from '../../../../pl import { DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; import { IBrowserWorkbenchEnvironmentService } from '../../../services/environment/browser/environmentService.js'; import { IThemeService } from '../../../../platform/theme/common/themeService.js'; -import { ThemeIcon } from '../../../../base/common/themables.js'; import { TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_BACKGROUND, TITLE_BAR_BORDER, WORKBENCH_BACKGROUND } from '../../../common/theme.js'; import { isMacintosh, isWindows, isLinux, isWeb, isNative, platformLocale } from '../../../../base/common/platform.js'; import { Color } from '../../../../base/common/color.js'; @@ -29,8 +28,6 @@ import { createActionViewItem, fillInActionBarActions as fillInActionBarActions import { Action2, IMenu, IMenuService, MenuId, registerAction2 } from '../../../../platform/actions/common/actions.js'; import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; import { IHostService } from '../../../services/host/browser/host.js'; -import { Codicon } from '../../../../base/common/codicons.js'; -import { getIconRegistry } from '../../../../platform/theme/common/iconRegistry.js'; import { WindowTitle } from './windowTitle.js'; import { CommandCenterControl } from './commandCenterControl.js'; import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; @@ -434,21 +431,9 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart { this.centerContent = append(this.rootContainer, $('.titlebar-center')); this.rightContent = append(this.rootContainer, $('.titlebar-right')); - // App Icon (Windows, Linux) / Home Indicator (Web) - const homeIndicator = this.environmentService.options?.homeIndicator; - const supportsAppIcon = isWindows || isLinux || (isWeb && homeIndicator && !this.isAuxiliary); - if (supportsAppIcon && !hasNativeTitlebar(this.configurationService, this.titleBarStyle)) { + // App Icon (Windows, Linux) + if ((isWindows || isLinux) && !hasNativeTitlebar(this.configurationService, this.titleBarStyle)) { this.appIcon = prepend(this.leftContent, $('a.window-appicon')); - - // Web: home indicator - if (isWeb && homeIndicator) { - const icon: ThemeIcon = getIconRegistry().getIcon(homeIndicator.icon) ? { id: homeIndicator.icon } : Codicon.code; - this.appIcon.setAttribute('href', homeIndicator.href); - this.appIcon.classList.add(...ThemeIcon.asClassNameArray(icon)); - this.appIconBadge = document.createElement('div'); - this.appIconBadge.classList.add('home-bar-icon-badge'); - this.appIcon.appendChild(this.appIconBadge); - } } // Draggable region that we can manipulate for #52522 diff --git a/src/vs/workbench/browser/web.api.ts b/src/vs/workbench/browser/web.api.ts index c2668a8ca6a..9ae723f51fd 100644 --- a/src/vs/workbench/browser/web.api.ts +++ b/src/vs/workbench/browser/web.api.ts @@ -332,11 +332,6 @@ export interface IWorkbenchConstructionOptions { //#region Branding - /** - * Optional home indicator to appear above the hamburger menu in the activity bar. - */ - readonly homeIndicator?: IHomeIndicator; - /** * Optional welcome banner to appear above the workbench. Can be dismissed by the * user. @@ -576,25 +571,6 @@ export interface ICommand { handler: (...args: any[]) => unknown; } -export interface IHomeIndicator { - - /** - * The link to open when clicking the home indicator. - */ - href: string; - - /** - * The icon name for the home indicator. This needs to be one of the existing - * icons from our Codicon icon set. For example `code`. - */ - icon: string; - - /** - * A tooltip that will appear while hovering over the home indicator. - */ - title: string; -} - export interface IWelcomeBanner { /** From 737e2ed44a2136e4e7b153ad79ebbb9d8c0558bc Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 16 Dec 2024 10:18:00 +0100 Subject: [PATCH 04/20] Free SKU flow does not work with multiple accounts (fix microsoft/vscode-copilot#11323) (#236190) --- src/vs/workbench/contrib/chat/browser/chatSetup.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatSetup.ts b/src/vs/workbench/contrib/chat/browser/chatSetup.ts index 2245da971d3..e814b6acb21 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSetup.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSetup.ts @@ -42,7 +42,7 @@ import { IWorkspaceContextService } from '../../../../platform/workspace/common/ import { IWorkbenchContribution } from '../../../common/contributions.js'; import { IViewDescriptorService, ViewContainerLocation } from '../../../common/views.js'; import { IActivityService, ProgressBadge } from '../../../services/activity/common/activity.js'; -import { AuthenticationSession, IAuthenticationService } from '../../../services/authentication/common/authentication.js'; +import { AuthenticationSession, IAuthenticationExtensionsService, IAuthenticationService } from '../../../services/authentication/common/authentication.js'; import { IWorkbenchExtensionEnablementService } from '../../../services/extensionManagement/common/extensionManagement.js'; import { IExtensionService } from '../../../services/extensions/common/extensions.js'; import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; @@ -706,6 +706,7 @@ class ChatSetupController extends Disposable { private readonly requests: ChatSetupRequests, @ITelemetryService private readonly telemetryService: ITelemetryService, @IAuthenticationService private readonly authenticationService: IAuthenticationService, + @IAuthenticationExtensionsService private readonly authenticationExtensionsService: IAuthenticationExtensionsService, @IViewsService private readonly viewsService: IViewsService, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IProductService private readonly productService: IProductService, @@ -804,8 +805,11 @@ class ChatSetupController extends Disposable { session = await this.authenticationService.createSession(defaultChat.providerId, defaultChat.providerScopes[0]); entitlement = await this.requests.forceResolveEntitlement(session); + + this.authenticationExtensionsService.updateAccountPreference(defaultChat.extensionId, defaultChat.providerId, session.account); + this.authenticationExtensionsService.updateAccountPreference(defaultChat.chatExtensionId, defaultChat.providerId, session.account); } catch (error) { - // noop + this.logService.error(`[chat setup] signIn: error ${error}`); } if (!session) { From 85709a0cd67d7945213598e7f3d4d017c7fbbe32 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:28:00 +0100 Subject: [PATCH 05/20] SCM - only show visible quick diff providers in the quick diff widget (#236192) --- .../contrib/scm/browser/quickDiffWidget.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/scm/browser/quickDiffWidget.ts b/src/vs/workbench/contrib/scm/browser/quickDiffWidget.ts index 35771008fe6..8ac67f6cd53 100644 --- a/src/vs/workbench/contrib/scm/browser/quickDiffWidget.ts +++ b/src/vs/workbench/contrib/scm/browser/quickDiffWidget.ts @@ -305,7 +305,11 @@ class QuickDiffWidget extends PeekViewWidget { } private shouldUseDropdown(): boolean { - return this.model.getQuickDiffResults() + const visibleQuickDiffs = this.model.quickDiffs.filter(quickDiff => quickDiff.visible); + const visibleQuickDiffResults = this.model.getQuickDiffResults() + .filter(result => visibleQuickDiffs.some(quickDiff => quickDiff.label === result.label)); + + return visibleQuickDiffResults .filter(quickDiff => quickDiff.changes.length > 0).length > 1; } @@ -333,9 +337,12 @@ class QuickDiffWidget extends PeekViewWidget { protected override _fillHead(container: HTMLElement): void { super._fillHead(container, true); + const visibleQuickDiffs = this.model.quickDiffs.filter(quickDiff => quickDiff.visible); + this.dropdownContainer = dom.prepend(this._titleElement!, dom.$('.dropdown')); - this.dropdown = this.instantiationService.createInstance(QuickDiffPickerViewItem, new QuickDiffPickerBaseAction((event?: IQuickDiffSelectItem) => this.switchQuickDiff(event)), - this.model.quickDiffs.map(quickDiffer => quickDiffer.label), this.model.changes[this._index].label); + this.dropdown = this.instantiationService.createInstance(QuickDiffPickerViewItem, + new QuickDiffPickerBaseAction((event?: IQuickDiffSelectItem) => this.switchQuickDiff(event)), + visibleQuickDiffs.map(quickDiff => quickDiff.label), this.model.changes[this._index].label); this.dropdown.render(this.dropdownContainer); this.updateActions(); } From 276e24792198ecb7e83533d575568b66da722064 Mon Sep 17 00:00:00 2001 From: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:03:13 +0100 Subject: [PATCH 06/20] Align view and container actions (#236199) align view and container actions --- src/vs/workbench/browser/media/part.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/browser/media/part.css b/src/vs/workbench/browser/media/part.css index f17465a5e4a..0cbc7346b60 100644 --- a/src/vs/workbench/browser/media/part.css +++ b/src/vs/workbench/browser/media/part.css @@ -78,6 +78,7 @@ background-size: 16px; background-position: center center; background-repeat: no-repeat; + padding: 2px; /* Make sure view actions and container actions align */ } .monaco-workbench .part > .title > .title-actions .action-label .label { From 8db8225de61cc748e0ae79154ce26610a9b8ec80 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 16 Dec 2024 11:05:31 +0100 Subject: [PATCH 07/20] Allow file level comments to start collapsed (#236201) Fixes https://github.com/microsoft/vscode-pull-request-github/issues/6465 --- .../contrib/comments/browser/commentThreadZoneWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts index eb2a0396eee..87e7767a8bc 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts @@ -388,7 +388,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget this._disposables.add(this._commentThreadWidget.onDidResize(dimension => { this._refresh(dimension); })); - if ((this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) || (range === undefined)) { + if (this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) { this.show(this.arrowPosition(range), 2); } From 3a1e3f7f92057ecc563da275e58f18ad8fceb2ca Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 16 Dec 2024 11:16:31 +0100 Subject: [PATCH 08/20] Adds derived owners (#236204) --- .../browser/model/inlineCompletionsModel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts index 3f9e7c85161..65201933d14 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts @@ -419,7 +419,7 @@ export class InlineCompletionsModel extends Disposable { return 'noSuggestion'; }); - public readonly inlineCompletionState = derived(reader => { + public readonly inlineCompletionState = derived(this, reader => { const s = this.state.read(reader); if (!s || s.kind !== 'ghostText') { return undefined; @@ -430,7 +430,7 @@ export class InlineCompletionsModel extends Disposable { return s; }); - public readonly inlineEditState = derived(reader => { + public readonly inlineEditState = derived(this, reader => { const s = this.state.read(reader); if (!s || s.kind !== 'inlineEdit') { return undefined; @@ -438,7 +438,7 @@ export class InlineCompletionsModel extends Disposable { return s; }); - public readonly inlineEditAvailable = derived(reader => { + public readonly inlineEditAvailable = derived(this, reader => { const s = this.inlineEditState.read(reader); return !!s; }); From 92d2d5d984b89fd44f831c04612e89c8e59028e2 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 16 Dec 2024 11:20:39 +0100 Subject: [PATCH 09/20] Observables: Adds debug logging (#236205) --- .../base/common/observableInternal/logging.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/vs/base/common/observableInternal/logging.ts b/src/vs/base/common/observableInternal/logging.ts index 56f154e001e..0de37a858cb 100644 --- a/src/vs/base/common/observableInternal/logging.ts +++ b/src/vs/base/common/observableInternal/logging.ts @@ -105,6 +105,28 @@ export class ConsoleObservableLogger implements IObservableLogger { this.changedObservablesSets.get(derived)!.add(observable); return existingHandleChange.apply(derived, [observable, change]); }; + + const debugTrackUpdating = false; + if (debugTrackUpdating) { + const updating: IObservable[] = []; + (derived as any).__debugUpdating = updating; + + const existingBeginUpdate = derived.beginUpdate; + derived.beginUpdate = (obs) => { + updating.push(obs); + return existingBeginUpdate.apply(derived, [obs]); + }; + + const existingEndUpdate = derived.endUpdate; + derived.endUpdate = (obs) => { + const idx = updating.indexOf(obs); + if (idx === -1) { + console.error('endUpdate called without beginUpdate', derived.debugName, obs.debugName); + } + updating.splice(idx, 1); + return existingEndUpdate.apply(derived, [obs]); + }; + } } handleDerivedRecomputed(derived: Derived, info: IChangeInformation): void { From 864d5d8aff43a9ff242c25f1603888a5ef036f89 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:28:44 +0100 Subject: [PATCH 10/20] Revert "Git - ignore changes reported to the submodule folder (#205125) (#236098)" (#236206) This reverts commit 899afc031137585826b56aa200aca155a785a319. --- extensions/git/src/repository.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 2465bd80bc4..73a54cef4af 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -2385,16 +2385,7 @@ export class Repository implements Disposable { } switch (raw.y) { - case 'M': { - // https://git-scm.com/docs/git-status#_porcelain_format_version_1 - // When using `-z` with the porcelain v1 format any submodule changes - // are reported as modified M instead of m or single ?. Due to that we - // will ignore any changes reported for the submodule folder. - if (this.submodules.every(s => !pathEquals(s.path, raw.path))) { - workingTreeGroup.push(new Resource(this.resourceCommandResolver, ResourceGroupType.WorkingTree, uri, Status.MODIFIED, useIcons, renameUri)); - } - break; - } + case 'M': workingTreeGroup.push(new Resource(this.resourceCommandResolver, ResourceGroupType.WorkingTree, uri, Status.MODIFIED, useIcons, renameUri)); break; case 'D': workingTreeGroup.push(new Resource(this.resourceCommandResolver, ResourceGroupType.WorkingTree, uri, Status.DELETED, useIcons, renameUri)); break; case 'A': workingTreeGroup.push(new Resource(this.resourceCommandResolver, ResourceGroupType.WorkingTree, uri, Status.INTENT_TO_ADD, useIcons, renameUri)); break; case 'R': workingTreeGroup.push(new Resource(this.resourceCommandResolver, ResourceGroupType.WorkingTree, uri, Status.INTENT_TO_RENAME, useIcons, renameUri)); break; From 27a8a26b36230b7956c58b313c9e432e685d3cf9 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 16 Dec 2024 11:38:23 +0100 Subject: [PATCH 11/20] update area labels (#236207) --- .vscode/notebooks/my-work.github-issues | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/notebooks/my-work.github-issues b/.vscode/notebooks/my-work.github-issues index 7577d9626c8..b47a08b5a18 100644 --- a/.vscode/notebooks/my-work.github-issues +++ b/.vscode/notebooks/my-work.github-issues @@ -102,7 +102,7 @@ { "kind": 2, "language": "github-issues", - "value": "repo:microsoft/vscode assignee:@me is:open type:issue -label:\"info-needed\" -label:api -label:api-finalization -label:api-proposal -label:authentication -label:bisect-ext -label:bracket-pair-colorization -label:bracket-pair-guides -label:breadcrumbs -label:callhierarchy -label:chrome-devtools -label:code-lens -label:command-center -label:comments -label:config -label:context-keys -label:custom-editors -label:debug -label:debug-console -label:debug-disassembly -label:dialogs -label:diff-editor -label:dropdown -label:editor-api -label:editor-autoclosing -label:editor-autoindent -label:editor-bracket-matching -label:editor-clipboard -label:editor-code-actions -label:editor-color-picker -label:editor-columnselect -label:editor-commands -label:editor-comments -label:editor-contrib -label:editor-core -label:editor-drag-and-drop -label:editor-error-widget -label:editor-find -label:editor-folding -label:editor-highlight -label:editor-hover -label:editor-indent-detection -label:editor-indent-guides -label:editor-input -label:editor-input-IME -label:editor-insets -label:editor-minimap -label:editor-multicursor -label:editor-parameter-hints -label:editor-render-whitespace -label:editor-rendering -label:editor-RTL -label:editor-scrollbar -label:editor-sorting -label:editor-sticky-scroll -label:editor-sticky-scroll-decorations -label:editor-symbols -label:editor-synced-region -label:editor-textbuffer -label:editor-theming -label:editor-wordnav -label:editor-wrapping -label:emmet-parse -label:extension-activation -label:extension-host -label:extension-prerelease -label:extension-recommendations -label:extension-signature -label:extensions -label:extensions-development -label:file-decorations -label:file-encoding -label:file-explorer -label:file-glob -label:file-io -label:file-nesting -label:file-watcher -label:font-rendering -label:formatting -label:getting-started -label:ghost-text -label:git -label:github -label:github-repositories -label:gpu -label:grammar -label:grid-widget -label:icon-brand -label:icons-product -label:icons-widget -label:inlay-hints -label:inline-chat -label:inline-completions -label:install-update -label:intellisense-config -label:interactive-playground -label:interactive-window -label:javascript -label:json -label:json-sorting -label:keybindings -label:keybindings-editor -label:keyboard-layout -label:L10N -label:l10n-platform -label:label-provider -label:languages-basic -label:languages-diagnostics -label:languages-guessing -label:layout -label:lcd-text-rendering -label:list-widget -label:live-preview -label:log -label:markdown -label:marketplace -label:menus -label:merge-conflict -label:merge-editor -label:merge-editor-workbench -label:monaco-editor -label:multi-monitor -label:native-file-dialog -label:network -label:notebook -label:notebook-accessibility -label:notebook-api -label:notebook-builtin-renderers -label:notebook-cell-editor -label:notebook-celltoolbar -label:notebook-clipboard -label:notebook-code-actions -label:notebook-commands -label:notebook-commenting -label:notebook-debugging -label:notebook-diff -label:notebook-dnd -label:notebook-execution -label:notebook-find -label:notebook-folding -label:notebook-format -label:notebook-getting-started -label:notebook-globaltoolbar -label:notebook-ipynb -label:notebook-kernel -label:notebook-kernel-picker -label:notebook-language -label:notebook-layout -label:notebook-markdown -label:notebook-minimap -label:notebook-multiselect -label:notebook-output -label:notebook-perf -label:notebook-remote -label:notebook-rendering -label:notebook-serialization -label:notebook-statusbar -label:notebook-sticky-scroll -label:notebook-toc-outline -label:notebook-undo-redo -label:notebook-variables -label:notebook-workbench-integration -label:notebook-workflow -label:open-editors -label:opener -label:outline -label:output -label:packaging -label:panel-chat -label:perf -label:perf-bloat -label:perf-startup -label:php -label:portable-mode -label:proxy -label:quick-open -label:quick-pick -label:quickpick-chat -label:references-viewlet -label:release-notes -label:remote -label:remote-connection -label:remote-desktop -label:remote-explorer -label:remote-tunnel -label:rename -label:runCommands -label:sandbox -label:sash-widget -label:scm -label:screencast-mode -label:search -label:search-api -label:search-editor -label:search-replace -label:semantic-tokens -label:server -label:settings-editor -label:settings-search -label:settings-sync -label:settings-sync-server -label:shared-process -label:simple-file-dialog -label:smart-select -label:snap -label:snippets -label:splitview-widget -label:ssh -label:suggest -label:system-context-menu -label:table-widget -label:tasks -label:telemetry -label:terminal -label:terminal-accessibility -label:terminal-conpty -label:terminal-editors -label:terminal-external -label:terminal-find -label:terminal-input -label:terminal-layout -label:terminal-links -label:terminal-local-echo -label:terminal-persistence -label:terminal-process -label:terminal-profiles -label:terminal-quick-fix -label:terminal-rendering -label:terminal-shell-bash -label:terminal-shell-cmd -label:terminal-shell-fish -label:terminal-shell-git-bash -label:terminal-shell-integration -label:terminal-shell-pwsh -label:terminal-shell-zsh -label:terminal-tabs -label:testing -label:themes -label:timeline -label:timeline-git -label:timeline-local-history -label:titlebar -label:tokenization -label:touch/pointer -label:trackpad/scroll -label:tree-views -label:tree-widget -label:typescript -label:unc -label:undo-redo -label:unicode-highlight -label:uri -label:user-profiles -label:ux -label:variable-resolving -label:VIM -label:virtual-documents -label:virtual-workspaces -label:vscode-website -label:vscode.dev -label:web -label:webview -label:webview-views -label:workbench-actions -label:workbench-auxwindow -label:workbench-banner -label:workbench-cli -label:workbench-diagnostics -label:workbench-dnd -label:workbench-editor-grid -label:workbench-editor-groups -label:workbench-editor-resolver -label:workbench-editors -label:workbench-electron -label:workbench-fonts -label:workbench-history -label:workbench-hot-exit -label:workbench-hover -label:workbench-launch -label:workbench-link -label:workbench-multiroot -label:workbench-notifications -label:workbench-os-integration -label:workbench-rapid-render -label:workbench-run-as-admin -label:workbench-state -label:workbench-status -label:workbench-tabs -label:workbench-touchbar -label:workbench-untitled-editors -label:workbench-views -label:workbench-voice -label:workbench-welcome -label:workbench-window -label:workbench-workspace -label:workbench-zen -label:workspace-edit -label:workspace-symbols -label:workspace-trust -label:zoom -label:error-list -label:winget" + "value": "repo:microsoft/vscode assignee:@me is:open type:issue -label:\"info-needed\" -label:api -label:api-finalization -label:api-proposal -label:authentication -label:bisect-ext -label:bracket-pair-colorization -label:bracket-pair-guides -label:breadcrumbs -label:callhierarchy -label:chrome-devtools -label:code-lens -label:command-center -label:comments -label:config -label:context-keys -label:custom-editors -label:debug -label:debug-console -label:debug-disassembly -label:dialogs -label:diff-editor -label:dropdown -label:editor-api -label:editor-autoclosing -label:editor-autoindent -label:editor-bracket-matching -label:editor-clipboard -label:editor-code-actions -label:editor-color-picker -label:editor-columnselect -label:editor-commands -label:editor-comments -label:editor-contrib -label:editor-core -label:editor-drag-and-drop -label:editor-error-widget -label:editor-find -label:editor-folding -label:editor-highlight -label:editor-hover -label:editor-indent-detection -label:editor-indent-guides -label:editor-input -label:editor-input-IME -label:editor-insets -label:editor-minimap -label:editor-multicursor -label:editor-parameter-hints -label:editor-render-whitespace -label:editor-rendering -label:editor-RTL -label:editor-scrollbar -label:editor-sorting -label:editor-sticky-scroll -label:editor-sticky-scroll-decorations -label:editor-symbols -label:editor-synced-region -label:editor-textbuffer -label:editor-theming -label:editor-wordnav -label:editor-wrapping -label:emmet-parse -label:extension-activation -label:extension-host -label:extension-prerelease -label:extension-recommendations -label:extension-signature -label:extensions -label:extensions-development -label:file-decorations -label:file-encoding -label:file-explorer -label:file-glob -label:file-io -label:file-nesting -label:file-watcher -label:font-rendering -label:formatting -label:getting-started -label:ghost-text -label:git -label:github -label:github-repositories -label:gpu -label:grammar -label:grid-widget -label:icon-brand -label:icons-product -label:icons-widget -label:inlay-hints -label:inline-chat -label:inline-completions -label:install-update -label:intellisense-config -label:interactive-playground -label:interactive-window -label:javascript -label:json -label:json-sorting -label:keybindings -label:keybindings-editor -label:keyboard-layout -label:L10N -label:l10n-platform -label:label-provider -label:languages-basic -label:languages-diagnostics -label:languages-guessing -label:layout -label:lcd-text-rendering -label:list-widget -label:live-preview -label:log -label:markdown -label:marketplace -label:menus -label:merge-conflict -label:merge-editor -label:merge-editor-workbench -label:monaco-editor -label:multi-monitor -label:native-file-dialog -label:network -label:notebook -label:notebook-accessibility -label:notebook-api -label:notebook-cell-editor -label:notebook-celltoolbar -label:notebook-clipboard -label:notebook-code-actions -label:notebook-commands -label:notebook-debugging -label:notebook-diff -label:notebook-dnd -label:notebook-execution -label:notebook-find -label:notebook-folding -label:notebook-format -label:notebook-getting-started -label:notebook-globaltoolbar -label:notebook-ipynb -label:notebook-kernel -label:notebook-kernel-picker -label:notebook-language -label:notebook-layout -label:notebook-markdown -label:notebook-output -label:notebook-perf -label:notebook-remote -label:notebook-serialization -label:notebook-statusbar -label:notebook-sticky-scroll -label:notebook-toc-outline -label:notebook-undo-redo -label:notebook-variables -label:notebook-workbench-integration -label:notebook-workflow -label:open-editors -label:opener -label:outline -label:output -label:packaging -label:panel-chat -label:perf -label:perf-bloat -label:perf-startup -label:php -label:portable-mode -label:proxy -label:quick-open -label:quick-pick -label:quickpick-chat -label:references-viewlet -label:release-notes -label:remote -label:remote-connection -label:remote-desktop -label:remote-explorer -label:remote-tunnel -label:rename -label:runCommands -label:sandbox -label:sash-widget -label:scm -label:screencast-mode -label:search -label:search-api -label:search-editor -label:search-replace -label:semantic-tokens -label:server -label:settings-editor -label:settings-search -label:settings-sync -label:settings-sync-server -label:shared-process -label:simple-file-dialog -label:smart-select -label:snap -label:snippets -label:splitview-widget -label:ssh -label:suggest -label:system-context-menu -label:table-widget -label:tasks -label:telemetry -label:terminal -label:terminal-accessibility -label:terminal-conpty -label:terminal-editors -label:terminal-external -label:terminal-find -label:terminal-input -label:terminal-layout -label:terminal-links -label:terminal-local-echo -label:terminal-persistence -label:terminal-process -label:terminal-profiles -label:terminal-quick-fix -label:terminal-rendering -label:terminal-shell-bash -label:terminal-shell-cmd -label:terminal-shell-fish -label:terminal-shell-git-bash -label:terminal-shell-integration -label:terminal-shell-pwsh -label:terminal-shell-zsh -label:terminal-tabs -label:testing -label:themes -label:timeline -label:timeline-git -label:timeline-local-history -label:titlebar -label:tokenization -label:touch/pointer -label:trackpad/scroll -label:tree-views -label:tree-widget -label:typescript -label:unc -label:undo-redo -label:unicode-highlight -label:uri -label:user-profiles -label:ux -label:variable-resolving -label:VIM -label:virtual-documents -label:virtual-workspaces -label:vscode-website -label:vscode.dev -label:web -label:webview -label:webview-views -label:workbench-actions -label:workbench-auxwindow -label:workbench-banner -label:workbench-cli -label:workbench-diagnostics -label:workbench-dnd -label:workbench-editor-grid -label:workbench-editor-groups -label:workbench-editor-resolver -label:workbench-editors -label:workbench-electron -label:workbench-fonts -label:workbench-history -label:workbench-hot-exit -label:workbench-hover -label:workbench-launch -label:workbench-link -label:workbench-multiroot -label:workbench-notifications -label:workbench-os-integration -label:workbench-rapid-render -label:workbench-run-as-admin -label:workbench-state -label:workbench-status -label:workbench-tabs -label:workbench-touchbar -label:workbench-untitled-editors -label:workbench-views -label:workbench-voice -label:workbench-welcome -label:workbench-window -label:workbench-workspace -label:workbench-zen -label:workspace-edit -label:workspace-symbols -label:workspace-trust -label:zoom -label:error-list -label:winget -label:cross-file-editing -label:editor-refactor-preview" }, { "kind": 1, From 17320a061adef54978fa300f9395e809df9168e0 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 16 Dec 2024 11:40:19 +0100 Subject: [PATCH 12/20] Fixing escape does not hide hover (#236200) * fixing escape does not work * making same fix --- .../hover/browser/contentHoverController.ts | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHoverController.ts b/src/vs/editor/contrib/hover/browser/contentHoverController.ts index 26a7115f3ad..f7831694948 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverController.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverController.ts @@ -83,18 +83,17 @@ export class ContentHoverController extends Disposable implements IEditorContrib sticky: hoverOpts.sticky, hidingDelay: hoverOpts.hidingDelay }; - if (hoverOpts.enabled) { - this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e))); - this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); - this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); - this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); - this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); - this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())); - this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); - this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e))); - } else { + if (!hoverOpts.enabled) { this._cancelSchedulerAndHide(); } + this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e))); + this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); + this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); + this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); + this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())); + this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); + this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e))); } private _unhookListeners(): void { @@ -229,9 +228,11 @@ export class ContentHoverController extends Disposable implements IEditorContrib if (!mouseEvent) { return; } - const contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget(); - if (contentWidget.showsOrWillShow(mouseEvent)) { - return; + if (this._hoverSettings.enabled) { + const contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget(); + if (contentWidget.showsOrWillShow(mouseEvent)) { + return; + } } if (_sticky) { return; From dc3bf2d878a01e7ef6e0031f59d5be363f8c0ab7 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:45:03 +0100 Subject: [PATCH 13/20] Git - fix submodule decoration (#236208) --- extensions/git/src/decorationProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/src/decorationProvider.ts b/extensions/git/src/decorationProvider.ts index ddb3574890b..2e72a1e4114 100644 --- a/extensions/git/src/decorationProvider.ts +++ b/extensions/git/src/decorationProvider.ts @@ -118,11 +118,11 @@ class GitDecorationProvider implements FileDecorationProvider { private onDidRunGitStatus(): void { const newDecorations = new Map(); - this.collectSubmoduleDecorationData(newDecorations); this.collectDecorationData(this.repository.indexGroup, newDecorations); this.collectDecorationData(this.repository.untrackedGroup, newDecorations); this.collectDecorationData(this.repository.workingTreeGroup, newDecorations); this.collectDecorationData(this.repository.mergeGroup, newDecorations); + this.collectSubmoduleDecorationData(newDecorations); const uris = new Set([...this.decorations.keys()].concat([...newDecorations.keys()])); this.decorations = newDecorations; From 002eaa541a29bba3f6a5194ce49047992c9d6a63 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 16 Dec 2024 12:11:06 +0100 Subject: [PATCH 14/20] remove console.log fyi @connor4312 (#236209) --- src/vs/workbench/contrib/testing/common/testService.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/workbench/contrib/testing/common/testService.ts b/src/vs/workbench/contrib/testing/common/testService.ts index f75e3145ae8..4f9fbbd8e9a 100644 --- a/src/vs/workbench/contrib/testing/common/testService.ts +++ b/src/vs/workbench/contrib/testing/common/testService.ts @@ -210,7 +210,6 @@ export const testsInFile = async function* (testService: ITestService, ident: IU } } } - console.log('iterated', n, 'times'); }; /** From 1bbe4e9d96e0ee30a1fa5fdeb3aeddb947bae871 Mon Sep 17 00:00:00 2001 From: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:15:15 +0100 Subject: [PATCH 15/20] Focus panel if maximized otherwise editor (#236211) fix #205584 --- src/vs/workbench/browser/layout.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index ca6cb860397..b60d2864283 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -1249,7 +1249,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } focus(): void { - this.focusPart(Parts.EDITOR_PART, getWindow(this.activeContainer)); + if (this.isPanelMaximized() && this.mainContainer === this.activeContainer) { + this.focusPart(Parts.PANEL_PART); + } else { + this.focusPart(Parts.EDITOR_PART, getWindow(this.activeContainer)); + } } private focusPanelOrEditor(): void { From 188b1f1b31cfd10448c19421bde0a528f41e13d5 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 16 Dec 2024 03:15:28 -0800 Subject: [PATCH 16/20] Only add additional margin on hover children with bg Fixes #228136 --- src/vs/base/browser/ui/hover/hoverWidget.css | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/hover/hoverWidget.css b/src/vs/base/browser/ui/hover/hoverWidget.css index e6b088e3301..c8138b37c16 100644 --- a/src/vs/base/browser/ui/hover/hoverWidget.css +++ b/src/vs/base/browser/ui/hover/hoverWidget.css @@ -176,12 +176,23 @@ color: var(--vscode-textLink-activeForeground); } -/** Spans in markdown hovers need a margin-bottom to avoid looking cramped: https://github.com/microsoft/vscode/issues/101496 **/ -.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span { +/** + * Spans in markdown hovers need a margin-bottom to avoid looking cramped: + * https://github.com/microsoft/vscode/issues/101496 + + * This was later refined to only apply when the last child of a rendered markdown block (before the + * border or a `hr`) uses background color: + * https://github.com/microsoft/vscode/issues/228136 + */ +.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*="background-color"] { margin-bottom: 4px; display: inline-block; } +/** + * Add a slight margin to try vertically align codicons with any text + * https://github.com/microsoft/vscode/issues/221359 + */ .monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon { margin-bottom: 2px; } From 0c995148f461418349157adad18d38eb0987a5c8 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Mon, 16 Dec 2024 13:27:29 +0100 Subject: [PATCH 17/20] Do not inherit outer editor padding (#236219) --- .../inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts index cf7c1f94cf4..096070fb167 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts @@ -235,6 +235,7 @@ export class InlineEditsSideBySideDiff extends Disposable { bracketPairsHorizontal: false, highlightActiveIndentation: false, }, + padding: { top: 0, bottom: 0 }, folding: false, selectOnLineNumbers: false, selectionHighlight: false, From 7abd349c802187e8fe6231bfc6755c43f34c73ef Mon Sep 17 00:00:00 2001 From: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:10:34 +0100 Subject: [PATCH 18/20] Hide Panel (X) tooltip now includes key binding (#236062) * #209193 * fix glitching render --- .../parts/auxiliarybar/auxiliaryBarActions.ts | 13 +++- .../browser/parts/panel/panelActions.ts | 61 ++++--------------- 2 files changed, 21 insertions(+), 53 deletions(-) diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts index 575a3aefe8f..3bea858332e 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts @@ -11,12 +11,13 @@ import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js' import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; import { AuxiliaryBarVisibleContext } from '../../../common/contextkeys.js'; import { ViewContainerLocation, ViewContainerLocationToString } from '../../../common/views.js'; -import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { ActivityBarPosition, IWorkbenchLayoutService, LayoutSettings, Parts } from '../../../services/layout/browser/layoutService.js'; import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; import { SwitchCompositeViewAction } from '../compositeBarActions.js'; +import { closeIcon } from '../panel/panelActions.js'; const auxiliaryBarRightIcon = registerIcon('auxiliarybar-right-layout-icon', Codicon.layoutSidebarRight, localize('toggleAuxiliaryIconRight', 'Icon to toggle the auxiliary bar off in its right position.')); const auxiliaryBarRightOffIcon = registerIcon('auxiliarybar-right-off-layout-icon', Codicon.layoutSidebarRightOff, localize('toggleAuxiliaryIconRightOn', 'Icon to toggle the auxiliary bar on in its right position.')); @@ -34,10 +35,11 @@ export class ToggleAuxiliaryBarAction extends Action2 { title: ToggleAuxiliaryBarAction.LABEL, toggled: { condition: AuxiliaryBarVisibleContext, - title: localize('secondary sidebar', "Secondary Side Bar"), + title: localize('closeSecondarySideBar', 'Hide Secondary Side Bar'), + icon: closeIcon, mnemonicTitle: localize({ key: 'secondary sidebar mnemonic', comment: ['&& denotes a mnemonic'] }, "Secondary Si&&de Bar"), }, - + icon: closeIcon, // Ensures no flickering when using toggled.icon category: Categories.View, f1: true, keybinding: { @@ -54,6 +56,11 @@ export class ToggleAuxiliaryBarAction extends Action2 { id: MenuId.MenubarAppearanceMenu, group: '2_workbench_layout', order: 2 + }, { + id: MenuId.AuxiliaryBarTitle, + group: 'navigation', + order: 2, + when: ContextKeyExpr.equals(`config.${LayoutSettings.ACTIVITY_BAR_LOCATION}`, ActivityBarPosition.DEFAULT) } ] }); diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index c9250e36e84..e8fbbacb68a 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -8,8 +8,8 @@ import { localize, localize2 } from '../../../../nls.js'; import { KeyMod, KeyCode } from '../../../../base/common/keyCodes.js'; import { MenuId, MenuRegistry, registerAction2, Action2, IAction2Options } from '../../../../platform/actions/common/actions.js'; import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; -import { ActivityBarPosition, isHorizontal, IWorkbenchLayoutService, LayoutSettings, PanelAlignment, Parts, Position, positionToString } from '../../../services/layout/browser/layoutService.js'; -import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelPositionContext, PanelVisibleContext } from '../../../common/contextkeys.js'; +import { isHorizontal, IWorkbenchLayoutService, PanelAlignment, Parts, Position, positionToString } from '../../../services/layout/browser/layoutService.js'; +import { PanelAlignmentContext, PanelMaximizedContext, PanelPositionContext, PanelVisibleContext } from '../../../common/contextkeys.js'; import { ContextKeyExpr, ContextKeyExpression } from '../../../../platform/contextkey/common/contextkey.js'; import { Codicon } from '../../../../base/common/codicons.js'; import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; @@ -24,7 +24,7 @@ import { SwitchCompositeViewAction } from '../compositeBarActions.js'; const maximizeIcon = registerIcon('panel-maximize', Codicon.chevronUp, localize('maximizeIcon', 'Icon to maximize a panel.')); const restoreIcon = registerIcon('panel-restore', Codicon.chevronDown, localize('restoreIcon', 'Icon to restore a panel.')); -const closeIcon = registerIcon('panel-close', Codicon.close, localize('closeIcon', 'Icon to close a panel.')); +export const closeIcon = registerIcon('panel-close', Codicon.close, localize('closeIcon', 'Icon to close a panel.')); const panelIcon = registerIcon('panel-layout-icon', Codicon.layoutPanel, localize('togglePanelOffIcon', 'Icon to toggle the panel off when it is on.')); const panelOffIcon = registerIcon('panel-layout-icon-off', Codicon.layoutPanelOff, localize('togglePanelOnIcon', 'Icon to toggle the panel on when it is off.')); @@ -39,9 +39,11 @@ export class TogglePanelAction extends Action2 { title: TogglePanelAction.LABEL, toggled: { condition: PanelVisibleContext, - title: localize('toggle panel', "Panel"), + title: localize('closePanel', 'Hide Panel'), + icon: closeIcon, mnemonicTitle: localize({ key: 'toggle panel mnemonic', comment: ['&& denotes a mnemonic'] }, "&&Panel"), }, + icon: closeIcon, // Ensures no flickering when using toggled.icon f1: true, category: Categories.View, keybinding: { primary: KeyMod.CtrlCmd | KeyCode.KeyJ, weight: KeybindingWeight.WorkbenchContrib }, @@ -54,7 +56,11 @@ export class TogglePanelAction extends Action2 { id: MenuId.LayoutControlMenuSubmenu, group: '0_workbench_layout', order: 4 - }, + }, { + id: MenuId.PanelTitle, + group: 'navigation', + order: 2 + } ] }); } @@ -288,51 +294,6 @@ registerAction2(class extends Action2 { } }); -registerAction2(class extends Action2 { - constructor() { - super({ - id: 'workbench.action.closePanel', - title: localize2('closePanel', 'Hide Panel'), - category: Categories.View, - icon: closeIcon, - menu: [{ - id: MenuId.CommandPalette, - when: PanelVisibleContext, - }, { - id: MenuId.PanelTitle, - group: 'navigation', - order: 2 - }] - }); - } - run(accessor: ServicesAccessor) { - accessor.get(IWorkbenchLayoutService).setPartHidden(true, Parts.PANEL_PART); - } -}); - -registerAction2(class extends Action2 { - constructor() { - super({ - id: 'workbench.action.closeAuxiliaryBar', - title: localize2('closeSecondarySideBar', 'Hide Secondary Side Bar'), - category: Categories.View, - icon: closeIcon, - menu: [{ - id: MenuId.CommandPalette, - when: AuxiliaryBarVisibleContext, - }, { - id: MenuId.AuxiliaryBarTitle, - group: 'navigation', - order: 2, - when: ContextKeyExpr.equals(`config.${LayoutSettings.ACTIVITY_BAR_LOCATION}`, ActivityBarPosition.DEFAULT) - }] - }); - } - run(accessor: ServicesAccessor) { - accessor.get(IWorkbenchLayoutService).setPartHidden(true, Parts.AUXILIARYBAR_PART); - } -}); - MenuRegistry.appendMenuItems([ { id: MenuId.LayoutControlMenu, From 9b05bdafb3d816d25a23b392fbcf24b6a7285087 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 16 Dec 2024 15:11:31 +0100 Subject: [PATCH 19/20] * make sure to cancel request when disposing session (#236225) * make sure to stop editing when request is cancalled fixes https://github.com/microsoft/vscode-copilot/issues/11349 fixes https://github.com/microsoft/vscode-copilot-release/issues/2684 --- .../contrib/chat/browser/actions/chatClearActions.ts | 4 ++-- .../contrib/chat/browser/chatEditing/chatEditingService.ts | 2 -- .../contrib/chat/browser/chatEditing/chatEditingSession.ts | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.ts index cbb333f9656..07f9ce1cc93 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.ts @@ -188,7 +188,7 @@ export function registerNewChatActions() { announceChatCleared(accessibilitySignalService); const widget = widgetService.getWidgetBySessionId(context.sessionId); if (widget) { - chatEditingService.currentEditingSessionObs.get()?.stop(true); + await chatEditingService.currentEditingSessionObs.get()?.stop(true); widget.clear(); widget.attachmentModel.clear(); widget.focusInput(); @@ -199,7 +199,7 @@ export function registerNewChatActions() { const widget = chatView.widget; announceChatCleared(accessibilitySignalService); - chatEditingService.currentEditingSessionObs.get()?.stop(true); + await chatEditingService.currentEditingSessionObs.get()?.stop(true); widget.clear(); widget.attachmentModel.clear(); widget.focusInput(); diff --git a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.ts b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.ts index af6ffc0640e..4d064636e7a 100644 --- a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.ts +++ b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.ts @@ -328,8 +328,6 @@ export class ChatEditingService extends Disposable implements IChatEditingServic if (responseModel.isComplete) { onResponseComplete(responseModel); disposable.dispose(); - } else if (responseModel.isCanceled || responseModel.isStale) { - disposable.dispose(); } }); } diff --git a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts index 6f24595cbad..31e9a672a13 100644 --- a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts +++ b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts @@ -6,7 +6,7 @@ import { ITask, Sequencer, timeout } from '../../../../../base/common/async.js'; import { BugIndicatingError } from '../../../../../base/common/errors.js'; import { Emitter } from '../../../../../base/common/event.js'; -import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { Disposable, dispose } from '../../../../../base/common/lifecycle.js'; import { ResourceMap, ResourceSet } from '../../../../../base/common/map.js'; import { autorun, derived, IObservable, IReader, ITransaction, observableValue, transaction } from '../../../../../base/common/observable.js'; import { URI } from '../../../../../base/common/uri.js'; @@ -523,10 +523,9 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio override dispose() { this._assertNotDisposed(); - for (const entry of this._entriesObs.get()) { - entry.dispose(); - } + this._chatService.cancelCurrentRequestForSession(this.chatSessionId); + dispose(this._entriesObs.get()); super.dispose(); this._state.set(ChatEditingSessionState.Disposed, undefined); this._onDidDispose.fire(); From 845f0ac17b88e75ed4ff2afd6a9975f36b1d7cb5 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 16 Dec 2024 15:48:58 +0100 Subject: [PATCH 20/20] Refactoring hover controller (#236228) refactoring hover computation --- .../hover/browser/contentHoverController.ts | 75 +++++++++---------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/src/vs/editor/contrib/hover/browser/contentHoverController.ts b/src/vs/editor/contrib/hover/browser/contentHoverController.ts index f7831694948..e44c40a947d 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverController.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverController.ts @@ -61,7 +61,11 @@ export class ContentHoverController extends Disposable implements IEditorContrib ) { super(); this._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler( - () => this._reactToEditorMouseMove(this._mouseMoveEvent), 0 + () => { + if (this._mouseMoveEvent) { + this._reactToEditorMouseMove(this._mouseMoveEvent); + } + }, 0 )); this._hookListeners(); this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { @@ -155,33 +159,49 @@ export class ContentHoverController extends Disposable implements IEditorContrib this.hideContentHover(); } - private _shouldNotRecomputeCurrentHoverWidget(mouseEvent: IEditorMouseEvent): boolean { - + private _shouldKeepCurrentHover(mouseEvent: IEditorMouseEvent): boolean { + const contentWidget = this._contentWidget; + if (!contentWidget) { + return false; + } const isHoverSticky = this._hoverSettings.sticky; - const isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => { const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); return isHoverSticky && isMouseOnContentHoverWidget; }; - const isMouseOnColorPicker = (mouseEvent: IEditorMouseEvent): boolean => { + const isMouseOnColorPickerOrChoosingColor = (mouseEvent: IEditorMouseEvent): boolean => { + const isColorPickerVisible = contentWidget.isColorPickerVisible; const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); - const isColorPickerVisible = this._contentWidget?.isColorPickerVisible ?? false; - return isMouseOnContentHoverWidget && isColorPickerVisible; + const isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget; + const isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown; + return isMouseOnHoverWithColorPicker || isMaybeChoosingColor; }; // TODO@aiday-mar verify if the following is necessary code const isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => { - return (sticky - && this._contentWidget?.containsNode(mouseEvent.event.browserEvent.view?.document.activeElement) - && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed) ?? false; + const view = mouseEvent.event.browserEvent.view; + if (!view) { + return false; + } + return sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed; }; - return isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky) - || isMouseOnColorPicker(mouseEvent) + const isFocused = contentWidget.isFocused; + const isResizing = contentWidget.isResizing; + const isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard; + + return this.shouldKeepOpenOnEditorMouseMoveOrLeave + || isFocused + || isResizing + || isStickyAndVisibleFromKeyboard + || isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky) + || isMouseOnColorPickerOrChoosingColor(mouseEvent) || isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky); } private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { - const shouldReactToEditorMouseMove = this._shouldReactToEditorMouseMove(mouseEvent); - if (!shouldReactToEditorMouseMove) { + this._mouseMoveEvent = mouseEvent; + const shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent); + if (shouldKeepCurrentHover) { + this._reactToEditorMouseMoveRunner.cancel(); return; } const shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation(); @@ -194,28 +214,6 @@ export class ContentHoverController extends Disposable implements IEditorContrib this._reactToEditorMouseMove(mouseEvent); } - private _shouldReactToEditorMouseMove(mouseEvent: IEditorMouseEvent): boolean { - if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { - return false; - } - this._mouseMoveEvent = mouseEvent; - if (this._contentWidget && (this._contentWidget.isFocused || this._contentWidget.isResizing || this._isMouseDown && this._contentWidget.isColorPickerVisible)) { - return false; - } - const sticky = this._hoverSettings.sticky; - if (sticky && this._contentWidget?.isVisibleFromKeyboard) { - // Sticky mode is on and the hover has been shown via keyboard - // so moving the mouse has no effect - return false; - } - const shouldNotRecomputeCurrentHoverWidget = this._shouldNotRecomputeCurrentHoverWidget(mouseEvent); - if (shouldNotRecomputeCurrentHoverWidget) { - this._reactToEditorMouseMoveRunner.cancel(); - return false; - } - return true; - } - private _shouldRescheduleHoverComputation(): boolean { const hidingDelay = this._hoverSettings.hidingDelay; const isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false; @@ -224,10 +222,7 @@ export class ContentHoverController extends Disposable implements IEditorContrib return isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0; } - private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent | undefined): void { - if (!mouseEvent) { - return; - } + private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent): void { if (this._hoverSettings.enabled) { const contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget(); if (contentWidget.showsOrWillShow(mouseEvent)) {