@codingame/monaco-vscode-rollup-vsix-plugin 6.0.2 → 7.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "6.0.2",
3
+ "version": "7.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@rollup/pluginutils": "^5.1.0",
22
22
  "css-url-parser": "^1.1.3",
23
- "memfs": "^4.9.2",
23
+ "memfs": "^4.9.3",
24
24
  "mime-types": "^2.1.35",
25
25
  "yauzl": "^3.0.0"
26
26
  }
@@ -148,7 +148,7 @@ interface IGrammar {
148
148
  /**
149
149
  * Language identifier for which this syntax is contributed to.
150
150
  */
151
- readonly language: string;
151
+ readonly language?: string;
152
152
  /**
153
153
  * Textmate scope name used by the tmLanguage file.
154
154
  */
@@ -5,99 +5,6 @@
5
5
 
6
6
  declare module 'vscode' {
7
7
 
8
- // https://github.com/microsoft/vscode/issues/205317
9
-
10
- /**
11
- * The parameters of a query for text search.
12
- */
13
- export interface TextSearchQuery {
14
- /**
15
- * The text pattern to search for.
16
- */
17
- pattern: string;
18
-
19
- /**
20
- * Whether or not `pattern` should match multiple lines of text.
21
- */
22
- isMultiline?: boolean;
23
-
24
- /**
25
- * Whether or not `pattern` should be interpreted as a regular expression.
26
- */
27
- isRegExp?: boolean;
28
-
29
- /**
30
- * Whether or not the search should be case-sensitive.
31
- */
32
- isCaseSensitive?: boolean;
33
-
34
- /**
35
- * Whether or not to search for whole word matches only.
36
- */
37
- isWordMatch?: boolean;
38
- }
39
-
40
- /**
41
- * Options common to file and text search
42
- */
43
- export interface SearchOptions {
44
- /**
45
- * The root folder to search within.
46
- */
47
- folder: Uri;
48
-
49
- /**
50
- * Files that match an `includes` glob pattern should be included in the search.
51
- */
52
- includes: GlobString[];
53
-
54
- /**
55
- * Files that match an `excludes` glob pattern should be excluded from the search.
56
- */
57
- excludes: GlobString[];
58
-
59
- /**
60
- * Whether external files that exclude files, like .gitignore, should be respected.
61
- * See the vscode setting `"search.useIgnoreFiles"`.
62
- */
63
- useIgnoreFiles: boolean;
64
-
65
- /**
66
- * Whether symlinks should be followed while searching.
67
- * See the vscode setting `"search.followSymlinks"`.
68
- */
69
- followSymlinks: boolean;
70
-
71
- /**
72
- * Whether global files that exclude files, like .gitignore, should be respected.
73
- * See the vscode setting `"search.useGlobalIgnoreFiles"`.
74
- */
75
- useGlobalIgnoreFiles: boolean;
76
-
77
- /**
78
- * Whether files in parent directories that exclude files, like .gitignore, should be respected.
79
- * See the vscode setting `"search.useParentIgnoreFiles"`.
80
- */
81
- useParentIgnoreFiles: boolean;
82
- }
83
-
84
- /**
85
- * Options to specify the size of the result text preview.
86
- * These options don't affect the size of the match itself, just the amount of preview text.
87
- */
88
- export interface TextSearchPreviewOptions {
89
- /**
90
- * The maximum number of lines in the preview.
91
- * Only search providers that support multiline search will ever return more than one line in the match.
92
- */
93
- matchLines: number;
94
-
95
- /**
96
- * The maximum number of characters included per line.
97
- */
98
- charsPerLine: number;
99
- }
100
-
101
8
  /**
102
9
  * Options that apply to AI text search.
103
10
  */
@@ -129,109 +36,6 @@ declare module 'vscode' {
129
36
  }
130
37
 
131
38
 
132
-
133
- /**
134
- * A message regarding a completed search.
135
- */
136
- export interface TextSearchCompleteMessage {
137
- /**
138
- * Markdown text of the message.
139
- */
140
- text: string;
141
- /**
142
- * Whether the source of the message is trusted, command links are disabled for untrusted message sources.
143
- * Messaged are untrusted by default.
144
- */
145
- trusted?: boolean;
146
- /**
147
- * The message type, this affects how the message will be rendered.
148
- */
149
- type: TextSearchCompleteMessageType;
150
- }
151
-
152
- /**
153
- * Information collected when text search is complete.
154
- */
155
- export interface TextSearchComplete {
156
- /**
157
- * Whether the search hit the limit on the maximum number of search results.
158
- * `maxResults` on {@linkcode AITextSearchOptions} specifies the max number of results.
159
- * - If exactly that number of matches exist, this should be false.
160
- * - If `maxResults` matches are returned and more exist, this should be true.
161
- * - If search hits an internal limit which is less than `maxResults`, this should be true.
162
- */
163
- limitHit?: boolean;
164
-
165
- /**
166
- * Additional information regarding the state of the completed search.
167
- *
168
- * Messages with "Information" style support links in markdown syntax:
169
- * - Click to [run a command](command:workbench.action.OpenQuickPick)
170
- * - Click to [open a website](https://aka.ms)
171
- *
172
- * Commands may optionally return { triggerSearch: true } to signal to the editor that the original search should run be again.
173
- */
174
- message?: TextSearchCompleteMessage | TextSearchCompleteMessage[];
175
- }
176
-
177
- /**
178
- * A preview of the text result.
179
- */
180
- export interface TextSearchMatchPreview {
181
- /**
182
- * The matching lines of text, or a portion of the matching line that contains the match.
183
- */
184
- text: string;
185
-
186
- /**
187
- * The Range within `text` corresponding to the text of the match.
188
- * The number of matches must match the TextSearchMatch's range property.
189
- */
190
- matches: Range | Range[];
191
- }
192
-
193
- /**
194
- * A match from a text search
195
- */
196
- export interface TextSearchMatch {
197
- /**
198
- * The uri for the matching document.
199
- */
200
- uri: Uri;
201
-
202
- /**
203
- * The range of the match within the document, or multiple ranges for multiple matches.
204
- */
205
- ranges: Range | Range[];
206
-
207
- /**
208
- * A preview of the text match.
209
- */
210
- preview: TextSearchMatchPreview;
211
- }
212
-
213
- /**
214
- * A line of context surrounding a TextSearchMatch.
215
- */
216
- export interface TextSearchContext {
217
- /**
218
- * The uri for the matching document.
219
- */
220
- uri: Uri;
221
-
222
- /**
223
- * One line of text.
224
- * previewOptions.charsPerLine applies to this
225
- */
226
- text: string;
227
-
228
- /**
229
- * The line number of this line of context.
230
- */
231
- lineNumber: number;
232
- }
233
-
234
-
235
39
  /**
236
40
  * An AITextSearchProvider provides additional AI text search results in the workspace.
237
41
  */
@@ -6,23 +6,41 @@
6
6
  declare module 'vscode' {
7
7
  export class FileCoverage2 extends FileCoverage {
8
8
  /**
9
- * Test {@link TestItem} this file coverage is generated from. If undefined,
10
- * the editor will assume the coverage is the overall summary coverage for
11
- * the entire file.
12
- *
13
- * If per-test coverage is available, an extension should append multiple
14
- * `FileCoverage` instances with this property set for each test item. It
15
- * must also append a `FileCoverage` instance without this property set to
16
- * represent the overall coverage of the file.
9
+ * A list of {@link TestItem test cases} that generated coverage in this
10
+ * file. If set, then {@link TestRunProfile.loadDetailedCoverageForTest}
11
+ * should also be defined in order to retrieve detailed coverage information.
17
12
  */
18
- testItem?: TestItem;
13
+ fromTests: TestItem[];
19
14
 
20
15
  constructor(
21
16
  uri: Uri,
22
17
  statementCoverage: TestCoverageCount,
23
18
  branchCoverage?: TestCoverageCount,
24
19
  declarationCoverage?: TestCoverageCount,
25
- testItem?: TestItem,
20
+ fromTests?: TestItem[],
26
21
  );
27
22
  }
23
+
24
+ export interface TestRunProfile {
25
+ /**
26
+ * An extension-provided function that provides detailed statement and
27
+ * function-level coverage for a single test in a file. This is the per-test
28
+ * sibling of {@link TestRunProfile.loadDetailedCoverage}, called only if
29
+ * a test item is provided in {@link FileCoverage.fromTests} and only for
30
+ * files where such data is reported.
31
+ *
32
+ * The editor will call this when user asks to view coverage for a test in
33
+ * a file, and the returned coverage information is used to display exactly
34
+ * what code was run by that test.
35
+ *
36
+ * The {@link FileCoverage} object passed to this function is the same
37
+ * instance emitted on {@link TestRun.addCoverage} calls associated with this profile.
38
+ *
39
+ * @param testRun The test run that generated the coverage data.
40
+ * @param fileCoverage The file coverage object to load detailed coverage for.
41
+ * @param fromTestItem The test item to request coverage information for.
42
+ * @param token A cancellation token that indicates the operation should be cancelled.
43
+ */
44
+ loadDetailedCoverageForTest?: (testRun: TestRun, fileCoverage: FileCoverage, fromTestItem: TestItem, token: CancellationToken) => Thenable<FileCoverageDetail[]>;
45
+ }
28
46
  }
@@ -7,42 +7,50 @@ declare module 'vscode' {
7
7
 
8
8
  // https://github.com/microsoft/vscode/issues/152399
9
9
 
10
- export interface AuthenticationForceNewSessionOptions {
11
- /**
12
- * The session that you are asking to be recreated. The Auth Provider can use this to
13
- * help guide the user to log in to the correct account.
14
- */
15
- sessionToRecreate?: AuthenticationSession;
16
- }
10
+ // FOR THE CONSUMER
17
11
 
18
12
  export namespace authentication {
19
13
  /**
20
- * Get all authentication sessions matching the desired scopes that this extension has access to. In order to request access,
21
- * use {@link getSession}. To request an additional account, specify {@link AuthenticationGetSessionOptions.clearSessionPreference}
22
- * and {@link AuthenticationGetSessionOptions.createIfNone} together.
14
+ * Get all accounts that the user is logged in to for the specified provider.
15
+ * Use this paired with {@link getSession} in order to get an authentication session for a specific account.
23
16
  *
24
17
  * Currently, there are only two authentication providers that are contributed from built in extensions
25
18
  * to the editor that implement GitHub and Microsoft authentication: their providerId's are 'github' and 'microsoft'.
26
19
  *
27
- * @param providerId The id of the provider to use
28
- * @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication provider
29
- * @returns A thenable that resolves to a readonly array of authentication sessions.
20
+ * Note: Getting accounts does not imply that your extension has access to that account or its authentication sessions. You can verify access to the account by calling {@link getSession}.
21
+ *
22
+ * @param providerId The id of the provider to use
23
+ * @returns A thenable that resolves to a readonly array of authentication accounts.
24
+ */
25
+ export function getAccounts(providerId: string): Thenable<readonly AuthenticationSessionAccountInformation[]>;
26
+ }
27
+
28
+ export interface AuthenticationGetSessionOptions {
29
+ /**
30
+ * The account that you would like to get a session for. This is passed down to the Authentication Provider to be used for creating the correct session.
30
31
  */
31
- export function getSessions(providerId: string, scopes: readonly string[]): Thenable<readonly AuthenticationSession[]>;
32
+ account?: AuthenticationSessionAccountInformation;
32
33
  }
33
34
 
34
- /**
35
- * The options passed in to the provider when creating a session.
36
- */
37
- export interface AuthenticationProviderCreateSessionOptions {
35
+ // FOR THE AUTH PROVIDER
36
+
37
+ export interface AuthenticationProviderSessionOptions {
38
38
  /**
39
- * The session that is being asked to be recreated. If this is passed in, the provider should
40
- * attempt to recreate the session based on the information in this session.
39
+ * The account that is being asked about. If this is passed in, the provider should
40
+ * attempt to return the sessions that are only related to this account.
41
41
  */
42
- sessionToRecreate?: AuthenticationSession;
42
+ account?: AuthenticationSessionAccountInformation;
43
43
  }
44
44
 
45
45
  export interface AuthenticationProvider {
46
+ /**
47
+ * Get a list of sessions.
48
+ * @param scopes An optional list of scopes. If provided, the sessions returned should match
49
+ * these permissions, otherwise all sessions should be returned.
50
+ * @param options Additional options for getting sessions.
51
+ * @returns A promise that resolves to an array of authentication sessions.
52
+ */
53
+ getSessions(scopes: readonly string[] | undefined, options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession[]>;
46
54
  /**
47
55
  * Prompts a user to login.
48
56
  *
@@ -57,6 +65,6 @@ declare module 'vscode' {
57
65
  * @param options Additional options for creating a session.
58
66
  * @returns A promise that resolves to an authentication session.
59
67
  */
60
- createSession(scopes: readonly string[], options: AuthenticationProviderCreateSessionOptions): Thenable<AuthenticationSession>;
68
+ createSession(scopes: readonly string[], options: AuthenticationProviderSessionOptions): Thenable<AuthenticationSession>;
61
69
  }
62
70
  }
@@ -10,20 +10,29 @@ declare module 'vscode' {
10
10
  part: string;
11
11
  }
12
12
 
13
+ export interface ChatResponseFragment2 {
14
+ index: number;
15
+ part: LanguageModelChatResponseTextPart | LanguageModelChatResponseFunctionUsePart;
16
+ }
17
+
13
18
  // @API extension ship a d.ts files for their options
14
19
 
15
20
  /**
16
21
  * Represents a large language model that accepts ChatML messages and produces a streaming response
17
22
  */
18
- export interface ChatResponseProvider {
23
+ export interface LanguageModelChatProvider {
19
24
 
20
25
  onDidReceiveLanguageModelResponse2?: Event<{ readonly extensionId: string; readonly participant?: string; readonly tokenCount?: number }>;
21
26
 
22
27
  provideLanguageModelResponse(messages: LanguageModelChatMessage[], options: { [name: string]: any }, extensionId: string, progress: Progress<ChatResponseFragment>, token: CancellationToken): Thenable<any>;
23
28
 
29
+ provideLanguageModelResponse2?(messages: LanguageModelChatMessage[], options: LanguageModelChatRequestOptions, extensionId: string, progress: Progress<ChatResponseFragment2>, token: CancellationToken): Thenable<any>;
30
+
24
31
  provideTokenCount(text: string | LanguageModelChatMessage, token: CancellationToken): Thenable<number>;
25
32
  }
26
33
 
34
+ export type ChatResponseProvider = LanguageModelChatProvider;
35
+
27
36
  export interface ChatResponseProviderMetadata {
28
37
 
29
38
  readonly vendor: string;
@@ -64,14 +73,14 @@ declare module 'vscode' {
64
73
  export namespace chat {
65
74
 
66
75
  /**
67
- * Register a LLM as chat response provider to the editor.
68
- *
69
- *
70
- * @param id
71
- * @param provider
72
- * @param metadata
73
- */
76
+ * @deprecated use `lm.registerChatResponseProvider` instead
77
+ */
74
78
  export function registerChatResponseProvider(id: string, provider: ChatResponseProvider, metadata: ChatResponseProviderMetadata): Disposable;
75
79
  }
76
80
 
81
+ export namespace lm {
82
+
83
+ export function registerChatModelProvider(id: string, provider: LanguageModelChatProvider, metadata: ChatResponseProviderMetadata): Disposable;
84
+ }
85
+
77
86
  }
@@ -19,15 +19,6 @@ declare module 'vscode' {
19
19
  * @param icon An icon to display when selecting context in the picker UI.
20
20
  */
21
21
  export function registerChatVariableResolver(id: string, name: string, userDescription: string, modelDescription: string | undefined, isSlow: boolean | undefined, resolver: ChatVariableResolver, fullName?: string, icon?: ThemeIcon): Disposable;
22
-
23
- /**
24
- * Attaches a chat context with the specified name, value, and location.
25
- *
26
- * @param name - The name of the chat context.
27
- * @param value - The value of the chat context.
28
- * @param location - The location of the chat context.
29
- */
30
- export function attachContext(name: string, value: string | Uri | Location | unknown, location: ChatLocation.Panel): void;
31
22
  }
32
23
 
33
24
  export interface ChatVariableValue {
@@ -0,0 +1,32 @@
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
+ // @alexr00 https://github.com/microsoft/vscode/issues/167253
9
+
10
+ /**
11
+ * Options to reveal a comment thread in an editor.
12
+ */
13
+ export interface CommentThreadRevealOptions {
14
+ /**
15
+ * By default, the comment thread will be focused. Set `preserveFocus` to `true` to maintain the original focus.
16
+ */
17
+ preserveFocus?: boolean;
18
+
19
+ /**
20
+ * Focus the comment thread reply editor, if the thread supports replying.
21
+ */
22
+ focusReply?: boolean;
23
+ }
24
+
25
+ export interface CommentThread {
26
+ /**
27
+ * Reveal the comment thread in an editor.
28
+ */
29
+ reveal(options?: CommentThreadRevealOptions): Thenable<void>;
30
+ }
31
+
32
+ }
@@ -28,5 +28,15 @@ declare module 'vscode' {
28
28
  * Worth noting that we already have this problem for the `comments` property.
29
29
  */
30
30
  state?: CommentThreadState | { resolved?: CommentThreadState; applicability?: CommentThreadApplicability };
31
+ readonly uri: Uri;
32
+ range: Range | undefined;
33
+ comments: readonly Comment[];
34
+ collapsibleState: CommentThreadCollapsibleState;
35
+ canReply: boolean;
36
+ contextValue?: string;
37
+ label?: string;
38
+ dispose(): void;
39
+ // Part of the comment reveal proposal
40
+ reveal(options?: CommentThreadRevealOptions): Thenable<void>;
31
41
  }
32
42
  }
@@ -28,7 +28,7 @@ declare module 'vscode' {
28
28
  * An optional set of glob patterns to exclude from watching.
29
29
  * Glob patterns are always matched relative to the watched folder.
30
30
  */
31
- readonly excludes?: string[];
31
+ readonly excludes: string[];
32
32
  }
33
33
 
34
34
  export namespace workspace {
@@ -6,68 +6,27 @@
6
6
  declare module 'vscode' {
7
7
 
8
8
  export interface CommentThread2 {
9
- /**
10
- * The uri of the document the thread has been created on.
11
- */
12
- readonly uri: Uri;
13
-
14
9
  /**
15
10
  * The range the comment thread is located within the document. The thread icon will be shown
16
- * at the last line of the range.
11
+ * at the last line of the range. When set to undefined, the comment will be associated with the
12
+ * file, and not a specific range.
17
13
  */
18
14
  range: Range | undefined;
15
+ }
19
16
 
17
+ /**
18
+ * The ranges a CommentingRangeProvider enables commenting on.
19
+ */
20
+ export interface CommentingRanges {
20
21
  /**
21
- * The ordered comments of the thread.
22
- */
23
- comments: readonly Comment[];
24
-
25
- /**
26
- * Whether the thread should be collapsed or expanded when opening the document.
27
- * Defaults to Collapsed.
28
- */
29
- collapsibleState: CommentThreadCollapsibleState;
30
-
31
- /**
32
- * Whether the thread supports reply.
33
- * Defaults to true.
34
- */
35
- canReply: boolean;
36
-
37
- /**
38
- * Context value of the comment thread. This can be used to contribute thread specific actions.
39
- * For example, a comment thread is given a context value as `editable`. When contributing actions to `comments/commentThread/title`
40
- * using `menus` extension point, you can specify context value for key `commentThread` in `when` expression like `commentThread == editable`.
41
- * ```json
42
- * "contributes": {
43
- * "menus": {
44
- * "comments/commentThread/title": [
45
- * {
46
- * "command": "extension.deleteCommentThread",
47
- * "when": "commentThread == editable"
48
- * }
49
- * ]
50
- * }
51
- * }
52
- * ```
53
- * This will show action `extension.deleteCommentThread` only for comment threads with `contextValue` is `editable`.
54
- */
55
- contextValue?: string;
56
-
57
- /**
58
- * The optional human-readable label describing the {@link CommentThread Comment Thread}
22
+ * Enables comments to be added to a file without a specific range.
59
23
  */
60
- label?: string;
61
-
62
- // from the commentThreadRelevance proposal
63
- state?: CommentThreadState | { resolved?: CommentThreadState; applicability?: CommentThreadApplicability };
24
+ enableFileComments: boolean;
64
25
 
65
26
  /**
66
- * Dispose this comment thread.
67
- *
68
- * Once disposed, this comment thread will be removed from visible editors and Comment Panel when appropriate.
27
+ * The ranges which allow new comment threads creation.
69
28
  */
70
- dispose(): void;
29
+ ranges?: Range[]
71
30
  }
72
31
 
73
32
  export interface CommentController {
@@ -78,6 +37,6 @@ declare module 'vscode' {
78
37
  /**
79
38
  * Provide a list of ranges which allow new comment threads creation or null for a given document
80
39
  */
81
- provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult<Range[] | { fileComments: boolean; ranges?: Range[] }>;
40
+ provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult<Range[] | CommentingRanges>;
82
41
  }
83
42
  }
@@ -13,6 +13,12 @@ declare module 'vscode' {
13
13
  export interface FileSearchQuery {
14
14
  /**
15
15
  * The search pattern to match against file paths.
16
+ * To be correctly interpreted by Quick Open, this is interpreted in a relaxed way. The picker will apply its own highlighting and scoring on the results.
17
+ *
18
+ * Tips for matching in Quick Open:
19
+ * With the pattern, the picker will use the file name and file paths to score each entry. The score will determine the ordering and filtering.
20
+ * The scoring prioritizes prefix and substring matching. Then, it checks and it checks whether the pattern's letters appear in the same order as in the target (file name and path).
21
+ * If a file does not match at all using our criteria, it will be omitted from Quick Open.
16
22
  */
17
23
  pattern: string;
18
24
  }
@@ -60,6 +60,12 @@ declare module 'vscode' {
60
60
  */
61
61
  // eslint-disable-next-line local/vscode-dts-provider-naming
62
62
  handleDidPartiallyAcceptCompletionItem?(completionItem: InlineCompletionItem, info: PartialAcceptInfo): void;
63
+
64
+ provideInlineEdits?(document: TextDocument, range: Range, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
65
+ }
66
+
67
+ export interface InlineCompletionContext {
68
+ readonly userPrompt?: string;
63
69
  }
64
70
 
65
71
  export interface PartialAcceptInfo {
@@ -0,0 +1,91 @@
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
+ // version: 2
7
+ // https://github.com/microsoft/vscode/issues/213274
8
+
9
+ declare module 'vscode' {
10
+
11
+ // TODO@API capabilities
12
+
13
+ export type JSONSchema = object;
14
+
15
+ // API -> LM: an tool/function that is available to the language model
16
+ export interface LanguageModelChatFunction {
17
+ name: string;
18
+ description: string;
19
+ parametersSchema?: JSONSchema;
20
+ }
21
+
22
+ // API -> LM: add tools as request option
23
+ export interface LanguageModelChatRequestOptions {
24
+ // TODO@API this will a heterogeneous array of different types of tools
25
+ tools?: LanguageModelChatFunction[];
26
+ }
27
+
28
+ // LM -> USER: function that should be used
29
+ export class LanguageModelChatResponseFunctionUsePart {
30
+ name: string;
31
+ parameters: any;
32
+
33
+ constructor(name: string, parameters: any);
34
+ }
35
+
36
+ // LM -> USER: text chunk
37
+ export class LanguageModelChatResponseTextPart {
38
+ value: string;
39
+
40
+ constructor(value: string);
41
+ }
42
+
43
+ export interface LanguageModelChatResponse {
44
+
45
+ stream: AsyncIterable<LanguageModelChatResponseTextPart | LanguageModelChatResponseFunctionUsePart>;
46
+ }
47
+
48
+
49
+ // USER -> LM: the result of a function call
50
+ export class LanguageModelChatMessageFunctionResultPart {
51
+ name: string;
52
+ content: string;
53
+ isError: boolean;
54
+
55
+ constructor(name: string, content: string, isError?: boolean);
56
+ }
57
+
58
+ export interface LanguageModelChatMessage {
59
+ content2: string | LanguageModelChatMessageFunctionResultPart;
60
+ }
61
+
62
+ // Tool registration/invoking between extensions
63
+
64
+ export namespace lm {
65
+ /**
66
+ * Register a LanguageModelTool. The tool must also be registered in the package.json `languageModelTools` contribution point.
67
+ */
68
+ export function registerTool(name: string, tool: LanguageModelTool): Disposable;
69
+
70
+ /**
71
+ * A list of all available tools.
72
+ */
73
+ export const tools: ReadonlyArray<LanguageModelToolDescription>;
74
+
75
+ /**
76
+ * Invoke a tool with the given parameters.
77
+ */
78
+ export function invokeTool(name: string, parameters: Object, token: CancellationToken): Thenable<string>;
79
+ }
80
+
81
+ // Is the same as LanguageModelChatFunction now, but could have more details in the future
82
+ export interface LanguageModelToolDescription {
83
+ name: string;
84
+ description: string;
85
+ parametersSchema?: JSONSchema;
86
+ }
87
+
88
+ export interface LanguageModelTool {
89
+ invoke(parameters: any, token: CancellationToken): Thenable<string>;
90
+ }
91
+ }
@@ -23,7 +23,7 @@ declare module 'vscode' {
23
23
  * Provide mapped edits for a given document.
24
24
  * @param document The document to provide mapped edits for.
25
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.
26
+ * "Apply in Editor" 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
27
  * @param context The context for providing mapped edits.
28
28
  * @param token A cancellation token.
29
29
  * @returns A provider result of text edits.
@@ -25,6 +25,7 @@ declare module 'vscode' {
25
25
  // onDidChangeHistoryItemGroups: Event<SourceControlHistoryChangeEvent>;
26
26
 
27
27
  provideHistoryItems(historyItemGroupId: string, options: SourceControlHistoryOptions, token: CancellationToken): ProviderResult<SourceControlHistoryItem[]>;
28
+ provideHistoryItems2(options: SourceControlHistoryOptions, token: CancellationToken): ProviderResult<SourceControlHistoryItem[]>;
28
29
  provideHistoryItemSummary?(historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): ProviderResult<SourceControlHistoryItem>;
29
30
  provideHistoryItemChanges(historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): ProviderResult<SourceControlHistoryItemChange[]>;
30
31
 
@@ -34,17 +35,14 @@ declare module 'vscode' {
34
35
  export interface SourceControlHistoryOptions {
35
36
  readonly cursor?: string;
36
37
  readonly limit?: number | { id?: string };
38
+ readonly historyItemGroupIds?: readonly string[];
37
39
  }
38
40
 
39
41
  export interface SourceControlHistoryItemGroup {
40
42
  readonly id: string;
41
43
  readonly name: string;
42
- readonly base?: Omit<SourceControlRemoteHistoryItemGroup, 'base'>;
43
- }
44
-
45
- export interface SourceControlRemoteHistoryItemGroup {
46
- readonly id: string;
47
- readonly name: string;
44
+ readonly base?: Omit<Omit<SourceControlHistoryItemGroup, 'base'>, 'remote'>;
45
+ readonly remote?: Omit<Omit<SourceControlHistoryItemGroup, 'base'>, 'remote'>;
48
46
  }
49
47
 
50
48
  export interface SourceControlHistoryItemStatistics {
@@ -53,6 +51,11 @@ declare module 'vscode' {
53
51
  readonly deletions: number;
54
52
  }
55
53
 
54
+ export interface SourceControlHistoryItemLabel {
55
+ readonly title: string;
56
+ readonly icon?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
57
+ }
58
+
56
59
  export interface SourceControlHistoryItem {
57
60
  readonly id: string;
58
61
  readonly parentIds: string[];
@@ -61,6 +64,7 @@ declare module 'vscode' {
61
64
  readonly icon?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
62
65
  readonly timestamp?: number;
63
66
  readonly statistics?: SourceControlHistoryItemStatistics;
67
+ readonly labels?: SourceControlHistoryItemLabel[];
64
68
  }
65
69
 
66
70
  export interface SourceControlHistoryItemChange {
@@ -29,9 +29,9 @@ declare module 'vscode' {
29
29
  * });
30
30
  * function summarizeCommandLine(commandLine: TerminalShellExecutionCommandLine) {
31
31
  * return [
32
- * ` Command line: ${command.ommandLine.value}`,
33
- * ` Confidence: ${command.ommandLine.confidence}`,
34
- * ` Trusted: ${command.ommandLine.isTrusted}
32
+ * ` Command line: ${command.commandLine.value}`,
33
+ * ` Confidence: ${command.commandLine.confidence}`,
34
+ * ` Trusted: ${command.commandLine.isTrusted}
35
35
  * ].join('\n');
36
36
  * }
37
37
  */
@@ -125,7 +125,7 @@ declare module 'vscode' {
125
125
  /**
126
126
  * An object that contains [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)-powered
127
127
  * features for the terminal. This will always be `undefined` immediately after the terminal
128
- * is created. Listen to {@link window.onDidActivateTerminalShellIntegration} to be notified
128
+ * is created. Listen to {@link window.onDidChangeTerminalShellIntegration} to be notified
129
129
  * when shell integration is activated for a terminal.
130
130
  *
131
131
  * Note that this object may remain undefined if shell integation never activates. For
@@ -155,11 +155,13 @@ declare module 'vscode' {
155
155
  * @example
156
156
  * // Execute a command in a terminal immediately after being created
157
157
  * const myTerm = window.createTerminal();
158
- * window.onDidActivateTerminalShellIntegration(async ({ terminal, shellIntegration }) => {
158
+ * window.onDidChangeTerminalShellIntegration(async ({ terminal, shellIntegration }) => {
159
159
  * if (terminal === myTerm) {
160
- * const command = shellIntegration.executeCommand('echo "Hello world"');
161
- * const code = await command.exitCode;
162
- * console.log(`Command exited with code ${code}`);
160
+ * const execution = shellIntegration.executeCommand('echo "Hello world"');
161
+ * window.onDidEndTerminalShellExecution(event => {
162
+ * if (event.execution === execution) {
163
+ * console.log(`Command exited with code ${event.exitCode}`);
164
+ * }
163
165
  * }
164
166
  * }));
165
167
  * // Fallback to sendText if there is no shell integration within 3 seconds of launching
@@ -175,9 +177,11 @@ declare module 'vscode' {
175
177
  * // Send command to terminal that has been alive for a while
176
178
  * const commandLine = 'echo "Hello world"';
177
179
  * if (term.shellIntegration) {
178
- * const command = term.shellIntegration.executeCommand({ commandLine });
179
- * const code = await command.exitCode;
180
- * console.log(`Command exited with code ${code}`);
180
+ * const execution = shellIntegration.executeCommand({ commandLine });
181
+ * window.onDidEndTerminalShellExecution(event => {
182
+ * if (event.execution === execution) {
183
+ * console.log(`Command exited with code ${event.exitCode}`);
184
+ * }
181
185
  * } else {
182
186
  * term.sendText(commandLine);
183
187
  * // Without shell integration, we can't know when the command has finished or what the
@@ -284,8 +288,29 @@ declare module 'vscode' {
284
288
  readonly execution: TerminalShellExecution;
285
289
 
286
290
  /**
287
- * The exit code reported by the shell. `undefined` means the shell did not report an exit
288
- * code or the shell reported a command started before the command finished.
291
+ * The exit code reported by the shell.
292
+ *
293
+ * Note that `undefined` means the shell either did not report an exit code (ie. the shell
294
+ * integration script is misbehaving) or the shell reported a command started before the command
295
+ * finished (eg. a sub-shell was opened). Generally this should not happen, depending on the use
296
+ * case, it may be best to treat this as a failure.
297
+ *
298
+ * @example
299
+ * const execution = shellIntegration.executeCommand({
300
+ * command: 'echo',
301
+ * args: ['Hello world']
302
+ * });
303
+ * window.onDidEndTerminalShellExecution(event => {
304
+ * if (event.execution === execution) {
305
+ * if (event.exitCode === undefined) {
306
+ * console.log('Command finished but exit code is unknown');
307
+ * } else if (event.exitCode === 0) {
308
+ * console.log('Command succeeded');
309
+ * } else {
310
+ * console.log('Command failed');
311
+ * }
312
+ * }
313
+ * });
289
314
  */
290
315
  readonly exitCode: number | undefined;
291
316
  }