extHost.protocol.ts 60.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.
 *--------------------------------------------------------------------------------------------*/

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

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

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

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

S
Sandeep Somavarapu 已提交
92
export interface IConfigurationInitData extends IConfigurationData {
S
Sandeep Somavarapu 已提交
93
	configurationScopes: [string, ConfigurationScope | undefined][];
S
Sandeep Somavarapu 已提交
94 95
}

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

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

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

108 109
// --- main thread

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

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

R
rebornix 已提交
122
export interface CommentProviderFeatures {
P
Peng Lyu 已提交
123
	reactionGroup?: modes.CommentReaction[];
P
Peng Lyu 已提交
124
	reactionHandler?: boolean;
R
rebornix 已提交
125 126
}

M
Matt Bierner 已提交
127
export interface MainThreadCommentsShape extends IDisposable {
P
Peng Lyu 已提交
128
	$registerCommentController(handle: number, id: string, label: string): void;
129
	$unregisterCommentController(handle: number): void;
P
Peng Lyu 已提交
130
	$updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void;
131
	$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, extensionId: ExtensionIdentifier): modes.CommentThread | undefined;
132
	$updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, label: string | undefined, contextValue: string | undefined, comments: modes.Comment[], collapseState: modes.CommentThreadCollapsibleState): void;
P
Peng Lyu 已提交
133
	$deleteCommentThread(handle: number, commentThreadHandle: number): void;
134
	$onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent): void;
M
Matt Bierner 已提交
135 136
}

137
export interface MainThreadConfigurationShape extends IDisposable {
138 139
	$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: any, resource: UriComponents | undefined): Promise<void>;
	$removeConfigurationOption(target: ConfigurationTarget | null, key: string, resource: UriComponents | undefined): Promise<void>;
140 141
}

142
export interface MainThreadDiagnosticsShape extends IDisposable {
143
	$changeMany(owner: string, entries: [UriComponents, IMarkerData[] | undefined][]): void;
144
	$clear(owner: string): void;
145 146
}

147
export interface MainThreadDialogOpenOptions {
148
	defaultUri?: UriComponents;
149
	openLabel?: string;
150 151 152
	canSelectFiles?: boolean;
	canSelectFolders?: boolean;
	canSelectMany?: boolean;
J
Johannes Rieken 已提交
153
	filters?: { [name: string]: string[] };
154 155
}

156
export interface MainThreadDialogSaveOptions {
157
	defaultUri?: UriComponents;
158
	saveLabel?: string;
J
Johannes Rieken 已提交
159
	filters?: { [name: string]: string[] };
160 161
}

162
export interface MainThreadDiaglogsShape extends IDisposable {
163 164
	$showOpenDialog(options: MainThreadDialogOpenOptions): Promise<UriComponents[] | undefined>;
	$showSaveDialog(options: MainThreadDialogSaveOptions): Promise<UriComponents | undefined>;
165 166
}

167 168 169
export interface MainThreadDecorationsShape extends IDisposable {
	$registerDecorationProvider(handle: number, label: string): void;
	$unregisterDecorationProvider(handle: number): void;
170
	$onDidChange(handle: number, resources: UriComponents[] | null): void;
171 172
}

173
export interface MainThreadDocumentContentProvidersShape extends IDisposable {
174 175
	$registerTextContentProvider(handle: number, scheme: string): void;
	$unregisterTextContentProvider(handle: number): void;
176
	$onVirtualDocumentChange(uri: UriComponents, value: string): void;
177 178
}

179
export interface MainThreadDocumentsShape extends IDisposable {
J
Johannes Rieken 已提交
180 181 182
	$tryCreateDocument(options?: { language?: string; content?: string; }): Promise<UriComponents>;
	$tryOpenDocument(uri: UriComponents): Promise<void>;
	$trySaveDocument(uri: UriComponents): Promise<boolean>;
183 184
}

185 186
export interface ITextEditorConfigurationUpdate {
	tabSize?: number | 'auto';
A
Alex Dima 已提交
187
	indentSize?: number | 'tabSize';
188 189
	insertSpaces?: boolean | 'auto';
	cursorStyle?: TextEditorCursorStyle;
190
	lineNumbers?: RenderLineNumbersType;
191 192 193 194
}

export interface IResolvedTextEditorConfiguration {
	tabSize: number;
D
David Lechner 已提交
195
	indentSize: number;
196 197
	insertSpaces: boolean;
	cursorStyle: TextEditorCursorStyle;
198
	lineNumbers: RenderLineNumbersType;
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
}

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 已提交
214
	setEndOfLine?: EndOfLineSequence;
215 216
}

217
export interface ITextDocumentShowOptions {
218
	position?: EditorViewColumn;
219 220
	preserveFocus?: boolean;
	pinned?: boolean;
221
	selection?: IRange;
222 223
}

224
export interface MainThreadTextEditorsShape extends IDisposable {
225
	$tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise<string | undefined>;
226 227
	$registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void;
	$removeTextEditorDecorationType(key: string): void;
J
Johannes Rieken 已提交
228 229 230 231 232 233 234 235
	$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>;
J
Johannes Rieken 已提交
236
	$tryApplyWorkspaceEdit(workspaceEditDto: IWorkspaceEditDto): Promise<boolean>;
M
Matt Bierner 已提交
237
	$tryInsertSnippet(id: string, template: string, selections: readonly IRange[], opts: IUndoStopOptions): Promise<boolean>;
J
Johannes Rieken 已提交
238
	$getDiffInformation(id: string): Promise<editorCommon.ILineChange[]>;
239 240
}

241
export interface MainThreadTreeViewsShape extends IDisposable {
242
	$registerTreeViewDataProvider(treeViewId: string, options: { showCollapseAll: boolean, canSelectMany: boolean }): void;
J
Johannes Rieken 已提交
243 244
	$refresh(treeViewId: string, itemsToRefresh?: { [treeItemHandle: string]: ITreeItem }): Promise<void>;
	$reveal(treeViewId: string, treeItem: ITreeItem, parentChain: ITreeItem[], options: IRevealOptions): Promise<void>;
245
	$setMessage(treeViewId: string, message: string): void;
246
	$setTitle(treeViewId: string, title: string): void;
247 248
}

249 250 251 252
export interface MainThreadDownloadServiceShape extends IDisposable {
	$download(uri: UriComponents, to: UriComponents): Promise<void>;
}

253
export interface MainThreadErrorsShape extends IDisposable {
254
	$onUnexpectedError(err: any | SerializedError): void;
255 256
}

257
export interface MainThreadConsoleShape extends IDisposable {
258
	$logExtensionHostMessage(msg: IRemoteConsoleLog): void;
259 260
}

