extHost.protocol.ts 59.1 KB
Newer Older
1 2 3 4 5
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

A
Alex Dima 已提交
6
import { CancellationToken } from 'vs/base/common/cancellation';
R
Rob Lourens 已提交
7 8
import { SerializedError } from 'vs/base/common/errors';
import { IDisposable } from 'vs/base/common/lifecycle';
9
import Severity from 'vs/base/common/severity';
10
import { URI, UriComponents } from 'vs/base/common/uri';
11
import { TextEditorCursorStyle, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
12 13
import { IPosition } from 'vs/editor/common/core/position';
import { IRange } from 'vs/editor/common/core/range';
14
import { ISelection, Selection } from 'vs/editor/common/core/selection';
R
Rob Lourens 已提交
15
import * as editorCommon from 'vs/editor/common/editorCommon';
16
import { ISingleEditOperation, EndOfLineSequence } from 'vs/editor/common/model';
R
Rob Lourens 已提交
17 18 19 20 21 22
import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel';
import * as modes from 'vs/editor/common/modes';
import { CharacterPair, CommentRule, EnterAction } from 'vs/editor/common/modes/languageConfiguration';
import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { ConfigurationTarget, IConfigurationData, IConfigurationModel } from 'vs/platform/configuration/common/configuration';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
J
Johannes Rieken 已提交
23
import * as files from 'vs/platform/files/common/files';
24
import { ResourceLabelFormatter } from 'vs/platform/label/common/label';
S
Sandeep Somavarapu 已提交
25
import { LogLevel } from 'vs/platform/log/common/log';
R
Rob Lourens 已提交
26
import { IMarkerData } from 'vs/platform/markers/common/markers';
J
Johannes Rieken 已提交
27 28 29
import * as quickInput from 'vs/platform/quickinput/common/quickInput';
import * as search from 'vs/workbench/services/search/common/search';
import * as statusbar from 'vs/platform/statusbar/common/statusbar';
R
Rob Lourens 已提交
30 31
import { ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry';
import { ThemeColor } from 'vs/platform/theme/common/themeService';
32 33
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import * as tasks from 'vs/workbench/api/common/shared/tasks';
34
import { ITreeItem, IRevealOptions } from 'vs/workbench/common/views';
35 36 37
import { IAdapterDescriptor, IConfig, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug';
import { ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder';
import { ITerminalDimensions } from 'vs/workbench/contrib/terminal/common/terminal';
38
import { ExtensionActivationError } from 'vs/workbench/services/extensions/common/extensions';
J
Johannes Rieken 已提交
39
import { IRPCProtocol, createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId } from 'vs/workbench/services/extensions/common/proxyIdentifier';
40
import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress';
R
Rob Lourens 已提交
41
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
42
import { IMarkdownString } from 'vs/base/common/htmlContent';
A
Tweaks  
Alex Dima 已提交
43
import { ResolvedAuthority, RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver';
44
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
45
import * as callHierarchy from 'vs/workbench/contrib/callHierarchy/common/callHierarchy';
46
import { IRelativePattern } from 'vs/base/common/glob';
47
import { IRemoteConsoleLog } from 'vs/base/common/console';
48
import { VSBuffer } from 'vs/base/common/buffer';
S
Sandeep Somavarapu 已提交
49

50
export interface IEnvironment {
51
	isExtensionDevelopmentDebug: boolean;
52
	appName: string;
53
	appRoot?: URI;
54 55
	appLanguage: string;
	appUriScheme: string;
56
	appSettingsHome?: URI;
57
	extensionDevelopmentLocationURI?: URI[];
58
	extensionTestsLocationURI?: URI;
A
Alex Dima 已提交
59
	globalStorageHome: URI;
D
Daniel Imms 已提交
60
	userHome: URI;
61 62
}

63
export interface IStaticWorkspaceData {
64
	id: string;
65
	name: string;
A
Alex Dima 已提交
66
	configuration?: UriComponents | null;
67
	isUntitled?: boolean | null;
68 69
}

70 71 72 73
export interface IWorkspaceData extends IStaticWorkspaceData {
	folders: { uri: UriComponents, name: string, index: number }[];
}

74
export interface IInitData {
75
	version: string;
76
	commit?: string;
77 78
	parentPid: number;
	environment: IEnvironment;
A
Alex Dima 已提交
79
	workspace?: IStaticWorkspaceData | null;
A
Alex Dima 已提交
80
	resolvedExtensions: ExtensionIdentifier[];
81
	hostExtensions: ExtensionIdentifier[];
82
	extensions: IExtensionDescription[];
83
	telemetryInfo: ITelemetryInfo;
S
Sandeep Somavarapu 已提交
84
	logLevel: LogLevel;
85
	logsLocation: URI;
A
Alex Dima 已提交
86
	autoStart: boolean;
A
Alex Dima 已提交
87
	remoteAuthority?: string | null;
88 89
}

S
Sandeep Somavarapu 已提交
90
export interface IConfigurationInitData extends IConfigurationData {
S
Sandeep Somavarapu 已提交
91
	configurationScopes: { [key: string]: ConfigurationScope };
S
Sandeep Somavarapu 已提交
92 93
}

94
export interface IWorkspaceConfigurationChangeEventData {
S
Sandeep Somavarapu 已提交
95 96
	changedConfiguration: IConfigurationModel;
	changedConfigurationByResource: { [folder: string]: IConfigurationModel };
97 98
}

A
Alex Dima 已提交
99
export interface IExtHostContext extends IRPCProtocol {
A
Alex Dima 已提交
100
	remoteAuthority: string;
101 102
}

A
Alex Dima 已提交
103
export interface IMainContext extends IRPCProtocol {
104 105
}

106 107
// --- main thread

108 109 110 111 112
export interface MainThreadClipboardShape extends IDisposable {
	$readText(): Promise<string>;
	$writeText(value: string): Promise<void>;
}

113
export interface MainThreadCommandsShape extends IDisposable {
114 115
	$registerCommand(id: string): void;
	$unregisterCommand(id: string): void;
116
	$executeCommand<T>(id: string, args: any[]): Promise<T | undefined>;
J
Johannes Rieken 已提交
117
	$getCommands(): Promise<string[]>;
118 119
}

P
Peng Lyu 已提交
120 121 122 123 124 125 126
export interface CommentThreadTemplate {
	label: string;
	acceptInputCommand?: modes.Command;
	additionalCommands?: modes.Command[];
	deleteCommand?: modes.Command;
}

R
rebornix 已提交
127 128 129 130
export interface CommentProviderFeatures {
	startDraftLabel?: string;
	deleteDraftLabel?: string;
	finishDraftLabel?: string;
P
Peng Lyu 已提交
131
	reactionGroup?: modes.CommentReaction[];
P
Peng Lyu 已提交
132
	commentThreadTemplate?: CommentThreadTemplate;
P
Peng Lyu 已提交
133
	reactionHandler?: boolean;
R
rebornix 已提交
134 135
}

M
Matt Bierner 已提交
136
export interface MainThreadCommentsShape extends IDisposable {
P
Peng Lyu 已提交
137
	$registerCommentController(handle: number, id: string, label: string): void;
138
	$unregisterCommentController(handle: number): void;
P
Peng Lyu 已提交
139
	$updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void;
140
	$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, extensionId: ExtensionIdentifier): modes.CommentThread2 | undefined;
P
Peng Lyu 已提交
141
	$updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, label: string, contextValue: string | undefined, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], deleteCommand: modes.Command | undefined, collapseState: modes.CommentThreadCollapsibleState): void;
P
Peng Lyu 已提交
142
	$deleteCommentThread(handle: number, commentThreadHandle: number): void;
P
Peng Lyu 已提交
143
	$setInputValue(handle: number, input: string): void;
R
rebornix 已提交
144
	$registerDocumentCommentProvider(handle: number, features: CommentProviderFeatures): void;
145
	$unregisterDocumentCommentProvider(handle: number): void;
146
	$registerWorkspaceCommentProvider(handle: number, extensionId: ExtensionIdentifier): void;
147
	$unregisterWorkspaceCommentProvider(handle: number): void;
148
	$onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent): void;
M
Matt Bierner 已提交
149 150
}

151
export interface MainThreadConfigurationShape extends IDisposable {
152 153
	$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: any, resource: UriComponents | undefined): Promise<void>;
	$removeConfigurationOption(target: ConfigurationTarget | null, key: string, resource: UriComponents | undefined): Promise<void>;
154 155
}

156
export interface MainThreadDiagnosticsShape extends IDisposable {
157
	$changeMany(owner: string, entries: [UriComponents, IMarkerData[] | undefined][]): void;
158
	$clear(owner: string): void;
159 160
}

