extHost.protocol.ts 24.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import {
	createMainContextProxyIdentifier as createMainId,
	createExtHostContextProxyIdentifier as createExtId,
10 11
	ProxyIdentifier, IThreadService
} from 'vs/workbench/services/thread/common/threadService';
12

13 14 15 16
import * as vscode from 'vscode';

import URI from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity';
17
import { TPromise } from 'vs/base/common/winjs.base';
18

19 20
import { IMarkerData } from 'vs/platform/markers/common/markers';
import { Position as EditorPosition } from 'vs/platform/editor/common/editor';
A
Alex Dima 已提交
21
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
22 23
import { StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry';
24
import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
25
import { IWorkspace } from 'vs/platform/workspace/common/workspace';
26 27 28

import * as editorCommon from 'vs/editor/common/editorCommon';
import * as modes from 'vs/editor/common/modes';
29
import { IResourceEdit } from 'vs/editor/common/services/bulkEdit';
A
Alex Dima 已提交
30
import { ITextSource } from 'vs/editor/common/model/textSource';
31

32
import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing';
33
import { IWorkspaceConfigurationValues } from 'vs/workbench/services/configuration/common/configuration';
34

J
Johannes Rieken 已提交
35
import { IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen';
36
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
J
Johannes Rieken 已提交
37
import { IApplyEditsOptions, IUndoStopOptions, TextEditorRevealType, ITextEditorConfigurationUpdate, IResolvedTextEditorConfiguration, ISelectionChangeEvent } from './mainThreadEditor';
38

P
Pine Wu 已提交
39
import { InternalTreeExplorerNodeContent } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel';
40
import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks';
A
Alex Dima 已提交
41
import { IModelChangedEvent } from 'vs/editor/common/model/mirrorModel';
A
Alex Dima 已提交
42
import { IPosition } from "vs/editor/common/core/position";
A
Alex Dima 已提交
43
import { IRange } from "vs/editor/common/core/range";
A
Alex Dima 已提交
44
import { ISelection } from "vs/editor/common/core/selection";
45

46
export interface IEnvironment {
47
	enableProposedApi: boolean;
48 49 50 51 52 53 54 55 56 57 58 59 60 61
	appSettingsHome: string;
	disableExtensions: boolean;
	userExtensionsHome: string;
	extensionDevelopmentPath: string;
	extensionTestsPath: string;
}

export interface IInitData {
	parentPid: number;
	environment: IEnvironment;
	contextService: {
		workspace: IWorkspace;
	};
	extensions: IExtensionDescription[];
62
	configuration: IWorkspaceConfigurationValues;
63
	telemetryInfo: ITelemetryInfo;
64 65
}

66
export interface InstanceSetter<T> {
67
	set<R extends T>(instance: T): R;
68 69 70
}

export class InstanceCollection {
71
	private _items: { [id: string]: any; };
72 73 74 75 76

	constructor() {
		this._items = Object.create(null);
	}

77
	public define<T>(id: ProxyIdentifier<T>): InstanceSetter<T> {
78 79
		let that = this;
		return new class {
80
			set(value: T) {
81 82 83 84 85 86
				that._set(id, value);
				return value;
			}
		};
	}

87
	_set<T>(id: ProxyIdentifier<T>, value: T): void {
88 89 90
		this._items[id.id] = value;
	}

91
	public finish(isMain: boolean, threadService: IThreadService): void {
92 93 94 95 96 97 98 99 100 101 102 103
		let expected = (isMain ? MainContext : ExtHostContext);
		Object.keys(expected).forEach((key) => {
			let id = expected[key];
			let value = this._items[id.id];

			if (!value) {
				throw new Error(`Missing actor ${key} (isMain: ${id.isMain}, id:  ${id.id})`);
			}
			threadService.set<any>(id, value);
		});
	}
}
104 105 106 107 108 109 110

function ni() { return new Error('Not implemented'); }

// --- main thread

export abstract class MainThreadCommandsShape {
	$registerCommand(id: string): TPromise<any> { throw ni(); }
J
Johannes Rieken 已提交
111
	$unregisterCommand(id: string): TPromise<any> { throw ni(); }
112 113 114 115
	$executeCommand<T>(id: string, args: any[]): Thenable<T> { throw ni(); }
	$getCommands(): Thenable<string[]> { throw ni(); }
}

116
export abstract class MainThreadConfigurationShape {
117
	$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise<void> { throw ni(); }
118
	$removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise<void> { throw ni(); }
119 120
}

121 122 123 124 125 126
export abstract class MainThreadDiagnosticsShape {
	$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any> { throw ni(); }
	$clear(owner: string): TPromise<any> { throw ni(); }
}

export abstract class MainThreadDocumentsShape {
127
	$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); }
128
	$tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
129
	$registerTextContentProvider(handle: number, scheme: string): void { throw ni(); }
A
Alex Dima 已提交
130
	$onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); }