A
Alex Dima 已提交
261 262 263 264 265
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>;
266
	$findCredentials(service: string): Promise<Array<{ account: string, password: string }>>;
A
Alex Dima 已提交
267 268
}

J
Johannes Rieken 已提交
269
export interface IRegExpDto {
270 271 272
	pattern: string;
	flags?: string;
}
J
Johannes Rieken 已提交
273 274 275 276 277
export interface IIndentationRuleDto {
	decreaseIndentPattern: IRegExpDto;
	increaseIndentPattern: IRegExpDto;
	indentNextLinePattern?: IRegExpDto;
	unIndentedLinePattern?: IRegExpDto;
278
}
J
Johannes Rieken 已提交
279 280 281 282
export interface IOnEnterRuleDto {
	beforeText: IRegExpDto;
	afterText?: IRegExpDto;
	oneLineAboveText?: IRegExpDto;
283 284
	action: EnterAction;
}
J
Johannes Rieken 已提交
285
export interface ILanguageConfigurationDto {
286 287
	comments?: CommentRule;
	brackets?: CharacterPair[];
J
Johannes Rieken 已提交
288 289 290
	wordPattern?: IRegExpDto;
	indentationRules?: IIndentationRuleDto;
	onEnterRules?: IOnEnterRuleDto[];
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
	__electricCharacterSupport?: {
		brackets?: any;
		docComment?: {
			scope: string;
			open: string;
			lineStart: string;
			close?: string;
		};
	};
	__characterPairSupport?: {
		autoClosingPairs: {
			open: string;
			close: string;
			notIn?: string[];
		}[];
	};
}

309 310
export type GlobPattern = string | { base: string; pattern: string };

J
Johannes Rieken 已提交
311
export interface IDocumentFilterDto {
A
Alex Dima 已提交
312 313 314
	$serialized: true;
	language?: string;
	scheme?: string;
315
	pattern?: string | IRelativePattern;
316
	exclusive?: boolean;
A
Alex Dima 已提交
317 318
}

J
Johannes Rieken 已提交
319
export interface ISignatureHelpProviderMetadataDto {
320 321
	readonly triggerCharacters: readonly string[];
	readonly retriggerCharacters: readonly string[];
322 323
}

324
export interface MainThreadLanguageFeaturesShape extends IDisposable {
325
	$unregister(handle: number): void;
J
Johannes Rieken 已提交
326 327
	$registerDocumentSymbolProvider(handle: number, selector: IDocumentFilterDto[], label: string): void;
	$registerCodeLensSupport(handle: number, selector: IDocumentFilterDto[], eventHandle: number | undefined): void;
328
	$emitCodeLensEvent(eventHandle: number, event?: any): void;
J
Johannes Rieken 已提交
329 330 331 332 333 334 335 336 337 338 339
	$registerDefinitionSupport(handle: number, selector: IDocumentFilterDto[]): void;
	$registerDeclarationSupport(handle: number, selector: IDocumentFilterDto[]): void;
	$registerImplementationSupport(handle: number, selector: IDocumentFilterDto[]): void;
	$registerTypeDefinitionSupport(handle: number, selector: IDocumentFilterDto[]): void;
	$registerHoverProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$registerDocumentHighlightProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$registerReferenceSupport(handle: number, selector: IDocumentFilterDto[]): void;
	$registerQuickFixSupport(handle: number, selector: IDocumentFilterDto[], supportedKinds?: string[]): void;
	$registerDocumentFormattingSupport(handle: number, selector: IDocumentFilterDto[], extensionId: ExtensionIdentifier, displayName: string): void;
	$registerRangeFormattingSupport(handle: number, selector: IDocumentFilterDto[], extensionId: ExtensionIdentifier, displayName: string): void;
	$registerOnTypeFormattingSupport(handle: number, selector: IDocumentFilterDto[], autoFormatTriggerCharacters: string[], extensionId: ExtensionIdentifier): void;
340
	$registerNavigateTypeSupport(handle: number): void;
J
Johannes Rieken 已提交
341 342 343 344 345 346 347 348 349
	$registerRenameSupport(handle: number, selector: IDocumentFilterDto[], supportsResolveInitialValues: boolean): void;
	$registerSuggestSupport(handle: number, selector: IDocumentFilterDto[], triggerCharacters: string[], supportsResolveDetails: boolean, extensionId: ExtensionIdentifier): void;
	$registerSignatureHelpProvider(handle: number, selector: IDocumentFilterDto[], metadata: ISignatureHelpProviderMetadataDto): void;
	$registerDocumentLinkProvider(handle: number, selector: IDocumentFilterDto[], supportsResolve: boolean): void;
	$registerDocumentColorProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$registerFoldingRangeProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$registerSelectionRangeProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$registerCallHierarchyProvider(handle: number, selector: IDocumentFilterDto[]): void;
	$setLanguageConfiguration(handle: number, languageId: string, configuration: ILanguageConfigurationDto): void;
350 351
}

352
export interface MainThreadLanguagesShape extends IDisposable {
J
Johannes Rieken 已提交
353 354
	$getLanguages(): Promise<string[]>;
	$changeLanguage(resource: UriComponents, languageId: string): Promise<void>;
355 356
}

357
export interface MainThreadMessageOptions {
358
	extension?: IExtensionDescription;
359
	modal?: boolean;
360 361
}

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

366
export interface MainThreadOutputServiceShape extends IDisposable {
J
Johannes Rieken 已提交
367
	$register(label: string, log: boolean, file?: UriComponents): Promise<string>;
368 369 370 371 372 373
	$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;
374 375
}

376
export interface MainThreadProgressShape extends IDisposable {
377

B
Benjamin Pasero 已提交
378
	$startProgress(handle: number, options: IProgressOptions, extension?: IExtensionDescription): void;
379 380
	$progressReport(handle: number, message: IProgressStep): void;
	$progressEnd(handle: number): void;
381 382
}

D
Daniel Imms 已提交
383 384 385 386 387 388 389 390 391
export interface TerminalLaunchConfig {
	name?: string;
	shellPath?: string;
	shellArgs?: string[] | string;
	cwd?: string | UriComponents;
	env?: { [key: string]: string | null };
	waitOnExit?: boolean;
	strictEnv?: boolean;
	hideFromUser?: boolean;
392
	isExtensionTerminal?: boolean;
D
Daniel Imms 已提交
393 394
}

