extHost.protocol.ts 27.3 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';
J
Johannes Rieken 已提交
25
import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress';
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 { IConfigurationData } from 'vs/platform/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';
37 38 39
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
import { EndOfLine, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes';

40

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

S
Sandeep Somavarapu 已提交
47
import { ITreeItem } from 'vs/workbench/parts/views/common/views';
B
Benjamin Pasero 已提交
48
import { ThemeColor } from 'vs/platform/theme/common/themeService';
S
Sandeep Somavarapu 已提交
49

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

60 61
export interface IWorkspaceData {
	id: string;
62
	name: string;
63 64 65
	roots: URI[];
}

66 67 68
export interface IInitData {
	parentPid: number;
	environment: IEnvironment;
69
	workspace: IWorkspaceData;
70
	extensions: IExtensionDescription[];
71
	configuration: IConfigurationData<any>;
72
	telemetryInfo: ITelemetryInfo;
73 74
}

75
export interface InstanceSetter<T> {
76
	set<R extends T>(instance: T): R;
77 78 79
}

export class InstanceCollection {
80
	private _items: { [id: string]: any; };
81 82 83 84 85

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

86
	public define<T>(id: ProxyIdentifier<T>): InstanceSetter<T> {
87 88
		let that = this;
		return new class {
89
			set<R extends T>(value: T): R {
90
				that._set(id, value);
91
				return <R>value;
92 93 94 95
			}
		};
	}

96
	_set<T>(id: ProxyIdentifier<T>, value: T): void {
97 98 99
		this._items[id.id] = value;
	}

100
	public finish(isMain: boolean, threadService: IThreadService): void {
101 102 103 104 105 106 107 108 109 110 111 112
		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);
		});
	}
}
113 114 115 116 117 118 119

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

// --- main thread

export abstract class MainThreadCommandsShape {
	$registerCommand(id: string): TPromise<any> { throw ni(); }
J
Johannes Rieken 已提交
120
	$unregisterCommand(id: string): TPromise<any> { throw ni(); }
121 122 123 124
	$executeCommand<T>(id: string, args: any[]): Thenable<T> { throw ni(); }
	$getCommands(): Thenable<string[]> { throw ni(); }
}

125
export abstract class MainThreadConfigurationShape {
126
	$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise<void> { throw ni(); }
127
	$removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise<void> { throw ni(); }
128 129
}

130 131 132 133 134 135
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 {
136
	$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); }
137
	$tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
138
	$registerTextContentProvider(handle: number, scheme: string): void { throw ni(); }
A
Alex Dima 已提交
139
	$onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); }
140
	$unregisterTextContentProvider(handle: number): void { throw ni(); }
141
	$trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); }
142 143
}

144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181

export interface ISelectionChangeEvent {
	selections: Selection[];
	source?: string;
}

export interface ITextEditorConfigurationUpdate {
	tabSize?: number | 'auto';
	insertSpaces?: boolean | 'auto';
	cursorStyle?: TextEditorCursorStyle;
	lineNumbers?: TextEditorLineNumbersStyle;
}

export interface IResolvedTextEditorConfiguration {
	tabSize: number;
	insertSpaces: boolean;
	cursorStyle: TextEditorCursorStyle;
	lineNumbers: TextEditorLineNumbersStyle;
}

export enum TextEditorRevealType {
	Default = 0,
	InCenter = 1,
	InCenterIfOutsideViewport = 2,
	AtTop = 3
}

export interface IUndoStopOptions {
	undoStopBefore: boolean;
	undoStopAfter: boolean;
}

export interface IApplyEditsOptions extends IUndoStopOptions {
	setEndOfLine: EndOfLine;
}



182 183 184 185
export interface ITextDocumentShowOptions {
	position?: EditorPosition;
	preserveFocus?: boolean;
	pinned?: boolean;
186
	selection?: IRange;
187 188
}

189
export abstract class MainThreadEditorsShape {
190
	$tryShowTextDocument(resource: URI, options: ITextDocumentShowOptions): TPromise<string> { throw ni(); }
191 192 193 194 195 196
	$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 已提交
197
	$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); }