131
	$unregisterTextContentProvider(handle: number): void { throw ni(); }
132
	$trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); }
133 134 135
}

export abstract class MainThreadEditorsShape {
136 137 138 139 140 141 142
	$tryShowTextDocument(resource: URI, position: EditorPosition, preserveFocus: boolean): 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(); }
A
Alex Dima 已提交
143
	$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); }
A
Alex Dima 已提交
144
	$trySetSelections(id: string, selections: ISelection[]): TPromise<any> { throw ni(); }
145
	$tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean> { throw ni(); }
A
Alex Dima 已提交
146
	$tryInsertSnippet(id: string, template: string, selections: IRange[], opts: IUndoStopOptions): TPromise<any> { throw ni(); }
147
	$getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]> { throw ni(); }
148 149
}

150
export abstract class MainThreadTreeExplorersShape {
151
	$registerTreeExplorerNodeProvider(providerId: string): void { throw ni(); }
152 153
}

154 155 156 157 158 159 160
export abstract class MainThreadErrorsShape {
	onUnexpectedExtHostError(err: any): void { throw ni(); }
}

export abstract class MainThreadLanguageFeaturesShape {
	$unregister(handle: number): TPromise<any> { throw ni(); }
	$registerOutlineSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
161 162
	$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any> { throw ni(); }
	$emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any> { throw ni(); }
163
	$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
164
	$registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
165
	$registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
166 167 168 169 170 171 172 173 174 175 176
	$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(); }
J
Johannes Rieken 已提交
177
	$registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
178
	$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); }
179 180 181
}

export abstract class MainThreadLanguagesShape {
182
	$getLanguages(): TPromise<string[]> { throw ni(); }
183 184 185
}

export abstract class MainThreadMessageServiceShape {
J
Joao Moreno 已提交
186
	$showMessage(severity: Severity, message: string, options: vscode.MessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number> { throw ni(); }
187 188 189
}

export abstract class MainThreadOutputServiceShape {
190 191
	$append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); }
	$clear(channelId: string, label: string): TPromise<void> { throw ni(); }
192
	$dispose(channelId: string, label: string): TPromise<void> { throw ni(); }
193 194
	$reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); }
	$close(channelId: string): TPromise<void> { throw ni(); }
195 196
}

197
export abstract class MainThreadProgressShape {
198 199 200

	$startWindow(handle: number, title: string): void { throw ni(); };
	$startScm(handle: number): void { throw ni(); };
201
	$progressReport(handle: number, message: string): void { throw ni(); }
202
	$progressEnd(handle: number): void { throw ni(); }
203 204
}

D
Daniel Imms 已提交
205
export abstract class MainThreadTerminalServiceShape {
206
	$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> { throw ni(); }
D
Daniel Imms 已提交
207 208
	$dispose(terminalId: number): void { throw ni(); }
	$hide(terminalId: number): void { throw ni(); }
D
Daniel Imms 已提交
209
	$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }
D
Daniel Imms 已提交
210
	$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
D
Daniel Imms 已提交
211
	$registerOnData(terminalId: number): void { throw ni(); }
D
Daniel Imms 已提交
212 213
}

214 215 216 217 218 219 220
export interface MyQuickPickItems extends IPickOpenEntry {
	handle: number;
}
export abstract class MainThreadQuickOpenShape {
	$show(options: IPickOptions): Thenable<number> { throw ni(); }
	$setItems(items: MyQuickPickItems[]): Thenable<any> { throw ni(); }
	$setError(error: Error): Thenable<any> { throw ni(); }
221
	$input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string> { throw ni(); }
222 223 224
}

export abstract class MainThreadStatusBarShape {
225
	$setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); }
226
	$dispose(id: number) { throw ni(); }
227 228 229
}

