extHost.protocol.ts 61.0 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';
49
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
S
Sandeep Somavarapu 已提交
50

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

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

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

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

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

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

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

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

107 108
// --- main thread

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

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

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

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

M
Matt Bierner 已提交
137
export interface MainThreadCommentsShape extends IDisposable {
P
Peng Lyu 已提交
138
	$registerCommentController(handle: number, id: string, label: string): void;
139
	$unregisterCommentController(handle: number): void;
P
Peng Lyu 已提交
140
	$updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void;
141
	$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, extensionId: ExtensionIdentifier): modes.CommentThread2 | undefined;
P
Peng Lyu 已提交
142
	$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 已提交
143
	$deleteCommentThread(handle: number, commentThreadHandle: number): void;
P
Peng Lyu 已提交
144
	$setInputValue(handle: number, input: string): void;
R
rebornix 已提交
145
	$registerDocumentCommentProvider(handle: number, features: CommentProviderFeatures): void;
146
	$unregisterDocumentCommentProvider(handle: number): void;
147
	$registerWorkspaceCommentProvider(handle: number, extensionId: ExtensionIdentifier): void;
148
	$unregisterWorkspaceCommentProvider(handle: number): void;
149
	$onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent): void;
M
Matt Bierner 已提交
150 151
}

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

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

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

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

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

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

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

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

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

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

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 已提交
229
	setEndOfLine?: EndOfLineSequence;
230 231
}

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

239
export interface MainThreadTextEditorsShape extends IDisposable {
240
	$tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise<string | undefined>;
241 242
	$registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void;
	$removeTextEditorDecorationType(key: string): void;
J
Johannes Rieken 已提交
243 244 245 246 247 248 249 250 251
	$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 已提交
252
	$tryInsertSnippet(id: string, template: string, selections: readonly IRange[], opts: IUndoStopOptions): Promise<boolean>;
J
Johannes Rieken 已提交
253
	$getDiffInformation(id: string): Promise<editorCommon.ILineChange[]>;
254 255
}

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

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

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

A
Alex Dima 已提交
271 272 273 274 275 276 277
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>;
}

278 279 280 281 282 283 284 285 286 287 288 289 290
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;
291
	oneLineAboveText?: ISerializedRegExp;
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 317
	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[];
		}[];
	};
}

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

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

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

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

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

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

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

375
export interface MainThreadOutputServiceShape extends IDisposable {
J
Johannes Rieken 已提交
376
	$register(label: string, log: boolean, file?: UriComponents): Promise<string>;
377 378 379 380 381 382
	$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;
383 384
}

385
export interface MainThreadProgressShape extends IDisposable {
386

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

D
Daniel Imms 已提交
392 393 394 395 396 397 398 399 400 401 402 403
export interface TerminalLaunchConfig {
	name?: string;
	shellPath?: string;
	shellArgs?: string[] | string;
	cwd?: string | UriComponents;
	env?: { [key: string]: string | null };
	waitOnExit?: boolean;
	strictEnv?: boolean;
	hideFromUser?: boolean;
	isVirtualProcess?: boolean;
}

404
export interface MainThreadTerminalServiceShape extends IDisposable {
D
Daniel Imms 已提交
405
	$createTerminal(config: TerminalLaunchConfig): Promise<{ id: number, name: string }>;
J
Johannes Rieken 已提交
406
	$createTerminalRenderer(name: string): Promise<number>;
407 408 409 410
	$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 已提交
411
	$registerOnDataListener(terminalId: number): void;
412

413
	// Process
414 415
	$sendProcessTitle(terminalId: number, title: string): void;
	$sendProcessData(terminalId: number, data: string): void;
D
Daniel Imms 已提交
416
	$sendProcessReady(terminalId: number, pid: number, cwd: string): void;
D
Daniel Imms 已提交
417
	$sendProcessExit(terminalId: number, exitCode: number): void;
D
Daniel Imms 已提交
418
	$sendOverrideDimensions(terminalId: number, dimensions: ITerminalDimensions | undefined): void;
419 420
	$sendProcessInitialCwd(terminalId: number, cwd: string): void;
	$sendProcessCwd(terminalId: number, initialCwd: string): void;
421 422 423

	// Renderer
	$terminalRendererSetName(terminalId: number, name: string): void;
D
Daniel Imms 已提交
424
	$terminalRendererSetDimensions(terminalId: number, dimensions: ITerminalDimensions): void;
425
	$terminalRendererWrite(terminalId: number, text: string): void;
D
Daniel Imms 已提交
426
	$terminalRendererRegisterOnInputListener(terminalId: number): void;
D
Daniel Imms 已提交
427 428
}

J
Johannes Rieken 已提交
429
export interface TransferQuickPickItems extends quickInput.IQuickPickItem {
430 431
	handle: number;
}
C
Christof Marti 已提交
432

J
Johannes Rieken 已提交
433
export interface TransferQuickInputButton extends quickInput.IQuickInputButton {
434 435
	handle: number;
}
436 437 438 439 440

export type TransferQuickInput = TransferQuickPick | TransferInputBox;

export interface BaseTransferQuickInput {

441 442
	[key: string]: any;

443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
	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 已提交
462
	buttons?: TransferQuickInputButton[];
463

C
Christof Marti 已提交
464
	items?: TransferQuickPickItems[];
465

466 467 468 469
	activeItems?: number[];

	selectedItems?: number[];

470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
	canSelectMany?: boolean;

	ignoreFocusOut?: boolean;

	matchOnDescription?: boolean;

	matchOnDetail?: boolean;
}

export interface TransferInputBox extends BaseTransferQuickInput {

	type?: 'inputBox';

	value?: string;

	placeholder?: string;

