Merge branch 'master' into roblou/extHostLogger2

This commit is contained in:
Rob Lourens
2017-12-13 14:21:08 -08:00
467 changed files with 2434 additions and 1341 deletions

View File

@@ -7,12 +7,14 @@
import {
createMainContextProxyIdentifier as createMainId,
createExtHostContextProxyIdentifier as createExtId,
ProxyIdentifier
} from 'vs/workbench/services/thread/common/threadService';
ProxyIdentifier,
IRPCProtocol,
ProxyType
} from 'vs/workbench/services/extensions/node/proxyIdentifier';
import * as vscode from 'vscode';
import URI from 'vs/base/common/uri';
import URI, { UriComponents } from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity';
import { TPromise } from 'vs/base/common/winjs.base';
@@ -90,23 +92,10 @@ export interface IWorkspaceConfigurationChangeEventData {
changedConfigurationByResource: { [folder: string]: IConfigurationModel };
}
export interface IExtHostContext {
/**
* Returns a proxy to an object addressable/named in the extension host process.
*/
get<T>(identifier: ProxyIdentifier<T>): T;
/**
* Register manually created instance.
*/
set<T, R extends T>(identifier: ProxyIdentifier<T>, instance: R): R;
export interface IExtHostContext extends IRPCProtocol {
}
export interface IMainContext {
/**
* Returns a proxy to an object addressable/named in the main/renderer process.
*/
get<T>(identifier: ProxyIdentifier<T>): T;
export interface IMainContext extends IRPCProtocol {
}
// --- main thread
@@ -124,12 +113,12 @@ export interface MainThreadConfigurationShape extends IDisposable {
}
export interface MainThreadDiagnosticsShape extends IDisposable {
$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any>;
$changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): TPromise<any>;
$clear(owner: string): TPromise<any>;
}
export interface MainThreadDialogOpenOptions {
defaultUri?: URI;
defaultUri?: UriComponents;
openLabel?: string;
canSelectFiles?: boolean;
canSelectFolders?: boolean;
@@ -138,7 +127,7 @@ export interface MainThreadDialogOpenOptions {
}
export interface MainThreadDialogSaveOptions {
defaultUri?: URI;
defaultUri?: UriComponents;
saveLabel?: string;
filters?: { [name: string]: string[] };
}
@@ -151,19 +140,19 @@ export interface MainThreadDiaglogsShape extends IDisposable {
export interface MainThreadDecorationsShape extends IDisposable {
$registerDecorationProvider(handle: number, label: string): void;
$unregisterDecorationProvider(handle: number): void;
$onDidChange(handle: number, resources: URI[]): void;
$onDidChange(handle: number, resources: UriComponents[]): void;
}
export interface MainThreadDocumentContentProvidersShape extends IDisposable {
$registerTextContentProvider(handle: number, scheme: string): void;
$unregisterTextContentProvider(handle: number): void;
$onVirtualDocumentChange(uri: URI, value: ITextSource): void;
$onVirtualDocumentChange(uri: UriComponents, value: ITextSource): void;
}
export interface MainThreadDocumentsShape extends IDisposable {
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any>;
$tryOpenDocument(uri: URI): TPromise<any>;
$trySaveDocument(uri: URI): TPromise<boolean>;
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<UriComponents>;
$tryOpenDocument(uri: UriComponents): TPromise<any>;
$trySaveDocument(uri: UriComponents): TPromise<boolean>;
}
export interface ISelectionChangeEvent {
@@ -211,7 +200,7 @@ export interface ITextDocumentShowOptions {
}
export interface IWorkspaceResourceEdit {
resource: URI;
resource: UriComponents;
modelVersionId?: number;
edits: {
range?: IRange;
@@ -221,14 +210,14 @@ export interface IWorkspaceResourceEdit {
}
export interface MainThreadEditorsShape extends IDisposable {
$tryShowTextDocument(resource: URI, options: ITextDocumentShowOptions): TPromise<string>;
$tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): TPromise<string>;
$registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void;
$removeTextEditorDecorationType(key: string): void;
$tryShowEditor(id: string, position: EditorPosition): TPromise<void>;
$tryHideEditor(id: string): TPromise<void>;
$trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise<any>;
$trySetDecorations(id: string, key: string, ranges: editorCommon.IDecorationOptions[]): TPromise<any>;
$trySetDecorationsFast(id: string, key: string, ranges: string): TPromise<any>;
$trySetDecorationsFast(id: string, key: string, ranges: number[]): TPromise<any>;
$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): TPromise<any>;
$trySetSelections(id: string, selections: ISelection[]): TPromise<any>;
$tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean>;
@@ -331,7 +320,7 @@ export interface MainThreadTelemetryShape extends IDisposable {
}
export interface MainThreadWorkspaceShape extends IDisposable {
$startSearch(includePattern: string, includeFolder: string, excludePattern: string, maxResults: number, requestId: number): Thenable<URI[]>;
$startSearch(includePattern: string, includeFolder: string, excludePattern: string, maxResults: number, requestId: number): Thenable<UriComponents[]>;
$cancelSearch(requestId: number): Thenable<boolean>;
$saveAll(includeUntitled?: boolean): Thenable<boolean>;
}
@@ -340,11 +329,11 @@ export interface MainThreadFileSystemShape extends IDisposable {
$registerFileSystemProvider(handle: number, scheme: string): void;
$unregisterFileSystemProvider(handle: number): void;
$onDidAddFileSystemRoot(root: URI): void;
$onDidAddFileSystemRoot(root: UriComponents): void;
$onFileSystemChange(handle: number, resource: IFileChange[]): void;
$reportFileChunk(handle: number, resource: URI, chunk: number[] | null): void;
$reportFileChunk(handle: number, resource: UriComponents, chunk: number[] | null): void;
$handleSearchProgress(handle: number, session: number, resource: URI): void;
$handleSearchProgress(handle: number, session: number, resource: UriComponents): void;
}
export interface MainThreadTaskShape extends IDisposable {
@@ -444,7 +433,7 @@ export interface ExtHostDiagnosticsShape {
}
export interface ExtHostDocumentContentProvidersShape {
$provideTextDocumentContent(handle: number, uri: URI): TPromise<string>;
$provideTextDocumentContent(handle: number, uri: UriComponents): TPromise<string>;
}
export interface IModelAddedData {
@@ -463,7 +452,7 @@ export interface ExtHostDocumentsShape {
}
export interface ExtHostDocumentSaveParticipantShape {
$participateInSave(resource: URI, reason: SaveReason): Thenable<boolean[]>;
$participateInSave(resource: UriComponents, reason: SaveReason): Thenable<boolean[]>;
}
export interface ITextEditorAddData {
@@ -521,9 +510,9 @@ export interface ExtHostExtensionServiceShape {
}
export interface FileSystemEvents {
created: URI[];
changed: URI[];
deleted: URI[];
created: UriComponents[];
changed: UriComponents[];
deleted: UriComponents[];
}
export interface ExtHostFileSystemEventServiceShape {
$onFileEvent(events: FileSystemEvents): void;
@@ -666,7 +655,7 @@ export interface ExtHostDebugServiceShape {
export type DecorationData = [number, boolean, string, string, ThemeColor, string];
export interface ExtHostDecorationsShape {
$providerDecorations(handle: number, uri: URI): TPromise<DecorationData>;
$providerDecorations(handle: number, uri: UriComponents): TPromise<DecorationData>;
}
export interface ExtHostWindowShape {
@@ -676,9 +665,9 @@ export interface ExtHostWindowShape {
// --- proxy identifiers
export const MainContext = {
MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands'),
MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration'),
MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService'),
MainThreadCommands: <ProxyIdentifier<MainThreadCommandsShape>>createMainId<MainThreadCommandsShape>('MainThreadCommands', ProxyType.CustomMarshaller),
MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', ProxyType.CustomMarshaller),
MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService', ProxyType.CustomMarshaller),
MainThreadDecorations: createMainId<MainThreadDecorationsShape>('MainThreadDecorations'),
MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics'),
MainThreadDialogs: createMainId<MainThreadDiaglogsShape>('MainThreadDiaglogs'),
@@ -687,7 +676,7 @@ export const MainContext = {
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors'),
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors'),
MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews'),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures'),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', ProxyType.CustomMarshaller),
MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages'),
MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService'),
MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService'),
@@ -697,36 +686,36 @@ export const MainContext = {
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', ProxyType.CustomMarshaller),
MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM'),
MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask'),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', ProxyType.CustomMarshaller),
MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', ProxyType.CustomMarshaller),
MainThreadWindow: createMainId<MainThreadWindowShape>('MainThreadWindow'),
};
export const ExtHostContext = {
ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands'),
ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration'),
ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ProxyType.CustomMarshaller),
ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ProxyType.CustomMarshaller),
ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics'),
ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService'),
ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService', ProxyType.CustomMarshaller),
ExtHostDecorations: createExtId<ExtHostDecorationsShape>('ExtHostDecorations'),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors'),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ProxyType.CustomMarshaller),
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors'),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ProxyType.CustomMarshaller),
ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem'),
ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem', ProxyType.CustomMarshaller),
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor'),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures'),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ProxyType.CustomMarshaller),
ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'),
ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService'),
// ExtHostLogService: createExtId<ExtHostLogServiceShape>('ExtHostLogService'),
ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService'),
ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM'),
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask'),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ProxyType.CustomMarshaller),
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ProxyType.CustomMarshaller),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace', ProxyType.CustomMarshaller),
ExtHostWindow: createExtId<ExtHostWindowShape>('ExtHostWindow'),
};