export abstract class MainThreadStorageShape {
230 231
	$getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); }
	$setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); }
232 233 234 235 236 237 238 239 240 241 242 243 244 245
}

export abstract class MainThreadTelemetryShape {
	$publicLog(eventName: string, data?: any): void { throw ni(); }
	$getTelemetryInfo(): TPromise<ITelemetryInfo> { throw ni(); }
}

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(); }
}

246 247 248 249 250
export abstract class MainThreadTaskShape {
	$registerTaskProvider(handle: number): TPromise<any> { throw ni(); }
	$unregisterTaskProvider(handle: number): TPromise<any> { throw ni(); }
}

251
export abstract class MainProcessExtensionServiceShape {
A
Alex Dima 已提交
252 253 254
	$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
	$onExtensionActivated(extensionId: string): void { throw ni(); }
	$onExtensionActivationFailed(extensionId: string): void { throw ni(); }
255 256
}

J
Joao Moreno 已提交
257
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
258 259
	hasQuickDiffProvider?: boolean;
	count?: number;
260 261 262
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
	statusBarCommands?: modes.Command[];
J
Joao Moreno 已提交
263 264 265 266
}

export interface SCMGroupFeatures {
	hideWhenEmpty?: boolean;
J
Joao Moreno 已提交
267 268
}

J
Joao Moreno 已提交
269
export type SCMRawResource = [
270
	number /*handle*/,
J
Joao Moreno 已提交
271 272
	string /*resourceUri*/,
	modes.Command /*command*/,
J
Joao Moreno 已提交
273 274 275
	string[] /*icons: light, dark*/,
	boolean /*strike through*/
];
276

J
Joao Moreno 已提交
277
export abstract class MainThreadSCMShape {
J
Joao Moreno 已提交
278 279 280 281 282 283 284 285 286
	$registerSourceControl(handle: number, id: string, label: string): void { throw ni(); }
	$updateSourceControl(handle: number, features: SCMProviderFeatures): void { throw ni(); }
	$unregisterSourceControl(handle: number): void { throw ni(); }

	$registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void { throw ni(); }
	$updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void { throw ni(); }
	$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); }
	$unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); }

287
	$setInputBoxValue(value: string): void { throw ni(); }
J
Joao Moreno 已提交
288 289
}

290 291 292 293 294 295 296 297
// -- 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 abstract class ExtHostConfigurationShape {
298
	$acceptConfigurationChanged(values: IWorkspaceConfigurationValues) { throw ni(); }
299 300 301 302 303 304 305 306 307
}

export abstract class ExtHostDiagnosticsShape {

}

export interface IModelAddedData {
	url: URI;
	versionId: number;
308 309
	lines: string[];
	EOL: string;
310 311 312 313 314
	modeId: string;
	isDirty: boolean;
}
export abstract class ExtHostDocumentsShape {
	$provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); }
315 316 317 318
	$acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); }
	$acceptModelSaved(strURL: string): void { throw ni(); }
	$acceptModelDirty(strURL: string): void { throw ni(); }
	$acceptModelReverted(strURL: string): void { throw ni(); }
319
	$acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); }
320 321
}

322
export abstract class ExtHostDocumentSaveParticipantShape {
323
	$participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]> { throw ni(); }
324 325
}

326 327 328 329
export interface ITextEditorAddData {
	id: string;
	document: URI;
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
330
	selections: ISelection[];
331 332 333 334 335 336
	editorPosition: EditorPosition;
}
export interface ITextEditorPositionData {
	[id: string]: EditorPosition;
}
export abstract class ExtHostEditorsShape {
337
	$acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); }
338
	$acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void { throw ni(); }
339
	$acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); }
340 341
}

J
Johannes Rieken 已提交
342 343 344 345 346 347 348 349 350 351 352 353 354
export interface IDocumentsAndEditorsDelta {
	removedDocuments?: string[];
	addedDocuments?: IModelAddedData[];
	removedEditors?: string[];
	addedEditors?: ITextEditorAddData[];
	newActiveEditor?: string;
}

export abstract class ExtHostDocumentsAndEditorsShape {
	$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void { throw ni(); }
}


