@codingame/monaco-vscode-api 1.83.14 → 1.83.15-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/api.js +1 -1
  2. package/contributions.js +36 -0
  3. package/extensions.d.ts +83 -4
  4. package/extensions.js +9 -14
  5. package/lifecycle.js +4 -1
  6. package/localExtensionHost.js +207 -0
  7. package/missing-services.js +15 -3
  8. package/monaco-editor-treemending.patch +3376 -3365
  9. package/monaco.js +4 -36
  10. package/package.json +10 -6
  11. package/service-override/tools/editor.d.ts +6 -6
  12. package/services.d.ts +18 -18
  13. package/services.js +1 -0
  14. package/vscode/src/vs/base/common/errors.d.ts +1 -8
  15. package/vscode/src/vs/base/common/uri.d.ts +1 -7
  16. package/vscode/src/vs/platform/terminal/common/terminal.d.ts +2 -27
  17. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +39 -1
  18. package/vscode/src/vs/platform/workspace/common/workspace.d.ts +1 -44
  19. package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +160 -2
  20. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +1 -0
  21. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +10 -0
  22. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +2 -37
  23. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +2 -73
  24. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +1 -5
  25. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +174 -0
  26. package/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts +49 -0
  27. package/vscode-dts/vscode.proposed.authGetSessions.d.ts +62 -0
  28. package/vscode-dts/vscode.proposed.authSession.d.ts +13 -0
  29. package/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts +47 -0
  30. package/vscode-dts/vscode.proposed.chat.d.ts +25 -0
  31. package/vscode-dts/vscode.proposed.chatAgents.d.ts +39 -0
  32. package/vscode-dts/vscode.proposed.chatProvider.d.ts +38 -0
  33. package/vscode-dts/vscode.proposed.chatRequestAccess.d.ts +47 -0
  34. package/vscode-dts/vscode.proposed.chatSlashCommands.d.ts +47 -0
  35. package/vscode-dts/vscode.proposed.chatVariables.d.ts +35 -0
  36. package/vscode-dts/vscode.proposed.codiconDecoration.d.ts +48 -0
  37. package/vscode-dts/vscode.proposed.commentsDraftState.d.ts +18 -0
  38. package/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts +6 -0
  39. package/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts +10 -0
  40. package/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +8 -0
  41. package/vscode-dts/vscode.proposed.contribEditSessions.d.ts +8 -0
  42. package/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts +6 -0
  43. package/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts +6 -0
  44. package/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts +6 -0
  45. package/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts +6 -0
  46. package/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts +6 -0
  47. package/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts +6 -0
  48. package/vscode-dts/vscode.proposed.contribShareMenu.d.ts +7 -0
  49. package/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts +8 -0
  50. package/vscode-dts/vscode.proposed.contribViewsRemote.d.ts +6 -0
  51. package/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts +6 -0
  52. package/vscode-dts/vscode.proposed.customEditorMove.d.ts +29 -0
  53. package/vscode-dts/vscode.proposed.debugFocus.d.ts +74 -0
  54. package/vscode-dts/vscode.proposed.diffCommand.d.ts +38 -0
  55. package/vscode-dts/vscode.proposed.diffContentOptions.d.ts +16 -0
  56. package/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts +13 -0
  57. package/vscode-dts/vscode.proposed.documentPaste.d.ts +111 -0
  58. package/vscode-dts/vscode.proposed.dropMetadata.d.ts +60 -0
  59. package/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts +71 -0
  60. package/vscode-dts/vscode.proposed.editorInsets.d.ts +22 -0
  61. package/vscode-dts/vscode.proposed.extensionRuntime.d.ts +24 -0
  62. package/vscode-dts/vscode.proposed.extensionsAny.d.ts +40 -0
  63. package/vscode-dts/vscode.proposed.externalUriOpener.d.ts +163 -0
  64. package/vscode-dts/vscode.proposed.fileComments.d.ts +85 -0
  65. package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +67 -0
  66. package/vscode-dts/vscode.proposed.findTextInFiles.d.ts +104 -0
  67. package/vscode-dts/vscode.proposed.fsChunks.d.ts +16 -0
  68. package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +31 -0
  69. package/vscode-dts/vscode.proposed.idToken.d.ts +16 -0
  70. package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +71 -0
  71. package/vscode-dts/vscode.proposed.interactive.d.ts +227 -0
  72. package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +70 -0
  73. package/vscode-dts/vscode.proposed.interactiveWindow.d.ts +25 -0
  74. package/vscode-dts/vscode.proposed.ipc.d.ts +37 -0
  75. package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +42 -0
  76. package/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts +52 -0
  77. package/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts +17 -0
  78. package/vscode-dts/vscode.proposed.notebookDeprecated.d.ts +16 -0
  79. package/vscode-dts/vscode.proposed.notebookExecution.d.ts +39 -0
  80. package/vscode-dts/vscode.proposed.notebookKernelSource.d.ts +46 -0
  81. package/vscode-dts/vscode.proposed.notebookLiveShare.d.ts +21 -0
  82. package/vscode-dts/vscode.proposed.notebookMessaging.d.ts +68 -0
  83. package/vscode-dts/vscode.proposed.notebookMime.d.ts +33 -0
  84. package/vscode-dts/vscode.proposed.portsAttributes.d.ts +100 -0
  85. package/vscode-dts/vscode.proposed.profileContentHandlers.d.ts +19 -0
  86. package/vscode-dts/vscode.proposed.quickDiffProvider.d.ts +17 -0
  87. package/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts +16 -0
  88. package/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts +16 -0
  89. package/vscode-dts/vscode.proposed.readonlyMessage.d.ts +14 -0
  90. package/vscode-dts/vscode.proposed.resolvers.d.ts +371 -0
  91. package/vscode-dts/vscode.proposed.saveEditor.d.ts +35 -0
  92. package/vscode-dts/vscode.proposed.scmActionButton.d.ts +19 -0
  93. package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +77 -0
  94. package/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts +22 -0
  95. package/vscode-dts/vscode.proposed.scmTextDocument.d.ts +19 -0
  96. package/vscode-dts/vscode.proposed.scmValidation.d.ts +60 -0
  97. package/vscode-dts/vscode.proposed.shareProvider.d.ts +74 -0
  98. package/vscode-dts/vscode.proposed.showLocal.d.ts +19 -0
  99. package/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts +25 -0
  100. package/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts +16 -0
  101. package/vscode-dts/vscode.proposed.telemetry.d.ts +36 -0
  102. package/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts +32 -0
  103. package/vscode-dts/vscode.proposed.terminalDimensions.d.ts +39 -0
  104. package/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts +46 -0
  105. package/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +83 -0
  106. package/vscode-dts/vscode.proposed.terminalSelection.d.ts +16 -0
  107. package/vscode-dts/vscode.proposed.testCoverage.d.ts +198 -0
  108. package/vscode-dts/vscode.proposed.testMessageContextValue.d.ts +45 -0
  109. package/vscode-dts/vscode.proposed.testObserver.d.ts +184 -0
  110. package/vscode-dts/vscode.proposed.textSearchProvider.d.ts +281 -0
  111. package/vscode-dts/vscode.proposed.timeline.d.ts +163 -0
  112. package/vscode-dts/vscode.proposed.tokenInformation.d.ts +26 -0
  113. package/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts +30 -0
  114. package/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts +28 -0
  115. package/vscode-dts/vscode.proposed.treeViewReveal.d.ts +13 -0
  116. package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +44 -0
  117. package/vscode-dts/vscode.proposed.tunnels.d.ts +64 -0
  118. package/vscode-dts/vscode.proposed.windowActivity.d.ts +17 -0
  119. package/vscode-dts/vscode.proposed.workspaceTrust.d.ts +30 -0
  120. package/vscode/src/vs/base/common/ternarySearchTree.d.ts +0 -46
  121. package/vscode/src/vs/base/common/uriIpc.d.ts +0 -10
  122. package/vscode/src/vs/platform/workspace/common/editSessions.d.ts +0 -7
  123. package/vscode/src/vs/workbench/services/extensions/common/proxyIdentifier.d.ts +0 -44
  124. package/vscode/src/vs/workbench/services/search/common/search.d.ts +0 -52
  125. package/vscode.proposed.d.ts +0 -4787