161
export interface MainThreadDialogOpenOptions {
162
	defaultUri?: UriComponents;
163
	openLabel?: string;
164 165 166
	canSelectFiles?: boolean;
	canSelectFolders?: boolean;
	canSelectMany?: boolean;
J
Johannes Rieken 已提交
167
	filters?: { [name: string]: string[] };
168 169
}

170
export interface MainThreadDialogSaveOptions {
171
	defaultUri?: UriComponents;
172
	saveLabel?: string;
J
Johannes Rieken 已提交
173
	filters?: { [name: string]: string[] };
174 175
}

176
export interface MainThreadDiaglogsShape extends IDisposable {
177 178
	$showOpenDialog(options: MainThreadDialogOpenOptions): Promise<UriComponents[] | undefined>;
	$showSaveDialog(options: MainThreadDialogSaveOptions): Promise<UriComponents | undefined>;
179 180
}

181 182 183
export interface MainThreadDecorationsShape extends IDisposable {
	$registerDecorationProvider(handle: number, label: string): void;
	$unregisterDecorationProvider(handle: number): void;
184
	$onDidChange(handle: number, resources: UriComponents[] | null): void;
185 186
}

187
export interface MainThreadDocumentContentProvidersShape extends IDisposable {
188 189
	$registerTextContentProvider(handle: number, scheme: string): void;
	$unregisterTextContentProvider(handle: number): void;
190
	$onVirtualDocumentChange(uri: UriComponents, value: string): void;
191 192
}

193
export interface MainThreadDocumentsShape extends IDisposable {
J
Johannes Rieken 已提交
194 195 196
	$tryCreateDocument(options?: { language?: string; content?: string; }): Promise<UriComponents>;
	$tryOpenDocument(uri: UriComponents): Promise<void>;
	$trySaveDocument(uri: UriComponents): Promise<boolean>;
197 198
}

199 200
export interface ITextEditorConfigurationUpdate {
	tabSize?: number | 'auto';
A
Alex Dima 已提交
201
	indentSize?: number | 'tabSize';
202 203
	insertSpaces?: boolean | 'auto';
	cursorStyle?: TextEditorCursorStyle;
204
	lineNumbers?: RenderLineNumbersType;
205 206 207 208
}

export interface IResolvedTextEditorConfiguration {
	tabSize: number;
D
David Lechner 已提交
209
	indentSize: number;
210 211
	insertSpaces: boolean;
	cursorStyle: TextEditorCursorStyle;
212
	lineNumbers: RenderLineNumbersType;
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
}

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

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

export interface IApplyEditsOptions extends IUndoStopOptions {
J
Johannes Rieken 已提交
228
	setEndOfLine?: EndOfLineSequence;
229 230
}

231
export interface ITextDocumentShowOptions {
232
	position?: EditorViewColumn;
233 234
	preserveFocus?: boolean;
	pinned?: boolean;
235
	selection?: IRange;
236 237
}

238
export interface MainThreadTextEditorsShape extends IDisposable {
239
	$tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise<string | undefined>;
240 241
	$registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void;
	$removeTextEditorDecorationType(key: string): void;
J
Johannes Rieken 已提交
242 243 244 245 246 247 248 249 250
	$tryShowEditor(id: string, position: EditorViewColumn): Promise<void>;
	$tryHideEditor(id: string): Promise<void>;
	$trySetOptions(id: string, options: ITextEditorConfigurationUpdate): Promise<void>;
	$trySetDecorations(id: string, key: string, ranges: editorCommon.IDecorationOptions[]): Promise<void>;
	$trySetDecorationsFast(id: string, key: string, ranges: number[]): Promise<void>;
	$tryRevealRange(id: string, range: IRange, revealType: TextEditorRevealType): Promise<void>;
	$trySetSelections(id: string, selections: ISelection[]): Promise<void>;
	$tryApplyEdits(id: string, modelVersionId: number, edits: ISingleEditOperation[], opts: IApplyEditsOptions): Promise<boolean>;
	$tryApplyWorkspaceEdit(workspaceEditDto: WorkspaceEditDto): Promise<boolean>;
M
Matt Bierner 已提交
251
	$tryInsertSnippet(id: string, template: string, selections: readonly IRange[], opts: IUndoStopOptions): Promise<boolean>;
J
Johannes Rieken 已提交
252
	$getDiffInformation(id: string): Promise<editorCommon.ILineChange[]>;
253 254
}

255
export interface MainThreadTreeViewsShape extends IDisposable {
256
	$registerTreeViewDataProvider(treeViewId: string, options: { showCollapseAll: boolean }): void;
J
Johannes Rieken 已提交
257 258
	$refresh(treeViewId: string, itemsToRefresh?: { [treeItemHandle: string]: ITreeItem }): Promise<void>;
	$reveal(treeViewId: string, treeItem: ITreeItem, parentChain: ITreeItem[], options: IRevealOptions): Promise<void>;
259
	$setMessage(treeViewId: string, message: string | IMarkdownString): void;
260 261
}

262
export interface MainThreadErrorsShape extends IDisposable {
263
	$onUnexpectedError(err: any | SerializedError): void;
264 265
}

266
export interface MainThreadConsoleShape extends IDisposable {
267
	$logExtensionHostMessage(msg: IRemoteConsoleLog): void;
268 269
}

A
Alex Dima 已提交
270 271 272 273 274 275 276
export interface MainThreadKeytarShape extends IDisposable {
	$getPassword(service: string, account: string): Promise<string | null>;
	$setPassword(service: string, account: string, password: string): Promise<void>;
	$deletePassword(service: string, account: string): Promise<boolean>;
	$findPassword(service: string): Promise<string | null>;
}

277 278 279 280 281 282 283 284 285 286 287 288 289
export interface ISerializedRegExp {
	pattern: string;
	flags?: string;
}
export interface ISerializedIndentationRule {
	decreaseIndentPattern: ISerializedRegExp;
	increaseIndentPattern: ISerializedRegExp;
	indentNextLinePattern?: ISerializedRegExp;
	unIndentedLinePattern?: ISerializedRegExp;
}
export interface ISerializedOnEnterRule {
	beforeText: ISerializedRegExp;
	afterText?: ISerializedRegExp;
290
	oneLineAboveText?: ISerializedRegExp;
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
	action: EnterAction;
}
export interface ISerializedLanguageConfiguration {
	comments?: CommentRule;
	brackets?: CharacterPair[];
	wordPattern?: ISerializedRegExp;
	indentationRules?: ISerializedIndentationRule;
	onEnterRules?: ISerializedOnEnterRule[];
	__electricCharacterSupport?: {
		brackets?: any;
		docComment?: {
			scope: string;
			open: string;
			lineStart: string;
			close?: string;
		};
	};
	__characterPairSupport?: {
		autoClosingPairs: {
			open: string;
			close: string;
			notIn?: string[];
		}[];
	};
}

317 318
export type GlobPattern = string | { base: string; pattern: string };

A
Alex Dima 已提交
319 320 321 322
export interface ISerializedDocumentFilter {
	$serialized: true;
	language?: string;
	scheme?: string;
323
	pattern?: string | IRelativePattern;
324
	exclusive?: boolean;
A
Alex Dima 已提交
325 326
}

327
export interface ISerializedSignatureHelpProviderMetadata {
328 329
	readonly triggerCharacters: readonly string[];
	readonly retriggerCharacters: readonly string[];
330 331
}

332
export interface MainThreadLanguageFeaturesShape extends IDisposable {
333
	$unregister(handle: number): void;
334
	$registerDocumentSymbolProvider(handle: number, selector: ISerializedDocumentFilter[], label: string): void;
335
	$registerCodeLensSupport(handle: number, selector: ISerializedDocumentFilter[], eventHandle: number | undefined): void;
336
	$emitCodeLensEvent(eventHandle: number, event?: any): void;
337 338
	$registerDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void;
	$registerDeclarationSupport(handle: number, selector: ISerializedDocumentFilter[]): void;
A
Alex Dima 已提交
339 340 341 342 343
	$registerImplementationSupport(handle: number, selector: ISerializedDocumentFilter[]): void;
	$registerTypeDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void;
	$registerHoverProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
	$registerDocumentHighlightProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
	$registerReferenceSupport(handle: number, selector: ISerializedDocumentFilter[]): void;
344
	$registerQuickFixSupport(handle: number, selector: ISerializedDocumentFilter[], supportedKinds?: string[]): void;
345 346
	$registerDocumentFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], extensionId: ExtensionIdentifier, displayName: string): void;
	$registerRangeFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], extensionId: ExtensionIdentifier, displayName: string): void;
