Merge branch 'master' into sandy081/userDataProvider

This commit is contained in:
Sandeep Somavarapu
2019-09-10 15:17:32 +02:00
376 changed files with 7822 additions and 6945 deletions

View File

@@ -514,7 +514,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
return extHostTerminalService.createTerminalFromOptions(nameOrOptions);
}
return extHostTerminalService.createTerminal(<string>nameOrOptions, shellPath, shellArgs);
return extHostTerminalService.createTerminal(nameOrOptions, shellPath, shellArgs);
},
registerTreeDataProvider(viewId: string, treeDataProvider: vscode.TreeDataProvider<any>): vscode.Disposable {
return extHostTreeViews.registerTreeDataProvider(viewId, treeDataProvider, extension);
@@ -900,7 +900,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
WorkspaceEdit: extHostTypes.WorkspaceEdit,
// proposed
CallHierarchyDirection: extHostTypes.CallHierarchyDirection,
CallHierarchyItem: extHostTypes.CallHierarchyItem
CallHierarchyItem: extHostTypes.CallHierarchyItem,
Decoration: extHostTypes.Decoration
};
};
}

View File

@@ -667,11 +667,7 @@ export type SCMRawResource = [
string[] /*icons: light, dark*/,
string /*tooltip*/,
boolean /*strike through*/,
boolean /*faded*/,
string | undefined /*source*/,
string | undefined /*letter*/,
ThemeColor | null /*color*/
boolean /*faded*/
];
export type SCMRawResourceSplice = [
@@ -723,6 +719,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$unregisterDebugConfigurationProvider(handle: number): void;
$unregisterDebugAdapterDescriptorFactory(handle: number): void;
$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
$setDebugSessionName(id: DebugSessionUUID, name: string): void;
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
$appendDebugConsole(value: string): void;
$startBreakpointEvents(): void;
@@ -1199,6 +1196,7 @@ export interface ExtHostTaskShape {
$onDidEndTaskProcess(value: tasks.TaskProcessEndedDTO): void;
$OnDidEndTask(execution: tasks.TaskExecutionDTO): void;
$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }, variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
$getDefaultShellAndArgs(): Thenable<{ shell: string, args: string[] | string | undefined }>;
}
export interface IBreakpointDto {
@@ -1274,6 +1272,7 @@ export interface ExtHostDebugServiceShape {
$acceptDebugSessionActiveChanged(session: IDebugSessionDto | undefined): void;
$acceptDebugSessionCustomEvent(session: IDebugSessionDto, event: any): void;
$acceptBreakpointsDelta(delta: IBreakpointsDeltaDto): void;
$acceptDebugSessionNameChanged(session: IDebugSessionDto, name: string): void;
}
@@ -1283,7 +1282,7 @@ export interface DecorationRequest {
readonly uri: UriComponents;
}
export type DecorationData = [number, boolean, string, string, ThemeColor, string];
export type DecorationData = [number, boolean, string, string, ThemeColor];
export type DecorationReply = { [id: number]: DecorationData };
export interface ExtHostDecorationsShape {

View File

@@ -6,7 +6,7 @@
import * as vscode from 'vscode';
import { URI } from 'vs/base/common/uri';
import { MainContext, ExtHostDecorationsShape, MainThreadDecorationsShape, DecorationData, DecorationRequest, DecorationReply } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/workbench/api/common/extHostTypes';
import { Disposable, Decoration } from 'vs/workbench/api/common/extHostTypes';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { asArray } from 'vs/base/common/arrays';
@@ -59,12 +59,14 @@ export class ExtHostDecorations implements IExtHostDecorations {
}
const { provider, extensionId } = entry;
return Promise.resolve(provider.provideDecoration(URI.revive(uri), token)).then(data => {
if (data && data.letter && data.letter.length !== 1) {
console.warn(`INVALID decoration from extension '${extensionId.value}'. The 'letter' must be set and be one character, not '${data.letter}'.`);
if (!data) {
return;
}
if (data) {
result[id] = <DecorationData>[data.priority, data.bubble, data.title, data.letter, data.color, data.source];
try {
Decoration.validate(data);
result[id] = <DecorationData>[data.priority, data.bubble, data.title, data.letter, data.color];
} catch (e) {
console.warn(`INVALID decoration from extension '${extensionId.value}': ${e}`);
}
}, err => {
console.error(err);

View File

@@ -319,11 +319,7 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const strikeThrough = r.decorations && !!r.decorations.strikeThrough;
const faded = r.decorations && !!r.decorations.faded;
const source = r.decorations && r.decorations.source || undefined;
const letter = r.decorations && r.decorations.letter || undefined;
const color = r.decorations && r.decorations.color || undefined;
const rawResource = [handle, <UriComponents>sourceUri, icons, tooltip, strikeThrough, faded, source, letter, color] as SCMRawResource;
const rawResource = [handle, <UriComponents>sourceUri, icons, tooltip, strikeThrough, faded] as SCMRawResource;
return { rawResource, handle };
});

View File

@@ -2349,3 +2349,21 @@ export enum ExtensionKind {
UI = 1,
Workspace = 2
}
export class Decoration {
static validate(d: Decoration): void {
if (d.letter && d.letter.length !== 1) {
throw new Error(`The 'letter'-property must be undefined or a single character`);
}
if (!d.bubble && !d.color && !d.letter && !d.priority && !d.title) {
throw new Error(`The decoration is empty`);
}
}
letter?: string;
title?: string;
color?: vscode.ThemeColor;
priority?: number;
bubble?: boolean;
}