Use native proxies for renderer <-> ext host RPC communication

This commit is contained in:
Alex Dima
2017-08-16 10:21:24 +02:00
parent 159de8236e
commit 2b3298af79
53 changed files with 357 additions and 414 deletions

View File

@@ -126,39 +126,37 @@ export class InstanceCollection {
}
}
function ni() { return new Error('Not implemented'); }
// --- main thread
export abstract class MainThreadCommandsShape {
dispose(): void { throw ni(); }
$registerCommand(id: string): TPromise<any> { throw ni(); }
$unregisterCommand(id: string): TPromise<any> { throw ni(); }
$executeCommand<T>(id: string, args: any[]): Thenable<T> { throw ni(); }
$getCommands(): Thenable<string[]> { throw ni(); }
export interface MainThreadCommandsShape {
dispose(): void;
$registerCommand(id: string): TPromise<any>;
$unregisterCommand(id: string): TPromise<any>;
$executeCommand<T>(id: string, args: any[]): Thenable<T>;
$getCommands(): Thenable<string[]>;
}
export abstract class MainThreadConfigurationShape {
dispose(): void { throw ni(); }
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any, resource: URI): TPromise<void> { throw ni(); }
$removeConfigurationOption(target: ConfigurationTarget, key: string, resource: URI): TPromise<void> { throw ni(); }
export interface MainThreadConfigurationShape {
dispose(): void;
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any, resource: URI): TPromise<void>;
$removeConfigurationOption(target: ConfigurationTarget, key: string, resource: URI): TPromise<void>;
}
export abstract class MainThreadDiagnosticsShape {
$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any> { throw ni(); }
$clear(owner: string): TPromise<any> { throw ni(); }
export interface MainThreadDiagnosticsShape {
$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any>;
$clear(owner: string): TPromise<any>;
}
export abstract class MainThreadDocumentContentProvidersShape {
$registerTextContentProvider(handle: number, scheme: string): void { throw ni(); }
$unregisterTextContentProvider(handle: number): void { throw ni(); }
$onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); }
export interface MainThreadDocumentContentProvidersShape {
$registerTextContentProvider(handle: number, scheme: string): void;
$unregisterTextContentProvider(handle: number): void;
$onVirtualDocumentChange(uri: URI, value: ITextSource): void;
}
export abstract class MainThreadDocumentsShape {
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); }
$tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
$trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); }
export interface MainThreadDocumentsShape {
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any>;
$tryOpenDocument(uri: URI): TPromise<any>;
$trySaveDocument(uri: URI): TPromise<boolean>;
}
export interface ISelectionChangeEvent {
@@ -205,131 +203,131 @@ export interface ITextDocumentShowOptions {
selection?: IRange;
}
export abstract class MainThreadEditorsShape {
$tryShowTextDocument(resource: URI, options: ITextDocumentShowOptions): TPromise<string> { throw ni(); }
$registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void { throw ni(); }
$removeTextEditorDecorationType(key: string): void { throw ni(); }
$tryShowEditor(id: string, position: EditorPosition): TPromise<void> { throw ni(); }
$tryHideEditor(id: string): TPromise<void> { throw ni(); }
$trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise<any> { throw ni(); }
$trySetDecorations(id: string, key: string, ranges: editorCommon.IDecorationOptions[]): TPromise<any> { throw ni(); }
$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); }
$trySetSelections(id: string, selections: ISelection[]): TPromise<any> { throw ni(); }
$tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean> { throw ni(); }
$tryInsertSnippet(id: string, template: string, selections: IRange[], opts: IUndoStopOptions): TPromise<any> { throw ni(); }
$getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]> { throw ni(); }
export interface MainThreadEditorsShape {
$tryShowTextDocument(resource: URI, 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>;
$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>;
$tryInsertSnippet(id: string, template: string, selections: IRange[], opts: IUndoStopOptions): TPromise<any>;
$getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]>;
}
export abstract class MainThreadTreeViewsShape {
$registerView(treeViewId: string): void { throw ni(); }
$refresh(treeViewId: string, treeItemHandles: number[]): void { throw ni(); }
export interface MainThreadTreeViewsShape {
$registerView(treeViewId: string): void;
$refresh(treeViewId: string, treeItemHandles: number[]): void;
}
export abstract class MainThreadErrorsShape {
onUnexpectedExtHostError(err: any): void { throw ni(); }
export interface MainThreadErrorsShape {
onUnexpectedExtHostError(err: any): void;
}
export abstract class MainThreadLanguageFeaturesShape {
dispose(): void { throw ni(); }
$unregister(handle: number): TPromise<any> { throw ni(); }
$registerOutlineSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any> { throw ni(); }
$emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any> { throw ni(); }
$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerHoverProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerDocumentHighlightProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerReferenceSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerQuickFixSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerDocumentFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerRangeFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerOnTypeFormattingSupport(handle: number, selector: vscode.DocumentSelector, autoFormatTriggerCharacters: string[]): TPromise<any> { throw ni(); }
$registerNavigateTypeSupport(handle: number): TPromise<any> { throw ni(); }
$registerRenameSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerSuggestSupport(handle: number, selector: vscode.DocumentSelector, triggerCharacters: string[]): TPromise<any> { throw ni(); }
$registerSignatureHelpProvider(handle: number, selector: vscode.DocumentSelector, triggerCharacter: string[]): TPromise<any> { throw ni(); }
$registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$registerColorFormats(formats: IRawColorFormatMap): TPromise<any> { throw ni(); }
$registerDocumentColorProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); }
export interface MainThreadLanguageFeaturesShape {
dispose(): void;
$unregister(handle: number): TPromise<any>;
$registerOutlineSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any>;
$emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any>;
$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerHoverProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerDocumentHighlightProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerReferenceSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerQuickFixSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerDocumentFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerRangeFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerOnTypeFormattingSupport(handle: number, selector: vscode.DocumentSelector, autoFormatTriggerCharacters: string[]): TPromise<any>;
$registerNavigateTypeSupport(handle: number): TPromise<any>;
$registerRenameSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerSuggestSupport(handle: number, selector: vscode.DocumentSelector, triggerCharacters: string[]): TPromise<any>;
$registerSignatureHelpProvider(handle: number, selector: vscode.DocumentSelector, triggerCharacter: string[]): TPromise<any>;
$registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$registerColorFormats(formats: IRawColorFormatMap): TPromise<any>;
$registerDocumentColorProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any>;
$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any>;
}
export abstract class MainThreadLanguagesShape {
$getLanguages(): TPromise<string[]> { throw ni(); }
export interface MainThreadLanguagesShape {
$getLanguages(): TPromise<string[]>;
}
export abstract class MainThreadMessageServiceShape {
$showMessage(severity: Severity, message: string, options: vscode.MessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number> { throw ni(); }
export interface MainThreadMessageServiceShape {
$showMessage(severity: Severity, message: string, options: vscode.MessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number>;
}
export abstract class MainThreadOutputServiceShape {
$append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); }
$clear(channelId: string, label: string): TPromise<void> { throw ni(); }
$dispose(channelId: string, label: string): TPromise<void> { throw ni(); }
$reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); }
$close(channelId: string): TPromise<void> { throw ni(); }
export interface MainThreadOutputServiceShape {
$append(channelId: string, label: string, value: string): TPromise<void>;
$clear(channelId: string, label: string): TPromise<void>;
$dispose(channelId: string, label: string): TPromise<void>;
$reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void>;
$close(channelId: string): TPromise<void>;
}
export abstract class MainThreadProgressShape {
export interface MainThreadProgressShape {
$startProgress(handle: number, options: IProgressOptions): void { throw ni(); };
$progressReport(handle: number, message: IProgressStep): void { throw ni(); }
$progressEnd(handle: number): void { throw ni(); }
$startProgress(handle: number, options: IProgressOptions): void;
$progressReport(handle: number, message: IProgressStep): void;
$progressEnd(handle: number): void;
}
export abstract class MainThreadTerminalServiceShape {
$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> { throw ni(); }
$dispose(terminalId: number): void { throw ni(); }
$hide(terminalId: number): void { throw ni(); }
$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }
$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
export interface MainThreadTerminalServiceShape {
$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number>;
$dispose(terminalId: number): void;
$hide(terminalId: number): void;
$sendText(terminalId: number, text: string, addNewLine: boolean): void;
$show(terminalId: number, preserveFocus: boolean): void;
}
export interface MyQuickPickItems extends IPickOpenEntry {
handle: number;
}
export abstract class MainThreadQuickOpenShape {
dispose(): void { throw ni(); }
$show(options: IPickOptions): TPromise<number> { throw ni(); }
$setItems(items: MyQuickPickItems[]): TPromise<any> { throw ni(); }
$setError(error: Error): TPromise<any> { throw ni(); }
$input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string> { throw ni(); }
export interface MainThreadQuickOpenShape {
dispose(): void;
$show(options: IPickOptions): TPromise<number>;
$setItems(items: MyQuickPickItems[]): TPromise<any>;
$setError(error: Error): TPromise<any>;
$input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string>;
}
export abstract class MainThreadStatusBarShape {
$setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); }
$dispose(id: number) { throw ni(); }
export interface MainThreadStatusBarShape {
$setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void;
$dispose(id: number);
}
export abstract class MainThreadStorageShape {
$getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); }
$setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); }
export interface MainThreadStorageShape {
$getValue<T>(shared: boolean, key: string): TPromise<T>;
$setValue(shared: boolean, key: string, value: any): TPromise<any>;
}
export abstract class MainThreadTelemetryShape {
$publicLog(eventName: string, data?: any): void { throw ni(); }
$getTelemetryInfo(): TPromise<ITelemetryInfo> { throw ni(); }
export interface MainThreadTelemetryShape {
$publicLog(eventName: string, data?: any): void;
$getTelemetryInfo(): TPromise<ITelemetryInfo>;
}
export abstract class MainThreadWorkspaceShape {
$startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<URI[]> { throw ni(); }
$cancelSearch(requestId: number): Thenable<boolean> { throw ni(); }
$saveAll(includeUntitled?: boolean): Thenable<boolean> { throw ni(); }
$applyWorkspaceEdit(edits: IResourceEdit[]): TPromise<boolean> { throw ni(); }
$registerFileSystemProvider(handle: number, authority: string): void { throw ni(); }
$onFileSystemChange(handle: number, resource: URI): void { throw ni(); }
export interface MainThreadWorkspaceShape {
$startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<URI[]>;
$cancelSearch(requestId: number): Thenable<boolean>;
$saveAll(includeUntitled?: boolean): Thenable<boolean>;
$applyWorkspaceEdit(edits: IResourceEdit[]): TPromise<boolean>;
$registerFileSystemProvider(handle: number, authority: string): void;
$onFileSystemChange(handle: number, resource: URI): void;
}
export abstract class MainThreadTaskShape {
$registerTaskProvider(handle: number): TPromise<any> { throw ni(); }
$unregisterTaskProvider(handle: number): TPromise<any> { throw ni(); }
export interface MainThreadTaskShape {
$registerTaskProvider(handle: number): TPromise<any>;
$unregisterTaskProvider(handle: number): TPromise<any>;
}
export abstract class MainProcessExtensionServiceShape {
$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
$onExtensionActivated(extensionId: string): void { throw ni(); }
$onExtensionActivationFailed(extensionId: string): void { throw ni(); }
export interface MainProcessExtensionServiceShape {
$localShowMessage(severity: Severity, msg: string): void;
$onExtensionActivated(extensionId: string): void;
$onExtensionActivationFailed(extensionId: string): void;
}
export interface SCMProviderFeatures {
@@ -354,53 +352,53 @@ export type SCMRawResource = [
boolean /*faded*/
];
export abstract class MainThreadSCMShape {
$registerSourceControl(handle: number, id: string, label: string): void { throw ni(); }
$updateSourceControl(handle: number, features: SCMProviderFeatures): void { throw ni(); }
$unregisterSourceControl(handle: number): void { throw ni(); }
export interface MainThreadSCMShape {
$registerSourceControl(handle: number, id: string, label: string): void;
$updateSourceControl(handle: number, features: SCMProviderFeatures): void;
$unregisterSourceControl(handle: number): void;
$registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void { throw ni(); }
$updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void { throw ni(); }
$updateGroupLabel(sourceControlHandle: number, handle: number, label: string): void { throw ni(); }
$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); }
$unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); }
$registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void;
$updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void;
$updateGroupLabel(sourceControlHandle: number, handle: number, label: string): void;
$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void;
$unregisterGroup(sourceControlHandle: number, handle: number): void;
$setInputBoxValue(value: string): void { throw ni(); }
$setInputBoxValue(value: string): void;
}
export type DebugSessionUUID = string;
export abstract class MainThreadDebugServiceShape {
dispose(): void { throw ni(); }
$startDebugging(folderUri: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
$startDebugSession(folderUri: URI | undefined, config: vscode.DebugConfiguration): TPromise<DebugSessionUUID> { throw ni(); }
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise<any> { throw ni(); }
export interface MainThreadDebugServiceShape {
dispose(): void;
$startDebugging(folderUri: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean>;
$startDebugSession(folderUri: URI | undefined, config: vscode.DebugConfiguration): TPromise<DebugSessionUUID>;
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise<any>;
}
export abstract class MainThreadCredentialsShape {
dispose(): void { throw ni(); }
$readSecret(service: string, account: string): Thenable<string | undefined> { throw ni(); }
$writeSecret(service: string, account: string, secret: string): Thenable<void> { throw ni(); }
$deleteSecret(service: string, account: string): Thenable<boolean> { throw ni(); }
export interface MainThreadCredentialsShape {
dispose(): void;
$readSecret(service: string, account: string): Thenable<string | undefined>;
$writeSecret(service: string, account: string, secret: string): Thenable<void>;
$deleteSecret(service: string, account: string): Thenable<boolean>;
}
// -- extension host
export abstract class ExtHostCommandsShape {
$executeContributedCommand<T>(id: string, ...args: any[]): Thenable<T> { throw ni(); }
$getContributedCommandHandlerDescriptions(): TPromise<{ [id: string]: string | ICommandHandlerDescription }> { throw ni(); }
export interface ExtHostCommandsShape {
$executeContributedCommand<T>(id: string, ...args: any[]): Thenable<T>;
$getContributedCommandHandlerDescriptions(): TPromise<{ [id: string]: string | ICommandHandlerDescription }>;
}
export abstract class ExtHostConfigurationShape {
$acceptConfigurationChanged(data: IConfigurationData<any>) { throw ni(); }
export interface ExtHostConfigurationShape {
$acceptConfigurationChanged(data: IConfigurationData<any>);
}
export abstract class ExtHostDiagnosticsShape {
export interface ExtHostDiagnosticsShape {
}
export abstract class ExtHostDocumentContentProvidersShape {
$provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); }
export interface ExtHostDocumentContentProvidersShape {
$provideTextDocumentContent(handle: number, uri: URI): TPromise<string>;
}
export interface IModelAddedData {
@@ -411,15 +409,15 @@ export interface IModelAddedData {
modeId: string;
isDirty: boolean;
}
export abstract class ExtHostDocumentsShape {
$acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); }
$acceptModelSaved(strURL: string): void { throw ni(); }
$acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { throw ni(); }
$acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); }
export interface ExtHostDocumentsShape {
$acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void;
$acceptModelSaved(strURL: string): void;
$acceptDirtyStateChanged(strURL: string, isDirty: boolean): void;
$acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void;
}
export abstract class ExtHostDocumentSaveParticipantShape {
$participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]> { throw ni(); }
export interface ExtHostDocumentSaveParticipantShape {
$participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]>;
}
export interface ITextEditorAddData {
@@ -432,10 +430,10 @@ export interface ITextEditorAddData {
export interface ITextEditorPositionData {
[id: string]: EditorPosition;
}
export abstract class ExtHostEditorsShape {
$acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); }
$acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void { throw ni(); }
$acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); }
export interface ExtHostEditorsShape {
$acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void;
$acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void;
$acceptEditorPositionData(data: ITextEditorPositionData): void;
}
export interface IDocumentsAndEditorsDelta {
@@ -446,23 +444,23 @@ export interface IDocumentsAndEditorsDelta {
newActiveEditor?: string;
}
export abstract class ExtHostDocumentsAndEditorsShape {
$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void { throw ni(); }
export interface ExtHostDocumentsAndEditorsShape {
$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void;
}
export abstract class ExtHostTreeViewsShape {
$getElements(treeViewId: string): TPromise<ITreeItem[]> { throw ni(); }
$getChildren(treeViewId: string, treeItemHandle: number): TPromise<ITreeItem[]> { throw ni(); }
export interface ExtHostTreeViewsShape {
$getElements(treeViewId: string): TPromise<ITreeItem[]>;
$getChildren(treeViewId: string, treeItemHandle: number): TPromise<ITreeItem[]>;
}
export abstract class ExtHostWorkspaceShape {
$acceptWorkspaceData(workspace: IWorkspaceData): void { throw ni(); }
$resolveFile(handle: number, resource: URI): TPromise<string> { throw ni(); }
$storeFile(handle: number, resource: URI, content: string): TPromise<any> { throw ni(); }
export interface ExtHostWorkspaceShape {
$acceptWorkspaceData(workspace: IWorkspaceData): void;
$resolveFile(handle: number, resource: URI): TPromise<string>;
$storeFile(handle: number, resource: URI, content: string): TPromise<any>;
}
export abstract class ExtHostExtensionServiceShape {
$activateByEvent(activationEvent: string): TPromise<void> { throw ni(); }
export interface ExtHostExtensionServiceShape {
$activateByEvent(activationEvent: string): TPromise<void>;
}
export interface FileSystemEvents {
@@ -470,8 +468,8 @@ export interface FileSystemEvents {
changed: URI[];
deleted: URI[];
}
export abstract class ExtHostFileSystemEventServiceShape {
$onFileEvent(events: FileSystemEvents) { throw ni(); }
export interface ExtHostFileSystemEventServiceShape {
$onFileEvent(events: FileSystemEvents);
}
export interface ObjectIdentifier {
@@ -489,8 +487,8 @@ export namespace ObjectIdentifier {
}
}
export abstract class ExtHostHeapServiceShape {
$onGarbageCollection(ids: number[]): void { throw ni(); }
export interface ExtHostHeapServiceShape {
$onGarbageCollection(ids: number[]): void;
}
export interface IRawColorInfo {
color: [number, number, number, number];
@@ -500,110 +498,110 @@ export interface IRawColorInfo {
export type IRawColorFormatMap = [number, string][];
export abstract class ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]> { throw ni(); }
$provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]> { throw ni(); }
$resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> { throw ni(); }
$provideDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> { throw ni(); }
$provideImplementation(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> { throw ni(); }
$provideTypeDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition> { throw ni(); }
$provideHover(handle: number, resource: URI, position: IPosition): TPromise<modes.Hover> { throw ni(); }
$provideDocumentHighlights(handle: number, resource: URI, position: IPosition): TPromise<modes.DocumentHighlight[]> { throw ni(); }
$provideReferences(handle: number, resource: URI, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> { throw ni(); }
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.Command[]> { throw ni(); }
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
$provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]> { throw ni(); }
$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation> { throw ni(); }
$provideRenameEdits(handle: number, resource: URI, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit> { throw ni(); }
$provideCompletionItems(handle: number, resource: URI, position: IPosition): TPromise<modes.ISuggestResult> { throw ni(); }
$resolveCompletionItem(handle: number, resource: URI, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> { throw ni(); }
$provideSignatureHelp(handle: number, resource: URI, position: IPosition): TPromise<modes.SignatureHelp> { throw ni(); }
$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> { throw ni(); }
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]> { throw ni(); }
$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> { throw ni(); }
export interface ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]>;
$provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]>;
$resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol>;
$provideDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideImplementation(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideTypeDefinition(handle: number, resource: URI, position: IPosition): TPromise<modes.Definition>;
$provideHover(handle: number, resource: URI, position: IPosition): TPromise<modes.Hover>;
$provideDocumentHighlights(handle: number, resource: URI, position: IPosition): TPromise<modes.DocumentHighlight[]>;
$provideReferences(handle: number, resource: URI, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]>;
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.Command[]>;
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]>;
$provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]>;
$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation>;
$provideRenameEdits(handle: number, resource: URI, position: IPosition, newName: string): TPromise<modes.WorkspaceEdit>;
$provideCompletionItems(handle: number, resource: URI, position: IPosition): TPromise<modes.ISuggestResult>;
$resolveCompletionItem(handle: number, resource: URI, position: IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion>;
$provideSignatureHelp(handle: number, resource: URI, position: IPosition): TPromise<modes.SignatureHelp>;
$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]>;
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]>;
$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink>;
}
export abstract class ExtHostQuickOpenShape {
$onItemSelected(handle: number): void { throw ni(); }
$validateInput(input: string): TPromise<string> { throw ni(); }
export interface ExtHostQuickOpenShape {
$onItemSelected(handle: number): void;
$validateInput(input: string): TPromise<string>;
}
export abstract class ExtHostTerminalServiceShape {
$acceptTerminalClosed(id: number): void { throw ni(); }
$acceptTerminalProcessId(id: number, processId: number): void { throw ni(); }
export interface ExtHostTerminalServiceShape {
$acceptTerminalClosed(id: number): void;
$acceptTerminalProcessId(id: number, processId: number): void;
}
export abstract class ExtHostSCMShape {
$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> { throw ni(); }
$onActiveSourceControlChange(sourceControlHandle: number): TPromise<void> { throw ni(); }
$onInputBoxValueChange(value: string): TPromise<void> { throw ni(); }
$onInputBoxAcceptChanges(): TPromise<void> { throw ni(); }
export interface ExtHostSCMShape {
$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI>;
$onActiveSourceControlChange(sourceControlHandle: number): TPromise<void>;
$onInputBoxValueChange(value: string): TPromise<void>;
$onInputBoxAcceptChanges(): TPromise<void>;
}
export abstract class ExtHostTaskShape {
$provideTasks(handle: number): TPromise<TaskSet> { throw ni(); }
export interface ExtHostTaskShape {
$provideTasks(handle: number): TPromise<TaskSet>;
}
export abstract class ExtHostDebugServiceShape {
$acceptDebugSessionStarted(id: DebugSessionUUID, type: string, name: string): void { throw ni(); }
$acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void { throw ni(); }
$acceptDebugSessionActiveChanged(id: DebugSessionUUID | undefined, type?: string, name?: string): void { throw ni(); }
$acceptDebugSessionCustomEvent(id: DebugSessionUUID, type: string, name: string, event: any): void { throw ni(); }
export interface ExtHostDebugServiceShape {
$acceptDebugSessionStarted(id: DebugSessionUUID, type: string, name: string): void;
$acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void;
$acceptDebugSessionActiveChanged(id: DebugSessionUUID | undefined, type?: string, name?: string): void;
$acceptDebugSessionCustomEvent(id: DebugSessionUUID, type: string, name: string, event: any): void;
}
export abstract class ExtHostCredentialsShape {
export interface ExtHostCredentialsShape {
}
// --- proxy identifiers
export const MainContext = {
MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape),
MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape),
MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService', MainThreadDebugServiceShape),
MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape),
MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape),
MainThreadDocumentContentProviders: createMainId<MainThreadDocumentContentProvidersShape>('MainThreadDocumentContentProviders', MainThreadDocumentContentProvidersShape),
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape),
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape),
MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews', MainThreadTreeViewsShape),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape),
MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape),
MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape),
MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape),
MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress', MainThreadProgressShape),
MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape),
MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape),
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService', MainThreadTerminalServiceShape),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape),
MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', MainThreadSCMShape),
MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', MainThreadTaskShape),
MainThreadCredentials: createMainId<MainThreadCredentialsShape>('MainThreadCredentials', MainThreadCredentialsShape),
MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands'),
MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration'),
MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService'),
MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics'),
MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments'),
MainThreadDocumentContentProviders: createMainId<MainThreadDocumentContentProvidersShape>('MainThreadDocumentContentProviders'),
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors'),
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors'),
MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews'),
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures'),
MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages'),
MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService'),
MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService'),
MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress'),
MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen'),
MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar'),
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService'),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM'),
MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask'),
MainThreadCredentials: createMainId<MainThreadCredentialsShape>('MainThreadCredentials'),
};
export const ExtHostContext = {
ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape),
ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape),
ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape),
ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService', ExtHostDebugServiceShape),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape),
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape),
ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders', ExtHostDocumentContentProvidersShape),
ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape),
ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews', ExtHostTreeViewsShape),
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape),
ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor', ExtHostHeapServiceShape),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape),
ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape),
ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape),
ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService', ExtHostTerminalServiceShape),
ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ExtHostSCMShape),
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ExtHostTaskShape),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace', ExtHostWorkspaceShape),
ExtHostCredentials: createExtId<ExtHostCredentialsShape>('ExtHostCredentials', ExtHostCredentialsShape),
ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands'),
ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration'),
ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics'),
ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService'),
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors'),
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors'),
ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor'),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures'),
ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'),
ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService'),
ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService'),
ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM'),
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask'),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
ExtHostCredentials: createExtId<ExtHostCredentialsShape>('ExtHostCredentials'),
};

