extHost.protocol.ts 25.4 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';
J
Johannes Rieken 已提交
26
import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress';
27 28 29

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

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

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

S
Sandeep Somavarapu 已提交
40
import { InternalTreeNodeContent } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel';
41
import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks';
A
Alex Dima 已提交
42
import { IModelChangedEvent } from 'vs/editor/common/model/mirrorModel';
43 44 45
import { IPosition } from 'vs/editor/common/core/position';
import { IRange } from 'vs/editor/common/core/range';
import { ISelection } from 'vs/editor/common/core/selection';
46

47
export interface IEnvironment {
48 49
	enableProposedApiForAll: boolean;
	enableProposedApiFor: string | string[];
50 51 52 53 54 55 56 57 58 59 60 61 62 63
	appSettingsHome: string;
	disableExtensions: boolean;
	userExtensionsHome: string;
	extensionDevelopmentPath: string;
	extensionTestsPath: string;
}

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

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

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

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

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

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

93
	public finish(isMain: boolean, threadService: IThreadService): void {
94 95 96 97 98 99 100 101 102 103 104 105
		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);
		});
	}
}
106 107 108 109 110 111 112

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

// --- main thread

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

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

123 124 125 126 127 128
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 {
129
	$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); }
130
	$tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
131
	$registerTextContentProvider(handle: number, scheme: string): void { throw ni(); }
A
Alex Dima 已提交
132
	$onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); }
133
	$unregisterTextContentProvider(handle: number): void { throw ni(); }
134
	$trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); }
135 136
}

137 138 139 140 141 142
export interface ITextDocumentShowOptions {
	position?: EditorPosition;
	preserveFocus?: boolean;
	pinned?: boolean;
}

143
export abstract class MainThreadEditorsShape {
144
	$tryShowTextDocument(resource: URI, options: ITextDocumentShowOptions): TPromise<string> { throw ni(); }
145 146 147 148 149 150
	$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 已提交
151
	$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); }
A
Alex Dima 已提交
152
	$trySetSelections(id: string, selections: ISelection[]): TPromise<any> { throw ni(); }
153
	$tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean> { throw ni(); }
A
Alex Dima 已提交
154
	$tryInsertSnippet(id: string, template: string, selections: IRange[], opts: IUndoStopOptions): TPromise<any> { throw ni(); }
155
	$getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]> { throw ni(); }
156 157
}

S
Sandeep Somavarapu 已提交
158 159 160
export abstract class MainThreadTreeViewShape {
	$registerTreeDataProvider(providerId: string): void { throw ni(); }
	$refresh(providerId: string, node: InternalTreeNodeContent): void { throw ni(); }
S
Sandeep Somavarapu 已提交
161 162 163
}

export abstract class MainThreadTreeShape {
S
Sandeep Somavarapu 已提交
164 165
	$registerTreeExplorerNodeProvider(providerId: string, node: InternalTreeNodeContent): void { throw ni(); }
	$refresh(providerId: string, node: InternalTreeNodeContent): void { throw ni(); }
166 167
}

168 169 170 171 172 173 174
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(); }
175 176
	$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any> { throw ni(); }
	$emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any> { throw ni(); }
177
	$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
178
	$registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
179
	$registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
180 181 182 183 184 185 186 187 188 189 190
	$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 已提交
191
	$registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
192
	$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); }
193 194 195
}

export abstract class MainThreadLanguagesShape {
196
	$getLanguages(): TPromise<string[]> { throw ni(); }
197 198 199
}

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

export abstract class MainThreadOutputServiceShape {
204 205
	$append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); }
	$clear(channelId: string, label: string): TPromise<void> { throw ni(); }
206
	$dispose(channelId: string, label: string): TPromise<void> { throw ni(); }
207 208
	$reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); }
	$close(channelId: string): TPromise<void> { throw ni(); }
209 210
}

211
export abstract class MainThreadProgressShape {
212

J
Johannes Rieken 已提交
213 214
	$startProgress(handle: number, options: IProgressOptions): void { throw ni(); };
	$progressReport(handle: number, message: IProgressStep): void { throw ni(); }
215
	$progressEnd(handle: number): void { throw ni(); }
216 217
}