A
Alex Dima 已提交
198
	$trySetSelections(id: string, selections: ISelection[]): TPromise<any> { throw ni(); }
199
	$tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean> { throw ni(); }
A
Alex Dima 已提交
200
	$tryInsertSnippet(id: string, template: string, selections: IRange[], opts: IUndoStopOptions): TPromise<any> { throw ni(); }
201
	$getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]> { throw ni(); }
202 203
}

S
Sandeep Somavarapu 已提交
204 205 206
export abstract class MainThreadTreeViewsShape {
	$registerView(treeViewId: string): void { throw ni(); }
	$refresh(treeViewId: string, treeItemHandle?: number): void { throw ni(); }
207 208
}

209 210 211 212 213 214 215
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(); }
216 217
	$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any> { throw ni(); }
	$emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any> { throw ni(); }
218
	$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
219
	$registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
220
	$registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
221 222 223 224 225 226 227 228 229 230 231
	$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 已提交
232
	$registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
233
	$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); }
234 235 236
}

export abstract class MainThreadLanguagesShape {
237
	$getLanguages(): TPromise<string[]> { throw ni(); }
238 239 240
}

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

export abstract class MainThreadOutputServiceShape {
245 246
	$append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); }
	$clear(channelId: string, label: string): TPromise<void> { throw ni(); }
247
	$dispose(channelId: string, label: string): TPromise<void> { throw ni(); }
248 249
	$reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); }
	$close(channelId: string): TPromise<void> { throw ni(); }
250 251
}

252
export abstract class MainThreadProgressShape {
253

J
Johannes Rieken 已提交
254 255
	$startProgress(handle: number, options: IProgressOptions): void { throw ni(); };
	$progressReport(handle: number, message: IProgressStep): void { throw ni(); }
256
	$progressEnd(handle: number): void { throw ni(); }
257 258
}

D
Daniel Imms 已提交
259
export abstract class MainThreadTerminalServiceShape {
260
	$createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> { throw ni(); }
D
Daniel Imms 已提交
261 262
	$dispose(terminalId: number): void { throw ni(); }
	$hide(terminalId: number): void { throw ni(); }
D
Daniel Imms 已提交
263
	$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }
D
Daniel Imms 已提交
264
	$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
D
Daniel Imms 已提交
265 266
}

267 268 269 270
export interface MyQuickPickItems extends IPickOpenEntry {
	handle: number;
}
export abstract class MainThreadQuickOpenShape {
J
Johannes Rieken 已提交
271 272 273
	$show(options: IPickOptions): TPromise<number> { throw ni(); }
	$setItems(items: MyQuickPickItems[]): TPromise<any> { throw ni(); }
	$setError(error: Error): TPromise<any> { throw ni(); }
274
	$input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string> { throw ni(); }
275 276 277
}

export abstract class MainThreadStatusBarShape {
278
	$setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); }
279
	$dispose(id: number) { throw ni(); }
280 281 282
}

export abstract class MainThreadStorageShape {
283 284
	$getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); }
	$setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); }
285 286 287 288 289 290 291 292 293 294 295 296 297 298
}

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

299 300 301 302 303
export abstract class MainThreadTaskShape {
	$registerTaskProvider(handle: number): TPromise<any> { throw ni(); }
	$unregisterTaskProvider(handle: number): TPromise<any> { throw ni(); }
}

304
export abstract class MainProcessExtensionServiceShape {
A
Alex Dima 已提交
305 306 307
	$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
	$onExtensionActivated(extensionId: string): void { throw ni(); }
	$onExtensionActivationFailed(extensionId: string): void { throw ni(); }
308 309
}

J
Joao Moreno 已提交
310
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
311 312
	hasQuickDiffProvider?: boolean;
	count?: number;
313 314 315
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
	statusBarCommands?: modes.Command[];
J
Joao Moreno 已提交
316 317 318 319
}

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