	password?: boolean;

C
Christof Marti 已提交
489
	buttons?: TransferQuickInputButton[];
490 491 492 493 494 495

	prompt?: string;

	validationMessage?: string;
}

496 497 498 499 500 501 502 503 504
export interface IInputBoxOptions {
	value?: string;
	valueSelection?: [number, number];
	prompt?: string;
	placeHolder?: string;
	password?: boolean;
	ignoreFocusOut?: boolean;
}

505
export interface MainThreadQuickOpenShape extends IDisposable {
J
Johannes Rieken 已提交
506
	$show(instance: number, options: quickInput.IPickOptions<TransferQuickPickItems>, token: CancellationToken): Promise<number | number[] | undefined>;
J
Johannes Rieken 已提交
507 508
	$setItems(instance: number, items: TransferQuickPickItems[]): Promise<void>;
	$setError(instance: number, error: Error): Promise<void>;
509
	$input(options: IInputBoxOptions | undefined, validateInput: boolean, token: CancellationToken): Promise<string>;
J
Johannes Rieken 已提交
510 511
	$createOrUpdate(params: TransferQuickInput): Promise<void>;
	$dispose(id: number): Promise<void>;
512 513
}

514
export interface MainThreadStatusBarShape extends IDisposable {
B
Benjamin Pasero 已提交
515
	$setEntry(id: number, statusId: string, statusName: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: statusbar.StatusbarAlignment, priority: number | undefined): void;
516
	$dispose(id: number): void;
517 518
}

519
export interface MainThreadStorageShape extends IDisposable {
520
	$getValue<T>(shared: boolean, key: string): Promise<T | undefined>;
J
Johannes Rieken 已提交
521
	$setValue(shared: boolean, key: string, value: object): Promise<void>;
522 523
}

524
export interface MainThreadTelemetryShape extends IDisposable {
525
	$publicLog(eventName: string, data?: any): void;
526
	$publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void;
527 528
}

529
export interface MainThreadEditorInsetsShape extends IDisposable {
530
	$createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void>;
531 532 533 534 535
	$disposeEditorInset(handle: number): void;

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

539 540 541 542 543 544
export interface ExtHostEditorInsetsShape {
	$onDidDispose(handle: number): void;
	$onDidReceiveMessage(handle: number, message: any): void;
}

export type WebviewPanelHandle = string;
545

M
Matt Bierner 已提交
546 547 548 549 550
export interface WebviewPanelShowOptions {
	readonly viewColumn?: EditorViewColumn;
	readonly preserveFocus?: boolean;
}

M
Matt Bierner 已提交
551
export interface MainThreadWebviewsShape extends IDisposable {
552
	$createWebviewPanel(handle: WebviewPanelHandle, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: modes.IWebviewPanelOptions & modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void;
553
	$disposeWebview(handle: WebviewPanelHandle): void;
M
Matt Bierner 已提交
554
	$reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void;
555
	$setTitle(handle: WebviewPanelHandle, value: string): void;
556
	$setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void;
557

558 559 560
	$setHtml(handle: WebviewPanelHandle, value: string): void;
	$setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void;
	$postMessage(handle: WebviewPanelHandle, value: any): Promise<boolean>;
561
	$getResourceRoot(handle: WebviewPanelHandle): Promise<string>;
562 563 564

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

M
Matt Bierner 已提交
567 568 569 570 571 572
export interface WebviewPanelViewState {
	readonly active: boolean;
	readonly visible: boolean;
	readonly position: EditorViewColumn;
}

M
Matt Bierner 已提交
573
export interface ExtHostWebviewsShape {
574
	$onMessage(handle: WebviewPanelHandle, message: any): void;
M
Matt Bierner 已提交
575
	$onDidChangeWebviewPanelViewState(handle: WebviewPanelHandle, newState: WebviewPanelViewState): void;
J
Johannes Rieken 已提交
576
	$onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise<void>;
577
	$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
M
Matt Bierner 已提交
578 579
}

J
Joao Moreno 已提交
580
export interface MainThreadUrlsShape extends IDisposable {
581
	$registerUriHandler(handle: number, extensionId: ExtensionIdentifier): Promise<void>;
J
Johannes Rieken 已提交
582
	$unregisterUriHandler(handle: number): Promise<void>;
J
Joao Moreno 已提交
583 584 585
}

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

589 590 591 592
export interface ITextSearchComplete {
	limitHit?: boolean;
}

593
export interface MainThreadWorkspaceShape extends IDisposable {
594
	$startFileSearch(includePattern: string | undefined, includeFolder: UriComponents | undefined, excludePatternOrDisregardExcludes: string | false | undefined, maxResults: number | undefined, token: CancellationToken): Promise<UriComponents[] | undefined>;
595
	$startTextSearch(query: search.IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<ITextSearchComplete>;
J
Johannes Rieken 已提交
596 597 598
	$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>;
599
	$resolveProxy(url: string): Promise<string | undefined>;
600
}
601

J
Johannes Rieken 已提交
602 603
export interface IFileChangeDto {
	resource: UriComponents;
J
Johannes Rieken 已提交
604
	type: files.FileChangeType;
J
Johannes Rieken 已提交
605 606
}

607
export interface MainThreadFileSystemShape extends IDisposable {
J
Johannes Rieken 已提交
608
	$registerFileSystemProvider(handle: number, scheme: string, capabilities: files.FileSystemProviderCapabilities): void;
609
	$unregisterProvider(handle: number): void;
J
Johannes Rieken 已提交
610
	$onFileSystemChange(handle: number, resource: IFileChangeDto[]): void;
611 612 613 614 615 616 617 618 619

	$stat(uri: UriComponents): Promise<files.IStat>;
	$readdir(resource: UriComponents): Promise<[string, files.FileType][]>;
	$readFile(resource: UriComponents): Promise<VSBuffer>;
	$writeFile(resource: UriComponents, content: VSBuffer, opts: files.FileWriteOptions): Promise<void>;
	$rename(resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
	$copy(resource: UriComponents, target: UriComponents, opts: files.FileOverwriteOptions): Promise<void>;
	$mkdir(resource: UriComponents): Promise<void>;
	$delete(resource: UriComponents, opts: files.FileDeleteOptions): Promise<void>;
620
}
J
Johannes Rieken 已提交
621

622 623 624 625 626
export interface MainThreadLabelServiceShape extends IDisposable {
	$registerResourceLabelFormatter(handle: number, formatter: ResourceLabelFormatter): void;
	$unregisterResourceLabelFormatter(handle: number): void;
}

627
export interface MainThreadSearchShape extends IDisposable {
628 629
	$registerFileSearchProvider(handle: number, scheme: string): void;
	$registerTextSearchProvider(handle: number, scheme: string): void;
630
	$unregisterProvider(handle: number): void;
631
	$handleFileMatch(handle: number, session: number, data: UriComponents[]): void;
J
Johannes Rieken 已提交
632
	$handleTextMatch(handle: number, session: number, data: search.IRawFileMatch2[]): void;
633
	$handleTelemetry(eventName: string, data: any): void;
634 635
}

636
export interface MainThreadTaskShape extends IDisposable {
J
Johannes Rieken 已提交
637
	$createTaskId(task: tasks.TaskDTO): Promise<string>;
J
Johannes Rieken 已提交
638 639
	$registerTaskProvider(handle: number): Promise<void>;
	$unregisterTaskProvider(handle: number): Promise<void>;
J
Johannes Rieken 已提交
640 641
	$fetchTasks(filter?: tasks.TaskFilterDTO): Promise<tasks.TaskDTO[]>;
	$executeTask(task: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
J
Johannes Rieken 已提交
642
	$terminateTask(id: string): Promise<void>;
J
Johannes Rieken 已提交
643
	$registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
G
Gabriel DeBacker 已提交
644
	$customExecutionComplete(id: string, result?: number): Promise<void>;
645 646
}

647
export interface MainThreadExtensionServiceShape extends IDisposable {
A
Alex Dima 已提交
648
	$activateExtension(extensionId: ExtensionIdentifier, activationEvent: string | null): Promise<void>;
649
	$onWillActivateExtension(extensionId: ExtensionIdentifier): void;
A
Alex Dima 已提交
650
	$onDidActivateExtension(extensionId: ExtensionIdentifier, startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number, activationEvent: string | null): void;
651
	$onExtensionActivationError(extensionId: ExtensionIdentifier, error: ExtensionActivationError): Promise<void>;
652
	$onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void;
A
Alex Dima 已提交
653
	$onExtensionHostExit(code: number): void;
654 655
}

J
Joao Moreno 已提交
656
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
657 658
	hasQuickDiffProvider?: boolean;
	count?: number;
659 660
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
J
Joao Moreno 已提交
661
	statusBarCommands?: CommandDto[];
J
Joao Moreno 已提交
662 663 664 665
}

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

J
Joao Moreno 已提交
668
export type SCMRawResource = [
669
	number /*handle*/,
670
	UriComponents /*resourceUri*/,
J
Joao Moreno 已提交
671
	string[] /*icons: light, dark*/,
672
	string /*tooltip*/,
673
	boolean /*strike through*/,
674 675
	boolean /*faded*/,

J
Joao Moreno 已提交
676 677 678
	string | undefined /*source*/,
	string | undefined /*letter*/,
	ThemeColor | null /*color*/
J
Joao Moreno 已提交
679
];
680

681 682 683
export type SCMRawResourceSplice = [
	number /* start */,
	number /* delete count */,
J
Joao 已提交
684 685 686
	SCMRawResource[]
];

687 688 689 690 691
export type SCMRawResourceSplices = [
	number, /*handle*/
	SCMRawResourceSplice[]
];

692
export interface MainThreadSCMShape extends IDisposable {
693
	$registerSourceControl(handle: number, id: string, label: string, rootUri: UriComponents | undefined): void;
694 695
	$updateSourceControl(handle: number, features: SCMProviderFeatures): void;
	$unregisterSourceControl(handle: number): void;
J
Joao Moreno 已提交
696

697 698 699 700
	$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 已提交
701

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

J
Joao Moreno 已提交
704
	$setInputBoxValue(sourceControlHandle: number, value: string): void;
705
	$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
706
	$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
707
	$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
J
Joao Moreno 已提交
708 709
}

710 711
export type DebugSessionUUID = string;

712 713 714 715 716 717 718
export interface IDebugConfiguration {
	type: string;
	name: string;
	request: string;
	[key: string]: any;
}

719
export interface MainThreadDebugServiceShape extends IDisposable {
A
Alex Dima 已提交
720
	$registerDebugTypes(debugTypes: string[]): void;
721
	$sessionCached(sessionID: string): void;
A
Alex Dima 已提交
722
	$acceptDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
723 724
	$acceptDAError(handle: number, name: string, message: string, stack: string | undefined): void;
	$acceptDAExit(handle: number, code: number | undefined, signal: string | undefined): void;
A
Andre Weinand 已提交
725
	$registerDebugConfigurationProvider(type: string, hasProvideMethod: boolean, hasResolveMethod: boolean, hasProvideDaMethod: boolean, handle: number): Promise<void>;
J
Johannes Rieken 已提交
726
	$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
727
	$unregisterDebugConfigurationProvider(handle: number): void;
A
Andre Weinand 已提交
728
	$unregisterDebugAdapterDescriptorFactory(handle: number): void;
729
	$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
J
Johannes Rieken 已提交
730
	$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
731 732
	$appendDebugConsole(value: string): void;
	$startBreakpointEvents(): void;
733
	$registerBreakpoints(breakpoints: Array<ISourceMultiBreakpointDto | IFunctionBreakpointDto>): Promise<void>;
J
Johannes Rieken 已提交
734
	$unregisterBreakpoints(breakpointIds: string[], functionBreakpointIds: string[]): Promise<void>;
735 736
}

737 738 739 740
export interface IOpenUriOptions {
	readonly allowTunneling?: boolean;
}

741
export interface MainThreadWindowShape extends IDisposable {
J
Johannes Rieken 已提交
742
	$getWindowVisibility(): Promise<boolean>;
743
	$openUri(uri: UriComponents, options: IOpenUriOptions): Promise<boolean>;
744 745
}

746 747
// -- extension host

748
export interface ExtHostCommandsShape {
J
Johannes Rieken 已提交
749 750
	$executeContributedCommand<T>(id: string, ...args: any[]): Promise<T>;
	$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescription }>;
751 752
}

753
export interface ExtHostConfigurationShape {
754 755
	$initializeConfiguration(data: IConfigurationInitData): void;
	$acceptConfigurationChanged(data: IConfigurationInitData, eventData: IWorkspaceConfigurationChangeEventData): void;
756 757
}

758
export interface ExtHostDiagnosticsShape {
759 760 761

}

762
export interface ExtHostDocumentContentProvidersShape {
M
Matt Bierner 已提交
763
	$provideTextDocumentContent(handle: number, uri: UriComponents): Promise<string | null | undefined>;
764 765
}

766
export interface IModelAddedData {
767
	uri: UriComponents;
768
	versionId: number;
769 770
	lines: string[];
	EOL: string;
771 772 773
	modeId: string;
	isDirty: boolean;
}
774
export interface ExtHostDocumentsShape {
775 776 777 778
	$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;
779 780
}

781
export interface ExtHostDocumentSaveParticipantShape {
J
Johannes Rieken 已提交
782
	$participateInSave(resource: UriComponents, reason: SaveReason): Promise<boolean[]>;
783 784
}

785 786
export interface ITextEditorAddData {
	id: string;
787
	documentUri: UriComponents;
788
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
789
	selections: ISelection[];
790
	visibleRanges: IRange[];
A
Alex Dima 已提交
791
	editorPosition: EditorViewColumn | undefined;
792 793
}
export interface ITextEditorPositionData {
794
	[id: string]: EditorViewColumn;
795
}
796 797 798
export interface IEditorPropertiesChangeData {
	options: IResolvedTextEditorConfiguration | null;
	selections: ISelectionChangeEvent | null;
799
	visibleRanges: IRange[] | null;
800 801 802 803 804 805
}
export interface ISelectionChangeEvent {
	selections: Selection[];
	source?: string;
}

806
export interface ExtHostEditorsShape {
807
	$acceptEditorPropertiesChanged(id: string, props: IEditorPropertiesChangeData): void;
808
	$acceptEditorPositionData(data: ITextEditorPositionData): void;
809 810
}

J
Johannes Rieken 已提交
811
export interface IDocumentsAndEditorsDelta {
812
	removedDocuments?: UriComponents[];
J
Johannes Rieken 已提交
813 814 815
	addedDocuments?: IModelAddedData[];
	removedEditors?: string[];
	addedEditors?: ITextEditorAddData[];
A
Alex Dima 已提交
816
	newActiveEditor?: string | null;
J
Johannes Rieken 已提交
817 818
}

819 820
export interface ExtHostDocumentsAndEditorsShape {
	$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void;
J
Johannes Rieken 已提交
821 822
}

823
export interface ExtHostTreeViewsShape {
J
Johannes Rieken 已提交
824
	$getChildren(treeViewId: string, treeItemHandle?: string): Promise<ITreeItem[]>;
825
	$setExpanded(treeViewId: string, treeItemHandle: string, expanded: boolean): void;
826
	$setSelection(treeViewId: string, treeItemHandles: string[]): void;
827
	$setVisible(treeViewId: string, visible: boolean): void;
S
Sandeep Somavarapu 已提交
828 829
}

830
export interface ExtHostWorkspaceShape {
831
	$initializeWorkspace(workspace: IWorkspaceData | null): void;
832
	$acceptWorkspaceData(workspace: IWorkspaceData | null): void;
J
Johannes Rieken 已提交
833
	$handleTextSearchResult(result: search.IRawFileMatch2, requestId: number): void;
834
}
835

836
export interface ExtHostFileSystemShape {
J
Johannes Rieken 已提交
837 838
	$stat(handle: number, resource: UriComponents): Promise<files.IStat>;
	$readdir(handle: number, resource: UriComponents): Promise<[string, files.FileType][]>;
839 840
	$readFile(handle: number, resource: UriComponents): Promise<VSBuffer>;
	$writeFile(handle: number, resource: UriComponents, content: VSBuffer, opts: files.FileWriteOptions): Promise<void>;
J
Johannes Rieken 已提交
841 842
	$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 已提交
843
	$mkdir(handle: number, resource: UriComponents): Promise<void>;
J
Johannes Rieken 已提交
844 845
	$delete(handle: number, resource: UriComponents, opts: files.FileDeleteOptions): Promise<void>;
	$watch(handle: number, session: number, resource: UriComponents, opts: files.IWatchOptions): void;
846
	$unwatch(handle: number, session: number): void;
J
Johannes Rieken 已提交
847
	$open(handle: number, resource: UriComponents, opts: files.FileOpenOptions): Promise<number>;
J
Johannes Rieken 已提交
848
	$close(handle: number, fd: number): Promise<void>;
849 850
	$read(handle: number, fd: number, pos: number, length: number): Promise<VSBuffer>;
	$write(handle: number, fd: number, pos: number, data: VSBuffer): Promise<number>;
851
}
852

853 854 855 856
export interface ExtHostLabelServiceShape {
	$registerResourceLabelFormatter(formatter: ResourceLabelFormatter): IDisposable;
}

857
export interface ExtHostSearchShape {
J
Johannes Rieken 已提交
858 859
	$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 已提交
860
	$clearCache(cacheKey: string): Promise<void>;
861 862
}

A
Tweaks  
Alex Dima 已提交
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878
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;

879
export interface ExtHostExtensionServiceShape {
A
Tweaks  
Alex Dima 已提交
880
	$resolveAuthority(remoteAuthority: string, resolveAttempt: number): Promise<IResolveAuthorityResult>;
881
	$startExtensionHost(enabledExtensionIds: ExtensionIdentifier[]): Promise<void>;
J
Johannes Rieken 已提交
882
	$activateByEvent(activationEvent: string): Promise<void>;
883
	$activate(extensionId: ExtensionIdentifier, activationEvent: string): Promise<boolean>;
884

885
	$deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise<void>;
886 887

	$test_latency(n: number): Promise<number>;
888 889
	$test_up(b: VSBuffer): Promise<number>;
	$test_down(size: number): Promise<VSBuffer>;
890 891 892
}

export interface FileSystemEvents {
J
Johannes Rieken 已提交
893 894 895
	created: UriComponents[];
	changed: UriComponents[];
	deleted: UriComponents[];
896
}
897
export interface ExtHostFileSystemEventServiceShape {
898
	$onFileEvent(events: FileSystemEvents): void;
899
	$onFileRename(oldUri: UriComponents, newUri: UriComponents): void;
J
Johannes Rieken 已提交
900
	$onWillRename(oldUri: UriComponents, newUri: UriComponents): Promise<any>;
901 902
}

J
Johannes Rieken 已提交
903
export interface ObjectIdentifier {
904
	$ident?: number;
J
Johannes Rieken 已提交
905 906 907
}

export namespace ObjectIdentifier {
908
	export const name = '$ident';
J
Johannes Rieken 已提交
909
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
910
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
911 912
		return <T & ObjectIdentifier>obj;
	}
913 914
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
915 916 917
	}
}

918 919
export interface ExtHostHeapServiceShape {
	$onGarbageCollection(ids: number[]): void;
920
}
921
export interface IRawColorInfo {
J
Joao Moreno 已提交
922
	color: [number, number, number, number];
923 924 925
	range: IRange;
}

926 927 928 929 930 931 932 933 934
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 已提交
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949
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
950
	x?: ChainedCacheId;
J
Johannes Rieken 已提交
951 952 953
}

export interface SuggestResultDto {
954
	x?: number;
J
Johannes Rieken 已提交
955 956 957
	a: IRange;
	b: SuggestDataDto[];
	c?: boolean;
958 959
}

960 961 962 963 964 965 966 967 968 969 970 971 972 973
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;
}

974 975 976
export interface LocationDto {
	uri: UriComponents;
	range: IRange;
977 978
}

M
Matt Bierner 已提交
979
export interface DefinitionLinkDto {
J
Johannes Rieken 已提交
980
	originSelectionRange?: IRange;
M
Matt Bierner 已提交
981 982
	uri: UriComponents;
	range: IRange;
J
Johannes Rieken 已提交
983
	targetSelectionRange?: IRange;
M
Matt Bierner 已提交
984 985
}

986
export interface WorkspaceSymbolDto extends IdObject {
987 988 989 990 991 992 993
	name: string;
	containerName?: string;
	kind: modes.SymbolKind;
	location: LocationDto;
}

export interface WorkspaceSymbolsDto extends IdObject {
994
	symbols: WorkspaceSymbolDto[];
995 996
}

997
export interface ResourceFileEditDto {
M
Matt Bierner 已提交
998 999
	oldUri?: UriComponents;
	newUri?: UriComponents;
1000 1001 1002 1003 1004 1005
	options?: {
		overwrite?: boolean;
		ignoreIfExists?: boolean;
		ignoreIfNotExists?: boolean;
		recursive?: boolean;
	};
1006 1007 1008
}

export interface ResourceTextEditDto {
1009
	resource: UriComponents;
1010 1011
	modelVersionId?: number;
	edits: modes.TextEdit[];
1012 1013
}

1014
export interface WorkspaceEditDto {
1015
	edits: Array<ResourceFileEditDto | ResourceTextEditDto>;
1016 1017

