Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)

* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c

* remove files we don't want

* fix hygiene

* update distro

* update distro

* fix hygiene

* fix strict nulls

* distro

* distro

* fix tests

* fix tests

* add another edit

* fix viewlet icon

* fix azure dialog

* fix some padding

* fix more padding issues
This commit is contained in:
Anthony Dresser
2019-12-04 19:28:22 -08:00
committed by GitHub
parent a8818ab0df
commit f5ce7fb2a5
1507 changed files with 42813 additions and 27370 deletions

View File

@@ -25,6 +25,7 @@ export interface IBaseOpenWindowsOptions {
export interface IOpenWindowOptions extends IBaseOpenWindowsOptions {
forceNewWindow?: boolean;
preferNewWindow?: boolean;
noRecentEntry?: boolean;
}
@@ -219,8 +220,9 @@ export interface IAddFoldersRequest {
}
export interface IWindowConfiguration extends ParsedArgs {
machineId: string;
windowId: number;
machineId?: string; // NOTE: This is undefined in the web, the telemetry service directly resolves this.
windowId: number; // TODO: should we deprecate this in favor of sessionId?
sessionId: string;
logLevel: LogLevel;
mainPid: number;
@@ -245,19 +247,14 @@ export interface IWindowConfiguration extends ParsedArgs {
fullscreen?: boolean;
maximized?: boolean;
highContrast?: boolean;
frameless?: boolean;
accessibilitySupport?: boolean;
partsSplashPath?: string;
perfStartTime?: number;
perfAppReady?: number;
perfWindowLoadTime?: number;
perfEntries: ExportData;
filesToOpenOrCreate?: IPath[];
filesToDiff?: IPath[];
filesToWait?: IPathsToWaitFor;
termProgram?: string;
}
export interface IRunActionInWindowRequest {

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs';
import { basename, normalize, join, } from 'vs/base/common/path';
import { basename, normalize, join, posix } from 'vs/base/common/path';
import { localize } from 'vs/nls';
import * as arrays from 'vs/base/common/arrays';
import { assign, mixin } from 'vs/base/common/objects';
@@ -496,7 +496,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// Remember in recent document list (unless this opens for extension development)
// Also do not add paths when files are opened for diffing, only if opened individually
if (!usedWindows.some(window => window.isExtensionDevelopmentHost) && !openConfig.diffMode && !openConfig.noRecentEntry) {
const isDiff = fileInputs && fileInputs.filesToDiff.length > 0;
if (!usedWindows.some(window => window.isExtensionDevelopmentHost) && !isDiff && !openConfig.noRecentEntry) {
const recents: IRecent[] = [];
for (let pathToOpen of pathsToOpen) {
if (pathToOpen.workspace) {
@@ -1107,8 +1108,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
const remoteAuthority = options.remoteAuthority;
if (remoteAuthority) {
// assume it's a folder or workspace file
const first = anyPath.charCodeAt(0);
// make absolute
if (first !== CharCode.Slash) {
@@ -1120,11 +1119,15 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
const uri = URI.from({ scheme: Schemas.vscodeRemote, authority: remoteAuthority, path: anyPath });
if (hasWorkspaceFileExtension(anyPath)) {
if (forceOpenWorkspaceAsFile) {
// guess the file type: If it ends with a slash it's a folder. If it has a file extension, it's a file or a workspace. By defaults it's a folder.
if (anyPath.charCodeAt(anyPath.length - 1) !== CharCode.Slash) {
if (hasWorkspaceFileExtension(anyPath)) {
if (forceOpenWorkspaceAsFile) {
return { fileUri: uri, remoteAuthority };
}
} else if (posix.extname(anyPath).length > 0) {
return { fileUri: uri, remoteAuthority };
}
return { workspace: getWorkspaceIdentifier(uri), remoteAuthority };
}
return { folderUri: uri, remoteAuthority };
}