Merge from vscode 6268feb42ba4f2e2fa15484e88c9af60d254998c (#6530)

This commit is contained in:
Anthony Dresser
2019-07-29 21:03:02 -07:00
committed by GitHub
parent 2c8a22bb0d
commit 6db84eefa3
104 changed files with 1797 additions and 3740 deletions

View File

@@ -21,10 +21,10 @@ export const enum ContextKeyExprType {
}
export interface IContextKeyExprMapper {
mapDefined(key: string): ContextKeyDefinedExpr;
mapNot(key: string): ContextKeyNotExpr;
mapEquals(key: string, value: any): ContextKeyEqualsExpr;
mapNotEquals(key: string, value: any): ContextKeyNotEqualsExpr;
mapDefined(key: string): ContextKeyExpr;
mapNot(key: string): ContextKeyExpr;
mapEquals(key: string, value: any): ContextKeyExpr;
mapNotEquals(key: string, value: any): ContextKeyExpr;
mapRegex(key: string, regexp: RegExp | null): ContextKeyRegexExpr;
}
@@ -217,7 +217,7 @@ function cmp(a: ContextKeyExpr, b: ContextKeyExpr): number {
}
export class ContextKeyDefinedExpr implements ContextKeyExpr {
public static create(key: string): ContextKeyExpr {
public static create(key: string): ContextKeyDefinedExpr {
return new ContextKeyDefinedExpr(key);
}
@@ -451,7 +451,7 @@ export class ContextKeyNotExpr implements ContextKeyExpr {
export class ContextKeyRegexExpr implements ContextKeyExpr {
public static create(key: string, regexp: RegExp | null): ContextKeyExpr {
public static create(key: string, regexp: RegExp | null): ContextKeyRegexExpr {
return new ContextKeyRegexExpr(key, regexp);
}

View File

@@ -10,7 +10,28 @@ export class SignService implements ISignService {
_serviceBrand: ServiceIdentifier<ISignService>;
async sign(value: string): Promise<string> {
return Promise.resolve(document.getElementById('vscode-remote-connection-token')!.getAttribute('data-settings')!);
private readonly _tkn: string | null;
constructor(token: string | undefined) {
if (typeof token !== 'undefined') {
this._tkn = token;
} else {
this._tkn = SignService._readTokenFromURL();
}
}
}
private static _readTokenFromURL(): string | null {
if (!document.location.hash) {
return null;
}
const m = document.location.hash.match(/[#&]tkn=([^&]+)/);
if (!m) {
return null;
}
return m[1];
}
async sign(value: string): Promise<string> {
return Promise.resolve(this._tkn || '');
}
}

View File

@@ -258,7 +258,7 @@ export const defaultListStyles: IColorMapping = {
listFilterWidgetOutline: listFilterWidgetOutline,
listFilterWidgetNoMatchesOutline: listFilterWidgetNoMatchesOutline,
listMatchesShadow: widgetShadow,
treeIndentGuidesStroke
treeIndentGuidesStroke: treeIndentGuidesStroke
};
export interface IButtonStyleOverrides extends IStyleOverrides {
@@ -357,4 +357,4 @@ export const defaultDialogStyles = <IDialogStyleOverrides>{
export function attachDialogStyler(widget: IThemable, themeService: IThemeService, style?: IDialogStyleOverrides): IDisposable {
return attachStyler(themeService, { ...defaultDialogStyles, ...style }, widget);
}
}

View File

@@ -156,7 +156,7 @@ export interface IWindowsService {
openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise<void>;
getWindows(): Promise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]>;
getWindowCount(): Promise<number>;
log(severity: string, ...messages: string[]): Promise<void>;
log(severity: string, args: string[]): Promise<void>;
showItemInFolder(path: URI): Promise<void>;
getActiveWindowId(): Promise<number | undefined>;

View File

@@ -226,8 +226,8 @@ export class WindowsService implements IWindowsService {
return this.channel.call('getWindowCount');
}
log(severity: string, ...messages: string[]): Promise<void> {
return this.channel.call('log', [severity, messages]);
log(severity: string, args: string[]): Promise<void> {
return this.channel.call('log', [severity, args]);
}
showItemInFolder(path: URI): Promise<void> {

View File

@@ -334,7 +334,7 @@ export class WindowsService extends Disposable implements IWindowsService, IURLH
return this.windowsMainService.getWindows().length;
}
async log(severity: string, ...messages: string[]): Promise<void> {
async log(severity: string, args: string[]): Promise<void> {
let consoleFn = console.log;
switch (severity) {
@@ -349,7 +349,7 @@ export class WindowsService extends Disposable implements IWindowsService, IURLH
break;
}
consoleFn(...messages);
consoleFn.call(console, ...args);
}
async showItemInFolder(resource: URI): Promise<void> {