	// todo@joh reject should go into rename
1018 1019 1020
	rejectReason?: string;
}

A
Alex Dima 已提交
1021
export function reviveWorkspaceEditDto(data: WorkspaceEditDto | undefined): modes.WorkspaceEdit {
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
	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;
}

1035 1036
export type CommandDto = ObjectIdentifier & modes.Command;

1037 1038
export interface CodeActionDto {
	title: string;
1039
	edit?: WorkspaceEditDto;
1040
	diagnostics?: IMarkerData[];
1041
	command?: CommandDto;
J
Johannes Rieken 已提交
1042
	kind?: string;
1043
	isPreferred?: boolean;
1044
}
1045

1046 1047 1048 1049 1050
export interface CodeActionListDto {
	cacheId: number;
	actions: ReadonlyArray<CodeActionDto>;
}

1051 1052 1053 1054 1055 1056 1057 1058 1059 1060
export type CacheId = number;
export type ChainedCacheId = [CacheId, CacheId];

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

export interface LinkDto {
	cacheId?: ChainedCacheId;
M
Martin Aeschlimann 已提交
1061 1062
	range: IRange;
	url?: string | UriComponents;
1063
	tooltip?: string;
M
Martin Aeschlimann 已提交
1064
}
1065

1066 1067 1068 1069 1070 1071 1072
export interface CodeLensListDto {
	cacheId?: number;
	lenses: CodeLensDto[];
}

export interface CodeLensDto {
	cacheId?: ChainedCacheId;
1073 1074 1075
	range: IRange;
	command?: CommandDto;
}
1076

1077 1078 1079 1080 1081 1082 1083 1084 1085 1086
export interface CallHierarchyDto {
	_id: number;
	kind: modes.SymbolKind;
	name: string;
	detail?: string;
	uri: UriComponents;
	range: IRange;
	selectionRange: IRange;
}

1087
export interface ExtHostLanguageFeaturesShape {
1088
	$provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise<modes.DocumentSymbol[] | undefined>;
1089
	$provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise<CodeLensListDto | undefined>;
1090
	$resolveCodeLens(handle: number, symbol: CodeLensDto, token: CancellationToken): Promise<CodeLensDto | undefined>;
1091
	$releaseCodeLenses(handle: number, id: number): void;
J
Johannes Rieken 已提交
1092 1093 1094 1095
	$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[]>;
1096 1097 1098
	$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>;
1099 1100
	$provideCodeActions(handle: number, resource: UriComponents, rangeOrSelection: IRange | ISelection, context: modes.CodeActionContext, token: CancellationToken): Promise<CodeActionListDto | undefined>;
	$releaseCodeActions(handle: number, cacheId: number): void;
1101 1102 1103
	$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 已提交
1104
	$provideWorkspaceSymbols(handle: number, search: string, token: CancellationToken): Promise<WorkspaceSymbolsDto>;
1105
	$resolveWorkspaceSymbol(handle: number, symbol: WorkspaceSymbolDto, token: CancellationToken): Promise<WorkspaceSymbolDto | undefined>;
1106
	$releaseWorkspaceSymbols(handle: number, id: number): void;
1107 1108
	$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>;
1109
	$provideCompletionItems(handle: number, resource: UriComponents, position: IPosition, context: modes.CompletionContext, token: CancellationToken): Promise<SuggestResultDto | undefined>;
1110
	$resolveCompletionItem(handle: number, resource: UriComponents, position: IPosition, id: ChainedCacheId, token: CancellationToken): Promise<SuggestDataDto | undefined>;
1111
	$releaseCompletionItems(handle: number, id: number): void;
1112 1113
	$provideSignatureHelp(handle: number, resource: UriComponents, position: IPosition, context: modes.SignatureHelpContext, token: CancellationToken): Promise<SignatureHelpDto | undefined>;
	$releaseSignatureHelp(handle: number, id: number): void;
1114
	$provideDocumentLinks(handle: number, resource: UriComponents, token: CancellationToken): Promise<LinksListDto | undefined>;
1115
	$resolveDocumentLink(handle: number, id: ChainedCacheId, token: CancellationToken): Promise<LinkDto | undefined>;
1116
	$releaseDocumentLinks(handle: number, id: number): void;
J
Johannes Rieken 已提交
1117
	$provideDocumentColors(handle: number, resource: UriComponents, token: CancellationToken): Promise<IRawColorInfo[]>;
M
Matt Bierner 已提交
1118 1119
	$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>;
1120
	$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]>;
1121 1122
	$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[]][]>;