@@ -0,0 +1,71 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ // https://github.com/microsoft/vscode/issues/124024 @hediet
9
+
10
+ export namespace languages {
11
+ /**
12
+ * Registers an inline completion provider.
13
+ *
14
+ * Multiple providers can be registered for a language. In that case providers are asked in
15
+ * parallel and the results are merged. A failing provider (rejected promise or exception) will
16
+ * not cause a failure of the whole operation.
17
+ *
18
+ * @param selector A selector that defines the documents this provider is applicable to.
19
+ * @param provider An inline completion provider.
20
+ * @param metadata Metadata about the provider.
21
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
22
+ */
23
+ export function registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider, metadata: InlineCompletionItemProviderMetadata): Disposable;
24
+ }
25
+
26
+ export interface InlineCompletionItem {
27
+ /**
28
+ * If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
29
+ * Defaults to `false`.
30
+ */
31
+ completeBracketPairs?: boolean;
32
+ }
33
+
34
+ export interface InlineCompletionItemProviderMetadata {
35
+ /**
36
+ * Specifies a list of extension ids that this provider yields to if they return a result.
37
+ * If some inline completion provider registered by such an extension returns a result, this provider is not asked.
38
+ */
39
+ yieldTo: string[];
40
+ }
41
+
42
+ export interface InlineCompletionItemProvider {
43
+ /**
44
+ * @param completionItem The completion item that was shown.
45
+ * @param updatedInsertText The actual insert text (after brackets were fixed).
46
+ */
47
+ // eslint-disable-next-line local/vscode-dts-provider-naming
48
+ handleDidShowCompletionItem?(completionItem: InlineCompletionItem, updatedInsertText: string): void;
49
+
50
+ /**
51
+ * Is called when an inline completion item was accepted partially.
52
+ * @param acceptedLength The length of the substring of the inline completion that was accepted already.
53
+ */
54
+ // eslint-disable-next-line local/vscode-dts-provider-naming
55
+ handleDidPartiallyAcceptCompletionItem?(completionItem: InlineCompletionItem, acceptedLength: number): void;
56
+ }
57
+
58
+ // When finalizing `commands`, make sure to add a corresponding constructor parameter.
59
+ export interface InlineCompletionList {
60
+ /**
61
+ * A list of commands associated with the inline completions of this list.
62
+ */
63
+ commands?: Command[];
64
+
65
+ /**
66
+ * When set and the user types a suggestion without derivating from it, the inline suggestion is not updated.
67
+ * Defaults to false (might change).
68
+ */
69
+ enableForwardStability?: boolean;
70
+ }
71
+ }
@@ -0,0 +1,227 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ export interface InteractiveEditorSlashCommand {
9
+ command: string;
10
+ detail?: string;
11
+ refer?: boolean;
12
+ /**
13
+ * Whether the command should execute as soon
14
+ * as it is entered. Defaults to `false`.
15
+ */
16
+ executeImmediately?: boolean;
17
+ // kind: CompletionItemKind;
18
+ }
19
+
20
+ // todo@API make classes
21
+ export interface InteractiveEditorSession {
22
+ placeholder?: string;
23
+ slashCommands?: InteractiveEditorSlashCommand[];
24
+ wholeRange?: Range;
25
+ message?: string;
26
+ }
27
+
28
+ // todo@API make classes
29
+ export interface InteractiveEditorRequest {
30
+ prompt: string;
31
+ selection: Selection;
32
+ wholeRange: Range;
33
+ attempt: number;
34
+ live: boolean;
35
+ }
36
+
37
+ // todo@API make classes
38
+ export interface InteractiveEditorResponse {
39
+ edits: TextEdit[] | WorkspaceEdit;
40
+ placeholder?: string;
41
+ wholeRange?: Range;
42
+ }
43
+
44
+ // todo@API make classes
45
+ export interface InteractiveEditorMessageResponse {
46
+ contents: MarkdownString;
47
+ placeholder?: string;
48
+ wholeRange?: Range;
49
+ }
50
+
51
+ export enum InteractiveEditorResponseFeedbackKind {
52
+ Unhelpful = 0,
53
+ Helpful = 1,
54
+ Undone = 2,
55
+ Accepted = 3
56
+ }
57
+
58
+ export interface TextDocumentContext {
59
+ document: TextDocument;
60
+ selection: Selection;
61
+ }
62
+
63
+ export interface InteractiveEditorSessionProviderMetadata {
64
+ label: string;
65
+ }
66
+
67
+ export interface InteractiveEditorSessionProvider<S extends InteractiveEditorSession = InteractiveEditorSession, R extends InteractiveEditorResponse | InteractiveEditorMessageResponse = InteractiveEditorResponse | InteractiveEditorMessageResponse> {
68
+
69
+ // Create a session. The lifetime of this session is the duration of the editing session with the input mode widget.
70
+ prepareInteractiveEditorSession(context: TextDocumentContext, token: CancellationToken): ProviderResult<S>;
71
+
72
+ provideInteractiveEditorResponse(session: S, request: InteractiveEditorRequest, progress: Progress<{ message: string; edits: TextEdit[] }>, token: CancellationToken): ProviderResult<R>;
73
+
74
+ // eslint-disable-next-line local/vscode-dts-provider-naming
75
+ handleInteractiveEditorResponseFeedback?(session: S, response: R, kind: InteractiveEditorResponseFeedbackKind): void;
76
+ }
77
+
78
+
79
+ export interface InteractiveSessionState { }
80
+
81
+ export interface InteractiveSessionParticipantInformation {
82
+ name: string;
83
+
84
+ /**
85
+ * A full URI for the icon of the participant.
86
+ */
87
+ icon?: Uri;
88
+ }
89
+
90
+ export interface InteractiveSession {
91
+ requester: InteractiveSessionParticipantInformation;
92
+ responder: InteractiveSessionParticipantInformation;
93
+ inputPlaceholder?: string;
94
+
95
+ saveState?(): InteractiveSessionState;
96
+ }
97
+
98
+ export interface InteractiveSessionRequestArgs {
99
+ command: string;
100
+ args: any;
101
+ }
102
+
103
+ export interface InteractiveRequest {
104
+ session: InteractiveSession;
105
+ message: string | InteractiveSessionReplyFollowup;
106
+ }
107
+
108
+ export interface InteractiveResponseErrorDetails {
109
+ message: string;
110
+ responseIsIncomplete?: boolean;
111
+ responseIsFiltered?: boolean;
112
+ }
113
+
114
+ export interface InteractiveResponseForProgress {
115
+ errorDetails?: InteractiveResponseErrorDetails;
116
+ }
117
+
118
+ export interface InteractiveProgressContent {
119
+ content: string | MarkdownString;
120
+ }
121
+
122
+ export interface InteractiveProgressId {
123
+ responseId: string;
124
+ }
125
+
126
+ export interface InteractiveProgressTask {
127
+ placeholder: string;
128
+ resolvedContent: Thenable<InteractiveProgressContent | InteractiveProgressFileTree>;
129
+ }
130
+
131
+ export interface FileTreeData {
132
+ label: string;
133
+ uri: Uri;
134
+ children?: FileTreeData[];
135
+ }
136
+
137
+ export interface InteractiveProgressFileTree {
138
+ treeData: FileTreeData;
139
+ }
140
+
141
+ export interface DocumentContext {
142
+ uri: Uri;
143
+ version: number;
144
+ ranges: Range[];
145
+ }
146
+
147
+ export interface InteractiveProgressUsedContext {
148
+ documents: DocumentContext[];
149
+ }
150
+
151
+ export type InteractiveProgress =
152
+ | InteractiveProgressContent
153
+ | InteractiveProgressId
154
+ | InteractiveProgressTask
155
+ | InteractiveProgressFileTree
156
+ | InteractiveProgressUsedContext;
157
+
158
+ export interface InteractiveResponseCommand {
159
+ commandId: string;
160
+ args?: any[];
161
+ title: string; // supports codicon strings
162
+ when?: string;
163
+ }
164
+
165
+ export interface InteractiveSessionSlashCommand {
166
+ command: string;
167
+ kind: CompletionItemKind;
168
+ detail?: string;
169
+ shouldRepopulate?: boolean;
170
+ followupPlaceholder?: string;
171
+ executeImmediately?: boolean;
172
+ yieldTo?: ReadonlyArray<{ readonly command: string }>;
173
+ }
174
+
175
+ export interface InteractiveSessionReplyFollowup {
176
+ message: string;
177
+ tooltip?: string;
178
+ title?: string;
179
+
180
+ // Extensions can put any serializable data here, such as an ID/version
181
+ metadata?: any;
182
+ }
183
+
184
+ export type InteractiveSessionFollowup = InteractiveSessionReplyFollowup | InteractiveResponseCommand;
185
+
186
+ export type InteractiveWelcomeMessageContent = string | InteractiveSessionReplyFollowup[];
187
+
188
+ export interface InteractiveSessionProvider<S extends InteractiveSession = InteractiveSession> {
189
+ provideWelcomeMessage?(token: CancellationToken): ProviderResult<InteractiveWelcomeMessageContent[]>;
190
+ provideFollowups?(session: S, token: CancellationToken): ProviderResult<(string | InteractiveSessionFollowup)[]>;
191
+ provideSlashCommands?(session: S, token: CancellationToken): ProviderResult<InteractiveSessionSlashCommand[]>;
192
+
193
+ prepareSession(initialState: InteractiveSessionState | undefined, token: CancellationToken): ProviderResult<S>;
194
+ resolveRequest(session: S, context: InteractiveSessionRequestArgs | string, token: CancellationToken): ProviderResult<InteractiveRequest>;
195
+ provideResponseWithProgress(request: InteractiveRequest, progress: Progress<InteractiveProgress>, token: CancellationToken): ProviderResult<InteractiveResponseForProgress>;
196
+
197
+ // eslint-disable-next-line local/vscode-dts-provider-naming
198
+ removeRequest(session: S, requestId: string): void;
199
+ }
200
+
201
+ export interface InteractiveSessionDynamicRequest {
202
+ /**
203
+ * The message that will be displayed in the UI
204
+ */
205
+ message: string;
206
+
207
+ /**
208
+ * Any extra metadata/context that will go to the provider.
209
+ * NOTE not actually used yet.
210
+ */
211
+ metadata?: any;
212
+ }
213
+
214
+ export namespace interactive {
215
+ // current version of the proposal.
216
+ export const _version: 1 | number;
217
+
218
+ export function registerInteractiveSessionProvider(id: string, provider: InteractiveSessionProvider): Disposable;
219
+ export function addInteractiveRequest(context: InteractiveSessionRequestArgs): void;
220
+
221
+ export function sendInteractiveRequestToProvider(providerId: string, message: InteractiveSessionDynamicRequest): void;
222
+
223
+ export function registerInteractiveEditorSessionProvider(provider: InteractiveEditorSessionProvider, metadata?: InteractiveEditorSessionProviderMetadata): Disposable;
224
+
225
+ export function transferChatSession(session: InteractiveSession, toWorkspace: Uri): void;
226
+ }
227
+ }
@@ -0,0 +1,70 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ export enum InteractiveSessionVoteDirection {
9
+ Up = 1,
10
+ Down = 2
11
+ }
12
+
13
+ export interface InteractiveSessionVoteAction {
14
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
15
+ kind: 'vote';
16
+ responseId: string;
17
+ direction: InteractiveSessionVoteDirection;
18
+ }
19
+
20
+ export enum InteractiveSessionCopyKind {
21
+ // Keyboard shortcut or context menu
22
+ Action = 1,
23
+ Toolbar = 2
24
+ }
25
+
26
+ export interface InteractiveSessionCopyAction {
27
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
28
+ kind: 'copy';
29
+ responseId: string;
30
+ codeBlockIndex: number;
31
+ copyType: InteractiveSessionCopyKind;
32
+ copiedCharacters: number;
33
+ totalCharacters: number;
34
+ copiedText: string;
35
+ }
36
+
37
+ export interface InteractiveSessionInsertAction {
38
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
39
+ kind: 'insert';
40
+ responseId: string;
41
+ codeBlockIndex: number;
42
+ totalCharacters: number;
43
+ newFile?: boolean;
44
+ }
45
+
46
+ export interface InteractiveSessionTerminalAction {
47
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
48
+ kind: 'runInTerminal';
49
+ responseId: string;
50
+ codeBlockIndex: number;
51
+ languageId?: string;
52
+ }
53
+
54
+ export interface InteractiveSessionCommandAction {
55
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
56
+ kind: 'command';
57
+ command: InteractiveResponseCommand;
58
+ }
59
+
60
+ export type InteractiveSessionUserAction = InteractiveSessionVoteAction | InteractiveSessionCopyAction | InteractiveSessionInsertAction | InteractiveSessionTerminalAction | InteractiveSessionCommandAction;
61
+
62
+ export interface InteractiveSessionUserActionEvent {
63
+ action: InteractiveSessionUserAction;
64
+ providerId: string;
65
+ }
66
+
67
+ export namespace interactive {
68
+ export const onDidPerformUserAction: Event<InteractiveSessionUserActionEvent>;
69
+ }
70
+ }
@@ -0,0 +1,25 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+ /**
8
+ * The tab represents an interactive window.
9
+ */
10
+ export class TabInputInteractiveWindow {
11
+ /**
12
+ * The uri of the history notebook in the interactive window.
13
+ */
14
+ readonly uri: Uri;
15
+ /**
16
+ * The uri of the input box in the interactive window.
17
+ */
18
+ readonly inputBoxUri: Uri;
19
+ private constructor(uri: Uri, inputBoxUri: Uri);
20
+ }
21
+
22
+ export interface Tab {
23
+ readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | TabInputInteractiveWindow | unknown;
24
+ }
25
+ }
@@ -0,0 +1,37 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ /**
9
+ * A message passing protocol, which enables sending and receiving messages
10
+ * between two parties.
11
+ */
12
+ export interface MessagePassingProtocol {
13
+
14
+ /**
15
+ * Fired when a message is received from the other party.
16
+ */
17
+ readonly onDidReceiveMessage: Event<any>;
18
+
19
+ /**
20
+ * Post a message to the other party.
21
+ *
22
+ * @param message Body of the message. This must be a JSON serializable object.
23
+ * @param transfer A collection of `ArrayBuffer` instances which can be transferred
24
+ * to the other party, saving costly memory copy operations.
25
+ */
26
+ postMessage(message: any, transfer?: ArrayBuffer[]): void;
27
+ }
28
+
29
+ export interface ExtensionContext {
30
+
31
+ /**
32
+ * When not `undefined`, this is an instance of {@link MessagePassingProtocol} in
33
+ * which the other party is owned by the web embedder.
34
+ */
35
+ readonly messagePassingProtocol: MessagePassingProtocol | undefined;
36
+ }
37
+ }
@@ -0,0 +1,42 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ export interface DocumentContextItem {
9
+ readonly uri: Uri;
10
+ readonly version: number;
11
+ readonly ranges: Range[];
12
+ }
13
+
14
+ export interface MappedEditsContext {
15
+ documents: DocumentContextItem[][];
16
+ }
17
+
18
+ /**
19
+ * Interface for providing mapped edits for a given document.
20
+ */
21
+ export interface MappedEditsProvider {
22
+ /**
23
+ * Provide mapped edits for a given document.
24
+ * @param document The document to provide mapped edits for.
25
+ * @param codeBlocks Code blocks that come from an LLM's reply.
26
+ * "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them.
27
+ * @param context The context for providing mapped edits.
28
+ * @param token A cancellation token.
29
+ * @returns A provider result of text edits.
30
+ */
31
+ provideMappedEdits(
32
+ document: TextDocument,
33
+ codeBlocks: string[],
34
+ context: MappedEditsContext,
35
+ token: CancellationToken
36
+ ): ProviderResult<WorkspaceEdit | null>;
37
+ }
38
+
39
+ namespace chat {
40
+ export function registerMappedEditsProvider(documentSelector: DocumentSelector, provider: MappedEditsProvider): Disposable;
41
+ }
42
+ }
@@ -0,0 +1,52 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ // https://github.com/microsoft/vscode/issues/124970
9
+
10
+ /**
11
+ * The execution state of a notebook cell.
12
+ */
13
+ export enum NotebookCellExecutionState {
14
+ /**
15
+ * The cell is idle.
16
+ */
17
+ Idle = 1,
18
+ /**
19
+ * Execution for the cell is pending.
20
+ */
21
+ Pending = 2,
22
+ /**
23
+ * The cell is currently executing.
24
+ */
25
+ Executing = 3,
26
+ }
27
+
28
+ /**
29
+ * An event describing a cell execution state change.
30
+ */
31
+ export interface NotebookCellExecutionStateChangeEvent {
32
+ /**
33
+ * The {@link NotebookCell cell} for which the execution state has changed.
34
+ */
35
+ readonly cell: NotebookCell;
36
+
37
+ /**
38
+ * The new execution state of the cell.
39
+ */
40
+ readonly state: NotebookCellExecutionState;
41
+ }
42
+
43
+ export namespace notebooks {
44
+
45
+ /**
46
+ * An {@link Event} which fires when the execution state of a cell has changed.
47
+ */
48
+ // todo@API this is an event that is fired for a property that cells don't have and that makes me wonder
49
+ // how a correct consumer works, e.g the consumer could have been late and missed an event?
50
+ export const onDidChangeNotebookCellExecutionState: Event<NotebookCellExecutionStateChangeEvent>;
51
+ }
52
+ }
@@ -0,0 +1,17 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+ // https://github.com/microsoft/vscode/issues/161144
8
+ export enum NotebookControllerAffinity2 {
9
+ Default = 1,
10
+ Preferred = 2,
11
+ Hidden = -1
12
+ }
13
+
14
+ export interface NotebookController {
15
+ updateNotebookAffinity(notebook: NotebookDocument, affinity: NotebookControllerAffinity | NotebookControllerAffinity2): void;
16
+ }
17
+ }
@@ -0,0 +1,16 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ // https://github.com/microsoft/vscode/issues/106744
9
+
10
+ export interface NotebookCellOutput {
11
+ /**
12
+ * @deprecated
13
+ */
14
+ id: string;
15
+ }
16
+ }
@@ -0,0 +1,39 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ /**
9
+ * A NotebookExecution is how {@link NotebookController notebook controller} can indicate whether the notebook controller is busy or not.
10
+ *
11
+ * When {@linkcode NotebookExecution.start start()} is called on the execution task, it causes the Notebook to enter a executing state .
12
+ * When {@linkcode NotebookExecution.end end()} is called, it enters the idle state.
13
+ */
14
+ export interface NotebookExecution {
15
+ /**
16
+ * Signal that the execution has begun.
17
+ */
18
+ start(): void;
19
+
20
+ /**
21
+ * Signal that execution has ended.
22
+ */
23
+ end(): void;
24
+ }
25
+
26
+ export interface NotebookController {
27
+ /**
28
+ * Create an execution task.
29
+ *
30
+ * _Note_ that there can only be one execution per Notebook, that also includes NotebookCellExecutions and t an error is thrown if
31
+ * a cell execution or another NotebookExecution is created while another is still active.
32
+ *
33
+ * This should be used to indicate the {@link NotebookController notebook controller} is busy even though user may not have executed any cell though the UI.
34
+ * @param {NotebookDocument} notebook
35
+ * @returns A notebook execution.
36
+ */
37
+ createNotebookExecution(notebook: NotebookDocument): NotebookExecution;
38
+ }
39
+ }
@@ -0,0 +1,46 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+ export interface NotebookControllerDetectionTask {
8
+ /**
9
+ * Dispose and remove the detection task.
10
+ */
11
+ dispose(): void;
12
+ }
13
+
14
+ export class NotebookKernelSourceAction {
15
+ readonly label: string;
16
+ readonly description?: string;
17
+ readonly detail?: string;
18
+ readonly command: string | Command;
19
+ readonly documentation?: Uri;
20
+
21
+ constructor(label: string);
22
+ }
23
+
24
+ export interface NotebookKernelSourceActionProvider {
25
+ /**
26
+ * An optional event to signal that the kernel source actions have changed.
27
+ */
28
+ onDidChangeNotebookKernelSourceActions?: Event<void>;
29
+ /**
30
+ * Provide kernel source actions
31
+ */
32
+ provideNotebookKernelSourceActions(token: CancellationToken): ProviderResult<NotebookKernelSourceAction[]>;
33
+ }
34
+
35
+ export namespace notebooks {
36
+ /**
37
+ * Create notebook controller detection task
38
+ */
39
+ export function createNotebookControllerDetectionTask(notebookType: string): NotebookControllerDetectionTask;
40
+
41
+ /**
42
+ * Register a notebook kernel source action provider
43
+ */
44
+ export function registerKernelSourceActionProvider(notebookType: string, provider: NotebookKernelSourceActionProvider): Disposable;
45
+ }
46
+ }
@@ -0,0 +1,21 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ // https://github.com/microsoft/vscode/issues/106744
9
+
10
+ export interface NotebookRegistrationData {
11
+ readonly displayName: string;
12
+ readonly filenamePattern: ReadonlyArray<(GlobPattern | { readonly include: GlobPattern; readonly exclude: GlobPattern })>;
13
+ readonly exclusive?: boolean;
14
+ }
15
+
16
+ export namespace workspace {
17
+
18
+ // SPECIAL overload with NotebookRegistrationData
19
+ export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions, registration?: NotebookRegistrationData): Disposable;
20
+ }
21
+ }