diff options
author | Henning Dieterichs <notify.henning.dieterichs@live.de> | 2022-07-27 15:18:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 15:18:30 +0300 |
commit | dd807977b119e930caef3526031e9a2fdaaac4e5 (patch) | |
tree | 8e96e132560e4215dcd7fd272b3ed109ff1614a3 /src/vs | |
parent | a4b7d52ba133ad5fff17dc77602d540151a75a78 (diff) | |
parent | cb48abb0c0470c6060ba34586aeb7053f9684ee8 (diff) |
Merge branch 'main' into modifying-bracket-completion-range
Diffstat (limited to 'src/vs')
27 files changed, 111 insertions, 67 deletions
diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 0cc2cfa02af..bed9912d2d3 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -371,7 +371,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE this._register(new dom.DragAndDropObserver(this._domElement, { onDragEnter: () => undefined, onDragOver: e => { - if (!this._configuration.options.get(EditorOption.enableDropIntoEditor)) { + if (!this._configuration.options.get(EditorOption.dropIntoEditor).enabled) { return; } @@ -381,7 +381,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE } }, onDrop: async e => { - if (!this._configuration.options.get(EditorOption.enableDropIntoEditor)) { + if (!this._configuration.options.get(EditorOption.dropIntoEditor).enabled) { return; } diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index ee1a5a107b9..ef1aa278e53 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -1189,7 +1189,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE result.ariaLabel = options.originalAriaLabel; } result.readOnly = !this._options.originalEditable; - result.enableDropIntoEditor = !result.readOnly; + result.dropIntoEditor = { enabled: !result.readOnly }; result.extraEditorClassName = 'original-in-monaco-diff-editor'; return { ...result, diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 826aa1a6a72..066080e9ae3 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -665,11 +665,11 @@ export interface IEditorOptions { bracketPairColorization?: IBracketPairColorizationOptions; /** - * Enables dropping into the editor from an external source. + * Controls dropping into the editor from an external source. * - * This shows a preview of the drop location and triggers an `onDropIntoEditor` event. + * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event. */ - enableDropIntoEditor?: boolean; + dropIntoEditor?: IDropIntoEditorOptions; } /** @@ -4439,6 +4439,53 @@ class EditorWrappingInfoComputer extends ComputedEditorOption<EditorOption.wrapp //#endregion +//#region dropIntoEditor + +/** + * Configuration options for editor drop into behavior + */ +export interface IDropIntoEditorOptions { + /** + * Enable the dropping into editor. + * Defaults to true. + */ + enabled?: boolean; +} + +/** + * @internal + */ +export type EditorDropIntoEditorOptions = Readonly<Required<IDropIntoEditorOptions>>; + +class EditorDropIntoEditor extends BaseEditorOption<EditorOption.dropIntoEditor, IDropIntoEditorOptions, EditorDropIntoEditorOptions> { + + constructor() { + const defaults: EditorDropIntoEditorOptions = { enabled: true }; + super( + EditorOption.dropIntoEditor, 'dropIntoEditor', defaults, + { + 'editor.dropIntoEditor.enabled': { + type: 'boolean', + default: defaults.enabled, + markdownDescription: nls.localize('dropIntoEditor.enabled', "Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor)."), + }, + } + ); + } + + public validate(_input: any): EditorDropIntoEditorOptions { + if (!_input || typeof _input !== 'object') { + return this.defaultValue; + } + const input = _input as IDropIntoEditorOptions; + return { + enabled: boolean(input.enabled, this.defaultValue.enabled) + }; + } +} + +//#endregion + const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace'; const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace'; const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'monospace\', monospace'; @@ -4501,7 +4548,7 @@ export const enum EditorOption { disableMonospaceOptimizations, domReadOnly, dragAndDrop, - enableDropIntoEditor, + dropIntoEditor, emptySelectionClipboard, extraEditorClassName, fastScrollSensitivity, @@ -4811,9 +4858,7 @@ export const EditorOptions = { { description: nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.") } )), emptySelectionClipboard: register(new EditorEmptySelectionClipboard()), - enableDropIntoEditor: register(new EditorBooleanOption( - EditorOption.enableDropIntoEditor, 'enableDropIntoEditor', true - )), + dropIntoEditor: register(new EditorDropIntoEditor()), extraEditorClassName: register(new EditorStringOption( EditorOption.extraEditorClassName, 'extraEditorClassName', '', )), diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 6e9446f55db..c62e7fc404f 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -204,7 +204,7 @@ export enum EditorOption { disableMonospaceOptimizations = 29, domReadOnly = 30, dragAndDrop = 31, - enableDropIntoEditor = 32, + dropIntoEditor = 32, emptySelectionClipboard = 33, extraEditorClassName = 34, fastScrollSensitivity = 35, diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index 0cd4c1e73b0..650488e797f 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -311,7 +311,7 @@ export class ContextMenuController implements IEditorContribution { const actions: IAction[] = []; actions.push(createAction({ - label: nls.localize('context.minimap.showMinimap', "Show Minimap"), + label: nls.localize('context.minimap.minimap', "Minimap"), checked: minimapOptions.enabled, run: () => { this._configurationService.updateValue(`editor.minimap.enabled`, !minimapOptions.enabled); diff --git a/src/vs/editor/contrib/dropIntoEditor/browser/dropIntoEditorContribution.ts b/src/vs/editor/contrib/dropIntoEditor/browser/dropIntoEditorContribution.ts index 10ed525fc05..83f8ad1e314 100644 --- a/src/vs/editor/contrib/dropIntoEditor/browser/dropIntoEditorContribution.ts +++ b/src/vs/editor/contrib/dropIntoEditor/browser/dropIntoEditorContribution.ts @@ -25,7 +25,6 @@ import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/edit import { performSnippetEdit } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -37,7 +36,6 @@ export class DropIntoEditorController extends Disposable implements IEditorContr constructor( editor: ICodeEditor, @IBulkEditService private readonly _bulkEditService: IBulkEditService, - @IConfigurationService private readonly _configurationService: IConfigurationService, @ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService, @IProgressService private readonly _progressService: IProgressService, @IWorkspaceContextService workspaceContextService: IWorkspaceContextService, @@ -46,22 +44,7 @@ export class DropIntoEditorController extends Disposable implements IEditorContr this._register(editor.onDropIntoEditor(e => this.onDropIntoEditor(editor, e.position, e.event))); - this._languageFeaturesService.documentOnDropEditProvider.register('*', new DefaultOnDropProvider(workspaceContextService)); - - this._register(this._configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration('workbench.editor.dropIntoEditor.enabled')) { - this.updateEditorOptions(editor); - } - })); - - this.updateEditorOptions(editor); - } - - private updateEditorOptions(editor: ICodeEditor) { - editor.updateOptions({ - enableDropIntoEditor: this._configurationService.getValue('workbench.editor.dropIntoEditor.enabled') - }); } private async onDropIntoEditor(editor: ICodeEditor, position: IPosition, dragEvent: DragEvent) { diff --git a/src/vs/editor/contrib/folding/browser/foldingModel.ts b/src/vs/editor/contrib/folding/browser/foldingModel.ts index f5b7a59f173..f3bc09b1ce3 100644 --- a/src/vs/editor/contrib/folding/browser/foldingModel.ts +++ b/src/vs/editor/contrib/folding/browser/foldingModel.ts @@ -94,9 +94,9 @@ export class FoldingModel { public removeManualRanges(ranges: ILineRange[]) { const newFoldingRanges: FoldRange[] = new Array(); - const containedBy = (foldRange: FoldRange) => { + const intersects = (foldRange: FoldRange) => { for (const range of ranges) { - if (range.startLineNumber <= foldRange.startLineNumber && range.endLineNumber >= foldRange.endLineNumber) { + if (!(range.startLineNumber > foldRange.endLineNumber || foldRange.startLineNumber > range.endLineNumber)) { return true; } } @@ -104,7 +104,7 @@ export class FoldingModel { }; for (let i = 0; i < this._regions.length; i++) { const foldRange = this._regions.toFoldRange(i); - if (!foldRange.isUserDefined && !foldRange.isRecovered || !containedBy(foldRange)) { + if (!foldRange.isUserDefined && !foldRange.isRecovered || !intersects(foldRange)) { newFoldingRanges.push(foldRange); } } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ac468aa007f..db39c17f9c6 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3439,11 +3439,11 @@ declare namespace monaco.editor { */ bracketPairColorization?: IBracketPairColorizationOptions; /** - * Enables dropping into the editor from an external source. + * Controls dropping into the editor from an external source. * - * This shows a preview of the drop location and triggers an `onDropIntoEditor` event. + * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event. */ - enableDropIntoEditor?: boolean; + dropIntoEditor?: IDropIntoEditorOptions; } export interface IDiffEditorBaseOptions { @@ -4330,6 +4330,17 @@ declare namespace monaco.editor { readonly wrappingColumn: number; } + /** + * Configuration options for editor drop into behavior + */ + export interface IDropIntoEditorOptions { + /** + * Enable the dropping into editor. + * Defaults to true. + */ + enabled?: boolean; + } + export enum EditorOption { acceptSuggestionOnCommitCharacter = 0, acceptSuggestionOnEnter = 1, @@ -4363,7 +4374,7 @@ declare namespace monaco.editor { disableMonospaceOptimizations = 29, domReadOnly = 30, dragAndDrop = 31, - enableDropIntoEditor = 32, + dropIntoEditor = 32, emptySelectionClipboard = 33, extraEditorClassName = 34, fastScrollSensitivity = 35, @@ -4503,7 +4514,7 @@ declare namespace monaco.editor { domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>; dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>; emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>; - enableDropIntoEditor: IEditorOption<EditorOption.enableDropIntoEditor, boolean>; + dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>; extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>; fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>; find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>; diff --git a/src/vs/platform/userDataProfile/common/userDataProfile.ts b/src/vs/platform/userDataProfile/common/userDataProfile.ts index 3d0c1ba1b4c..1d7ad908f95 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfile.ts @@ -155,7 +155,7 @@ export class UserDataProfilesService extends Disposable implements IUserDataProf readonly _serviceBrand: undefined; - private enabled: boolean = false; + protected enabled: boolean = false; protected readonly defaultProfileShouldIncludeExtensionsResourceAlways: boolean = false; readonly profilesHome: URI; diff --git a/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts b/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts index 0ac191f058a..db97f74bd82 100644 --- a/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts @@ -17,6 +17,7 @@ import { IStringDictionary } from 'vs/base/common/collections'; export const IUserDataProfilesMainService = refineServiceDecorator<IUserDataProfilesService, IUserDataProfilesMainService>(IUserDataProfilesService); export interface IUserDataProfilesMainService extends IUserDataProfilesService { + isEnabled(): boolean; unsetWorkspace(workspaceIdentifier: WorkspaceIdentifier): Promise<void>; readonly onWillCreateProfile: Event<WillCreateProfileEvent>; readonly onWillRemoveProfile: Event<WillRemoveProfileEvent>; @@ -34,6 +35,10 @@ export class UserDataProfilesMainService extends UserDataProfilesService impleme super(stateMainService, uriIdentityService, environmentService, fileService, logService); } + isEnabled(): boolean { + return this.enabled; + } + protected override saveStoredProfiles(storedProfiles: StoredUserDataProfile[]): void { this.stateMainService.setItem(UserDataProfilesMainService.PROFILES_KEY, storedProfiles); } diff --git a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts index 2ee6816721e..8e5d39ff29e 100644 --- a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts +++ b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts @@ -205,8 +205,10 @@ export class WorkspacesManagementMainService extends Disposable implements IWork // Delete from disk this.doDeleteUntitledWorkspaceSync(workspace); - // unset workspace from profiles - this.userDataProfilesMainService.unsetWorkspace(workspace); + if (this.userDataProfilesMainService.isEnabled()) { + // unset workspace from profiles + this.userDataProfilesMainService.unsetWorkspace(workspace); + } // Event this._onDidDeleteUntitledWorkspace.fire(workspace); diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 150c192a1b8..519e716b8c7 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -81,7 +81,7 @@ export class ToggleActivityBarVisibilityAction extends Action2 { id: ToggleActivityBarVisibilityAction.ID, title: { value: localize('toggleActivityBar', "Toggle Activity Bar Visibility"), - mnemonicTitle: localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"), + mnemonicTitle: localize({ key: 'miActivityBar', comment: ['&& denotes a mnemonic'] }, "&&Activity Bar"), original: 'Toggle Activity Bar Visibility' }, category: CATEGORIES.View, @@ -406,7 +406,7 @@ MenuRegistry.appendMenuItems([ group: '2_workbench_layout', command: { id: ToggleSidebarVisibilityAction.ID, - title: localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Primary Side Bar"), + title: localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "&&Primary Side Bar"), toggled: SideBarVisibleContext }, order: 1 @@ -417,7 +417,7 @@ MenuRegistry.appendMenuItems([ group: '0_workbench_layout', command: { id: ToggleSidebarVisibilityAction.ID, - title: localize('miShowSidebarNoMnnemonic', "Show Primary Side Bar"), + title: localize('miSidebarNoMnnemonic', "Primary Side Bar"), toggled: SideBarVisibleContext }, order: 0 @@ -464,7 +464,7 @@ export class ToggleStatusbarVisibilityAction extends Action2 { id: ToggleStatusbarVisibilityAction.ID, title: { value: localize('toggleStatusbar', "Toggle Status Bar Visibility"), - mnemonicTitle: localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "Show S&&tatus Bar"), + mnemonicTitle: localize({ key: 'miStatusbar', comment: ['&& denotes a mnemonic'] }, "S&&tatus Bar"), original: 'Toggle Status Bar Visibility' }, category: CATEGORIES.View, @@ -573,7 +573,7 @@ if (isWindows || isLinux || isWeb) { id: 'workbench.action.toggleMenuBar', title: { value: localize('toggleMenuBar', "Toggle Menu Bar"), - mnemonicTitle: localize({ key: 'miShowMenuBar', comment: ['&& denotes a mnemonic'] }, "Show Menu &&Bar"), + mnemonicTitle: localize({ key: 'miMenuBar', comment: ['&& denotes a mnemonic'] }, "Menu &&Bar"), original: 'Toggle Menu Bar' }, category: CATEGORIES.View, @@ -596,7 +596,7 @@ if (isWindows || isLinux || isWeb) { MenuRegistry.appendMenuItem(MenuId.TitleBarContext, { command: { id: 'workbench.action.toggleMenuBar', - title: localize('miShowMenuBarNoMnemonic', "Show Menu Bar"), + title: localize('miMenuBarNoMnemonic', "Menu Bar"), toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact')) }, order: 0 diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts index 2b0b723d0e3..cf521c32e16 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts @@ -76,7 +76,7 @@ MenuRegistry.appendMenuItems([ group: '0_workbench_layout', command: { id: ToggleAuxiliaryBarAction.ID, - title: localize('miShowAuxiliaryBarNoMnemonic', "Show Secondary Side Bar"), + title: localize('miAuxiliaryBarNoMnemonic', "Secondary Side Bar"), toggled: AuxiliaryBarVisibleContext }, order: 2 @@ -116,7 +116,7 @@ MenuRegistry.appendMenuItems([ group: '2_workbench_layout', command: { id: ToggleAuxiliaryBarAction.ID, - title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Secondary Si&&de Bar"), + title: localize({ key: 'miAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Secondary Si&&de Bar"), toggled: AuxiliaryBarVisibleContext }, order: 2 diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts index 51879dbf0ba..0ef796ae3fa 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts @@ -504,7 +504,7 @@ registerAction2(class ToggleBreadcrumb extends Action2 { id: 'breadcrumbs.toggle', title: { value: localize('cmd.toggle', "Toggle Breadcrumbs"), - mnemonicTitle: localize('miShowBreadcrumbs', "Show &&Breadcrumbs"), + mnemonicTitle: localize('miBreadcrumbs', "&&Breadcrumbs"), original: 'Toggle Breadcrumbs', }, category: CATEGORIES.View, diff --git a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts index e9686439360..947f4475f3b 100644 --- a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts +++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts @@ -32,7 +32,7 @@ interface IDropOperation { } function isDropIntoEditorEnabledGlobally(configurationService: IConfigurationService) { - return configurationService.getValue<boolean>('workbench.editor.dropIntoEditor.enabled'); + return configurationService.getValue<boolean>('editor.dropIntoEditor.enabled'); } function isDragIntoEditorEvent(e: DragEvent): boolean { diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 2aa1285f9a1..2dcf135be7c 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -240,7 +240,7 @@ export class TextDiffEditor extends AbstractTextEditor<IDiffEditorViewState> imp return { ...super.getConfigurationOverrides(), readOnly, - enableDropIntoEditor: !readOnly, + dropIntoEditor: { enabled: !readOnly }, originalEditable: this.input instanceof DiffEditorInput && !this.input.original.hasCapability(EditorInputCapabilities.Readonly), lineDecorationsWidth: '2ch' }; @@ -251,7 +251,7 @@ export class TextDiffEditor extends AbstractTextEditor<IDiffEditorViewState> imp this.diffEditorControl?.updateOptions({ readOnly: input.hasCapability(EditorInputCapabilities.Readonly), originalEditable: !input.original.hasCapability(EditorInputCapabilities.Readonly), - enableDropIntoEditor: !input.hasCapability(EditorInputCapabilities.Readonly) + dropIntoEditor: { enabled: !input.hasCapability(EditorInputCapabilities.Readonly) } }); } else { super.updateReadonly(input); diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index c803409ef74..b43dd3baa8d 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -138,7 +138,7 @@ export abstract class AbstractTextEditor<T extends IEditorViewState> extends Abs this.updateEditorControlOptions({ readOnly, - enableDropIntoEditor: !readOnly + dropIntoEditor: { enabled: !readOnly }, }); } @@ -150,7 +150,7 @@ export abstract class AbstractTextEditor<T extends IEditorViewState> extends Abs lineNumbersMinChars: 3, fixedOverflowWidgets: true, readOnly, - enableDropIntoEditor: !readOnly, + dropIntoEditor: { enabled: !readOnly }, renderValidationDecorations: 'on' // render problems even in readonly editors (https://github.com/microsoft/vscode/issues/89057) }; } diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index e64439239c5..b23e8bd6fa3 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -422,7 +422,7 @@ MenuRegistry.appendMenuItems([ group: '2_workbench_layout', command: { id: TogglePanelAction.ID, - title: localize({ key: 'miShowPanel', comment: ['&& denotes a mnemonic'] }, "Show &&Panel"), + title: localize({ key: 'miPanel', comment: ['&& denotes a mnemonic'] }, "&&Panel"), toggled: PanelVisibleContext }, order: 5 @@ -433,7 +433,7 @@ MenuRegistry.appendMenuItems([ group: '0_workbench_layout', command: { id: TogglePanelAction.ID, - title: localize('miShowPanelNoMnemonic', "Show Panel"), + title: localize('miPanelNoMnemonic', "Panel"), toggled: PanelVisibleContext }, order: 4 diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 7c4cef14f90..31f4d9b6e27 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -524,12 +524,12 @@ class ToogleConfigAction extends Action2 { registerAction2(class ToogleCommandCenter extends ToogleConfigAction { constructor() { - super('window.commandCenter', localize('toggle.commandCenter', 'Show Command Center'), 1); + super('window.commandCenter', localize('toggle.commandCenter', 'Command Center'), 1); } }); registerAction2(class ToogleLayoutControl extends ToogleConfigAction { constructor() { - super('workbench.layoutControl.enabled', localize('toggle.layout', 'Show Layout Controls'), 2); + super('workbench.layoutControl.enabled', localize('toggle.layout', 'Layout Controls'), 2); } }); diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index b042c202d98..c8728506774 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -466,11 +466,6 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con 'default': 'both', 'description': localize('layoutControlType', "Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles."), }, - 'workbench.editor.dropIntoEditor.enabled': { - 'type': 'boolean', - 'default': true, - 'markdownDescription': localize('dropIntoEditor', "Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor)."), - }, 'workbench.experimental.layoutControl.enabled': { 'type': 'boolean', 'tags': ['experimental'], diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts index 54fc34de741..f0ea2a89e33 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts @@ -20,7 +20,7 @@ export class ToggleMinimapAction extends Action2 { title: { value: localize('toggleMinimap', "Toggle Minimap"), original: 'Toggle Minimap', - mnemonicTitle: localize({ key: 'miShowMinimap', comment: ['&& denotes a mnemonic'] }, "Show &&Minimap") + mnemonicTitle: localize({ key: 'miMinimap', comment: ['&& denotes a mnemonic'] }, "&&Minimap") }, category: CATEGORIES.View, f1: true, diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts index 99c4aae1ca9..c057977818c 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts @@ -456,6 +456,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget override show(rangeOrPos: IRange | IPosition, heightInLines: number): void { this._isExpanded = true; super.show(rangeOrPos, heightInLines); + this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded; this._refresh(this._commentThreadWidget.getDimensions()); } diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts index 03adbe3a5f0..030f0b5ca87 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts @@ -216,6 +216,7 @@ suite('ExtensionRecommendationsService Test', () => { onDidInstallExtensions: didInstallEvent.event, onUninstallExtension: uninstallEvent.event, onDidUninstallExtension: didUninstallEvent.event, + onDidChangeProfileExtensions: Event.None, async getInstalled() { return []; }, async canInstall() { return true; }, async getExtensionsControlManifest() { return { malicious: [], deprecated: {} }; }, diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/markdownCell.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/markdownCell.ts index 870d4b2d719..813a6ef4354 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/markdownCell.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/markdownCell.ts @@ -329,7 +329,7 @@ export class StatefulMarkdownCell extends Disposable { width: width, height: editorHeight }, - enableDropIntoEditor: true, + dropIntoEditor: { enabled: true }, // overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode() }, { contributions: this.notebookEditor.creationOptions.cellEditorContributions diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts index 949c8dd25b5..fff16d43316 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts @@ -275,7 +275,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende width: 0, height: 0 }, - enableDropIntoEditor: true, + dropIntoEditor: { enabled: true }, }, { contributions: this.notebookEditor.creationOptions.cellEditorContributions }); diff --git a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts index f479781fba7..32a0d626d66 100644 --- a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts +++ b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts @@ -1963,7 +1963,7 @@ class SCMInputWidget { scrollbar: { alwaysConsumeMouseWheel: false }, overflowWidgetsDomNode, renderWhitespace: 'none', - enableDropIntoEditor: true, + dropIntoEditor: { enabled: true }, accessibilitySupport }; diff --git a/src/vs/workbench/electron-sandbox/desktop.contribution.ts b/src/vs/workbench/electron-sandbox/desktop.contribution.ts index 1dd0c84873b..6559a5f52b7 100644 --- a/src/vs/workbench/electron-sandbox/desktop.contribution.ts +++ b/src/vs/workbench/electron-sandbox/desktop.contribution.ts @@ -242,6 +242,7 @@ import { ModifierKeyEmitter } from 'vs/base/browser/dom'; type: 'boolean', description: localize('experimentalUseSandbox', "Experimental: When enabled, the window will have sandbox mode enabled via Electron API."), default: false, + 'scope': ConfigurationScope.APPLICATION, ignoreSync: true }, } |