395
export interface MainThreadTerminalServiceShape extends IDisposable {
D
Daniel Imms 已提交
396
	$createTerminal(config: TerminalLaunchConfig): Promise<{ id: number, name: string }>;
397 398 399 400
	$dispose(terminalId: number): void;
	$hide(terminalId: number): void;
	$sendText(terminalId: number, text: string, addNewLine: boolean): void;
	$show(terminalId: number, preserveFocus: boolean): void;
401 402
	$startSendingDataEvents(): void;
	$stopSendingDataEvents(): void;
403

404
	// Process
405 406
	$sendProcessTitle(terminalId: number, title: string): void;
	$sendProcessData(terminalId: number, data: string): void;
D
Daniel Imms 已提交
407
	$sendProcessReady(terminalId: number, pid: number, cwd: string): void;
D
Daniel Imms 已提交
408
	$sendProcessExit(terminalId: number, exitCode: number): void;
409 410
	$sendProcessInitialCwd(terminalId: number, cwd: string): void;
	$sendProcessCwd(terminalId: number, initialCwd: string): void;
411
	$sendOverrideDimensions(terminalId: number, dimensions: ITerminalDimensions | undefined): void;
412
	$sendResolvedLaunchConfig(terminalId: number, shellLaunchConfig: IShellLaunchConfig): 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

export type TransferQuickInput = TransferQuickPick | TransferInputBox;

export interface BaseTransferQuickInput {

427 428
	[key: string]: any;

429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
	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 已提交
448
	buttons?: TransferQuickInputButton[];
449

C
Christof Marti 已提交
450
	items?: TransferQuickPickItems[];
451

452 453 454 455
	activeItems?: number[];

	selectedItems?: number[];

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

	ignoreFocusOut?: boolean;

	matchOnDescription?: boolean;

	matchOnDetail?: boolean;
}

export interface TransferInputBox extends BaseTransferQuickInput {

	type?: 'inputBox';

	value?: string;

	placeholder?: string;

	password?: boolean;

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

	prompt?: string;

	validationMessage?: string;
}

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

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

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

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

510
export interface MainThreadTelemetryShape extends IDisposable {
511
	$publicLog(eventName: string, data?: any): void;
512
	$publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void;
513 514
}

515
export interface MainThreadEditorInsetsShape extends IDisposable {
516
	$createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void>;
517 518 519 520 521 522
	$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 已提交
523

524 525 526 527 528 529
export interface ExtHostEditorInsetsShape {
	$onDidDispose(handle: number): void;
	$onDidReceiveMessage(handle: number, message: any): void;
}

export type WebviewPanelHandle = string;
530

M
Matt Bierner 已提交
531 532 533 534 535
export interface WebviewPanelShowOptions {
	readonly viewColumn?: EditorViewColumn;
	readonly preserveFocus?: boolean;
}

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

544 545 546
	$setHtml(handle: WebviewPanelHandle, value: string): void;
	$setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void;
	$postMessage(handle: WebviewPanelHandle, value: any): Promise<boolean>;
547 548 549

	$registerSerializer(viewType: string): void;
	$unregisterSerializer(viewType: string): void;
550 551 552

	$registerEditorProvider(viewType: string): void;
	$unregisterEditorProvider(viewType: string): void;
M
Matt Bierner 已提交
553
}
554

555 556 557 558 559 560
export interface WebviewPanelViewStateData {
	[handle: string]: {
		readonly active: boolean;
		readonly visible: boolean;
		readonly position: EditorViewColumn;
	};
M
Matt Bierner 已提交
561 562
}

M
Matt Bierner 已提交
563
export interface ExtHostWebviewsShape {
564
	$onMessage(handle: WebviewPanelHandle, message: any): void;
565
	$onMissingCsp(handle: WebviewPanelHandle, extensionId: string): void;
566
	$onDidChangeWebviewPanelViewStates(newState: WebviewPanelViewStateData): void;
J
Johannes Rieken 已提交
567
	$onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise<void>;
568
	$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
569
	$resolveWebviewEditor(resource: UriComponents, newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
M
Matt Bierner 已提交
570 571
}

J
Joao Moreno 已提交
572
export interface MainThreadUrlsShape extends IDisposable {
573
	$registerUriHandler(handle: number, extensionId: ExtensionIdentifier): Promise<void>;
J
Johannes Rieken 已提交
574
	$unregisterUriHandler(handle: number): Promise<void>;
575
	$createAppUri(extensionId: ExtensionIdentifier, options?: { payload?: Partial<UriComponents> }): Promise<UriComponents>;
J
Joao Moreno 已提交
576 577 578
}

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

582 583 584 585
export interface ITextSearchComplete {
	limitHit?: boolean;
}

586
export interface MainThreadWorkspaceShape extends IDisposable {
587
	$startFileSearch(includePattern: string | null, includeFolder: UriComponents | null, excludePatternOrDisregardExcludes: string | false | null, maxResults: number | null, token: CancellationToken): Promise<UriComponents[] | null>;
588
	$startTextSearch(query: search.IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise<ITextSearchComplete>;
589
	$checkExists(folders: UriComponents[], includes: string[], token: CancellationToken): Promise<boolean>;
J
Johannes Rieken 已提交
590 591
	$saveAll(includeUntitled?: boolean): Promise<boolean>;
	$updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents, name?: string }[]): Promise<void>;
592
	$resolveProxy(url: string): Promise<string | undefined>;
593
}
594

J
Johannes Rieken 已提交
595 596
export interface IFileChangeDto {
	resource: UriComponents;
J
Johannes Rieken 已提交
597
	type: files.FileChangeType;
J
Johannes Rieken 已提交
598 599
}

600
export interface MainThreadFileSystemShape extends IDisposable {
J
Johannes Rieken 已提交
601
	$registerFileSystemProvider(handle: number, scheme: string, capabilities: files.FileSystemProviderCapabilities): void;
602
	$unregisterProvider(handle: number): void;
J
Johannes Rieken 已提交
603
	$onFileSystemChange(handle: number, resource: IFileChangeDto[]): void;
604 605 606 607

