Merge from vscode 0fde6619172c9f04c41f2e816479e432cc974b8b (#5199)

This commit is contained in:
Anthony Dresser
2019-04-24 22:26:02 -07:00
committed by GitHub
parent d63f07d29a
commit 34457880c7
86 changed files with 1254 additions and 702 deletions

View File

@@ -652,6 +652,7 @@ import { InstallVSIXAction } from 'vs/workbench/contrib/extensions/electron-brow
'type': 'boolean',
'default': true,
'description': nls.localize('autoDetectHighContrast', "If enabled, will automatically change to high contrast theme if Windows is using a high contrast theme, and to dark theme when switching away from a Windows high contrast theme."),
'scope': ConfigurationScope.APPLICATION,
'included': isWindows
},
'window.doubleClickIconToClose': {
@@ -678,6 +679,7 @@ import { InstallVSIXAction } from 'vs/workbench/contrib/extensions/electron-brow
'type': 'boolean',
'default': true,
'description': nls.localize('window.nativeFullScreen', "Controls if native full-screen should be used on macOS. Disable this option to prevent macOS from creating a new space when going full-screen."),
'scope': ConfigurationScope.APPLICATION,
'included': isMacintosh
},
'window.clickThroughInactive': {

View File

@@ -91,7 +91,7 @@ class CodeRendererMain extends Disposable {
const filesToWait = this.configuration.filesToWait;
const filesToWaitPaths = filesToWait && filesToWait.paths;
[filesToWaitPaths, this.configuration.filesToOpen, this.configuration.filesToCreate, this.configuration.filesToDiff].forEach(paths => {
[filesToWaitPaths, this.configuration.filesToOpenOrCreate, this.configuration.filesToDiff].forEach(paths => {
if (Array.isArray(paths)) {
paths.forEach(path => {
if (path.fileUri) {

View File

@@ -11,10 +11,10 @@ import * as DOM from 'vs/base/browser/dom';
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { IAction, Action } from 'vs/base/common/actions';
import { IFileService } from 'vs/platform/files/common/files';
import { toResource, IUntitledResourceInput, SideBySideEditor } from 'vs/workbench/common/editor';
import { toResource, IUntitledResourceInput, SideBySideEditor, pathsToEditors } from 'vs/workbench/common/editor';
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWindowsService, IWindowService, IWindowSettings, IOpenFileRequest, IWindowsConfiguration, IAddFoldersRequest, IRunActionInWindowRequest, IPathData, IRunKeybindingInWindowRequest } from 'vs/platform/windows/common/windows';
import { IWindowsService, IWindowService, IWindowSettings, IOpenFileRequest, IWindowsConfiguration, IAddFoldersRequest, IRunActionInWindowRequest, IRunKeybindingInWindowRequest } from 'vs/platform/windows/common/windows';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ITitleService } from 'vs/workbench/services/title/common/titleService';
import { IWorkbenchThemeService, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
@@ -468,20 +468,16 @@ export class ElectronWindow extends Disposable {
this.workspaceEditingService.addFolders(foldersToAdd);
}
private onOpenFiles(request: IOpenFileRequest): void {
private async onOpenFiles(request: IOpenFileRequest): Promise<void> {
const inputs: IResourceEditor[] = [];
const diffMode = !!(request.filesToDiff && (request.filesToDiff.length === 2));
if (!diffMode && request.filesToOpen) {
inputs.push(...this.toInputs(request.filesToOpen, false));
}
if (!diffMode && request.filesToCreate) {
inputs.push(...this.toInputs(request.filesToCreate, true));
if (!diffMode && request.filesToOpenOrCreate) {
inputs.push(...(await pathsToEditors(request.filesToOpenOrCreate, this.fileService)));
}
if (diffMode && request.filesToDiff) {
inputs.push(...this.toInputs(request.filesToDiff, false));
inputs.push(...(await pathsToEditors(request.filesToDiff, this.fileService)));
}
if (inputs.length) {
@@ -521,27 +517,6 @@ export class ElectronWindow extends Disposable {
});
}
private toInputs(paths: IPathData[], isNew: boolean): IResourceEditor[] {
return paths.map(p => {
const resource = URI.revive(p.fileUri);
let input: IResourceInput | IUntitledResourceInput;
if (isNew) {
input = { filePath: resource!.fsPath, options: { pinned: true } };
} else {
input = { resource, options: { pinned: true } };
}
if (!isNew && typeof p.lineNumber === 'number' && typeof p.columnNumber === 'number') {
input.options!.selection = {
startLineNumber: p.lineNumber,
startColumn: p.columnNumber
};
}
return input;
});
}
dispose(): void {
this.touchBarDisposables = dispose(this.touchBarDisposables);