1123 1124
}

1125 1126
export interface ExtHostQuickOpenShape {
	$onItemSelected(handle: number): void;
M
Matt Bierner 已提交
1127
	$validateInput(input: string): Promise<string | null | undefined>;
1128 1129 1130
	$onDidChangeActive(sessionId: number, handles: number[]): void;
	$onDidChangeSelection(sessionId: number, handles: number[]): void;
	$onDidAccept(sessionId: number): void;
1131
	$onDidChangeValue(sessionId: number, value: string): void;
C
Christof Marti 已提交
1132
	$onDidTriggerButton(sessionId: number, handle: number): void;
1133
	$onDidHide(sessionId: number): void;
1134 1135
}

1136 1137 1138 1139
export interface ShellLaunchConfigDto {
	name?: string;
	executable?: string;
	args?: string[] | string;
1140
	cwd?: string | UriComponents;
1141
	env?: { [key: string]: string | null };
1142 1143
}

D
Daniel Imms 已提交
1144 1145 1146 1147 1148
export interface IShellDefinitionDto {
	label: string;
	path: string;
}

D
Daniel Imms 已提交
1149 1150 1151 1152 1153
export interface IShellAndArgsDto {
	shell: string;
	args: string[] | string | undefined;
}

1154 1155
export interface ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void;
1156
	$acceptTerminalOpened(id: number, name: string): void;