	$stat(uri: UriComponents): Promise<files.IStat>;
	$readdir(resource: UriComponents): Promise<[string, files.FileType][]>;
	$readFile(resource: UriComponents): Promise<VSBuffer>;
608
	$writeFile(resource: UriComponents, content: VSBuffer): Promise<void>;
609 610 611 612
	$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>;
613
}
J
Johannes Rieken 已提交
614

615 616 617 618 619
export interface MainThreadLabelServiceShape extends IDisposable {
	$registerResourceLabelFormatter(handle: number, formatter: ResourceLabelFormatter): void;
	$unregisterResourceLabelFormatter(handle: number): void;
}

620
export interface MainThreadSearchShape extends IDisposable {
621 622
	$registerFileSearchProvider(handle: number, scheme: string): void;
	$registerTextSearchProvider(handle: number, scheme: string): void;
623
	$unregisterProvider(handle: number): void;
624
	$handleFileMatch(handle: number, session: number, data: UriComponents[]): void;
J
Johannes Rieken 已提交
625
	$handleTextMatch(handle: number, session: number, data: search.IRawFileMatch2[]): void;
626
	$handleTelemetry(eventName: string, data: any): void;
627 628
}

629
export interface MainThreadTaskShape extends IDisposable {
J
Johannes Rieken 已提交
630
	$createTaskId(task: tasks.TaskDTO): Promise<string>;
631
	$registerTaskProvider(handle: number, type: string): Promise<void>;
J
Johannes Rieken 已提交
632
	$unregisterTaskProvider(handle: number): Promise<void>;
J
Johannes Rieken 已提交
633 634
	$fetchTasks(filter?: tasks.TaskFilterDTO): Promise<tasks.TaskDTO[]>;
	$executeTask(task: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
J
Johannes Rieken 已提交
635
	$terminateTask(id: string): Promise<void>;
J
Johannes Rieken 已提交
636
	$registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
G
Gabriel DeBacker 已提交
637
	$customExecutionComplete(id: string, result?: number): Promise<void>;
638 639
}

640
export interface MainThreadExtensionServiceShape extends IDisposable {
A
Alex Dima 已提交
641
	$activateExtension(extensionId: ExtensionIdentifier, activationEvent: string | null): Promise<void>;
642
	$onWillActivateExtension(extensionId: ExtensionIdentifier): void;
A
Alex Dima 已提交
643
	$onDidActivateExtension(extensionId: ExtensionIdentifier, startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number, activationEvent: string | null): void;
644
	$onExtensionActivationError(extensionId: ExtensionIdentifier, error: ExtensionActivationError): Promise<void>;
645
	$onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void;
A
Alex Dima 已提交
646
	$onExtensionHostExit(code: number): void;
647 648
}

J
Joao Moreno 已提交
649
export interface SCMProviderFeatures {
J
Joao Moreno 已提交
650 651
	hasQuickDiffProvider?: boolean;
	count?: number;
652 653
	commitTemplate?: string;
	acceptInputCommand?: modes.Command;
J
Johannes Rieken 已提交
654
	statusBarCommands?: ICommandDto[];
J
Joao Moreno 已提交
655 656 657 658
}

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

J
Joao Moreno 已提交
661
export type SCMRawResource = [
662
	number /*handle*/,
663
	UriComponents /*resourceUri*/,
J
Joao Moreno 已提交
664
	string[] /*icons: light, dark*/,
665
	string /*tooltip*/,
666
	boolean /*strike through*/,
667
	boolean /*faded*/
J
Joao Moreno 已提交
668
];
669

670 671 672
export type SCMRawResourceSplice = [
	number /* start */,
	number /* delete count */,
J
Joao 已提交
673 674 675
	SCMRawResource[]
];

676 677 678 679 680
export type SCMRawResourceSplices = [
	number, /*handle*/
	SCMRawResourceSplice[]
];

681
export interface MainThreadSCMShape extends IDisposable {
682
	$registerSourceControl(handle: number, id: string, label: string, rootUri: UriComponents | undefined): void;
683 684
	$updateSourceControl(handle: number, features: SCMProviderFeatures): void;
	$unregisterSourceControl(handle: number): void;
J
Joao Moreno 已提交
685

686 687 688 689
	$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 已提交
690

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

J
Joao Moreno 已提交
693
	$setInputBoxValue(sourceControlHandle: number, value: string): void;
694
	$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
695
	$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
696
	$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
J
Joao Moreno 已提交
697 698
}

699 700
export type DebugSessionUUID = string;

701 702 703 704 705 706 707
export interface IDebugConfiguration {
	type: string;
	name: string;
	request: string;
	[key: string]: any;
}

708
export interface MainThreadDebugServiceShape extends IDisposable {
A
Alex Dima 已提交
709
	$registerDebugTypes(debugTypes: string[]): void;
710
	$sessionCached(sessionID: string): void;
A
Alex Dima 已提交
711
	$acceptDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
712 713
	$acceptDAError(handle: number, name: string, message: string, stack: string | undefined): void;
	$acceptDAExit(handle: number, code: number | undefined, signal: string | undefined): void;
A
Andre Weinand 已提交
714
	$registerDebugConfigurationProvider(type: string, hasProvideMethod: boolean, hasResolveMethod: boolean, hasProvideDaMethod: boolean, handle: number): Promise<void>;
J
Johannes Rieken 已提交
715
	$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
716
	$unregisterDebugConfigurationProvider(handle: number): void;
A
Andre Weinand 已提交
717
	$unregisterDebugAdapterDescriptorFactory(handle: number): void;
718
	$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, parentSessionID: string | undefined): Promise<boolean>;
719
	$setDebugSessionName(id: DebugSessionUUID, name: string): void;
J
Johannes Rieken 已提交
720
	$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
721 722
	$appendDebugConsole(value: string): void;
	$startBreakpointEvents(): void;
I
isidor 已提交
723 724
	$registerBreakpoints(breakpoints: Array<ISourceMultiBreakpointDto | IFunctionBreakpointDto | IDataBreakpointDto>): Promise<void>;
	$unregisterBreakpoints(breakpointIds: string[], functionBreakpointIds: string[], dataBreakpointIds: string[]): Promise<void>;
725 726
}

727 728 729 730
export interface IOpenUriOptions {
	readonly allowTunneling?: boolean;
}

731
export interface MainThreadWindowShape extends IDisposable {
J
Johannes Rieken 已提交
732
	$getWindowVisibility(): Promise<boolean>;
733
	$openUri(uri: UriComponents, options: IOpenUriOptions): Promise<boolean>;
734 735
}

736 737
// -- extension host

738
export interface ExtHostCommandsShape {
J
Johannes Rieken 已提交
739 740
	$executeContributedCommand<T>(id: string, ...args: any[]): Promise<T>;
	$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescription }>;
741 742
}

743
export interface ExtHostConfigurationShape {
744 745
	$initializeConfiguration(data: IConfigurationInitData): void;
	$acceptConfigurationChanged(data: IConfigurationInitData, eventData: IWorkspaceConfigurationChangeEventData): void;
746 747
}

748
export interface ExtHostDiagnosticsShape {
J
Johannes Rieken 已提交
749
	$acceptMarkersChange(data: [UriComponents, IMarkerData[]][]): void;
750 751
}

752
export interface ExtHostDocumentContentProvidersShape {
M
Matt Bierner 已提交
753
	$provideTextDocumentContent(handle: number, uri: UriComponents): Promise<string | null | undefined>;
754 755
}