J
Joao Moreno 已提交
322
export type SCMRawResource = [
323
	number /*handle*/,
J
Joao Moreno 已提交
324 325
	string /*resourceUri*/,
	modes.Command /*command*/,
J
Joao Moreno 已提交
326
	string[] /*icons: light, dark*/,
327 328
	boolean /*strike through*/,
	boolean /*faded*/
J
Joao Moreno 已提交
329
];
330

J
Joao Moreno 已提交
331
export abstract class MainThreadSCMShape {
J
Joao Moreno 已提交
332 333 334 335 336 337
	$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(); }
338
	$updateGroupLabel(sourceControlHandle: number, handle: number, label: string): void { throw ni(); }
J
Joao Moreno 已提交
339 340 341
	$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); }
	$unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); }

342
	$setInputBoxValue(value: string): void { throw ni(); }
J
Joao Moreno 已提交
343 344
}

345 346 347
export type DebugSessionUUID = string;

export abstract class MainThreadDebugServiceShape {
348
	$startDebugging(nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
349
	$startDebugSession(config: vscode.DebugConfiguration): TPromise<DebugSessionUUID> { throw ni(); }
350 351 352
	$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise<any> { throw ni(); }
}

C
Christof Marti 已提交
353 354 355 356 357 358
export abstract class MainThreadCredentialsShape {
	$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(); }
}

359 360 361 362 363 364 365 366
// -- 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 {
367
	$acceptConfigurationChanged(data: IConfigurationData<any>) { throw ni(); }
368 369 370 371 372 373 374 375 376
}

export abstract class ExtHostDiagnosticsShape {

}

export interface IModelAddedData {
	url: URI;
	versionId: number;
377 378
	lines: string[];
	EOL: string;
379 380 381 382 383
	modeId: string;
	isDirty: boolean;
}
export abstract class ExtHostDocumentsShape {
	$provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); }
384 385
	$acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); }
	$acceptModelSaved(strURL: string): void { throw ni(); }
J
Johannes Rieken 已提交
386
	$acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { throw ni(); }
387
	$acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); }
388 389
}

390
export abstract class ExtHostDocumentSaveParticipantShape {
391
	$participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]> { throw ni(); }
392 393
}

394 395 396 397
export interface ITextEditorAddData {
	id: string;
	document: URI;
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
398
	selections: ISelection[];
399 400 401 402 403 404
	editorPosition: EditorPosition;
}
export interface ITextEditorPositionData {
	[id: string]: EditorPosition;
}
export abstract class ExtHostEditorsShape {
405
	$acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); }
406
	$acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void { throw ni(); }
407
	$acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); }
408 409
}

J
Johannes Rieken 已提交
410 411 412 413 414 415 416 417 418 419 420 421
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 已提交
422
export abstract class ExtHostTreeViewsShape {
S
Sandeep Somavarapu 已提交
423 424
	$getElements(treeViewId: string): TPromise<ITreeItem[]> { throw ni(); }
	$getChildren(treeViewId: string, treeItemHandle: number): TPromise<ITreeItem[]> { throw ni(); }
S
Sandeep Somavarapu 已提交
425 426
}

427
export abstract class ExtHostWorkspaceShape {
428
	$acceptWorkspaceData(workspace: IWorkspaceData): void { throw ni(); }
429 430
}

431 432 433 434 435 436 437 438 439 440
export abstract class ExtHostExtensionServiceShape {
	$activateExtension(extensionDescription: IExtensionDescription): TPromise<void> { throw ni(); }
}

export interface FileSystemEvents {
	created: URI[];
	changed: URI[];
	deleted: URI[];
}
export abstract class ExtHostFileSystemEventServiceShape {
441
	$onFileEvent(events: FileSystemEvents) { throw ni(); }
442 443
}

J
Johannes Rieken 已提交
444 445 446 447 448
export interface ObjectIdentifier {
	$ident: number;
}

export namespace ObjectIdentifier {
449
	export const name = '$ident';
J
Johannes Rieken 已提交
450
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
451
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
452 453
		return <T & ObjectIdentifier>obj;
	}
454 455
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
456 457 458
	}
}