347
	$registerOnTypeFormattingSupport(handle: number, selector: ISerializedDocumentFilter[], autoFormatTriggerCharacters: string[], extensionId: ExtensionIdentifier): void;
348
	$registerNavigateTypeSupport(handle: number): void;
A
Alex Dima 已提交
349 350
	$registerRenameSupport(handle: number, selector: ISerializedDocumentFilter[], supportsResolveInitialValues: boolean): void;
	$registerSuggestSupport(handle: number, selector: ISerializedDocumentFilter[], triggerCharacters: string[], supportsResolveDetails: boolean): void;
351
	$registerSignatureHelpProvider(handle: number, selector: ISerializedDocumentFilter[], metadata: ISerializedSignatureHelpProviderMetadata): void;
352
	$registerDocumentLinkProvider(handle: number, selector: ISerializedDocumentFilter[], supportsResolve: boolean): void;
A
Alex Dima 已提交
353
	$registerDocumentColorProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
354
	$registerFoldingRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
355
	$registerSelectionRangeProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
356
	$registerCallHierarchyProvider(handle: number, selector: ISerializedDocumentFilter[]): void;
357
	$setLanguageConfiguration(handle: number, languageId: string, configuration: ISerializedLanguageConfiguration): void;
358 359
}

360
export interface MainThreadLanguagesShape extends IDisposable {
J
Johannes Rieken 已提交
361 362
	$getLanguages(): Promise<string[]>;
	$changeLanguage(resource: UriComponents, languageId: string): Promise<void>;
363 364
}

365
export interface MainThreadMessageOptions {
366
	extension?: IExtensionDescription;
367
	modal?: boolean;
368 369
}

370
export interface MainThreadMessageServiceShape extends IDisposable {
371
	$showMessage(severity: Severity, message: string, options: MainThreadMessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Promise<number | undefined>;
372 373
}

374
export interface MainThreadOutputServiceShape extends IDisposable {
J
Johannes Rieken 已提交
375
	$register(label: string, log: boolean, file?: UriComponents): Promise<string>;
376 377 378 379 380 381
	$append(channelId: string, value: string): Promise<void> | undefined;
	$update(channelId: string): Promise<void> | undefined;
	$clear(channelId: string, till: number): Promise<void> | undefined;
	$reveal(channelId: string, preserveFocus: boolean): Promise<void> | undefined;
	$close(channelId: string): Promise<void> | undefined;
	$dispose(channelId: string): Promise<void> | undefined;
382 383
}

384
export interface MainThreadProgressShape extends IDisposable {
385

B
Benjamin Pasero 已提交
386
	$startProgress(handle: number, options: IProgressOptions, extension?: IExtensionDescription): void;
387 388
	$progressReport(handle: number, message: IProgressStep): void;
	$progressEnd(handle: number): void;
389 390
}

391
export interface MainThreadTerminalServiceShape extends IDisposable {
392
	$createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string, cwd?: string | UriComponents, env?: { [key: string]: string | null }, waitOnExit?: boolean, strictEnv?: boolean, runInBackground?: boolean): Promise<{ id: number, name: string }>;
J
Johannes Rieken 已提交
393
	$createTerminalRenderer(name: string): Promise<number>;
394 395 396 397
	$dispose(terminalId: number): void;
	$hide(terminalId: number): void;
	$sendText(terminalId: number, text: string, addNewLine: boolean): void;
	$show(terminalId: number, preserveFocus: boolean): void;
D
Daniel Imms 已提交
398
	$registerOnDataListener(terminalId: number): void;
399

400
	// Process
401 402
	$sendProcessTitle(terminalId: number, title: string): void;
	$sendProcessData(terminalId: number, data: string): void;
D
Daniel Imms 已提交
403
	$sendProcessReady(terminalId: number, pid: number, cwd: string): void;
D
Daniel Imms 已提交
404
	$sendProcessExit(terminalId: number, exitCode: number): void;
405 406
	$sendProcessInitialCwd(terminalId: number, cwd: string): void;
	$sendProcessCwd(terminalId: number, initialCwd: string): void;
407 408 409

	// Renderer
	$terminalRendererSetName(terminalId: number, name: string): void;
D
Daniel Imms 已提交
410
	$terminalRendererSetDimensions(terminalId: number, dimensions: ITerminalDimensions): void;
411
	$terminalRendererWrite(terminalId: number, text: string): void;
D
Daniel Imms 已提交
412
	$terminalRendererRegisterOnInputListener(terminalId: number): void;
D
Daniel Imms 已提交
413 414
}

J
Johannes Rieken 已提交
415
export interface TransferQuickPickItems extends quickInput.IQuickPickItem {
416 417
	handle: number;
}
C
Christof Marti 已提交
418

J
Johannes Rieken 已提交
419
export interface TransferQuickInputButton extends quickInput.IQuickInputButton {
420 421
	handle: number;
}
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445

export type TransferQuickInput = TransferQuickPick | TransferInputBox;

export interface BaseTransferQuickInput {

	id: number;

	type?: 'quickPick' | 'inputBox';

	enabled?: boolean;

	busy?: boolean;

	visible?: boolean;
}

export interface TransferQuickPick extends BaseTransferQuickInput {

	type?: 'quickPick';

	value?: string;

	placeholder?: string;

C
Christof Marti 已提交
446
	buttons?: TransferQuickInputButton[];
447

C
Christof Marti 已提交
448
	items?: TransferQuickPickItems[];
449

450 451 452 453
	activeItems?: number[];

	selectedItems?: number[];

454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
	canSelectMany?: boolean;

	ignoreFocusOut?: boolean;

	matchOnDescription?: boolean;

	matchOnDetail?: boolean;
}

export interface TransferInputBox extends BaseTransferQuickInput {

	type?: 'inputBox';

	value?: string;

	placeholder?: string;

	password?: boolean;

C
Christof Marti 已提交
473
	buttons?: TransferQuickInputButton[];
474 475 476 477 478 479

	prompt?: string;

	validationMessage?: string;
}

480 481 482 483 484 485 486 487 488
export interface IInputBoxOptions {
	value?: string;
	valueSelection?: [number, number];
	prompt?: string;
	placeHolder?: string;
	password?: boolean;
	ignoreFocusOut?: boolean;
}