1157
	$acceptActiveTerminalChanged(id: number | null): void;
1158
	$acceptTerminalProcessId(id: number, processId: number): void;
A
Alex Dima 已提交
1159
	$acceptTerminalProcessData(id: number, data: string): void;
D
Daniel Imms 已提交
1160
	$acceptTerminalRendererInput(id: number, data: string): void;
1161
	$acceptTerminalTitleChange(id: number, name: string): void;
1162
	$acceptTerminalDimensions(id: number, cols: number, rows: number): void;
1163
	$acceptTerminalMaximumDimensions(id: number, cols: number, rows: number): void;
D
Daniel Imms 已提交
1164
	$createProcess(id: number, shellLaunchConfig: ShellLaunchConfigDto, activeWorkspaceRootUri: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
D
Daniel Imms 已提交
1165 1166
	$acceptProcessInput(id: number, data: string): void;
	$acceptProcessResize(id: number, cols: number, rows: number): void;
1167
	$acceptProcessShutdown(id: number, immediate: boolean): void;
1168 1169
	$acceptProcessRequestInitialCwd(id: number): void;
	$acceptProcessRequestCwd(id: number): void;
1170
	$acceptProcessRequestLatency(id: number): number;
1171
	$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
1172
	$requestAvailableShells(): Promise<IShellDefinitionDto[]>;
D
Daniel Imms 已提交
1173
	$requestDefaultShellAndArgs(): Promise<IShellAndArgsDto>;
1174 1175
}