View File

@@ -26,7 +26,7 @@ export interface ArgumentProcessor {
processArgument(arg: any): any;
}
export class ExtHostCommands extends ExtHostCommandsShape {
export class ExtHostCommands implements ExtHostCommandsShape {
private _commands = new Map<string, CommandHandler>();
private _proxy: MainThreadCommandsShape;
@@ -37,7 +37,6 @@ export class ExtHostCommands extends ExtHostCommandsShape {
mainContext: IMainContext,
heapService: ExtHostHeapService
) {
super();
this._proxy = mainContext.get(MainContext.MainThreadCommands);
this._converter = new CommandsConverter(this, heapService);
}

View File

@@ -33,7 +33,7 @@ type ConfigurationInspect<T> = {
workspaceFolderValue?: T;
};
export class ExtHostConfiguration extends ExtHostConfigurationShape {
export class ExtHostConfiguration implements ExtHostConfigurationShape {
private readonly _onDidChangeConfiguration = new Emitter<void>();
private readonly _proxy: MainThreadConfigurationShape;
@@ -41,7 +41,6 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
private _configuration: Configuration<any>;
constructor(proxy: MainThreadConfigurationShape, extHostWorkspace: ExtHostWorkspace, data: IConfigurationData<any>) {
super();
this._proxy = proxy;
this._extHostWorkspace = extHostWorkspace;
this._configuration = Configuration.parse(data, extHostWorkspace.workspace);

View File

@@ -7,12 +7,11 @@
import { MainContext, MainThreadCredentialsShape, ExtHostCredentialsShape, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
export class ExtHostCredentials extends ExtHostCredentialsShape {
export class ExtHostCredentials implements ExtHostCredentialsShape {
private _proxy: MainThreadCredentialsShape;
constructor(mainContext: IMainContext) {
super();
this._proxy = mainContext.get(MainContext.MainThreadCredentials);
};

View File

@@ -13,7 +13,7 @@ import * as vscode from 'vscode';
import URI from 'vs/base/common/uri';
export class ExtHostDebugService extends ExtHostDebugServiceShape {
export class ExtHostDebugService implements ExtHostDebugServiceShape {
private _debugServiceProxy: MainThreadDebugServiceShape;
private _debugSessions: Map<DebugSessionUUID, ExtHostDebugSession> = new Map<DebugSessionUUID, ExtHostDebugSession>();
@@ -35,8 +35,6 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
constructor(mainContext: IMainContext) {
super();
this._onDidStartDebugSession = new Emitter<vscode.DebugSession>();
this._onDidTerminateDebugSession = new Emitter<vscode.DebugSession>();
this._onDidChangeActiveDebugSession = new Emitter<vscode.DebugSession>();

View File

@@ -216,7 +216,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
}
}
export class ExtHostDiagnostics extends ExtHostDiagnosticsShape {
export class ExtHostDiagnostics implements ExtHostDiagnosticsShape {
private static _idPool: number = 0;
@@ -224,7 +224,6 @@ export class ExtHostDiagnostics extends ExtHostDiagnosticsShape {
private _collections: DiagnosticCollection[];
constructor(mainContext: IMainContext) {
super();
this._proxy = mainContext.get(MainContext.MainThreadDiagnostics);
this._collections = [];
}

View File

@@ -17,7 +17,7 @@ import { TextSource } from 'vs/editor/common/model/textSource';
import { MainContext, ExtHostDocumentContentProvidersShape, MainThreadDocumentContentProvidersShape } from './extHost.protocol';
import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors';
export class ExtHostDocumentContentProvider extends ExtHostDocumentContentProvidersShape {
export class ExtHostDocumentContentProvider implements ExtHostDocumentContentProvidersShape {
private static _handlePool = 0;
@@ -26,7 +26,6 @@ export class ExtHostDocumentContentProvider extends ExtHostDocumentContentProvid
private readonly _documentsAndEditors: ExtHostDocumentsAndEditors;
constructor(threadService: IThreadService, documentsAndEditors: ExtHostDocumentsAndEditors) {
super();
this._proxy = threadService.get(MainContext.MainThreadDocumentContentProviders);
this._documentsAndEditors = documentsAndEditors;
}

View File

@@ -18,7 +18,7 @@ import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments';
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
import * as vscode from 'vscode';
export class ExtHostDocumentSaveParticipant extends ExtHostDocumentSaveParticipantShape {
export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSaveParticipantShape {
private _documents: ExtHostDocuments;
private _workspace: MainThreadWorkspaceShape;
@@ -27,7 +27,6 @@ export class ExtHostDocumentSaveParticipant extends ExtHostDocumentSaveParticipa
private _thresholds: { timeout: number; errors: number; };
constructor(documents: ExtHostDocuments, workspace: MainThreadWorkspaceShape, thresholds: { timeout: number; errors: number; } = { timeout: 1500, errors: 3 }) {
super();
this._documents = documents;
this._workspace = workspace;
this._thresholds = thresholds;

View File

@@ -15,7 +15,7 @@ import { ExtHostDocumentData, setWordDefinitionFor } from './extHostDocumentData
import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors';
import { IModelChangedEvent } from 'vs/editor/common/model/mirrorModel';
export class ExtHostDocuments extends ExtHostDocumentsShape {
export class ExtHostDocuments implements ExtHostDocumentsShape {
private _onDidAddDocument = new Emitter<vscode.TextDocument>();
private _onDidRemoveDocument = new Emitter<vscode.TextDocument>();
@@ -33,7 +33,6 @@ export class ExtHostDocuments extends ExtHostDocumentsShape {
private _documentLoader = new Map<string, TPromise<ExtHostDocumentData>>();
constructor(mainContext: IMainContext, documentsAndEditors: ExtHostDocumentsAndEditors) {
super();
this._proxy = mainContext.get(MainContext.MainThreadDocuments);
this._documentsAndEditors = documentsAndEditors;

View File

@@ -12,7 +12,7 @@ import { ExtHostTextEditor } from './extHostTextEditor';
import * as assert from 'assert';
import * as typeConverters from './extHostTypeConverters';
export class ExtHostDocumentsAndEditors extends ExtHostDocumentsAndEditorsShape {
export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsShape {
private _activeEditorId: string;
private readonly _editors = new Map<string, ExtHostTextEditor>();
@@ -31,7 +31,6 @@ export class ExtHostDocumentsAndEditors extends ExtHostDocumentsAndEditorsShape
constructor(
private readonly _mainContext: IMainContext
) {
super();
}
$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void {

View File

@@ -87,12 +87,11 @@ class FileSystemWatcher implements _FileSystemWatcher {
}
}
export class ExtHostFileSystemEventService extends ExtHostFileSystemEventServiceShape {
export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServiceShape {
private _emitter = new Emitter<FileSystemEvents>();
constructor() {
super();
}
public createFileSystemWatcher(globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): _FileSystemWatcher {

View File

@@ -6,7 +6,7 @@
import { ExtHostHeapServiceShape } from './extHost.protocol';
export class ExtHostHeapService extends ExtHostHeapServiceShape {
export class ExtHostHeapService implements ExtHostHeapServiceShape {
private static _idPool = 0;

View File

@@ -723,7 +723,7 @@ type Adapter = OutlineAdapter | CodeLensAdapter | DefinitionAdapter | HoverAdapt
| RangeFormattingAdapter | OnTypeFormattingAdapter | NavigateTypeAdapter | RenameAdapter
| SuggestAdapter | SignatureHelpAdapter | LinkProviderAdapter | ImplementationAdapter | TypeDefinitionAdapter | ColorProviderAdapter;
export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
private static _handlePool: number = 0;
@@ -742,7 +742,6 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
heapMonitor: ExtHostHeapService,
diagnostics: ExtHostDiagnostics
) {
super();
this._proxy = mainContext.get(MainContext.MainThreadLanguageFeatures);
this._documents = documents;
this._commands = commands;

View File

@@ -12,14 +12,13 @@ import { MainContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, MyQuickPi
export type Item = string | QuickPickItem;
export class ExtHostQuickOpen extends ExtHostQuickOpenShape {
export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
private _proxy: MainThreadQuickOpenShape;
private _onDidSelectItem: (handle: number) => void;
private _validateInput: (input: string) => string;
constructor(mainContext: IMainContext) {
super();
this._proxy = mainContext.get(MainContext.MainThreadQuickOpen);
}

View File

@@ -395,14 +395,13 @@ interface HandlerData {
extension: IExtensionDescription;
}
export class ExtHostTask extends ExtHostTaskShape {
export class ExtHostTask implements ExtHostTaskShape {
private _proxy: MainThreadTaskShape;
private _handleCounter: number;
private _handlers: Map<number, HandlerData>;
constructor(mainContext: IMainContext) {
super();
this._proxy = mainContext.get(MainContext.MainThreadTask);
this._handleCounter = 0;
this._handlers = new Map<number, HandlerData>();

View File

@@ -16,7 +16,7 @@ import { Position as EditorPosition } from 'vs/platform/editor/common/editor';
import { MainContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData, IResolvedTextEditorConfiguration, ISelectionChangeEvent, IMainContext } from './extHost.protocol';
import * as vscode from 'vscode';
export class ExtHostEditors extends ExtHostEditorsShape {
export class ExtHostEditors implements ExtHostEditorsShape {
private readonly _onDidChangeTextEditorSelection = new Emitter<vscode.TextEditorSelectionChangeEvent>();
private readonly _onDidChangeTextEditorOptions = new Emitter<vscode.TextEditorOptionsChangeEvent>();
@@ -38,7 +38,6 @@ export class ExtHostEditors extends ExtHostEditorsShape {
mainContext: IMainContext,
extHostDocumentsAndEditors: ExtHostDocumentsAndEditors,
) {
super();
this._proxy = mainContext.get(MainContext.MainThreadEditors);
this._extHostDocumentsAndEditors = extHostDocumentsAndEditors;

View File

@@ -19,7 +19,7 @@ import { asWinJsPromise } from 'vs/base/common/async';
type TreeItemHandle = number;
export class ExtHostTreeViews extends ExtHostTreeViewsShape {
export class ExtHostTreeViews implements ExtHostTreeViewsShape {
private treeViews: Map<string, ExtHostTreeView<any>> = new Map<string, ExtHostTreeView<any>>();
@@ -27,7 +27,6 @@ export class ExtHostTreeViews extends ExtHostTreeViewsShape {
private _proxy: MainThreadTreeViewsShape,
private commands: ExtHostCommands
) {
super();
commands.registerArgumentProcessor({
processArgument: arg => {
if (arg && arg.$treeViewId && arg.$treeItemHandle) {

View File

@@ -65,7 +65,7 @@ class Workspace2 extends Workspace {
}
}
export class ExtHostWorkspace extends ExtHostWorkspaceShape {
export class ExtHostWorkspace implements ExtHostWorkspaceShape {
private static _requestIdPool = 0;
@@ -76,7 +76,6 @@ export class ExtHostWorkspace extends ExtHostWorkspaceShape {
readonly onDidChangeWorkspace: Event<vscode.WorkspaceFoldersChangeEvent> = this._onDidChangeWorkspace.event;
constructor(mainContext: IMainContext, data: IWorkspaceData) {
super();
this._proxy = mainContext.get(MainContext.MainThreadWorkspace);
this._workspace = Workspace2.fromData(data);
}