489
export interface MainThreadQuickOpenShape extends IDisposable {
J
Johannes Rieken 已提交
490
	$show(instance: number, options: quickInput.IPickOptions<TransferQuickPickItems>, token: CancellationToken): Promise<number | number[] | undefined>;
J
Johannes Rieken 已提交
491 492
	$setItems(instance: number, items: TransferQuickPickItems[]): Promise<void>;
	$setError(instance: number, error: Error): Promise<void>;
493
	$input(options: IInputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string>;
J
Johannes Rieken 已提交
494 495
	$createOrUpdate(params: TransferQuickInput): Promise<void>;
	$dispose(id: number): Promise<void>;
496 497
}

498
export interface MainThreadStatusBarShape extends IDisposable {
B
Benjamin Pasero 已提交
499
	$setEntry(id: number, statusId: string, statusName: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: statusbar.StatusbarAlignment, priority: number | undefined): void;
500
	$dispose(id: number): void;
501 502
}

503
export interface MainThreadStorageShape extends IDisposable {
504
	$getValue<T>(shared: boolean, key: string): Promise<T | undefined>;
J
Johannes Rieken 已提交
505
	$setValue(shared: boolean, key: string, value: object): Promise<void>;
506 507
}

508
export interface MainThreadTelemetryShape extends IDisposable {
509
	$publicLog(eventName: string, data?: any): void;
510 511
}

512
export interface MainThreadEditorInsetsShape extends IDisposable {
513
	$createEditorInset(handle: number, id: string, uri: UriComponents, range: IRange, options: modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void>;
514 515 516 517 518 519
	$disposeEditorInset(handle: number): void;

	$setHtml(handle: number, value: string): void;
	$setOptions(handle: number, options: modes.IWebviewOptions): void;
	$postMessage(handle: number, value: any): Promise<boolean>;
}
M
Matt Bierner 已提交
520

521 522 523 524 525 526
export interface ExtHostEditorInsetsShape {
	$onDidDispose(handle: number): void;
	$onDidReceiveMessage(handle: number, message: any): void;
}

export type WebviewPanelHandle = string;
527

M
Matt Bierner 已提交
528 529 530 531 532
export interface WebviewPanelShowOptions {
	readonly viewColumn?: EditorViewColumn;
	readonly preserveFocus?: boolean;
}

M
Matt Bierner 已提交
533
export interface MainThreadWebviewsShape extends IDisposable {
534
	$createWebviewPanel(handle: WebviewPanelHandle, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: modes.IWebviewPanelOptions & modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void;
535
	$disposeWebview(handle: WebviewPanelHandle): void;
M
Matt Bierner 已提交
536
	$reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void;
537
	$setTitle(handle: WebviewPanelHandle, value: string): void;
538
	$setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void;
539

540 541 542
	$setHtml(handle: WebviewPanelHandle, value: string): void;
	$setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void;
	$postMessage(handle: WebviewPanelHandle, value: any): Promise<boolean>;
543 544 545

	$registerSerializer(viewType: string): void;
	$unregisterSerializer(viewType: string): void;
M
Matt Bierner 已提交
546
}
547

M
Matt Bierner 已提交
548 549 550 551 552 553
export interface WebviewPanelViewState {
	readonly active: boolean;
	readonly visible: boolean;
	readonly position: EditorViewColumn;
}

M
Matt Bierner 已提交
554
export interface ExtHostWebviewsShape {
555
	$onMessage(handle: WebviewPanelHandle, message: any): void;
M
Matt Bierner 已提交
556
	$onDidChangeWebviewPanelViewState(handle: WebviewPanelHandle, newState: WebviewPanelViewState): void;
J
Johannes Rieken 已提交
557
	$onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise<void>;
558
	$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
M
Matt Bierner 已提交
559 560
}

J
Joao Moreno 已提交
561
export interface MainThreadUrlsShape extends IDisposable {
562
	$registerUriHandler(handle: number, extensionId: ExtensionIdentifier): Promise<void>;
J
Johannes Rieken 已提交
563
	$unregisterUriHandler(handle: number): Promise<void>;
J
Joao Moreno 已提交
564 565 566
}

export interface ExtHostUrlsShape {
J
Johannes Rieken 已提交
567
	$handleExternalUri(handle: number, uri: UriComponents): Promise<void>;
M
Matt Bierner 已提交
568 569
}

570 571 572 573
export interface ITextSearchComplete {
	limitHit?: boolean;
}

574
export interface MainThreadWorkspaceShape extends IDisposable {
575
	$startFileSearch(includePattern: string | undefined, includeFolder: UriComponents | undefined, excludePatternOrDisregardExcludes: string | false | undefined, maxResults: number | undefined, token: CancellationToken): Promise<UriComponents[] | undefined>;
576
	$startTextSearch(query: search.IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<ITextSearchComplete>;
J
Johannes Rieken 已提交
577 578 579
	$checkExists(includes: string[], token: CancellationToken): Promise<boolean>;
	$saveAll(includeUntitled?: boolean): Promise<boolean>;
	$updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents, name?: string }[]): Promise<void>;
580
	$resolveProxy(url: string): Promise<string | undefined>;
581
}
582

J
Johannes Rieken 已提交
583 584
export interface IFileChangeDto {
	resource: UriComponents;
J
Johannes Rieken 已提交
585
	type: files.FileChangeType;
J
Johannes Rieken 已提交
586 587
}

588
export interface MainThreadFileSystemShape extends IDisposable {
J
Johannes Rieken 已提交
589
	$registerFileSystemProvider(handle: number, scheme: string, capabilities: files.FileSystemProviderCapabilities): void;
590
	$unregisterProvider(handle: number): void;
591 592
	$registerResourceLabelFormatter(handle: number, formatter: ResourceLabelFormatter): void;
	$unregisterResourceLabelFormatter(handle: number): void;
J
Johannes Rieken 已提交
593
	$onFileSystemChange(handle: number, resource: IFileChangeDto[]): void;
594
}
J
Johannes Rieken 已提交
595

596
export interface MainThreadSearchShape extends IDisposable {
597 598
	$registerFileSearchProvider(handle: number, scheme: string): void;
	$registerTextSearchProvider(handle: number, scheme: string): void;
599
	$unregisterProvider(handle: number): void;
600
	$handleFileMatch(handle: number, session: number, data: UriComponents[]): void;
J
Johannes Rieken 已提交
601
	$handleTextMatch(handle: number, session: number, data: search.IRawFileMatch2[]): void;
602
	$handleTelemetry(eventName: string, data: any): void;
603 604
}

605
export interface MainThreadTaskShape extends IDisposable {
J
Johannes Rieken 已提交
606
	$createTaskId(task: tasks.TaskDTO): Promise<string>;
J
Johannes Rieken 已提交
607 608
	$registerTaskProvider(handle: number): Promise<void>;
	$unregisterTaskProvider(handle: number): Promise<void>;
J
Johannes Rieken 已提交
609 610
	$fetchTasks(filter?: tasks.TaskFilterDTO): Promise<tasks.TaskDTO[]>;
	$executeTask(task: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
J
Johannes Rieken 已提交
611
	$terminateTask(id: string): Promise<void>;
J
Johannes Rieken 已提交
612
	$registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
G
Gabriel DeBacker 已提交
613
	$customExecutionComplete(id: string, result?: number): Promise<void>;
614 615
}

616
export interface MainThreadExtensionServiceShape extends IDisposable {
A
Alex Dima 已提交
617
	$activateExtension(extensionId: ExtensionIdentifier, activationEvent: string | null): Promise<void>;
618
	$onWillActivateExtension(extensionId: ExtensionIdentifier): void;
A
Alex Dima 已提交
619
	$onDidActivateExtension(extensionId: ExtensionIdentifier, startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number, activationEvent: string | null): void;
620
	$onExtensionActivationError(extensionId: ExtensionIdentifier, error: ExtensionActivationError): Promise<void>;
621
	$onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void;
A
Alex Dima 已提交
622
	$onExtensionHostExit(code: number): void;
623 624
}

J
Joao Moreno 已提交
625
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
626 627
	hasQuickDiffProvider?: boolean;
	count?: number;
628 629
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
J
Joao Moreno 已提交
630
	statusBarCommands?: CommandDto[];
J
Joao Moreno 已提交
631 632 633 634
}

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

J
Joao Moreno 已提交
637
export type SCMRawResource = [
638
	number /*handle*/,
639
	UriComponents /*resourceUri*/,
J
Joao Moreno 已提交
640
	string[] /*icons: light, dark*/,
641
	string /*tooltip*/,
642
	boolean /*strike through*/,
643 644
	boolean /*faded*/,

J
Joao Moreno 已提交
645 646 647
	string | undefined /*source*/,
	string | undefined /*letter*/,
	ThemeColor | null /*color*/
J
Joao Moreno 已提交
648
];
649

650 651 652
export type SCMRawResourceSplice = [
	number /* start */,
	number /* delete count */,
J
Joao 已提交
653 654 655
	SCMRawResource[]
];

656 657 658 659 660
export type SCMRawResourceSplices = [
	number, /*handle*/
	SCMRawResourceSplice[]
];

661
export interface MainThreadSCMShape extends IDisposable {
662
	$registerSourceControl(handle: number, id: string, label: string, rootUri: UriComponents | undefined): void;
663 664
	$updateSourceControl(handle: number, features: SCMProviderFeatures): void;
	$unregisterSourceControl(handle: number): void;
J
Joao Moreno 已提交
665

666 667 668 669
	$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;
	$unregisterGroup(sourceControlHandle: number, handle: number): void;
J
Joao Moreno 已提交
670

671
	$spliceResourceStates(sourceControlHandle: number, splices: SCMRawResourceSplices[]): void;
J
Joao 已提交
672

J
Joao Moreno 已提交
673
	$setInputBoxValue(sourceControlHandle: number, value: string): void;
674
	$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
675
	$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
676
	$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
J
Joao Moreno 已提交
677 678
}

679 680
export type DebugSessionUUID = string;

681 682 683 684 685 686 687
export interface IDebugConfiguration {
	type: string;
	name: string;
	request: string;
	[key: string]: any;
}

688
export interface MainThreadDebugServiceShape extends IDisposable {
A
Alex Dima 已提交
689
	$registerDebugTypes(debugTypes: string[]): void;
690
	$sessionCached(sessionID: string): void;
A
Alex Dima 已提交
691
	$acceptDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
692 693
	$acceptDAError(handle: number, name: string, message: string, stack: string | undefined): void;
	$acceptDAExit(handle: number, code: number | undefined, signal: string | undefined): void;
A
Andre Weinand 已提交
694
	$registerDebugConfigurationProvider(type: string, hasProvideMethod: boolean, hasResolveMethod: boolean, hasProvideDaMethod: boolean, handle: number): Promise<void>;
J
Johannes Rieken 已提交
695
	$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
696
	$unregisterDebugConfigurationProvider(handle: number): void;
A
Andre Weinand 已提交
697
	$unregisterDebugAdapterDescriptorFactory(handle: number): void;
698
	$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
J
Johannes Rieken 已提交
699
	$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
700 701
	$appendDebugConsole(value: string): void;
	$startBreakpointEvents(): void;
702
	$registerBreakpoints(breakpoints: Array<ISourceMultiBreakpointDto | IFunctionBreakpointDto>): Promise<void>;
J
Johannes Rieken 已提交
703
	$unregisterBreakpoints(breakpointIds: string[], functionBreakpointIds: string[]): Promise<void>;
704 705
}

706 707 708 709
export interface IOpenUriOptions {
	readonly allowTunneling?: boolean;
}

710
export interface MainThreadWindowShape extends IDisposable {
J
Johannes Rieken 已提交
711
	$getWindowVisibility(): Promise<boolean>;
712
	$openUri(uri: UriComponents, options: IOpenUriOptions): Promise<boolean>;
713 714
}

715 716
// -- extension host

717
export interface ExtHostCommandsShape {
J
Johannes Rieken 已提交
718 719
	$executeContributedCommand<T>(id: string, ...args: any[]): Promise<T>;
	$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescription }>;
720 721
}

722
export interface ExtHostConfigurationShape {
723 724
	$initializeConfiguration(data: IConfigurationInitData): void;
	$acceptConfigurationChanged(data: IConfigurationInitData, eventData: IWorkspaceConfigurationChangeEventData): void;
725 726
}

727
export interface ExtHostDiagnosticsShape {
728 729 730

}

731
export interface ExtHostDocumentContentProvidersShape {
M
Matt Bierner 已提交
732
	$provideTextDocumentContent(handle: number, uri: UriComponents): Promise<string | null | undefined>;
733 734
}

735
export interface IModelAddedData {
736
	uri: UriComponents;
737
	versionId: number;
738 739
	lines: string[];
	EOL: string;
740 741 742
	modeId: string;
	isDirty: boolean;
}
743
export interface ExtHostDocumentsShape {
744 745 746 747
	$acceptModelModeChanged(strURL: UriComponents, oldModeId: string, newModeId: string): void;
	$acceptModelSaved(strURL: UriComponents): void;
	$acceptDirtyStateChanged(strURL: UriComponents, isDirty: boolean): void;
	$acceptModelChanged(strURL: UriComponents, e: IModelChangedEvent, isDirty: boolean): void;
748 749
}

750
export interface ExtHostDocumentSaveParticipantShape {
J
Johannes Rieken 已提交
751
	$participateInSave(resource: UriComponents, reason: SaveReason): Promise<boolean[]>;
752 753
}

754 755
export interface ITextEditorAddData {
	id: string;
756
	documentUri: UriComponents;
757
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
758
	selections: ISelection[];
759
	visibleRanges: IRange[];
A
Alex Dima 已提交
760
	editorPosition: EditorViewColumn | undefined;
761 762
}
export interface ITextEditorPositionData {
763
	[id: string]: EditorViewColumn;
764
}
765 766 767
export interface IEditorPropertiesChangeData {
	options: IResolvedTextEditorConfiguration | null;
	selections: ISelectionChangeEvent | null;
768
	visibleRanges: IRange[] | null;
769 770 771 772 773 774
}
export interface ISelectionChangeEvent {
	selections: Selection[];
	source?: string;
}

775
export interface ExtHostEditorsShape {
776
	$acceptEditorPropertiesChanged(id: string, props: IEditorPropertiesChangeData): void;
777
	$acceptEditorPositionData(data: ITextEditorPositionData): void;
778 779
}

J
Johannes Rieken 已提交
780
export interface IDocumentsAndEditorsDelta {
781
	removedDocuments?: UriComponents[];
J
Johannes Rieken 已提交
782 783 784
	addedDocuments?: IModelAddedData[];
	removedEditors?: string[];
	addedEditors?: ITextEditorAddData[];
A
Alex Dima 已提交
785
	newActiveEditor?: string | null;
J
Johannes Rieken 已提交
786 787
}

788 789
export interface ExtHostDocumentsAndEditorsShape {
	$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void;
J
Johannes Rieken 已提交
790 791
}

792
export interface ExtHostTreeViewsShape {
J
Johannes Rieken 已提交
793
	$getChildren(treeViewId: string, treeItemHandle?: string): Promise<ITreeItem[]>;
794
	$setExpanded(treeViewId: string, treeItemHandle: string, expanded: boolean): void;
795
	$setSelection(treeViewId: string, treeItemHandles: string[]): void;
796
	$setVisible(treeViewId: string, visible: boolean): void;
S
Sandeep Somavarapu 已提交
797 798
}

799
export interface ExtHostWorkspaceShape {
800
	$initializeWorkspace(workspace: IWorkspaceData | null): void;
801
	$acceptWorkspaceData(workspace: IWorkspaceData | null): void;
J
Johannes Rieken 已提交
802
	$handleTextSearchResult(result: search.IRawFileMatch2, requestId: number): void;
803
}
804

805
export interface ExtHostFileSystemShape {
J
Johannes Rieken 已提交
806 807
	$stat(handle: number, resource: UriComponents): Promise<files.IStat>;
	$readdir(handle: number, resource: UriComponents): Promise<[string, files.FileType][]>;
808 809
	$readFile(handle: number, resource: UriComponents): Promise<VSBuffer>;
	$writeFile(handle: number, resource: UriComponents, content: VSBuffer, opts: files.FileWriteOptions): Promise<void>;
J
Johannes Rieken 已提交
810 811
	$rename(handle: number, resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
	$copy(handle: number, resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
J
Johannes Rieken 已提交
812
	$mkdir(handle: number, resource: UriComponents): Promise<void>;
J
Johannes Rieken 已提交
813 814
	$delete(handle: number, resource: UriComponents, opts: files.FileDeleteOptions): Promise<void>;
	$watch(handle: number, session: number, resource: UriComponents, opts: files.IWatchOptions): void;
815
	$unwatch(handle: number, session: number): void;
J
Johannes Rieken 已提交
816
	$open(handle: number, resource: UriComponents, opts: files.FileOpenOptions): Promise<number>;
J
Johannes Rieken 已提交
817
	$close(handle: number, fd: number): Promise<void>;
818 819
	$read(handle: number, fd: number, pos: number, length: number): Promise<VSBuffer>;
	$write(handle: number, fd: number, pos: number, data: VSBuffer): Promise<number>;
820
}
821

822
export interface ExtHostSearchShape {
J
Johannes Rieken 已提交
823 824
	$provideFileSearchResults(handle: number, session: number, query: search.IRawQuery, token: CancellationToken): Promise<search.ISearchCompleteStats>;
	$provideTextSearchResults(handle: number, session: number, query: search.IRawTextQuery, token: CancellationToken): Promise<search.ISearchCompleteStats>;
J
Johannes Rieken 已提交
825
	$clearCache(cacheKey: string): Promise<void>;
826 827
}

A
Tweaks  
Alex Dima 已提交
828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843
export interface IResolveAuthorityErrorResult {
	type: 'error';
	error: {
		message: string | undefined;
		code: RemoteAuthorityResolverErrorCode;
		detail: any;
	};
}

export interface IResolveAuthorityOKResult {
	type: 'ok';
	value: ResolvedAuthority;
}

export type IResolveAuthorityResult = IResolveAuthorityErrorResult | IResolveAuthorityOKResult;

844
export interface ExtHostExtensionServiceShape {
A
Tweaks  
Alex Dima 已提交
845
	$resolveAuthority(remoteAuthority: string, resolveAttempt: number): Promise<IResolveAuthorityResult>;
846
	$startExtensionHost(enabledExtensionIds: ExtensionIdentifier[]): Promise<void>;
J
Johannes Rieken 已提交
847
	$activateByEvent(activationEvent: string): Promise<void>;
848
	$activate(extensionId: ExtensionIdentifier, activationEvent: string): Promise<boolean>;
849

850
	$deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise<void>;
851 852

	$test_latency(n: number): Promise<number>;
853 854
	$test_up(b: VSBuffer): Promise<number>;
	$test_down(size: number): Promise<VSBuffer>;
855 856 857
}

export interface FileSystemEvents {
J
Johannes Rieken 已提交
858 859 860
	created: UriComponents[];
	changed: UriComponents[];
	deleted: UriComponents[];
861
}
862
export interface ExtHostFileSystemEventServiceShape {
863
	$onFileEvent(events: FileSystemEvents): void;
864
	$onFileRename(oldUri: UriComponents, newUri: UriComponents): void;
J
Johannes Rieken 已提交
865
	$onWillRename(oldUri: UriComponents, newUri: UriComponents): Promise<any>;
866 867
}

J
Johannes Rieken 已提交
868
export interface ObjectIdentifier {
869
	$ident?: number;
J
Johannes Rieken 已提交
870 871 872
}

export namespace ObjectIdentifier {
873
	export const name = '$ident';
J
Johannes Rieken 已提交
874
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
875
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
876 877
		return <T & ObjectIdentifier>obj;
	}
878 879
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
880 881 882
	}
}

883 884
export interface ExtHostHeapServiceShape {
	$onGarbageCollection(ids: number[]): void;
885
}
886
export interface IRawColorInfo {
J
Joao Moreno 已提交
887
	color: [number, number, number, number];
888 889 890
	range: IRange;
}

891 892 893 894 895 896 897 898 899
export class IdObject {
	_id?: number;
	private static _n = 0;
	static mixin<T extends object>(object: T): T & IdObject {
		(<any>object)._id = IdObject._n++;
		return <any>object;
	}
}

J
Johannes Rieken 已提交
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914
export interface SuggestDataDto {
	a/* label */: string;
	b/* kind */: modes.CompletionItemKind;
	c/* detail */?: string;
	d/* documentation */?: string | IMarkdownString;
	e/* sortText */?: string;
	f/* filterText */?: string;
	g/* preselect */?: boolean;
	h/* insertText */?: string;
	i/* insertTextRules */?: modes.CompletionItemInsertTextRule;
	j/* range */?: IRange;
	k/* commitCharacters */?: string[];
	l/* additionalTextEdits */?: ISingleEditOperation[];
	m/* command */?: modes.Command;
	// not-standard
915
	x?: ChainedCacheId;
J
Johannes Rieken 已提交
916 917 918
}

export interface SuggestResultDto {
919
	x?: number;
J
Johannes Rieken 已提交
920 921 922
	a: IRange;
	b: SuggestDataDto[];
	c?: boolean;
923 924
}

925 926 927 928 929 930 931 932 933 934 935 936 937 938
export interface SignatureHelpDto {
	id: CacheId;
	signatures: modes.SignatureInformation[];
	activeSignature: number;
	activeParameter: number;
}

export interface SignatureHelpContextDto {
	readonly triggerKind: modes.SignatureHelpTriggerKind;
	readonly triggerCharacter?: string;
	readonly isRetrigger: boolean;
	readonly activeSignatureHelp?: SignatureHelpDto;
}

939 940 941
export interface LocationDto {
	uri: UriComponents;
	range: IRange;
942 943
}

M
Matt Bierner 已提交
944
export interface DefinitionLinkDto {
J
Johannes Rieken 已提交
945
	originSelectionRange?: IRange;
M
Matt Bierner 已提交
946 947
	uri: UriComponents;
	range: IRange;
J
Johannes Rieken 已提交
948
	targetSelectionRange?: IRange;
M
Matt Bierner 已提交
949 950
}

951
export interface WorkspaceSymbolDto extends IdObject {
952 953 954 955 956 957 958
	name: string;
	containerName?: string;
	kind: modes.SymbolKind;
	location: LocationDto;
}

export interface WorkspaceSymbolsDto extends IdObject {
959
	symbols: WorkspaceSymbolDto[];
960 961
}

962
export interface ResourceFileEditDto {
M
Matt Bierner 已提交
963 964
	oldUri?: UriComponents;
	newUri?: UriComponents;
965 966 967 968 969 970
	options?: {
		overwrite?: boolean;
		ignoreIfExists?: boolean;
		ignoreIfNotExists?: boolean;
		recursive?: boolean;
	};
971 972 973
}

export interface ResourceTextEditDto {
974
	resource: UriComponents;
975 976
	modelVersionId?: number;
	edits: modes.TextEdit[];
977 978
}

979
export interface WorkspaceEditDto {
980
	edits: Array<ResourceFileEditDto | ResourceTextEditDto>;
981 982