756
export interface IModelAddedData {
757
	uri: UriComponents;
758
	versionId: number;
759 760
	lines: string[];
	EOL: string;
761 762 763
	modeId: string;
	isDirty: boolean;
}
764
export interface ExtHostDocumentsShape {
765 766 767 768
	$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;
769 770
}

771
export interface ExtHostDocumentSaveParticipantShape {
J
Johannes Rieken 已提交
772
	$participateInSave(resource: UriComponents, reason: SaveReason): Promise<boolean[]>;
773 774
}

775 776
export interface ITextEditorAddData {
	id: string;
777
	documentUri: UriComponents;
778
	options: IResolvedTextEditorConfiguration;
A
Alex Dima 已提交
779
	selections: ISelection[];
780
	visibleRanges: IRange[];
A
Alex Dima 已提交
781
	editorPosition: EditorViewColumn | undefined;
782 783
}
export interface ITextEditorPositionData {
784
	[id: string]: EditorViewColumn;
785
}
786 787 788
export interface IEditorPropertiesChangeData {
	options: IResolvedTextEditorConfiguration | null;
	selections: ISelectionChangeEvent | null;
789
	visibleRanges: IRange[] | null;
790 791 792 793 794 795
}
export interface ISelectionChangeEvent {
	selections: Selection[];
	source?: string;
}

796
export interface ExtHostEditorsShape {
797
	$acceptEditorPropertiesChanged(id: string, props: IEditorPropertiesChangeData): void;
798
	$acceptEditorPositionData(data: ITextEditorPositionData): void;
799 800
}

J
Johannes Rieken 已提交
801
export interface IDocumentsAndEditorsDelta {
802
	removedDocuments?: UriComponents[];
J
Johannes Rieken 已提交
803 804 805
	addedDocuments?: IModelAddedData[];
	removedEditors?: string[];
	addedEditors?: ITextEditorAddData[];
A
Alex Dima 已提交
806
	newActiveEditor?: string | null;
J
Johannes Rieken 已提交
807 808
}

809 810
export interface ExtHostDocumentsAndEditorsShape {
	$acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void;
J
Johannes Rieken 已提交
811 812
}

813
export interface ExtHostTreeViewsShape {
J
Johannes Rieken 已提交
814
	$getChildren(treeViewId: string, treeItemHandle?: string): Promise<ITreeItem[]>;
815
	$setExpanded(treeViewId: string, treeItemHandle: string, expanded: boolean): void;
816
	$setSelection(treeViewId: string, treeItemHandles: string[]): void;
817
	$setVisible(treeViewId: string, visible: boolean): void;
S
Sandeep Somavarapu 已提交
818 819
}

820
export interface ExtHostWorkspaceShape {
821
	$initializeWorkspace(workspace: IWorkspaceData | null): void;
822
	$acceptWorkspaceData(workspace: IWorkspaceData | null): void;
J
Johannes Rieken 已提交
823
	$handleTextSearchResult(result: search.IRawFileMatch2, requestId: number): void;
824
}
825

826
export interface ExtHostFileSystemShape {
J
Johannes Rieken 已提交
827 828
	$stat(handle: number, resource: UriComponents): Promise<files.IStat>;
	$readdir(handle: number, resource: UriComponents): Promise<[string, files.FileType][]>;
829 830
	$readFile(handle: number, resource: UriComponents): Promise<VSBuffer>;
	$writeFile(handle: number, resource: UriComponents, content: VSBuffer, opts: files.FileWriteOptions): Promise<void>;
J
Johannes Rieken 已提交
831 832
	$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 已提交
833
	$mkdir(handle: number, resource: UriComponents): Promise<void>;
J
Johannes Rieken 已提交
834 835
	$delete(handle: number, resource: UriComponents, opts: files.FileDeleteOptions): Promise<void>;
	$watch(handle: number, session: number, resource: UriComponents, opts: files.IWatchOptions): void;
836
	$unwatch(handle: number, session: number): void;
J
Johannes Rieken 已提交
837
	$open(handle: number, resource: UriComponents, opts: files.FileOpenOptions): Promise<number>;
J
Johannes Rieken 已提交
838
	$close(handle: number, fd: number): Promise<void>;
839 840
	$read(handle: number, fd: number, pos: number, length: number): Promise<VSBuffer>;
	$write(handle: number, fd: number, pos: number, data: VSBuffer): Promise<number>;
841
}
842

843 844 845 846
export interface ExtHostLabelServiceShape {
	$registerResourceLabelFormatter(formatter: ResourceLabelFormatter): IDisposable;
}

847
export interface ExtHostSearchShape {
J
Johannes Rieken 已提交
848 849
	$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 已提交
850
	$clearCache(cacheKey: string): Promise<void>;
851 852
}

A
Tweaks  
Alex Dima 已提交
853 854 855 856 857 858 859 860 861 862 863
export interface IResolveAuthorityErrorResult {
	type: 'error';
	error: {
		message: string | undefined;
		code: RemoteAuthorityResolverErrorCode;
		detail: any;
	};
}

export interface IResolveAuthorityOKResult {
	type: 'ok';
864
	value: ResolverResult;
A
Tweaks  
Alex Dima 已提交
865 866 867 868
}

export type IResolveAuthorityResult = IResolveAuthorityErrorResult | IResolveAuthorityOKResult;

869
export interface ExtHostExtensionServiceShape {
A
Tweaks  
Alex Dima 已提交
870
	$resolveAuthority(remoteAuthority: string, resolveAttempt: number): Promise<IResolveAuthorityResult>;
871
	$startExtensionHost(enabledExtensionIds: ExtensionIdentifier[]): Promise<void>;
J
Johannes Rieken 已提交
872
	$activateByEvent(activationEvent: string): Promise<void>;
873
	$activate(extensionId: ExtensionIdentifier, activationEvent: string): Promise<boolean>;
874
	$setRemoteEnvironment(env: { [key: string]: string | null }): Promise<void>;
875

876
	$deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise<void>;
877 878

	$test_latency(n: number): Promise<number>;
879 880
	$test_up(b: VSBuffer): Promise<number>;
	$test_down(size: number): Promise<VSBuffer>;
881 882 883
}

export interface FileSystemEvents {
J
Johannes Rieken 已提交
884 885 886
	created: UriComponents[];
	changed: UriComponents[];
	deleted: UriComponents[];
887
}
888
export interface ExtHostFileSystemEventServiceShape {
889
	$onFileEvent(events: FileSystemEvents): void;
890
	$onFileRename(oldUri: UriComponents, newUri: UriComponents): void;
J
Johannes Rieken 已提交
891
	$onWillRename(oldUri: UriComponents, newUri: UriComponents): Promise<any>;
892 893
}

