chore(vscode): update to 1.56.0

This commit is contained in:
Akash Satheesan
2021-04-30 20:25:17 +05:30
1749 changed files with 88014 additions and 43316 deletions

View File

@@ -28,6 +28,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { CATEGORIES } from 'vs/workbench/common/actions';
import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup';
class InspectContextKeysAction extends Action2 {
@@ -263,15 +264,24 @@ class LogWorkingCopiesAction extends Action2 {
});
}
run(accessor: ServicesAccessor): void {
async run(accessor: ServicesAccessor): Promise<void> {
const workingCopyService = accessor.get(IWorkingCopyService);
const workingCopyBackupService = accessor.get(IWorkingCopyBackupService);
const logService = accessor.get(ILogService);
const backups = await workingCopyBackupService.getBackups();
const msg = [
`Dirty Working Copies:`,
...workingCopyService.dirtyWorkingCopies.map(workingCopy => workingCopy.resource.toString(true)),
``,
`All Working Copies:`,
...workingCopyService.workingCopies.map(workingCopy => workingCopy.resource.toString(true)),
`[Working Copies]`,
...(workingCopyService.workingCopies.length > 0) ?
workingCopyService.workingCopies.map(workingCopy => `${workingCopy.isDirty() ? '● ' : ''}${workingCopy.resource.toString(true)} (typeId: ${workingCopy.typeId || '<no typeId>'})`) :
['<none>'],
``,
`[Backups]`,
...(backups.length > 0) ?
backups.map(backup => `${backup.resource.toString(true)} (typeId: ${backup.typeId || '<no typeId>'})`) :
['<none>'],
];
logService.info(msg.join('\n'));

View File

@@ -139,7 +139,7 @@ export class ToggleSidebarPositionAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
const position = this.layoutService.getSideBarPosition();
const newPositionValue = (position === Position.LEFT) ? 'right' : 'left';
@@ -244,7 +244,7 @@ export class ToggleEditorVisibilityAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
this.layoutService.toggleMaximizedPanel();
}
}
@@ -339,7 +339,7 @@ export class ToggleStatusbarVisibilityAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
const visibility = this.layoutService.isVisible(Parts.STATUSBAR_PART);
const newVisibilityValue = !visibility;
@@ -376,7 +376,7 @@ class ToggleTabsVisibilityAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
const visibility = this.configurationService.getValue<string>(ToggleTabsVisibilityAction.tabsVisibleKey);
const newVisibilityValue = !visibility;
@@ -405,7 +405,7 @@ class ToggleZenMode extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
this.layoutService.toggleZenMode();
}
}
@@ -448,7 +448,7 @@ export class ToggleMenuBarAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
this.layoutService.toggleMenuBar();
}
}
@@ -482,7 +482,7 @@ export class ResetViewLocationsAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
this.viewDescriptorService.reset();
}
}
@@ -585,7 +585,7 @@ export class MoveViewAction extends Action {
});
}
async run(): Promise<void> {
override async run(): Promise<void> {
const focusedViewId = FocusedViewContext.getValue(this.contextKeyService);
let viewId: string;
@@ -624,7 +624,7 @@ export class MoveFocusedViewAction extends Action {
super(id, label);
}
async run(viewId: string): Promise<void> {
override async run(viewId: string): Promise<void> {
const focusedViewId = viewId || FocusedViewContext.getValue(this.contextKeyService);
if (focusedViewId === undefined || focusedViewId.trim() === '') {
@@ -744,7 +744,7 @@ export class ResetFocusedViewLocationAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
const focusedViewId = FocusedViewContext.getValue(this.contextKeyService);
let viewDescriptor: IViewDescriptor | null = null;

View File

@@ -32,7 +32,7 @@ abstract class BaseNavigationAction extends Action {
super(id, label);
}
async run(): Promise<boolean | IViewlet | IPanel> {
override async run(): Promise<void> {
const isEditorFocus = this.layoutService.hasFocus(Parts.EDITOR_PART);
const isPanelFocus = this.layoutService.hasFocus(Parts.PANEL_PART);
const isSidebarFocus = this.layoutService.hasFocus(Parts.SIDEBAR_PART);
@@ -41,7 +41,7 @@ abstract class BaseNavigationAction extends Action {
if (isEditorFocus) {
const didNavigate = this.navigateAcrossEditorGroup(this.toGroupDirection(this.direction));
if (didNavigate) {
return true;
return;
}
neighborPart = this.layoutService.getVisibleNeighborPart(Parts.EDITOR_PART, this.direction);
@@ -56,18 +56,12 @@ abstract class BaseNavigationAction extends Action {
}
if (neighborPart === Parts.EDITOR_PART) {
return this.navigateToEditorGroup(this.direction === Direction.Right ? GroupLocation.FIRST : GroupLocation.LAST);
this.navigateToEditorGroup(this.direction === Direction.Right ? GroupLocation.FIRST : GroupLocation.LAST);
} else if (neighborPart === Parts.SIDEBAR_PART) {
this.navigateToSidebar();
} else if (neighborPart === Parts.PANEL_PART) {
this.navigateToPanel();
}
if (neighborPart === Parts.SIDEBAR_PART) {
return this.navigateToSidebar();
}
if (neighborPart === Parts.PANEL_PART) {
return this.navigateToPanel();
}
return false;
}
private async navigateToPanel(): Promise<IPanel | boolean> {
@@ -240,7 +234,7 @@ export class FocusNextPart extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
focusNextOrPreviousPart(this.layoutService, this.editorService, true);
}
}
@@ -258,7 +252,7 @@ export class FocusPreviousPart extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
focusNextOrPreviousPart(this.layoutService, this.editorService, false);
}
}

View File

@@ -42,7 +42,7 @@ export class TextInputActionsProvider extends Disposable implements IWorkbenchCo
// Cut / Copy / Paste
new Action('editor.action.clipboardCutAction', localize('cut', "Cut"), undefined, true, async () => document.execCommand('cut')),
new Action('editor.action.clipboardCopyAction', localize('copy', "Copy"), undefined, true, async () => document.execCommand('copy')),
new Action('editor.action.clipboardPasteAction', localize('paste', "Paste"), undefined, true, async (element: HTMLInputElement | HTMLTextAreaElement) => {
new Action('editor.action.clipboardPasteAction', localize('paste', "Paste"), undefined, true, async element => {
// Native: paste is supported
if (isNative) {

View File

@@ -78,7 +78,7 @@ abstract class BaseOpenRecentAction extends Action {
protected abstract isQuickNavigate(): boolean;
async run(): Promise<void> {
override async run(): Promise<void> {
const recentlyOpened = await this.workspacesService.getRecentlyOpened();
const dirtyWorkspacesAndFolders = await this.workspacesService.getDirtyWorkspaces();
@@ -286,7 +286,7 @@ class ToggleFullScreenAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
return this.hostService.toggleFullScreen();
}
}
@@ -304,10 +304,8 @@ export class ReloadWindowAction extends Action {
super(id, label);
}
async run(): Promise<boolean> {
override async run(): Promise<void> {
await this.hostService.reload();
return true;
}
}
@@ -324,7 +322,7 @@ class ShowAboutDialogAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
return this.dialogService.about();
}
}
@@ -342,7 +340,7 @@ export class NewWindowAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
return this.hostService.openWindow({ remoteAuthority: null });
}
}

View File

@@ -24,6 +24,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IWorkspacesService, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
import { WORKSPACE_TRUST_ENABLED } from 'vs/workbench/services/workspaces/common/workspaceTrust';
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
export class OpenFileAction extends Action {
@@ -38,7 +39,7 @@ export class OpenFileAction extends Action {
super(id, label);
}
run(event?: unknown, data?: ITelemetryData): Promise<void> {
override run(event?: unknown, data?: ITelemetryData): Promise<void> {
return this.dialogService.pickFileAndOpen({ forceNewWindow: false, telemetryExtraData: data });
}
}
@@ -56,7 +57,7 @@ export class OpenFolderAction extends Action {
super(id, label);
}
run(event?: unknown, data?: ITelemetryData): Promise<void> {
override run(event?: unknown, data?: ITelemetryData): Promise<void> {
return this.dialogService.pickFolderAndOpen({ forceNewWindow: false, telemetryExtraData: data });
}
}
@@ -74,7 +75,7 @@ export class OpenFileFolderAction extends Action {
super(id, label);
}
run(event?: unknown, data?: ITelemetryData): Promise<void> {
override run(event?: unknown, data?: ITelemetryData): Promise<void> {
return this.dialogService.pickFileFolderAndOpen({ forceNewWindow: false, telemetryExtraData: data });
}
}
@@ -92,7 +93,7 @@ export class OpenWorkspaceAction extends Action {
super(id, label);
}
run(event?: unknown, data?: ITelemetryData): Promise<void> {
override run(event?: unknown, data?: ITelemetryData): Promise<void> {
return this.dialogService.pickWorkspaceAndOpen({ telemetryExtraData: data });
}
}
@@ -113,7 +114,7 @@ export class CloseWorkspaceAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
this.notificationService.info(localize('noWorkspaceOrFolderOpened', "There is currently no workspace or folder opened in this instance to close."));
return;
@@ -139,7 +140,7 @@ export class OpenWorkspaceConfigFileAction extends Action {
this.enabled = !!this.workspaceContextService.getWorkspace().configuration;
}
async run(): Promise<void> {
override async run(): Promise<void> {
const configuration = this.workspaceContextService.getWorkspace().configuration;
if (configuration) {
await this.editorService.openEditor({ resource: configuration, options: { pinned: true } });
@@ -160,7 +161,7 @@ export class AddRootFolderAction extends Action {
super(id, label);
}
run(): Promise<void> {
override run(): Promise<void> {
return this.commandService.executeCommand(ADD_ROOT_FOLDER_COMMAND_ID);
}
}
@@ -180,7 +181,7 @@ export class GlobalRemoveRootFolderAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
const state = this.contextService.getWorkbenchState();
// Workspace / Folder
@@ -208,7 +209,7 @@ export class SaveWorkspaceAsAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
const configPathUri = await this.workspaceEditingService.pickNewWorkspacePath();
if (configPathUri && hasWorkspaceFileExtension(configPathUri)) {
switch (this.contextService.getWorkbenchState()) {
@@ -240,7 +241,7 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
super(id, label);
}
async run(): Promise<void> {
override async run(): Promise<void> {
const folders = this.workspaceContextService.getWorkspace().folders;
const remoteAuthority = this.environmentService.remoteAuthority;
@@ -256,7 +257,7 @@ class WorkspaceTrustManageAction extends Action2 {
super({
id: 'workbench.action.manageTrust',
title: { value: localize('manageTrustAction', "Manage Workspace Trust"), original: 'Manage Workspace Trust' },
precondition: ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true),
precondition: ContextKeyExpr.and(IsWebContext.negate(), ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)),
category: localize('workspacesCategory', "Workspaces"),
f1: true
});

View File

@@ -17,11 +17,12 @@ import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/qu
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
import { IFileDialogService, IPickAndOpenOptions } from 'vs/platform/dialogs/common/dialogs';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { IOpenWindowOptions, IWindowOpenable } from 'vs/platform/windows/common/windows';
import { hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
import { IPathService } from 'vs/workbench/services/path/common/pathService';
export const ADD_ROOT_FOLDER_COMMAND_ID = 'addRootFolder';
export const ADD_ROOT_FOLDER_LABEL = localize('addFolderToWorkspace', "Add Folder to Workspace...");
@@ -60,12 +61,14 @@ CommandsRegistry.registerCommand({
handler: async (accessor) => {
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
const dialogsService = accessor.get(IFileDialogService);
const pathService = accessor.get(IPathService);
const folders = await dialogsService.showOpenDialog({
openLabel: mnemonicButtonLabel(localize({ key: 'add', comment: ['&& denotes a mnemonic'] }, "&&Add")),
title: localize('addFolderToWorkspaceTitle', "Add Folder to Workspace"),
canSelectFolders: true,
canSelectMany: true,
defaultUri: await dialogsService.defaultFolderPath()
defaultUri: await dialogsService.defaultFolderPath(),
availableFileSystems: [pathService.defaultUriScheme]
});
if (!folders || !folders.length) {
@@ -127,21 +130,28 @@ interface IOpenFolderAPICommandOptions {
forceNewWindow?: boolean;
forceReuseWindow?: boolean;
noRecentEntry?: boolean;
forceLocalWindow?: boolean;
}
CommandsRegistry.registerCommand({
id: 'vscode.openFolder',
handler: (accessor: ServicesAccessor, uri?: URI, arg?: boolean | IOpenFolderAPICommandOptions) => {
const commandService = accessor.get(ICommandService);
// Be compatible to previous args by converting to options
if (typeof arg === 'boolean') {
arg = { forceNewWindow: arg };
}
// Without URI, ask to pick a folder or workpsace to open
// Without URI, ask to pick a folder or workspace to open
if (!uri) {
return commandService.executeCommand('_files.pickFolderAndOpen', { forceNewWindow: arg?.forceNewWindow });
const options: IPickAndOpenOptions = {
forceNewWindow: arg?.forceNewWindow
};
if (arg?.forceLocalWindow) {
options.remoteAuthority = null;
options.availableFileSystems = ['file'];
}
return commandService.executeCommand('_files.pickFolderAndOpen', options);
}
uri = URI.revive(uri);
@@ -149,17 +159,28 @@ CommandsRegistry.registerCommand({
const options: IOpenWindowOptions = {
forceNewWindow: arg?.forceNewWindow,
forceReuseWindow: arg?.forceReuseWindow,
noRecentEntry: arg?.noRecentEntry
noRecentEntry: arg?.noRecentEntry,
remoteAuthority: arg?.forceLocalWindow ? null : undefined
};
const uriToOpen: IWindowOpenable = (hasWorkspaceFileExtension(uri) || uri.scheme === Schemas.untitled) ? { workspaceUri: uri } : { folderUri: uri };
return commandService.executeCommand('_files.windowOpen', [uriToOpen], options);
},
description: {
description: 'Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.',
args: [
{ name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder', constraint: (value: any) => value === undefined || value instanceof URI },
{ name: 'options', description: '(optional) Options. Object with the following properties: `forceNewWindow `: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `noRecentEntry`: Whether the opened URI will appear in the \'Open Recent\' list. Defaults to true. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.', constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean' }
{
name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder',
constraint: (value: any) => value === undefined || value === null || value instanceof URI
},
{
name: 'options',
description: '(optional) Options. Object with the following properties: ' +
'`forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. ' +
'`forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. ' +
'`noRecentEntry`: Whether the opened URI will appear in the \'Open Recent\' list. Defaults to false. ' +
'Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.',
constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean'
}
]
}
});