	// todo@joh reject should go into rename
983 984 985
	rejectReason?: string;
}

A
Alex Dima 已提交
986
export function reviveWorkspaceEditDto(data: WorkspaceEditDto | undefined): modes.WorkspaceEdit {
987 988 989 990 991 992 993 994 995 996 997 998 999
	if (data && data.edits) {
		for (const edit of data.edits) {
			if (typeof (<ResourceTextEditDto>edit).resource === 'object') {
				(<ResourceTextEditDto>edit).resource = URI.revive((<ResourceTextEditDto>edit).resource);
			} else {
				(<ResourceFileEditDto>edit).newUri = URI.revive((<ResourceFileEditDto>edit).newUri);
				(<ResourceFileEditDto>edit).oldUri = URI.revive((<ResourceFileEditDto>edit).oldUri);
			}
		}
	}
	return <modes.WorkspaceEdit>data;
}

1000 1001
export type CommandDto = ObjectIdentifier & modes.Command;

1002 1003
export interface CodeActionDto {
	title: string;
1004
	edit?: WorkspaceEditDto;
1005
	diagnostics?: IMarkerData[];
1006
	command?: CommandDto;
J
Johannes Rieken 已提交
1007
	kind?: string;
1008
	isPreferred?: boolean;
1009
}
1010

1011 1012 1013 1014 1015
export interface CodeActionListDto {
	cacheId: number;
	actions: ReadonlyArray<CodeActionDto>;
}

1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
export type CacheId = number;
export type ChainedCacheId = [CacheId, CacheId];

export interface LinksListDto {
	id?: CacheId;
	links: LinkDto[];
}

export interface LinkDto {
	cacheId?: ChainedCacheId;
M
Martin Aeschlimann 已提交
1026 1027
	range: IRange;
	url?: string | UriComponents;
1028
	tooltip?: string;
M
Martin Aeschlimann 已提交
1029
}
1030

1031 1032 1033 1034 1035 1036 1037
export interface CodeLensListDto {
	cacheId?: number;
	lenses: CodeLensDto[];
}

export interface CodeLensDto {
	cacheId?: ChainedCacheId;
1038 1039 1040
	range: IRange;
	command?: CommandDto;
}
1041

1042 1043 1044 1045 1046 1047 1048 1049 1050 1051
export interface CallHierarchyDto {
	_id: number;
	kind: modes.SymbolKind;
	name: string;
	detail?: string;
	uri: UriComponents;
	range: IRange;
	selectionRange: IRange;
}

1052
export interface ExtHostLanguageFeaturesShape {
1053
	$provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise<modes.DocumentSymbol[] | undefined>;
1054
	$provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise<CodeLensListDto | undefined>;
1055
	$resolveCodeLens(handle: number, symbol: CodeLensDto, token: CancellationToken): Promise<CodeLensDto | undefined>;
1056
	$releaseCodeLenses(handle: number, id: number): void;
J
Johannes Rieken 已提交
1057 1058 1059 1060
	$provideDefinition(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<DefinitionLinkDto[]>;
	$provideDeclaration(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<DefinitionLinkDto[]>;
	$provideImplementation(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<DefinitionLinkDto[]>;
	$provideTypeDefinition(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<DefinitionLinkDto[]>;
1061 1062 1063
	$provideHover(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<modes.Hover | undefined>;
	$provideDocumentHighlights(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<modes.DocumentHighlight[] | undefined>;
	$provideReferences(handle: number, resource: UriComponents, position: IPosition, context: modes.ReferenceContext, token: CancellationToken): Promise<LocationDto[] | undefined>;
1064 1065
	$provideCodeActions(handle: number, resource: UriComponents, rangeOrSelection: IRange | ISelection, context: modes.CodeActionContext, token: CancellationToken): Promise<CodeActionListDto | undefined>;
	$releaseCodeActions(handle: number, cacheId: number): void;
1066 1067 1068
	$provideDocumentFormattingEdits(handle: number, resource: UriComponents, options: modes.FormattingOptions, token: CancellationToken): Promise<ISingleEditOperation[] | undefined>;
	$provideDocumentRangeFormattingEdits(handle: number, resource: UriComponents, range: IRange, options: modes.FormattingOptions, token: CancellationToken): Promise<ISingleEditOperation[] | undefined>;
	$provideOnTypeFormattingEdits(handle: number, resource: UriComponents, position: IPosition, ch: string, options: modes.FormattingOptions, token: CancellationToken): Promise<ISingleEditOperation[] | undefined>;
J
Johannes Rieken 已提交
1069
	$provideWorkspaceSymbols(handle: number, search: string, token: CancellationToken): Promise<WorkspaceSymbolsDto>;
1070
	$resolveWorkspaceSymbol(handle: number, symbol: WorkspaceSymbolDto, token: CancellationToken): Promise<WorkspaceSymbolDto | undefined>;
1071
	$releaseWorkspaceSymbols(handle: number, id: number): void;
1072 1073
	$provideRenameEdits(handle: number, resource: UriComponents, position: IPosition, newName: string, token: CancellationToken): Promise<WorkspaceEditDto | undefined>;
	$resolveRenameLocation(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<modes.RenameLocation | undefined>;
1074
	$provideCompletionItems(handle: number, resource: UriComponents, position: IPosition, context: modes.CompletionContext, token: CancellationToken): Promise<SuggestResultDto | undefined>;
1075
	$resolveCompletionItem(handle: number, resource: UriComponents, position: IPosition, id: ChainedCacheId, token: CancellationToken): Promise<SuggestDataDto | undefined>;
1076
	$releaseCompletionItems(handle: number, id: number): void;
1077 1078
	$provideSignatureHelp(handle: number, resource: UriComponents, position: IPosition, context: modes.SignatureHelpContext, token: CancellationToken): Promise<SignatureHelpDto | undefined>;
	$releaseSignatureHelp(handle: number, id: number): void;
1079
	$provideDocumentLinks(handle: number, resource: UriComponents, token: CancellationToken): Promise<LinksListDto | undefined>;
1080
	$resolveDocumentLink(handle: number, id: ChainedCacheId, token: CancellationToken): Promise<LinkDto | undefined>;
1081
	$releaseDocumentLinks(handle: number, id: number): void;
J
Johannes Rieken 已提交
1082
	$provideDocumentColors(handle: number, resource: UriComponents, token: CancellationToken): Promise<IRawColorInfo[]>;
M
Matt Bierner 已提交
1083 1084
	$provideColorPresentations(handle: number, resource: UriComponents, colorInfo: IRawColorInfo, token: CancellationToken): Promise<modes.IColorPresentation[] | undefined>;
	$provideFoldingRanges(handle: number, resource: UriComponents, context: modes.FoldingContext, token: CancellationToken): Promise<modes.FoldingRange[] | undefined>;
1085
	$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]>;
1086 1087
	$provideCallHierarchyItem(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<CallHierarchyDto | undefined>;
	$resolveCallHierarchyItem(handle: number, item: callHierarchy.CallHierarchyItem, direction: callHierarchy.CallHierarchyDirection, token: CancellationToken): Promise<[CallHierarchyDto, modes.Location[]][]>;
1088 1089
}

1090 1091
export interface ExtHostQuickOpenShape {
	$onItemSelected(handle: number): void;
M
Matt Bierner 已提交
1092
	$validateInput(input: string): Promise<string | null | undefined>;
1093 1094 1095
	$onDidChangeActive(sessionId: number, handles: number[]): void;
	$onDidChangeSelection(sessionId: number, handles: number[]): void;
	$onDidAccept(sessionId: number): void;
1096
	$onDidChangeValue(sessionId: number, value: string): void;
C
Christof Marti 已提交
1097
	$onDidTriggerButton(sessionId: number, handle: number): void;
1098
	$onDidHide(sessionId: number): void;
1099 1100
}

1101 1102 1103 1104
export interface ShellLaunchConfigDto {
	name?: string;
	executable?: string;
	args?: string[] | string;
1105
	cwd?: string | UriComponents;
1106
	env?: { [key: string]: string | null };
1107 1108
}

D
Daniel Imms 已提交
1109 1110 1111 1112 1113
export interface IShellDefinitionDto {
	label: string;
	path: string;
}

1114 1115
export interface ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void;
1116
	$acceptTerminalOpened(id: number, name: string): void;
1117
	$acceptActiveTerminalChanged(id: number | null): void;
1118
	$acceptTerminalProcessId(id: number, processId: number): void;
A
Alex Dima 已提交
1119
	$acceptTerminalProcessData(id: number, data: string): void;
D
Daniel Imms 已提交
1120
	$acceptTerminalRendererInput(id: number, data: string): void;
1121
	$acceptTerminalTitleChange(id: number, name: string): void;
1122
	$acceptTerminalDimensions(id: number, cols: number, rows: number): void;
D
Daniel Imms 已提交
1123
	$createProcess(id: number, shellLaunchConfig: ShellLaunchConfigDto, activeWorkspaceRootUri: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
D
Daniel Imms 已提交
1124 1125
	$acceptProcessInput(id: number, data: string): void;
	$acceptProcessResize(id: number, cols: number, rows: number): void;
1126
	$acceptProcessShutdown(id: number, immediate: boolean): void;
1127 1128
	$acceptProcessRequestInitialCwd(id: number): void;
	$acceptProcessRequestCwd(id: number): void;
1129
	$acceptProcessRequestLatency(id: number): number;
1130
	$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
1131
	$requestAvailableShells(): Promise<IShellDefinitionDto[]>;
1132 1133
}

1134
export interface ExtHostSCMShape {
M
Matt Bierner 已提交
1135
	$provideOriginalResource(sourceControlHandle: number, uri: UriComponents, token: CancellationToken): Promise<UriComponents | null>;
A
Alex Dima 已提交
1136
	$onInputBoxValueChange(sourceControlHandle: number, value: string): void;
J
Johannes Rieken 已提交
1137 1138 1139
	$executeResourceCommand(sourceControlHandle: number, groupHandle: number, handle: number): Promise<void>;
	$validateInput(sourceControlHandle: number, value: string, cursorPosition: number): Promise<[string, number] | undefined>;
	$setSelectedSourceControls(selectedSourceControlHandles: number[]): Promise<void>;
J
Joao Moreno 已提交
1140 1141
}

1142
export interface ExtHostTaskShape {
J
Johannes Rieken 已提交
1143 1144 1145 1146 1147
	$provideTasks(handle: number, validTypes: { [key: string]: boolean; }): Thenable<tasks.TaskSetDTO>;
	$onDidStartTask(execution: tasks.TaskExecutionDTO, terminalId: number): void;
	$onDidStartTaskProcess(value: tasks.TaskProcessStartedDTO): void;
	$onDidEndTaskProcess(value: tasks.TaskProcessEndedDTO): void;
	$OnDidEndTask(execution: tasks.TaskExecutionDTO): void;
J
Johannes Rieken 已提交
1148
	$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }, variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
1149 1150
}

1151 1152
export interface IBreakpointDto {
	type: string;
1153
	id?: string;
1154 1155 1156
	enabled: boolean;
	condition?: string;
	hitCondition?: string;
1157 1158 1159 1160 1161
	logMessage?: string;
}

export interface IFunctionBreakpointDto extends IBreakpointDto {
	type: 'function';
1162
	functionName: string;
1163 1164
}

1165
export interface ISourceBreakpointDto extends IBreakpointDto {
1166
	type: 'source';
1167
	uri: UriComponents;
1168 1169
	line: number;
	character: number;
1170 1171
}

1172
export interface IBreakpointsDeltaDto {
1173
	added?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
1174
	removed?: string[];
1175
	changed?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
1176 1177
}

1178 1179 1180 1181
export interface ISourceMultiBreakpointDto {
	type: 'sourceMulti';
	uri: UriComponents;
	lines: {
1182
		id: string;
1183 1184 1185
		enabled: boolean;
		condition?: string;
		hitCondition?: string;
1186
		logMessage?: string;
1187 1188 1189
		line: number;
		character: number;
	}[];
1190 1191
}

A
Andre Weinand 已提交
1192
export interface IDebugSessionFullDto {
1193 1194 1195
	id: DebugSessionUUID;
	type: string;
	name: string;
1196
	folderUri: UriComponents | undefined;
A
Andre Weinand 已提交
1197
	configuration: IConfig;
1198 1199
}

A
Andre Weinand 已提交
1200 1201
export type IDebugSessionDto = IDebugSessionFullDto | DebugSessionUUID;

1202
export interface ExtHostDebugServiceShape {
J
Johannes Rieken 已提交
1203 1204 1205 1206
	$substituteVariables(folder: UriComponents | undefined, config: IConfig): Promise<IConfig>;
	$runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): Promise<number | undefined>;
	$startDASession(handle: number, session: IDebugSessionDto): Promise<void>;
	$stopDASession(handle: number): Promise<void>;
1207
	$sendDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
1208
	$resolveDebugConfiguration(handle: number, folder: UriComponents | undefined, debugConfiguration: IConfig): Promise<IConfig | null | undefined>;
J
Johannes Rieken 已提交
1209 1210 1211
	$provideDebugConfigurations(handle: number, folder: UriComponents | undefined): Promise<IConfig[]>;
	$legacyDebugAdapterExecutable(handle: number, folderUri: UriComponents | undefined): Promise<IAdapterDescriptor>; // TODO@AW legacy
	$provideDebugAdapter(handle: number, session: IDebugSessionDto): Promise<IAdapterDescriptor>;
1212 1213
	$acceptDebugSessionStarted(session: IDebugSessionDto): void;
	$acceptDebugSessionTerminated(session: IDebugSessionDto): void;
1214
	$acceptDebugSessionActiveChanged(session: IDebugSessionDto | undefined): void;
1215 1216
	$acceptDebugSessionCustomEvent(session: IDebugSessionDto, event: any): void;
	$acceptBreakpointsDelta(delta: IBreakpointsDeltaDto): void;
1217 1218
}

1219

1220 1221 1222 1223 1224 1225
export interface DecorationRequest {
	readonly id: number;
	readonly handle: number;
	readonly uri: UriComponents;
}

1226
export type DecorationData = [number, boolean, string, string, ThemeColor, string];
1227
export type DecorationReply = { [id: number]: DecorationData };
1228 1229

export interface ExtHostDecorationsShape {
J
Johannes Rieken 已提交
1230
	$provideDecorations(requests: DecorationRequest[], token: CancellationToken): Promise<DecorationReply>;
1231 1232
}

1233 1234
export interface ExtHostWindowShape {
	$onDidChangeWindowFocus(value: boolean): void;
1235 1236
}

S
Sandeep Somavarapu 已提交
1237
export interface ExtHostLogServiceShape {
A
Alex Dima 已提交
1238
	$setLevel(level: LogLevel): void;
S
Sandeep Somavarapu 已提交
1239 1240
}

1241 1242 1243 1244
export interface ExtHostOutputServiceShape {
	$setVisibleChannel(channelId: string | null): void;
}

1245 1246 1247 1248
export interface ExtHostProgressShape {
	$acceptProgressCanceled(handle: number): void;
}

M
Matt Bierner 已提交
1249
export interface ExtHostCommentsShape {
1250
	$provideDocumentComments(handle: number, document: UriComponents): Promise<modes.CommentInfo | null>;
1251
	$createNewCommentThread(handle: number, document: UriComponents, range: IRange, text: string): Promise<modes.CommentThread | null>;
P
Peng Lyu 已提交
1252
	$createCommentThreadTemplate(commentControllerHandle: number, uriComponents: UriComponents, range: IRange): void;
1253
	$updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange): Promise<void>;
P
Peng Lyu 已提交
1254
	$onCommentWidgetInputChange(commentControllerHandle: number, document: UriComponents, range: IRange, input: string | undefined): Promise<number | undefined>;
1255
	$deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number): void;
P
Peng Lyu 已提交
1256
	$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined>;
P
Peng Lyu 已提交
1257
	$checkStaticContribution(commentControllerHandle: number): Promise<boolean>;
P
Peng Lyu 已提交
1258 1259
	$provideReactionGroup(commentControllerHandle: number): Promise<modes.CommentReaction[] | undefined>;
	$toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise<void>;
P
Peng Lyu 已提交
1260
	$createNewCommentWidgetCallback(commentControllerHandle: number, uriComponents: UriComponents, range: IRange, token: CancellationToken): Promise<void>;
1261
	$replyToCommentThread(handle: number, document: UriComponents, range: IRange, commentThread: modes.CommentThread, text: string): Promise<modes.CommentThread | null>;
J
Johannes Rieken 已提交
1262 1263
	$editComment(handle: number, document: UriComponents, comment: modes.Comment, text: string): Promise<void>;
	$deleteComment(handle: number, document: UriComponents, comment: modes.Comment): Promise<void>;
1264 1265 1266
	$startDraft(handle: number, document: UriComponents): Promise<void>;
	$deleteDraft(handle: number, document: UriComponents): Promise<void>;
	$finishDraft(handle: number, document: UriComponents): Promise<void>;
P
Peng Lyu 已提交
1267 1268
	$addReaction(handle: number, document: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise<void>;
	$deleteReaction(handle: number, document: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise<void>;
1269
	$provideWorkspaceComments(handle: number): Promise<modes.CommentThread[] | null>;
M
Matt Bierner 已提交
1270 1271
}

1272
export interface ExtHostStorageShape {
1273
	$acceptValue(shared: boolean, key: string, value: object | undefined): void;
1274 1275
}

1276 1277 1278
// --- proxy identifiers

export const MainContext = {
1279 1280
	MainThreadClipboard: createMainId<MainThreadClipboardShape>('MainThreadClipboard'),
	MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands'),
M
Matt Bierner 已提交
1281
	MainThreadComments: createMainId<MainThreadCommentsShape>('MainThreadComments'),
1282
	MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration'),
1283
	MainThreadConsole: createMainId<MainThreadConsoleShape>('MainThreadConsole'),
1284
	MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService'),
1285 1286 1287 1288
	MainThreadDecorations: createMainId<MainThreadDecorationsShape>('MainThreadDecorations'),
	MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics'),
	MainThreadDialogs: createMainId<MainThreadDiaglogsShape>('MainThreadDiaglogs'),
	MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments'),
1289
	MainThreadDocumentContentProviders: createMainId<MainThreadDocumentContentProvidersShape>('MainThreadDocumentContentProviders'),
1290
	MainThreadTextEditors: createMainId<MainThreadTextEditorsShape>('MainThreadTextEditors'),
1291
	MainThreadEditorInsets: createMainId<MainThreadEditorInsetsShape>('MainThreadEditorInsets'),
1292 1293
	MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors'),
	MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews'),
A
Alex Dima 已提交
1294
	MainThreadKeytar: createMainId<MainThreadKeytarShape>('MainThreadKeytar'),
1295
	MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures'),
1296
	MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages'),
1297
	MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService'),
1298 1299
	MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService'),
	MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress'),
1300
	MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen'),
1301
	MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar'),
1302
	MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
1303
	MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
1304
	MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
M
Matt Bierner 已提交
1305
	MainThreadWebviews: createMainId<MainThreadWebviewsShape>('MainThreadWebviews'),
J
Joao Moreno 已提交
1306
	MainThreadUrls: createMainId<MainThreadUrlsShape>('MainThreadUrls'),
1307
	MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
1308
	MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
1309
	MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
J
Joao Moreno 已提交
1310
	MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM'),
1311
	MainThreadSearch: createMainId<MainThreadSearchShape>('MainThreadSearch'),
1312
	MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask'),
1313
	MainThreadWindow: createMainId<MainThreadWindowShape>('MainThreadWindow'),
1314 1315 1316
};

export const ExtHostContext = {
1317
	ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands'),
1318
	ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration'),
1319
	ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics'),
1320
	ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService'),
J
Johannes Rieken 已提交
1321
	ExtHostDecorations: createExtId<ExtHostDecorationsShape>('ExtHostDecorations'),
1322
	ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors'),
1323
	ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
J
Johannes Rieken 已提交
1324
	ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
J
Johannes Rieken 已提交
1325
	ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
J
Johannes Rieken 已提交
1326
	ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors'),
1327
	ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
J
Johannes Rieken 已提交
1328
	ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem'),
J
Johannes Rieken 已提交
1329
	ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
1330
	ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures'),
1331 1332
	ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'),
	ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService'),
1333
	ExtHostLogService: createExtId<ExtHostLogServiceShape>('ExtHostLogService'),
1334
	ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService'),
J
Joao Moreno 已提交
1335
	ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM'),
1336
	ExtHostSearch: createExtId<ExtHostSearchShape>('ExtHostSearch'),
1337
	ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask'),
1338
	ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
1339
	ExtHostWindow: createExtId<ExtHostWindowShape>('ExtHostWindow'),
1340
	ExtHostWebviews: createExtId<ExtHostWebviewsShape>('ExtHostWebviews'),
1341
	ExtHostEditorInsets: createExtId<ExtHostEditorInsetsShape>('ExtHostEditorInsets'),
M
Matt Bierner 已提交
1342
	ExtHostProgress: createMainId<ExtHostProgressShape>('ExtHostProgress'),
1343
	ExtHostComments: createMainId<ExtHostCommentsShape>('ExtHostComments'),
1344
	ExtHostStorage: createMainId<ExtHostStorageShape>('ExtHostStorage'),
1345 1346
	ExtHostUrls: createExtId<ExtHostUrlsShape>('ExtHostUrls'),
	ExtHostOutputService: createMainId<ExtHostOutputServiceShape>('ExtHostOutputService'),
1347
};