D
Daniel Imms 已提交
218
export abstract class MainThreadTerminalServiceShape {
219
	$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> { throw ni(); }
D
Daniel Imms 已提交
220 221
	$dispose(terminalId: number): void { throw ni(); }
	$hide(terminalId: number): void { throw ni(); }
D
Daniel Imms 已提交
222
	$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }
D
Daniel Imms 已提交
223
	$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
D
Daniel Imms 已提交
224
	$registerOnData(terminalId: number): void { throw ni(); }
D
Daniel Imms 已提交
225 226
}

227 228 229 230 231 232 233
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(); }
234
	$input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string> { throw ni(); }
235 236 237
}

export abstract class MainThreadStatusBarShape {
238
	$setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); }
239
	$dispose(id: number) { throw ni(); }
240 241 242
}

export abstract class MainThreadStorageShape {
243 244
	$getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); }
	$setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); }
245 246 247 248 249 250 251 252 253 254 255 256 257 258
}

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

259 260 261 262 263
export abstract class MainThreadTaskShape {
	$registerTaskProvider(handle: number): TPromise<any> { throw ni(); }
	$unregisterTaskProvider(handle: number): TPromise<any> { throw ni(); }
}

264
export abstract class MainProcessExtensionServiceShape {
A
Alex Dima 已提交
265 266 267
	$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
	$onExtensionActivated(extensionId: string): void { throw ni(); }
	$onExtensionActivationFailed(extensionId: string): void { throw ni(); }
268 269
}

J
Joao Moreno 已提交
270
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
271 272
	hasQuickDiffProvider?: boolean;
	count?: number;
273 274 275
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
	statusBarCommands?: modes.Command[];
J
Joao Moreno 已提交
276 277 278 279
}

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

J
Joao Moreno 已提交
282
export type SCMRawResource = [
283
	number /*handle*/,
J
Joao Moreno 已提交
284 285
	string /*resourceUri*/,
	modes.Command /*command*/,
J
Joao Moreno 已提交
286 287 288
	string[] /*icons: light, dark*/,
	boolean /*strike through*/
];
289

J
Joao Moreno 已提交
290
export abstract class MainThreadSCMShape {
J
Joao Moreno 已提交
291 292 293 294 295 296 297 298 299
	$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(); }

300
	$setInputBoxValue(value: string): void { throw ni(); }
J
Joao Moreno 已提交
301 302
}

303 304 305 306 307 308 309 310
// -- 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 {
311
	$acceptConfigurationChanged(values: IWorkspaceConfigurationValues) { throw ni(); }
312 313 314 315 316 317 318 319 320
}

export abstract class ExtHostDiagnosticsShape {

}

export interface IModelAddedData {
	url: URI;
	versionId: number;
321 322
	lines: string[];
	EOL: string;
323 324 325 326 327
	modeId: string;
	isDirty: boolean;
}
export abstract class ExtHostDocumentsShape {
	$provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); }
328 329 330 331
	$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(); }
332
	$acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); }
333 334
}

335
export abstract class ExtHostDocumentSaveParticipantShape {
336
	$participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]> { throw ni(); }
337 338
}

339 340 341 342
export interface ITextEditorAddData {
	id: string;
	document: URI;
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
343
	selections: ISelection[];
344 345 346 347 348 349
	editorPosition: EditorPosition;
}
export interface ITextEditorPositionData {
	[id: string]: EditorPosition;
}
export abstract class ExtHostEditorsShape {
350
	$acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); }
351
	$acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void { throw ni(); }
352
	$acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); }
353 354
}

J
Johannes Rieken 已提交
355 356 357 358 359 360 361 362 363 364 365 366 367
export interface IDocumentsAndEditorsDelta {
	removedDocuments?: string[];
	addedDocuments?: IModelAddedData[];
	removedEditors?: string[];
	addedEditors?: ITextEditorAddData[];
	newActiveEditor?: string;
}

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


S
Sandeep Somavarapu 已提交
368 369 370 371
export abstract class ExtHostTreeViewShape {
	$provideRootNode(providerId: string): TPromise<InternalTreeNodeContent> { throw ni(); };
	$resolveChildren(providerId: string, node: InternalTreeNodeContent): TPromise<InternalTreeNodeContent[]> { throw ni(); }
	$getInternalCommand(providerId: string, node: InternalTreeNodeContent): TPromise<modes.Command> { throw ni(); }
372 373
}