1176
export interface ExtHostSCMShape {
M
Matt Bierner 已提交
1177
	$provideOriginalResource(sourceControlHandle: number, uri: UriComponents, token: CancellationToken): Promise<UriComponents | null>;
A
Alex Dima 已提交
1178
	$onInputBoxValueChange(sourceControlHandle: number, value: string): void;
J
Johannes Rieken 已提交
1179 1180 1181
	$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 已提交
1182 1183
}

1184
export interface ExtHostTaskShape {
J
Johannes Rieken 已提交
1185 1186 1187 1188 1189
	$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 已提交
1190
	$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }, variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
1191 1192
}

1193 1194
export interface IBreakpointDto {
	type: string;
1195
	id?: string;
1196 1197 1198
	enabled: boolean;
	condition?: string;
	hitCondition?: string;
1199 1200 1201 1202 1203
	logMessage?: string;
}

export interface IFunctionBreakpointDto extends IBreakpointDto {
	type: 'function';
1204
	functionName: string;
1205 1206
}

1207
export interface ISourceBreakpointDto extends IBreakpointDto {
1208
	type: 'source';
1209
	uri: UriComponents;
1210 1211
	line: number;
	character: number;
1212 1213
}

1214
export interface IBreakpointsDeltaDto {
1215
	added?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
1216
	removed?: string[];
1217
	changed?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
1218 1219
}

