mirror of
https://github.com/coder/code-server.git
synced 2026-05-09 05:47:26 +02:00
chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@@ -3,48 +3,97 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
import { localize } from 'vs/nls';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Action2, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { CATEGORIES } from 'vs/workbench/common/actions';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IsDevelopmentContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
|
||||
export class ToggleDevToolsAction extends Action {
|
||||
export class ToggleDevToolsAction extends Action2 {
|
||||
|
||||
static readonly ID = 'workbench.action.toggleDevTools';
|
||||
static readonly LABEL = nls.localize('toggleDevTools', "Toggle Developer Tools");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@INativeHostService private readonly nativeHostService: INativeHostService
|
||||
) {
|
||||
super(id, label);
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.toggleDevTools',
|
||||
title: { value: localize('toggleDevTools', "Toggle Developer Tools"), original: 'Toggle Developer Tools' },
|
||||
category: CATEGORIES.Developer,
|
||||
f1: true,
|
||||
keybinding: {
|
||||
weight: KeybindingWeight.WorkbenchContrib + 50,
|
||||
when: IsDevelopmentContext,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I }
|
||||
},
|
||||
menu: {
|
||||
id: MenuId.MenubarHelpMenu,
|
||||
group: '5_tools',
|
||||
order: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
return this.nativeHostService.toggleDevTools();
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const nativeHostService = accessor.get(INativeHostService);
|
||||
|
||||
return nativeHostService.toggleDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
export class ConfigureRuntimeArgumentsAction extends Action {
|
||||
export class ConfigureRuntimeArgumentsAction extends Action2 {
|
||||
|
||||
static readonly ID = 'workbench.action.configureRuntimeArguments';
|
||||
static readonly LABEL = nls.localize('configureRuntimeArguments', "Configure Runtime Arguments");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@IEditorService private readonly editorService: IEditorService
|
||||
) {
|
||||
super(id, label);
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.configureRuntimeArguments',
|
||||
title: { value: localize('configureRuntimeArguments', "Configure Runtime Arguments"), original: 'Configure Runtime Arguments' },
|
||||
category: CATEGORIES.Preferences,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
await this.editorService.openEditor({
|
||||
resource: this.environmentService.argvResource,
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const environmentService = accessor.get(IWorkbenchEnvironmentService);
|
||||
|
||||
await editorService.openEditor({
|
||||
resource: environmentService.argvResource,
|
||||
options: { pinned: true }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class ToggleSharedProcessAction extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.toggleSharedProcess',
|
||||
title: { value: localize('toggleSharedProcess', "Toggle Shared Process"), original: 'Toggle Shared Process' },
|
||||
category: CATEGORIES.Developer,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
return accessor.get(INativeHostService).toggleSharedProcessWindow();
|
||||
}
|
||||
}
|
||||
|
||||
export class ReloadWindowWithExtensionsDisabledAction extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.reloadWindowWithExtensionsDisabled',
|
||||
title: { value: localize('reloadWindowWithExtensionsDisabled', "Reload With Extensions Disabled"), original: 'Reload With Extensions Disabled' },
|
||||
category: CATEGORIES.Developer,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
return accessor.get(INativeHostService).reload({ disableExtensions: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/actions';
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
@@ -21,6 +20,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
|
||||
export class CloseCurrentWindowAction extends Action {
|
||||
|
||||
@@ -122,26 +122,6 @@ export class ZoomResetAction extends BaseZoomAction {
|
||||
}
|
||||
}
|
||||
|
||||
export class ReloadWindowWithExtensionsDisabledAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.reloadWindowWithExtensionsDisabled';
|
||||
static readonly LABEL = nls.localize('reloadWindowWithExtensionsDisabled', "Reload With Extensions Disabled");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@INativeHostService private readonly nativeHostService: INativeHostService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(): Promise<boolean> {
|
||||
await this.nativeHostService.reload({ disableExtensions: true });
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class BaseSwitchWindow extends Action {
|
||||
|
||||
private readonly closeWindowAction: IQuickInputButton = {
|
||||
@@ -174,16 +154,16 @@ export abstract class BaseSwitchWindow extends Action {
|
||||
|
||||
const windows = await this.nativeHostService.getWindows();
|
||||
const placeHolder = nls.localize('switchWindowPlaceHolder', "Select a window to switch to");
|
||||
const picks = windows.map(win => {
|
||||
const resource = win.filename ? URI.file(win.filename) : win.folderUri ? win.folderUri : win.workspace ? win.workspace.configPath : undefined;
|
||||
const fileKind = win.filename ? FileKind.FILE : win.workspace ? FileKind.ROOT_FOLDER : win.folderUri ? FileKind.FOLDER : FileKind.FILE;
|
||||
const picks = windows.map(window => {
|
||||
const resource = window.filename ? URI.file(window.filename) : isSingleFolderWorkspaceIdentifier(window.workspace) ? window.workspace.uri : isWorkspaceIdentifier(window.workspace) ? window.workspace.configPath : undefined;
|
||||
const fileKind = window.filename ? FileKind.FILE : isSingleFolderWorkspaceIdentifier(window.workspace) ? FileKind.FOLDER : isWorkspaceIdentifier(window.workspace) ? FileKind.ROOT_FOLDER : FileKind.FILE;
|
||||
return {
|
||||
payload: win.id,
|
||||
label: win.title,
|
||||
ariaLabel: win.dirty ? nls.localize('windowDirtyAriaLabel', "{0}, dirty window", win.title) : win.title,
|
||||
payload: window.id,
|
||||
label: window.title,
|
||||
ariaLabel: window.dirty ? nls.localize('windowDirtyAriaLabel', "{0}, dirty window", window.title) : window.title,
|
||||
iconClasses: getIconClasses(this.modelService, this.modeService, resource, fileKind),
|
||||
description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : undefined,
|
||||
buttons: currentWindowId !== win.id ? win.dirty ? [this.closeDirtyWindowAction] : [this.closeWindowAction] : undefined
|
||||
description: (currentWindowId === window.id) ? nls.localize('current', "Current Window") : undefined,
|
||||
buttons: currentWindowId !== window.id ? window.dirty ? [this.closeDirtyWindowAction] : [this.closeWindowAction] : undefined
|
||||
};
|
||||
});
|
||||
const autoFocusIndex = (picks.indexOf(picks.filter(pick => pick.payload === currentWindowId)[0]) + 1) % picks.length;
|
||||
|
||||
Reference in New Issue
Block a user