J
Johannes Rieken 已提交
894
export interface ObjectIdentifier {
895
	$ident?: number;
J
Johannes Rieken 已提交
896 897 898
}

export namespace ObjectIdentifier {
899
	export const name = '$ident';
J
Johannes Rieken 已提交
900
	export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
901
		Object.defineProperty(obj, name, { value: id, enumerable: true });
J
Johannes Rieken 已提交
902 903
		return <T & ObjectIdentifier>obj;
	}
904 905
	export function of(obj: any): number {
		return obj[name];
J
Johannes Rieken 已提交
906 907 908
	}
}

909 910
export interface ExtHostHeapServiceShape {
	$onGarbageCollection(ids: number[]): void;
911
}
912
export interface IRawColorInfo {
J
Joao Moreno 已提交
913
	color: [number, number, number, number];
914 915 916
	range: IRange;
}

917 918 919 920 921 922 923 924 925
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 已提交
926
export interface ISuggestDataDto {
J
Johannes Rieken 已提交
927 928 929 930 931 932 933 934 935 936 937 938 939
	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;
940
	n/* kindModifier */?: modes.CompletionItemTag[];
J
Johannes Rieken 已提交
941
	// not-standard
942
	x?: ChainedCacheId;
J
Johannes Rieken 已提交
943 944
}

J
Johannes Rieken 已提交
945
export interface ISuggestResultDto {
946
	x?: number;
J
Johannes Rieken 已提交
947
	a: IRange;
J
Johannes Rieken 已提交
948
	b: ISuggestDataDto[];
J
Johannes Rieken 已提交
949
	c?: boolean;
950 951
}

J
Johannes Rieken 已提交
952
export interface ISignatureHelpDto {
953 954 955 956 957 958
	id: CacheId;
	signatures: modes.SignatureInformation[];
	activeSignature: number;
	activeParameter: number;
}

J
Johannes Rieken 已提交
959
export interface ISignatureHelpContextDto {
960 961 962
	readonly triggerKind: modes.SignatureHelpTriggerKind;
	readonly triggerCharacter?: string;
	readonly isRetrigger: boolean;
J
Johannes Rieken 已提交
963
	readonly activeSignatureHelp?: ISignatureHelpDto;
964 965
}

J
Johannes Rieken 已提交
966
export interface ILocationDto {
967 968
	uri: UriComponents;
	range: IRange;
969 970
}

J
Johannes Rieken 已提交
971
export interface IDefinitionLinkDto {
J
Johannes Rieken 已提交
972
	originSelectionRange?: IRange;
M
Matt Bierner 已提交
973 974
	uri: UriComponents;
	range: IRange;
J
Johannes Rieken 已提交
975
	targetSelectionRange?: IRange;
M
Matt Bierner 已提交
976 977
}

J
Johannes Rieken 已提交
978
export interface IWorkspaceSymbolDto extends IdObject {
979 980 981
	name: string;
	containerName?: string;
	kind: modes.SymbolKind;
J
Johannes Rieken 已提交
982
	location: ILocationDto;
983 984
}

J
Johannes Rieken 已提交
985 986
export interface IWorkspaceSymbolsDto extends IdObject {
	symbols: IWorkspaceSymbolDto[];
987 988
}

J
Johannes Rieken 已提交
989
export interface IResourceFileEditDto {
M
Matt Bierner 已提交
990 991
	oldUri?: UriComponents;
	newUri?: UriComponents;
992 993 994 995 996 997
	options?: {
		overwrite?: boolean;
		ignoreIfExists?: boolean;
		ignoreIfNotExists?: boolean;
		recursive?: boolean;
	};
998 999
}

J
Johannes Rieken 已提交
1000
export interface IResourceTextEditDto {
1001
	resource: UriComponents;
1002 1003
	modelVersionId?: number;
	edits: modes.TextEdit[];
1004 1005
}

J
Johannes Rieken 已提交
1006 1007
export interface IWorkspaceEditDto {
	edits: Array<IResourceFileEditDto | IResourceTextEditDto>;
1008 1009

	// todo@joh reject should go into rename
1010 1011 1012
	rejectReason?: string;
}

J
Johannes Rieken 已提交
1013
export function reviveWorkspaceEditDto(data: IWorkspaceEditDto | undefined): modes.WorkspaceEdit {
1014 1015
	if (data && data.edits) {
		for (const edit of data.edits) {
J
Johannes Rieken 已提交
1016 1017
			if (typeof (<IResourceTextEditDto>edit).resource === 'object') {
				(<IResourceTextEditDto>edit).resource = URI.revive((<IResourceTextEditDto>edit).resource);
1018
			} else {
J
Johannes Rieken 已提交
1019 1020
				(<IResourceFileEditDto>edit).newUri = URI.revive((<IResourceFileEditDto>edit).newUri);
				(<IResourceFileEditDto>edit).oldUri = URI.revive((<IResourceFileEditDto>edit).oldUri);
1021 1022 1023 1024 1025 1026
			}
		}
	}
	return <modes.WorkspaceEdit>data;
}

J
Johannes Rieken 已提交
1027
export type ICommandDto = ObjectIdentifier & modes.Command;
1028

J
Johannes Rieken 已提交
1029
export interface ICodeActionDto {
1030
	title: string;
J
Johannes Rieken 已提交
1031
	edit?: IWorkspaceEditDto;
1032
	diagnostics?: IMarkerData[];
J
Johannes Rieken 已提交
1033
	command?: ICommandDto;
J
Johannes Rieken 已提交
1034
	kind?: string;
1035
	isPreferred?: boolean;
1036
}
1037

J
Johannes Rieken 已提交
1038
export interface ICodeActionListDto {
1039
	cacheId: number;
J
Johannes Rieken 已提交
1040
	actions: ReadonlyArray<ICodeActionDto>;
1041 1042
}

1043 1044 1045
export type CacheId = number;
export type ChainedCacheId = [CacheId, CacheId];

J
Johannes Rieken 已提交
1046
export interface ILinksListDto {
1047
	id?: CacheId;
J
Johannes Rieken 已提交
1048
	links: ILinkDto[];
1049 1050
}

J
Johannes Rieken 已提交
1051
export interface ILinkDto {
1052
	cacheId?: ChainedCacheId;
M
Martin Aeschlimann 已提交
1053 1054
	range: IRange;
	url?: string | UriComponents;
1055
	tooltip?: string;
M
Martin Aeschlimann 已提交
1056
}
1057

J
Johannes Rieken 已提交
1058
export interface ICodeLensListDto {
1059
	cacheId?: number;
J
Johannes Rieken 已提交
1060
	lenses: ICodeLensDto[];
1061 1062
}