S
Sandeep Somavarapu 已提交
374
export abstract class ExtHostTreeShape {
S
Sandeep Somavarapu 已提交
375 376
	$resolveChildren(providerId: string, node: InternalTreeNodeContent): TPromise<InternalTreeNodeContent[]> { throw ni(); }
	$getInternalCommand(providerId: string, node: InternalTreeNodeContent): TPromise<modes.Command> { throw ni(); }
S
Sandeep Somavarapu 已提交
377 378
}

379 380 381 382 383 384 385 386 387 388 389
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 {
390
	$onFileEvent(events: FileSystemEvents) { throw ni(); }
391 392
}

J
Johannes Rieken 已提交
393 394 395 396 397
export interface ObjectIdentifier {
	$ident: number;
}

export namespace ObjectIdentifier {
398
	export const name = '$ident';
J
Johannes Rieken 已提交
399
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
400
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
401 402
		return <T & ObjectIdentifier>obj;
	}
403 404
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
405 406 407
	}
}

J
Johannes Rieken 已提交
408
export abstract class ExtHostHeapServiceShape {
409 410 411
	$onGarbageCollection(ids: number[]): void { throw ni(); }
}

412 413 414 415
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 已提交
416 417 418 419 420 421
	$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 已提交
422
	$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]> { throw ni(); }
423
	$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
424
	$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
425
	$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
426 427
	$provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]> { throw ni(); }
	$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation> { throw ni(); }
A
Alex Dima 已提交
428 429 430 431
	$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(); }
432 433
	$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> { throw ni(); }
	$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> { throw ni(); }
434 435 436 437 438 439 440
}

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

441 442
export abstract class ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void { throw ni(); }
443
	$acceptTerminalProcessId(id: number, processId: number): void { throw ni(); }
D
Daniel Imms 已提交
444
	$acceptTerminalData(id: number, data: string): void { throw ni(); }
445 446
}

J
Joao Moreno 已提交
447
export abstract class ExtHostSCMShape {
J
Joao Moreno 已提交
448 449
	$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> { throw ni(); }
	$onActiveSourceControlChange(sourceControlHandle: number): TPromise<void> { throw ni(); }
450
	$onInputBoxValueChange(value: string): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
451
	$onInputBoxAcceptChanges(): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
452 453
}

454 455 456 457
export abstract class ExtHostTaskShape {
	$provideTasks(handle: number): TPromise<TaskSet> { throw ni(); }
}

458 459 460 461
// --- proxy identifiers

export const MainContext = {
	MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape),
462
	MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape),
463 464 465 466
	MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape),
	MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape),
	MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape),
	MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape),
S
Sandeep Somavarapu 已提交
467
	MainThreadExplorers: createMainId<MainThreadTreeViewShape>('MainThreadTreeView', MainThreadTreeViewShape),
468 469 470 471
	MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape),
	MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape),
	MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape),
	MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape),
472
	MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress', MainThreadProgressShape),
473 474 475 476
	MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape),
	MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape),
	MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape),
	MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape),
D
Daniel Imms 已提交
477
	MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService', MainThreadTerminalServiceShape),
478 479
	MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape),
	MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape),
480 481
	MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', MainThreadSCMShape),
	MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', MainThreadTaskShape)
482 483 484 485 486 487
};

export const ExtHostContext = {
	ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape),
	ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape),
	ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape),
J
Johannes Rieken 已提交
488
	ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape),
489
	ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape),
490
	ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape),
491
	ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape),
S
Sandeep Somavarapu 已提交
492
	ExtHostTreeView: createExtId<ExtHostTreeViewShape>('ExtHostTreeView', ExtHostTreeViewShape),
493
	ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape),
J
Johannes Rieken 已提交
494
	ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor', ExtHostHeapServiceShape),
495 496 497
	ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape),
	ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape),
	ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape),
J
Joao Moreno 已提交
498
	ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService', ExtHostTerminalServiceShape),
499 500
	ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ExtHostSCMShape),
	ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ExtHostTaskShape)
501
};