1220 1221 1222 1223
export interface ISourceMultiBreakpointDto {
	type: 'sourceMulti';
	uri: UriComponents;
	lines: {
1224
		id: string;
1225 1226 1227
		enabled: boolean;
		condition?: string;
		hitCondition?: string;
1228
		logMessage?: string;
1229 1230 1231
		line: number;
		character: number;
	}[];
1232 1233
}

A
Andre Weinand 已提交
1234
export interface IDebugSessionFullDto {
1235 1236 1237
	id: DebugSessionUUID;
	type: string;
	name: string;
1238
	folderUri: UriComponents | undefined;
A
Andre Weinand 已提交
1239
	configuration: IConfig;
1240 1241
}

A
Andre Weinand 已提交
1242 1243
export type IDebugSessionDto = IDebugSessionFullDto | DebugSessionUUID;

1244
export interface ExtHostDebugServiceShape {
J
Johannes Rieken 已提交
1245 1246 1247 1248
	$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>;
1249
	$sendDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
1250
	$resolveDebugConfiguration(handle: number, folder: UriComponents | undefined, debugConfiguration: IConfig): Promise<IConfig | null | undefined>;
J
Johannes Rieken 已提交
1251 1252 1253
	$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>;
1254 1255
	$acceptDebugSessionStarted(session: IDebugSessionDto): void;
	$acceptDebugSessionTerminated(session: IDebugSessionDto): void;
1256
	$acceptDebugSessionActiveChanged(session: IDebugSessionDto | undefined): void;
1257 1258
	$acceptDebugSessionCustomEvent(session: IDebugSessionDto, event: any): void;
	$acceptBreakpointsDelta(delta: IBreakpointsDeltaDto): void;
1259 1260
}

1261

1262 1263 1264 1265 1266 1267
export interface DecorationRequest {
	readonly id: number;
	readonly handle: number;
	readonly uri: UriComponents;
}

1268
export type DecorationData = [number, boolean, string, string, ThemeColor, string];
1269
export type DecorationReply = { [id: number]: DecorationData };
1270 1271

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

1275 1276
export interface ExtHostWindowShape {
	$onDidChangeWindowFocus(value: boolean): void;
1277 1278
}

S
Sandeep Somavarapu 已提交
1279
export interface ExtHostLogServiceShape {
A
Alex Dima 已提交
1280
	$setLevel(level: LogLevel): void;
S
Sandeep Somavarapu 已提交
1281 1282
}

1283 1284 1285 1286
export interface ExtHostOutputServiceShape {
	$setVisibleChannel(channelId: string | null): void;
}

1287 1288 1289 1290
export interface ExtHostProgressShape {
	$acceptProgressCanceled(handle: number): void;
}

M
Matt Bierner 已提交
1291
export interface ExtHostCommentsShape {
1292
	$provideDocumentComments(handle: number, document: UriComponents): Promise<modes.CommentInfo | null>;
1293
	$createNewCommentThread(handle: number, document: UriComponents, range: IRange, text: string): Promise<modes.CommentThread | null>;
P
Peng Lyu 已提交
1294
	$createCommentThreadTemplate(commentControllerHandle: number, uriComponents: UriComponents, range: IRange): void;
1295
	$updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange): Promise<void>;
P
Peng Lyu 已提交
1296
	$onCommentWidgetInputChange(commentControllerHandle: number, document: UriComponents, range: IRange, input: string | undefined): Promise<number | undefined>;
1297
	$deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number): void;
P
Peng Lyu 已提交
1298
	$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined>;
P
Peng Lyu 已提交
1299
	$checkStaticContribution(commentControllerHandle: number): Promise<boolean>;
P
Peng Lyu 已提交
1300 1301
	$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 已提交
1302
	$createNewCommentWidgetCallback(commentControllerHandle: number, uriComponents: UriComponents, range: IRange, token: CancellationToken): Promise<void>;