J
Johannes Rieken 已提交
459
export abstract class ExtHostHeapServiceShape {
460 461 462
	$onGarbageCollection(ids: number[]): void { throw ni(); }
}

463 464 465 466
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 已提交
467 468 469 470 471 472
	$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(); }
J
Johannes Rieken 已提交
473
	$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.Command[]> { throw ni(); }
474
	$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
475
	$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
A
Alex Dima 已提交
476
	$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
477 478
	$provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]> { throw ni(); }
	$resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation> { throw ni(); }
A
Alex Dima 已提交
479 480 481 482
	$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(); }
483 484
	$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> { throw ni(); }
	$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> { throw ni(); }
485 486 487 488 489 490 491
}

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

492 493
export abstract class ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void { throw ni(); }
494
	$acceptTerminalProcessId(id: number, processId: number): void { throw ni(); }
495 496
}

J
Joao Moreno 已提交
497
export abstract class ExtHostSCMShape {
J
Joao Moreno 已提交
498 499
	$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> { throw ni(); }
	$onActiveSourceControlChange(sourceControlHandle: number): TPromise<void> { throw ni(); }
500
	$onInputBoxValueChange(value: string): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
501
	$onInputBoxAcceptChanges(): TPromise<void> { throw ni(); }
J
Joao Moreno 已提交
502 503
}

504 505 506 507
export abstract class ExtHostTaskShape {
	$provideTasks(handle: number): TPromise<TaskSet> { throw ni(); }
}

508
export abstract class ExtHostDebugServiceShape {
509
	$acceptDebugSessionStarted(id: DebugSessionUUID, type: string, name: string): void { throw ni(); }
510
	$acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void { throw ni(); }
511
	$acceptDebugSessionActiveChanged(id: DebugSessionUUID | undefined, type?: string, name?: string): void { throw ni(); }
A
Andre Weinand 已提交
512
	$acceptDebugSessionCustomEvent(id: DebugSessionUUID, type: string, name: string, event: any): void { throw ni(); }
513 514
}

C
Christof Marti 已提交
515 516 517
export abstract class ExtHostCredentialsShape {
}

518 519 520 521
// --- proxy identifiers

export const MainContext = {
	MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape),
522
	MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape),
523
	MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService', MainThreadDebugServiceShape),
524 525 526 527
	MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape),
	MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape),
	MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape),
	MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape),
S
Sandeep Somavarapu 已提交
528
	MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews', MainThreadTreeViewsShape),
529 530 531 532
	MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape),
	MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape),
	MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape),
	MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape),
533
	MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress', MainThreadProgressShape),
534 535 536 537
	MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape),
	MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape),
	MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape),
	MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape),
D
Daniel Imms 已提交
538
	MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService', MainThreadTerminalServiceShape),
539 540
	MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape),
	MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape),
541
	MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', MainThreadSCMShape),
C
Christof Marti 已提交
542 543
	MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', MainThreadTaskShape),
	MainThreadCredentials: createMainId<MainThreadCredentialsShape>('MainThreadCredentials', MainThreadCredentialsShape),
544 545 546 547 548 549
};

export const ExtHostContext = {
	ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape),
	ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape),
	ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape),
550
	ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService', ExtHostDebugServiceShape),
J
Johannes Rieken 已提交
551
	ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape),
552
	ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape),
553
	ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape),
554
	ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape),
S
Sandeep Somavarapu 已提交
555
	ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews', ExtHostTreeViewsShape),
556
	ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape),
J
Johannes Rieken 已提交
557
	ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor', ExtHostHeapServiceShape),
558 559 560
	ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape),
	ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape),
	ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape),
J
Joao Moreno 已提交
561
	ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService', ExtHostTerminalServiceShape),
562
	ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ExtHostSCMShape),
563 564
	ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ExtHostTaskShape),
	ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace', ExtHostWorkspaceShape),
C
Christof Marti 已提交
565
	ExtHostCredentials: createExtId<ExtHostCredentialsShape>('ExtHostCredentials', ExtHostCredentialsShape),
566
};