355
export abstract class ExtHostTreeExplorersShape {
P
Pine Wu 已提交
356 357 358
	$provideRootNode(providerId: string): TPromise<InternalTreeExplorerNodeContent> { throw ni(); };
	$resolveChildren(providerId: string, node: InternalTreeExplorerNodeContent): TPromise<InternalTreeExplorerNodeContent[]> { throw ni(); }
	$getInternalCommand(providerId: string, node: InternalTreeExplorerNodeContent): TPromise<modes.Command> { throw ni(); }
359 360
}

361 362 363 364 365 366 367 368 369 370 371
export abstract class ExtHostExtensionServiceShape {
	$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
	$activateExtension(extensionDescription: IExtensionDescription): TPromise<void> { throw ni(); }
}

export interface FileSystemEvents {
	created: URI[];
	changed: URI[];
	deleted: URI[];
}
export abstract class ExtHostFileSystemEventServiceShape {
372
	$onFileEvent(events: FileSystemEvents) { throw ni(); }
373 374
}

J
Johannes Rieken 已提交
375 376 377 378 379
export interface ObjectIdentifier {
	$ident: number;
}

export namespace ObjectIdentifier {
380
	export const name = '$ident';
J
Johannes Rieken 已提交
381
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
382
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
383 384
		return <T & ObjectIdentifier>obj;
	}
385 386
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
387 388 389
	}
}

J
Johannes Rieken 已提交
390
export abstract class ExtHostHeapServiceShape {
391 392 393
	$onGarbageCollection(ids: number[]): void { throw ni(); }
}

394 395 396 397
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(); }
A
Alex Dima 已提交
398 399 400 401 402 403
	$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(); }
A
Alex Dima 已提交
404
	$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]> { throw ni(); }
405
	$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
406
	$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
407
	$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
408 409
	$provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]> { throw ni(); }
	$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation> { throw ni(); }
A
Alex Dima 已提交
410 411 412 413
	$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(); }
414 415
	$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> { throw ni(); }
	$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> { throw ni(); }
416 417 418 419 420 421 422
}

export abstract class ExtHostQuickOpenShape {
	$onItemSelected(handle: number): void { throw ni(); }
	$validateInput(input: string): TPromise<string> { throw ni(); }
}

423 424
export abstract class ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void { throw ni(); }
425
	$acceptTerminalProcessId(id: number, processId: number): void { throw ni(); }
D
Daniel Imms 已提交
426
	$acceptTerminalData(id: number, data: string): void { throw ni(); }
427 428
}

J
Joao Moreno 已提交
429
export abstract class ExtHostSCMShape {
J
Joao Moreno 已提交
430 431
	$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> { throw ni(); }
	$onActiveSourceControlChange(sourceControlHandle: number): TPromise<void> { throw ni(); }
432
	$onInputBoxValueChange(value: string): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
433
	$onInputBoxAcceptChanges(): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
434 435
}

436 437 438 439
export abstract class ExtHostTaskShape {
	$provideTasks(handle: number): TPromise<TaskSet> { throw ni(); }
}

440 441 442 443
// --- proxy identifiers

export const MainContext = {
	MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape),
444
	MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape),
445 446 447 448
	MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape),
	MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape),
	MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape),
	MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape),
449
	MainThreadExplorers: createMainId<MainThreadTreeExplorersShape>('MainThreadExplorers', MainThreadTreeExplorersShape),
450 451 452 453
	MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape),
	MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape),
	MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape),
	MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape),
454
	MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress', MainThreadProgressShape),
455 456 457 458
	MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape),
	MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape),
	MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape),
	MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape),
D
Daniel Imms 已提交
459
	MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService', MainThreadTerminalServiceShape),
460 461
	MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape),
	MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape),
462 463
	MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', MainThreadSCMShape),
	MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', MainThreadTaskShape)
464 465 466 467 468 469
};

export const ExtHostContext = {
	ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape),
	ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape),
	ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape),
J
Johannes Rieken 已提交
470
	ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape),
471
	ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape),
472
	ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape),
473
	ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape),
474
	ExtHostExplorers: createExtId<ExtHostTreeExplorersShape>('ExtHostExplorers', ExtHostTreeExplorersShape),
475
	ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape),
J
Johannes Rieken 已提交
476
	ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor', ExtHostHeapServiceShape),
477 478 479
	ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape),
	ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape),
	ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape),
J
Joao Moreno 已提交
480
	ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService', ExtHostTerminalServiceShape),
481 482
	ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ExtHostSCMShape),
	ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ExtHostTaskShape)
483
};