1303
	$replyToCommentThread(handle: number, document: UriComponents, range: IRange, commentThread: modes.CommentThread, text: string): Promise<modes.CommentThread | null>;
J
Johannes Rieken 已提交
1304 1305
	$editComment(handle: number, document: UriComponents, comment: modes.Comment, text: string): Promise<void>;
	$deleteComment(handle: number, document: UriComponents, comment: modes.Comment): Promise<void>;
1306 1307 1308
	$startDraft(handle: number, document: UriComponents): Promise<void>;
	$deleteDraft(handle: number, document: UriComponents): Promise<void>;
	$finishDraft(handle: number, document: UriComponents): Promise<void>;
P
Peng Lyu 已提交
1309 1310
	$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>;
1311
	$provideWorkspaceComments(handle: number): Promise<modes.CommentThread[] | null>;
M
Matt Bierner 已提交
1312 1313
}

1314
export interface ExtHostStorageShape {
1315
	$acceptValue(shared: boolean, key: string, value: object | undefined): void;
1316 1317
}

1318 1319 1320
// --- proxy identifiers

export const MainContext = {
1321 1322
	MainThreadClipboard: createMainId<MainThreadClipboardShape>('MainThreadClipboard'),
	MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands'),
M
Matt Bierner 已提交
1323
	MainThreadComments: createMainId<MainThreadCommentsShape>('MainThreadComments'),
1324
	MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration'),
1325
	MainThreadConsole: createMainId<MainThreadConsoleShape>('MainThreadConsole'),
1326
	MainThreadDebugService: createMainId<MainThreadDebugServiceShape>('MainThreadDebugService'),
1327 1328 1329 1330
	MainThreadDecorations: createMainId<MainThreadDecorationsShape>('MainThreadDecorations'),
	MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics'),
	MainThreadDialogs: createMainId<MainThreadDiaglogsShape>('MainThreadDiaglogs'),
	MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments'),
1331
	MainThreadDocumentContentProviders: createMainId<MainThreadDocumentContentProvidersShape>('MainThreadDocumentContentProviders'),
1332
	MainThreadTextEditors: createMainId<MainThreadTextEditorsShape>('MainThreadTextEditors'),
1333
	MainThreadEditorInsets: createMainId<MainThreadEditorInsetsShape>('MainThreadEditorInsets'),
1334 1335
	MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors'),
	MainThreadTreeViews: createMainId<MainThreadTreeViewsShape>('MainThreadTreeViews'),
A
Alex Dima 已提交
1336
	MainThreadKeytar: createMainId<MainThreadKeytarShape>('MainThreadKeytar'),
1337
	MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures'),
1338
	MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages'),
1339
	MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService'),
1340 1341
	MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService'),
	MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress'),
1342
	MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen'),
1343
	MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar'),
1344
	MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
1345
	MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
1346
	MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
M
Matt Bierner 已提交
1347
	MainThreadWebviews: createMainId<MainThreadWebviewsShape>('MainThreadWebviews'),
J
Joao Moreno 已提交
1348
	MainThreadUrls: createMainId<MainThreadUrlsShape>('MainThreadUrls'),
1349
	MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
1350
	MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
1351
	MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
J
Joao Moreno 已提交
1352
	MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM'),
1353
	MainThreadSearch: createMainId<MainThreadSearchShape>('MainThreadSearch'),
1354
	MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask'),
1355
	MainThreadWindow: createMainId<MainThreadWindowShape>('MainThreadWindow'),
1356
	MainThreadLabelService: createMainId<MainThreadLabelServiceShape>('MainThreadLabelService')
1357 1358 1359
};

export const ExtHostContext = {
1360
	ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands'),
1361
	ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration'),
1362
	ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics'),
1363
	ExtHostDebugService: createExtId<ExtHostDebugServiceShape>('ExtHostDebugService'),
J
Johannes Rieken 已提交
1364
	ExtHostDecorations: createExtId<ExtHostDecorationsShape>('ExtHostDecorations'),
1365
	ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors'),
1366
	ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
J
Johannes Rieken 已提交
1367
	ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
J
Johannes Rieken 已提交
1368
	ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
J
Johannes Rieken 已提交
1369
	ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors'),
1370
	ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
J
Johannes Rieken 已提交
1371
	ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem'),
J
Johannes Rieken 已提交
1372
	ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
1373
	ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures'),
1374 1375
	ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'),
	ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService'),
1376
	ExtHostLogService: createExtId<ExtHostLogServiceShape>('ExtHostLogService'),
1377
	ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService'),
J
Joao Moreno 已提交
1378
	ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM'),
1379
	ExtHostSearch: createExtId<ExtHostSearchShape>('ExtHostSearch'),
1380
	ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask'),
1381
	ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
1382
	ExtHostWindow: createExtId<ExtHostWindowShape>('ExtHostWindow'),
1383
	ExtHostWebviews: createExtId<ExtHostWebviewsShape>('ExtHostWebviews'),
1384
	ExtHostEditorInsets: createExtId<ExtHostEditorInsetsShape>('ExtHostEditorInsets'),
M
Matt Bierner 已提交
1385
	ExtHostProgress: createMainId<ExtHostProgressShape>('ExtHostProgress'),
1386
	ExtHostComments: createMainId<ExtHostCommentsShape>('ExtHostComments'),
1387
	ExtHostStorage: createMainId<ExtHostStorageShape>('ExtHostStorage'),
1388 1389
	ExtHostUrls: createExtId<ExtHostUrlsShape>('ExtHostUrls'),
	ExtHostOutputService: createMainId<ExtHostOutputServiceShape>('ExtHostOutputService'),
1390
	ExtHosLabelService: createMainId<ExtHostLabelServiceShape>('ExtHostLabelService')
1391
};