J
Johannes Rieken 已提交
1063
export interface ICodeLensDto {
1064
	cacheId?: ChainedCacheId;
1065
	range: IRange;
J
Johannes Rieken 已提交
1066
	command?: ICommandDto;
1067
}
1068

J
jrieken 已提交
1069
export interface ICallHierarchyItemDto {
1070 1071 1072 1073 1074 1075 1076 1077
	kind: modes.SymbolKind;
	name: string;
	detail?: string;
	uri: UriComponents;
	range: IRange;
	selectionRange: IRange;
}

1078
export interface ExtHostLanguageFeaturesShape {
1079
	$provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise<modes.DocumentSymbol[] | undefined>;
J
Johannes Rieken 已提交
1080 1081
	$provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise<ICodeLensListDto | undefined>;
	$resolveCodeLens(handle: number, symbol: ICodeLensDto, token: CancellationToken): Promise<ICodeLensDto | undefined>;
1082
	$releaseCodeLenses(handle: number, id: number): void;
J
Johannes Rieken 已提交
1083 1084 1085 1086
	$provideDefinition(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<IDefinitionLinkDto[]>;
	$provideDeclaration(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<IDefinitionLinkDto[]>;
	$provideImplementation(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<IDefinitionLinkDto[]>;
	$provideTypeDefinition(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<IDefinitionLinkDto[]>;
1087 1088
	$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>;
J
Johannes Rieken 已提交
1089 1090
	$provideReferences(handle: number, resource: UriComponents, position: IPosition, context: modes.ReferenceContext, token: CancellationToken): Promise<ILocationDto[] | undefined>;
	$provideCodeActions(handle: number, resource: UriComponents, rangeOrSelection: IRange | ISelection, context: modes.CodeActionContext, token: CancellationToken): Promise<ICodeActionListDto | undefined>;
1091
	$releaseCodeActions(handle: number, cacheId: number): void;
1092 1093 1094
	$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 已提交
1095 1096
	$provideWorkspaceSymbols(handle: number, search: string, token: CancellationToken): Promise<IWorkspaceSymbolsDto>;
	$resolveWorkspaceSymbol(handle: number, symbol: IWorkspaceSymbolDto, token: CancellationToken): Promise<IWorkspaceSymbolDto | undefined>;
1097
	$releaseWorkspaceSymbols(handle: number, id: number): void;
J
Johannes Rieken 已提交
1098
	$provideRenameEdits(handle: number, resource: UriComponents, position: IPosition, newName: string, token: CancellationToken): Promise<IWorkspaceEditDto | undefined>;
1099
	$resolveRenameLocation(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<modes.RenameLocation | undefined>;
J
Johannes Rieken 已提交
1100 1101
	$provideCompletionItems(handle: number, resource: UriComponents, position: IPosition, context: modes.CompletionContext, token: CancellationToken): Promise<ISuggestResultDto | undefined>;
	$resolveCompletionItem(handle: number, resource: UriComponents, position: IPosition, id: ChainedCacheId, token: CancellationToken): Promise<ISuggestDataDto | undefined>;
1102
	$releaseCompletionItems(handle: number, id: number): void;
J
Johannes Rieken 已提交
1103
	$provideSignatureHelp(handle: number, resource: UriComponents, position: IPosition, context: modes.SignatureHelpContext, token: CancellationToken): Promise<ISignatureHelpDto | undefined>;
1104
	$releaseSignatureHelp(handle: number, id: number): void;
J
Johannes Rieken 已提交
1105 1106
	$provideDocumentLinks(handle: number, resource: UriComponents, token: CancellationToken): Promise<ILinksListDto | undefined>;
	$resolveDocumentLink(handle: number, id: ChainedCacheId, token: CancellationToken): Promise<ILinkDto | undefined>;
1107
	$releaseDocumentLinks(handle: number, id: number): void;
J
Johannes Rieken 已提交
1108
	$provideDocumentColors(handle: number, resource: UriComponents, token: CancellationToken): Promise<IRawColorInfo[]>;
M
Matt Bierner 已提交
1109 1110
	$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>;
1111
	$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]>;
1112 1113
	$provideCallHierarchyIncomingCalls(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>;
	$provideCallHierarchyOutgoingCalls(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>;
1114 1115
}

1116 1117
export interface ExtHostQuickOpenShape {
	$onItemSelected(handle: number): void;
M
Matt Bierner 已提交
1118
	$validateInput(input: string): Promise<string | null | undefined>;
1119 1120 1121
	$onDidChangeActive(sessionId: number, handles: number[]): void;
	$onDidChangeSelection(sessionId: number, handles: number[]): void;
	$onDidAccept(sessionId: number): void;
1122
	$onDidChangeValue(sessionId: number, value: string): void;
C
Christof Marti 已提交
1123
	$onDidTriggerButton(sessionId: number, handle: number): void;
1124
	$onDidHide(sessionId: number): void;
1125 1126
}

J
Johannes Rieken 已提交
1127
export interface IShellLaunchConfigDto {
1128 1129 1130
	name?: string;
	executable?: string;
	args?: string[] | string;
1131
	cwd?: string | UriComponents;
1132
	env?: { [key: string]: string | null };
1133 1134
}

D
Daniel Imms 已提交
1135 1136 1137 1138 1139
export interface IShellDefinitionDto {
	label: string;
	path: string;
}

D
Daniel Imms 已提交
1140 1141 1142 1143 1144
export interface IShellAndArgsDto {
	shell: string;
	args: string[] | string | undefined;
}

1145 1146 1147 1148 1149
export interface ITerminalDimensionsDto {
	columns: number;
	rows: number;
}

1150 1151
export interface ExtHostTerminalServiceShape {
	$acceptTerminalClosed(id: number): void;
1152
	$acceptTerminalOpened(id: number, name: string): void;
1153
	$acceptActiveTerminalChanged(id: number | null): void;
1154
	$acceptTerminalProcessId(id: number, processId: number): void;
A
Alex Dima 已提交
1155
	$acceptTerminalProcessData(id: number, data: string): void;
1156
	$acceptTerminalTitleChange(id: number, name: string): void;
1157
	$acceptTerminalDimensions(id: number, cols: number, rows: number): void;
1158
	$acceptTerminalMaximumDimensions(id: number, cols: number, rows: number): void;
J
Johannes Rieken 已提交
1159
	$spawnExtHostProcess(id: number, shellLaunchConfig: IShellLaunchConfigDto, activeWorkspaceRootUri: UriComponents, cols: number, rows: number, isWorkspaceShellAllowed: boolean): void;
1160
	$startExtensionTerminal(id: number, initialDimensions: ITerminalDimensionsDto | undefined): void;
D
Daniel Imms 已提交
1161 1162
	$acceptProcessInput(id: number, data: string): void;
	$acceptProcessResize(id: number, cols: number, rows: number): void;
1163
	$acceptProcessShutdown(id: number, immediate: boolean): void;
1164 1165
	$acceptProcessRequestInitialCwd(id: number): void;
	$acceptProcessRequestCwd(id: number): void;
1166
	$acceptProcessRequestLatency(id: number): number;
1167
	$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
1168
	$requestAvailableShells(): Promise<IShellDefinitionDto[]>;
1169
	$requestDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
1170 1171
}

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

1180
export interface ExtHostTaskShape {
J
Johannes Rieken 已提交
1181
	$provideTasks(handle: number, validTypes: { [key: string]: boolean; }): Thenable<tasks.TaskSetDTO>;
1182
	$resolveTask(handle: number, taskDTO: tasks.TaskDTO): Thenable<tasks.TaskDTO | undefined>;
J
Johannes Rieken 已提交
1183 1184 1185 1186
	$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 已提交
1187
	$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }, variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
1188
	$getDefaultShellAndArgs(): Thenable<{ shell: string, args: string[] | string | undefined }>;
1189 1190
}

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

export interface IFunctionBreakpointDto extends IBreakpointDto {
	type: 'function';
1202
	functionName: string;
1203 1204
}

I
isidor 已提交
1205 1206 1207 1208 1209 1210 1211
export interface IDataBreakpointDto extends IBreakpointDto {
	type: 'data';
	dataId: string;
	canPersist: boolean;
	label: string;
}

1212
export interface ISourceBreakpointDto extends IBreakpointDto {
1213
	type: 'source';
1214
	uri: UriComponents;
1215 1216
	line: number;
	character: number;
1217 1218
}

1219
export interface IBreakpointsDeltaDto {
I
isidor 已提交
1220
	added?: Array<ISourceBreakpointDto | IFunctionBreakpointDto | IDataBreakpointDto>;
1221
	removed?: string[];
I
isidor 已提交
1222
	changed?: Array<ISourceBreakpointDto | IFunctionBreakpointDto | IDataBreakpointDto>;
1223 1224
}

1225 1226 1227 1228
export interface ISourceMultiBreakpointDto {
	type: 'sourceMulti';
	uri: UriComponents;
	lines: {
1229
		id: string;
1230 1231 1232
		enabled: boolean;
		condition?: string;
		hitCondition?: string;
1233
		logMessage?: string;
1234 1235 1236
		line: number;
		character: number;
	}[];
1237 1238
}

A
Andre Weinand 已提交
1239
export interface IDebugSessionFullDto {
1240 1241 1242
	id: DebugSessionUUID;
	type: string;
	name: string;
1243
	folderUri: UriComponents | undefined;
A
Andre Weinand 已提交
1244
	configuration: IConfig;
1245 1246
}

A
Andre Weinand 已提交
1247 1248
export type IDebugSessionDto = IDebugSessionFullDto | DebugSessionUUID;

1249
export interface ExtHostDebugServiceShape {
J
Johannes Rieken 已提交
1250
	$substituteVariables(folder: UriComponents | undefined, config: IConfig): Promise<IConfig>;
1251
	$runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments): Promise<number | undefined>;
J
Johannes Rieken 已提交
1252 1253
	$startDASession(handle: number, session: IDebugSessionDto): Promise<void>;
	$stopDASession(handle: number): Promise<void>;
1254
	$sendDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
1255 1256
	$resolveDebugConfiguration(handle: number, folder: UriComponents | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
	$provideDebugConfigurations(handle: number, folder: UriComponents | undefined, token: CancellationToken): Promise<IConfig[]>;
J
Johannes Rieken 已提交
1257 1258
	$legacyDebugAdapterExecutable(handle: number, folderUri: UriComponents | undefined): Promise<IAdapterDescriptor>; // TODO@AW legacy
	$provideDebugAdapter(handle: number, session: IDebugSessionDto): Promise<IAdapterDescriptor>;
1259 1260
	$acceptDebugSessionStarted(session: IDebugSessionDto): void;
	$acceptDebugSessionTerminated(session: IDebugSessionDto): void;
1261
	$acceptDebugSessionActiveChanged(session: IDebugSessionDto | undefined): void;
1262 1263
	$acceptDebugSessionCustomEvent(session: IDebugSessionDto, event: any): void;
	$acceptBreakpointsDelta(delta: IBreakpointsDeltaDto): void;
1264
	$acceptDebugSessionNameChanged(session: IDebugSessionDto, name: string): void;
1265 1266
}

1267

1268 1269 1270 1271 1272 1273
export interface DecorationRequest {
	readonly id: number;
	readonly handle: number;
	readonly uri: UriComponents;
}

1274
export type DecorationData = [number, boolean, string, string, ThemeColor];
1275
export type DecorationReply = { [id: number]: DecorationData };
1276 1277

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

1281 1282
export interface ExtHostWindowShape {
	$onDidChangeWindowFocus(value: boolean): void;
1283 1284
}

S
Sandeep Somavarapu 已提交
1285
export interface ExtHostLogServiceShape {
A
Alex Dima 已提交
1286
	$setLevel(level: LogLevel): void;
S
Sandeep Somavarapu 已提交
1287 1288
}

J
Johannes Rieken 已提交
1289 1290 1291 1292
export interface MainThreadLogShape {
	$log(file: UriComponents, level: LogLevel, args: any[]): void;
}

1293 1294 1295 1296
export interface ExtHostOutputServiceShape {
	$setVisibleChannel(channelId: string | null): void;
}

1297 1298 1299 1300
export interface ExtHostProgressShape {
	$acceptProgressCanceled(handle: number): void;
}

M
Matt Bierner 已提交
1301
export interface ExtHostCommentsShape {
P
Peng Lyu 已提交
1302
	$createCommentThreadTemplate(commentControllerHandle: number, uriComponents: UriComponents, range: IRange): void;
1303
	$updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange): Promise<void>;
1304
	$deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number): void;
P
Peng Lyu 已提交
1305
	$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined>;
P
Peng Lyu 已提交
1306
	$toggleReaction(commentControllerHandle: number, threadHandle: number, uri: UriComponents, comment: modes.Comment, reaction: modes.CommentReaction): Promise<void>;
M
Matt Bierner 已提交
1307 1308
}

1309
export interface ExtHostStorageShape {
1310
	$acceptValue(shared: boolean, key: string, value: object | undefined): void;
1311 1312
}

1313 1314 1315
// --- proxy identifiers

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

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