@theia/plugin 1.67.0-next.3 → 1.67.0-next.56

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/README.md CHANGED
@@ -761,7 +761,7 @@ function provideRanges(document: theia.TextDocument): theia.ProviderResult<theia
761
761
 
762
762
  ## Additional Information
763
763
 
764
- - [API documentation for `@theia/plugin`](https://eclipse-theia.github.io/theia/docs/next/modules/plugin.html)
764
+ - [API documentation for `@theia/plugin`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_plugin.html)
765
765
  - [Theia - GitHub](https://github.com/eclipse-theia/theia)
766
766
  - [Theia - Website](https://theia-ide.org/)
767
767
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.67.0-next.3+7946ca874",
3
+ "version": "1.67.0-next.56+d8f18cc386c",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "7946ca874b04e6249d883e9a586f193194df1365"
35
+ "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -3204,6 +3204,8 @@ export module '@theia/plugin' {
3204
3204
  * @param commandLine The command line to execute, this is the exact text that will be sent
3205
3205
  * to the terminal.
3206
3206
  *
3207
+ * @throws When run on a terminal doesn't support this API, such as task terminals.
3208
+ *
3207
3209
  * @example
3208
3210
  * // Execute a command in a terminal immediately after being created
3209
3211
  * const myTerm = window.createTerminal();
@@ -11478,6 +11480,10 @@ export module '@theia/plugin' {
11478
11480
  * semantic tokens.
11479
11481
  */
11480
11482
  export interface DocumentRangeSemanticTokensProvider {
11483
+ /**
11484
+ * An optional event to signal that the semantic tokens from this provider have changed.
11485
+ */
11486
+ onDidChangeSemanticTokens?: Event<void>;
11481
11487
  /**
11482
11488
  * @see {@link DocumentSemanticTokensProvider.provideDocumentSemanticTokens provideDocumentSemanticTokens}.
11483
11489
  */
@@ -15028,10 +15034,17 @@ export module '@theia/plugin' {
15028
15034
  readonly id: string;
15029
15035
 
15030
15036
  /**
15031
- * The access token.
15037
+ * The access token. This token should be used to authenticate requests to a service. Popularized by OAuth.
15038
+ * @reference https://oauth.net/2/access-tokens/
15032
15039
  */
15033
15040
  readonly accessToken: string;
15034
15041
 
15042
+ /**
15043
+ * The ID token. This token contains identity information about the user. Popularized by OpenID Connect.
15044
+ * @reference https://openid.net/specs/openid-connect-core-1_0.html#IDToken
15045
+ */
15046
+ readonly idToken?: string;
15047
+
15035
15048
  /**
15036
15049
  * The account associated with the session.
15037
15050
  */
@@ -18629,7 +18642,7 @@ export module '@theia/plugin' {
18629
18642
  * @param name The optional name of a user for the message.
18630
18643
  * @stubbed
18631
18644
  */
18632
- static User(content: string | Array<LanguageModelTextPart | LanguageModelToolResultPart>, name?: string): LanguageModelChatMessage;
18645
+ static User(content: string | Array<LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelDataPart>, name?: string): LanguageModelChatMessage;
18633
18646
 
18634
18647
  /**
18635
18648
  * Utility to create a new assistant message.
@@ -18638,7 +18651,7 @@ export module '@theia/plugin' {
18638
18651
  * @param name The optional name of a user for the message.
18639
18652
  * @stubbed
18640
18653
  */
18641
- static Assistant(content: string | Array<(LanguageModelTextPart | LanguageModelToolCallPart)>, name?: string): LanguageModelChatMessage;
18654
+ static Assistant(content: string | Array<LanguageModelTextPart | LanguageModelToolCallPart | LanguageModelDataPart>, name?: string): LanguageModelChatMessage;
18642
18655
 
18643
18656
  /**
18644
18657
  * The role of this message.
@@ -18674,13 +18687,13 @@ export module '@theia/plugin' {
18674
18687
  * The various message types which a {@linkcode LanguageModelChatProvider} can emit in the chat response stream
18675
18688
  * @stubbed
18676
18689
  */
18677
- export type LanguageModelResponsePart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart;
18690
+ export type LanguageModelResponsePart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart | LanguageModelDataPart;
18678
18691
 
18679
18692
  /**
18680
18693
  * The various message types which can be sent via {@linkcode LanguageModelChat.sendRequest } and processed by a {@linkcode LanguageModelChatProvider}
18681
18694
  * @stubbed
18682
18695
  */
18683
- export type LanguageModelInputPart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart;
18696
+ export type LanguageModelInputPart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart | LanguageModelDataPart;
18684
18697
 
18685
18698
  /**
18686
18699
  * Represents a language model response.
@@ -18722,7 +18735,7 @@ export module '@theia/plugin' {
18722
18735
  * ```
18723
18736
  * @stubbed
18724
18737
  */
18725
- stream: AsyncIterable<LanguageModelTextPart | LanguageModelToolCallPart | unknown>;
18738
+ stream: AsyncIterable<LanguageModelTextPart | LanguageModelToolCallPart | LanguageModelDataPart | unknown>;
18726
18739
 
18727
18740
  /**
18728
18741
  * This is equivalent to filtering everything except for text parts from a {@link LanguageModelChatResponse.stream}.
@@ -19512,14 +19525,14 @@ export module '@theia/plugin' {
19512
19525
  * The value of the tool result.
19513
19526
  * @stubbed
19514
19527
  */
19515
- content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | unknown>;
19528
+ content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>;
19516
19529
 
19517
19530
  /**
19518
19531
  * @param callId The ID of the tool call.
19519
19532
  * @param content The content of the tool result.
19520
19533
  * @stubbed
19521
19534
  */
19522
- constructor(callId: string, content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart | unknown)>);
19535
+ constructor(callId: string, content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>);
19523
19536
  }
19524
19537
 
19525
19538
  /**
@@ -19572,14 +19585,71 @@ export module '@theia/plugin' {
19572
19585
  * @see {@link lm.invokeTool}.
19573
19586
  * @stubbed
19574
19587
  */
19575
- content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart | unknown)>;
19588
+ content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>;
19576
19589
 
19577
19590
  /**
19578
19591
  * Create a LanguageModelToolResult
19579
19592
  * @param content A list of tool result content parts
19580
19593
  * @stubbed
19581
19594
  */
19582
- constructor(content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart)>);
19595
+ constructor(content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | LanguageModelDataPart | unknown>);
19596
+ }
19597
+
19598
+ /**
19599
+ * A language model response part containing arbitrary data. Can be used in {@link LanguageModelChatResponse responses},
19600
+ * {@link LanguageModelChatMessage chat messages}, {@link LanguageModelToolResult tool results}, and other language model interactions.
19601
+ * @stubbed
19602
+ */
19603
+ export class LanguageModelDataPart {
19604
+ /**
19605
+ * Create a new {@linkcode LanguageModelDataPart} for an image.
19606
+ * @param data Binary image data
19607
+ * @param mime The MIME type of the image. Common values are `image/png` and `image/jpeg`.
19608
+ * @stubbed
19609
+ */
19610
+ static image(data: Uint8Array, mime: string): LanguageModelDataPart;
19611
+
19612
+ /**
19613
+ * Create a new {@linkcode LanguageModelDataPart} for a json.
19614
+ *
19615
+ * *Note* that this function is not expecting "stringified JSON" but
19616
+ * an object that can be stringified. This function will throw an error
19617
+ * when the passed value cannot be JSON-stringified.
19618
+ * @param value A JSON-stringifyable value.
19619
+ * @param mime Optional MIME type, defaults to `application/json`
19620
+ * @stubbed
19621
+ */
19622
+ static json(value: any, mime?: string): LanguageModelDataPart;
19623
+
19624
+ /**
19625
+ * Create a new {@linkcode LanguageModelDataPart} for text.
19626
+ *
19627
+ * *Note* that an UTF-8 encoder is used to create bytes for the string.
19628
+ * @param value Text data
19629
+ * @param mime The MIME type if any. Common values are `text/plain` and `text/markdown`.
19630
+ * @stubbed
19631
+ */
19632
+ static text(value: string, mime?: string): LanguageModelDataPart;
19633
+
19634
+ /**
19635
+ * The mime type which determines how the data property is interpreted.
19636
+ * @stubbed
19637
+ */
19638
+ mimeType: string;
19639
+
19640
+ /**
19641
+ * The byte data for this part.
19642
+ * @stubbed
19643
+ */
19644
+ data: Uint8Array;
19645
+
19646
+ /**
19647
+ * Construct a generic data part with the given content.
19648
+ * @param data The byte data for this part.
19649
+ * @param mimeType The mime type of the data.
19650
+ * @stubbed
19651
+ */
19652
+ constructor(data: Uint8Array, mimeType: string);
19583
19653
  }
19584
19654
 
19585
19655
  /**
@@ -18,6 +18,7 @@
18
18
  * Copyright (c) Microsoft Corporation. All rights reserved.
19
19
  * Licensed under the MIT License. See License.txt in the project root for license information.
20
20
  *--------------------------------------------------------------------------------------------*/
21
+ // code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts
21
22
 
22
23
  export module '@theia/plugin' {
23
24
  export interface NotebookControllerDetectionTask {
@@ -41,7 +42,7 @@ export module '@theia/plugin' {
41
42
  /**
42
43
  * An optional event to signal that the kernel source actions have changed.
43
44
  */
44
- onDidChangeNotebookKernelSourceActions?: Event<void>;
45
+ readonly onDidChangeNotebookKernelSourceActions?: Event<void>;
45
46
  /**
46
47
  * Provide kernel source actions
47
48
  */
@@ -18,7 +18,7 @@
18
18
  * Copyright (c) Microsoft Corporation. All rights reserved.
19
19
  * Licensed under the MIT License. See License.txt in the project root for license information.
20
20
  *--------------------------------------------------------------------------------------------*/
21
- // code copied and modified from https://github.com/microsoft/vscode/blob/1.105.0/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts
21
+ // code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts
22
22
 
23
23
  export module '@theia/plugin' {
24
24
 
@@ -31,13 +31,13 @@ export module '@theia/plugin' {
31
31
  * {@link TerminalCompletionList} describing completions for the current command line.
32
32
  *
33
33
  * @example <caption>Simple provider returning a single completion</caption>
34
- * window.registerTerminalCompletionProvider('extension-provider-id', {
34
+ * window.registerTerminalCompletionProvider({
35
35
  * provideTerminalCompletions(terminal, context) {
36
- * return [{ label: '--help', replacementIndex: Math.max(0, context.cursorPosition - 2), replacementLength: 2 }];
36
+ * return [{ label: '--help', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }];
37
37
  * }
38
38
  * });
39
39
  */
40
- export interface TerminalCompletionProvider<T extends TerminalCompletionItem> {
40
+ export interface TerminalCompletionProvider<T extends TerminalCompletionItem = TerminalCompletionItem> {
41
41
  /**
42
42
  * Provide completions for the given terminal and context.
43
43
  * @param terminal The terminal for which completions are being provided.
@@ -54,8 +54,7 @@ export module '@theia/plugin' {
54
54
  * @example <caption>Completion item for `ls -|`</caption>
55
55
  * const item = {
56
56
  * label: '-A',
57
- * replacementIndex: 3,
58
- * replacementLength: 1,
57
+ * replacementRange: [3, 4], // replace the single character at index 3
59
58
  * detail: 'List all entries except for . and .. (always set for the super-user)',
60
59
  * kind: TerminalCompletionItemKind.Flag
61
60
  * };
@@ -63,21 +62,18 @@ export module '@theia/plugin' {
63
62
  * The fields on a completion item describe what text should be shown to the user
64
63
  * and which portion of the command line should be replaced when the item is accepted.
65
64
  */
66
- export interface TerminalCompletionItem {
65
+ export class TerminalCompletionItem {
67
66
  /**
68
67
  * The label of the completion.
69
68
  */
70
69
  label: string | CompletionItemLabel;
71
70
 
72
71
  /**
73
- * The index of the start of the range to replace.
72
+ * The range in the command line to replace when the completion is accepted. Defined
73
+ * as a tuple where the first entry is the inclusive start index and the second entry is the
74
+ * exclusive end index.
74
75
  */
75
- replacementIndex: number;
76
-
77
- /**
78
- * The length of the range to replace.
79
- */
80
- replacementLength: number;
76
+ replacementRange: readonly [number, number];
81
77
 
82
78
  /**
83
79
  * The completion's detail which appears on the right of the list.
@@ -90,9 +86,22 @@ export module '@theia/plugin' {
90
86
  documentation?: string | MarkdownString;
91
87
 
92
88
  /**
93
- * The completion's kind. Note that this will map to an icon.
89
+ * The completion's kind. Note that this will map to an icon. If no kind is provided, a generic icon representing plaintext will be provided.
94
90
  */
95
91
  kind?: TerminalCompletionItemKind;
92
+
93
+ /**
94
+ * Creates a new terminal completion item.
95
+ *
96
+ * @param label The label of the completion.
97
+ * @param replacementRange The inclusive start and exclusive end index of the text to replace.
98
+ * @param kind The completion's kind.
99
+ */
100
+ constructor(
101
+ label: string | CompletionItemLabel,
102
+ replacementRange: readonly [number, number],
103
+ kind?: TerminalCompletionItemKind
104
+ );
96
105
  }
97
106
 
98
107
  /**
@@ -100,85 +109,127 @@ export module '@theia/plugin' {
100
109
  *
101
110
  * The kind is used to render an appropriate icon in the suggest list and to convey the semantic
102
111
  * meaning of the suggestion (file, folder, flag, commit, branch, etc.).
103
- *
104
112
  */
105
113
  export enum TerminalCompletionItemKind {
114
+ /**
115
+ * A file completion item.
116
+ * Example: `README.md`
117
+ */
106
118
  File = 0,
119
+ /**
120
+ * A folder completion item.
121
+ * Example: `src/`
122
+ */
107
123
  Folder = 1,
124
+ /**
125
+ * A method completion item.
126
+ * Example: `git commit`
127
+ */
108
128
  Method = 2,
129
+ /**
130
+ * An alias completion item.
131
+ * Example: `ll` as an alias for `ls -l`
132
+ */
109
133
  Alias = 3,
134
+ /**
135
+ * An argument completion item.
136
+ * Example: `origin` in `git push origin main`
137
+ */
110
138
  Argument = 4,
139
+ /**
140
+ * An option completion item. An option value is expected to follow.
141
+ * Example: `--locale` in `code --locale en`
142
+ */
111
143
  Option = 5,
144
+ /**
145
+ * The value of an option completion item.
146
+ * Example: `en-US` in `code --locale en-US`
147
+ */
112
148
  OptionValue = 6,
149
+ /**
150
+ * A flag completion item.
151
+ * Example: `--amend` in `git commit --amend`
152
+ */
113
153
  Flag = 7,
154
+ /**
155
+ * A symbolic link file completion item.
156
+ * Example: `link.txt` (symlink to a file)
157
+ */
114
158
  SymbolicLinkFile = 8,
159
+ /**
160
+ * A symbolic link folder completion item.
161
+ * Example: `node_modules/` (symlink to a folder)
162
+ */
115
163
  SymbolicLinkFolder = 9,
116
- Commit = 10,
117
- Branch = 11,
118
- Tag = 12,
119
- Stash = 13,
120
- Remote = 14,
164
+ /**
165
+ * A source control commit completion item.
166
+ * Example: `abc1234` (commit hash)
167
+ */
168
+ ScmCommit = 10,
169
+ /**
170
+ * A source control branch completion item.
171
+ * Example: `main`
172
+ */
173
+ ScmBranch = 11,
174
+ /**
175
+ * A source control tag completion item.
176
+ * Example: `v1.0.0`
177
+ */
178
+ ScmTag = 12,
179
+ /**
180
+ * A source control stash completion item.
181
+ * Example: `stash@{0}`
182
+ */
183
+ ScmStash = 13,
184
+ /**
185
+ * A source control remote completion item.
186
+ * Example: `origin`
187
+ */
188
+ ScmRemote = 14,
189
+ /**
190
+ * A pull request completion item.
191
+ * Example: `#42 Add new feature`
192
+ */
121
193
  PullRequest = 15,
194
+ /**
195
+ * A closed pull request completion item.
196
+ * Example: `#41 Fix bug (closed)`
197
+ */
122
198
  PullRequestDone = 16,
123
199
  }
124
200
 
125
201
  /**
126
202
  * Context information passed to {@link TerminalCompletionProvider.provideTerminalCompletions}.
127
203
  *
128
- * It contains the full command line, the current cursor position, and a flag indicating whether
129
- * fallback completions are allowed when the exact completion type cannot be determined.
204
+ * It contains the full command line and the current cursor position.
130
205
  */
131
206
  export interface TerminalCompletionContext {
132
207
  /**
133
208
  * The complete terminal command line.
134
209
  */
135
- commandLine: string;
210
+ readonly commandLine: string;
136
211
  /**
137
212
  * The index of the cursor in the command line.
138
213
  */
139
- cursorPosition: number;
140
- /**
141
- * Whether completions should be provided when it is not clear to what type of completion is
142
- * well known.
143
- */
144
- allowFallbackCompletions: boolean;
145
- }
146
-
147
- export namespace window {
148
- /**
149
- * Register a completion provider for terminals.
150
- * @param id The unique identifier of the terminal provider, used as a settings key and shown in the information hover of the suggest widget.
151
- * @param provider The completion provider.
152
- * @returns A {@link Disposable} that unregisters this provider when being disposed.
153
- *
154
- * @example <caption>Register a provider for an extension</caption>
155
- * window.registerTerminalCompletionProvider('extension-provider-id', {
156
- * provideTerminalCompletions(terminal, context) {
157
- * return new TerminalCompletionList([
158
- * { label: '--version', replacementIndex: Math.max(0, context.cursorPosition - 2), replacementLength: 2 }
159
- * ]);
160
- * }
161
- * });
162
- */
163
- export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(
164
- id: string, provider: TerminalCompletionProvider<T>, ...triggerCharacters: string[]): Disposable;
214
+ readonly cursorIndex: number;
165
215
  }
166
216
 
167
217
  /**
168
218
  * Represents a collection of {@link TerminalCompletionItem completion items} to be presented
169
- * in the terminal.
219
+ * in the terminal plus {@link TerminalCompletionList.resourceOptions} which indicate
220
+ * which file and folder resources should be requested for the terminal's cwd.
170
221
  *
171
222
  * @example <caption>Create a completion list that requests files for the terminal cwd</caption>
172
223
  * const list = new TerminalCompletionList([
173
- * { label: 'ls', replacementIndex: 0, replacementLength: 0, kind: TerminalCompletionItemKind.Method }
174
- * ], { filesRequested: true, cwd: Uri.file('/home/user') });
224
+ * { label: 'ls', replacementRange: [0, 0], kind: TerminalCompletionItemKind.Method }
225
+ * ], { showFiles: true, cwd: Uri.file('/home/user') });
175
226
  */
176
227
  export class TerminalCompletionList<T extends TerminalCompletionItem = TerminalCompletionItem> {
177
228
 
178
229
  /**
179
230
  * Resources that should be shown in the completions list for the cwd of the terminal.
180
231
  */
181
- resourceRequestConfig?: TerminalResourceRequestConfig;
232
+ resourceOptions?: TerminalCompletionResourceOptions;
182
233
 
183
234
  /**
184
235
  * The completion items.
@@ -189,9 +240,9 @@ export module '@theia/plugin' {
189
240
  * Creates a new completion list.
190
241
  *
191
242
  * @param items The completion items.
192
- * @param resourceRequestConfig Indicates which resources should be shown as completions for the cwd of the terminal.
243
+ * @param resourceOptions Indicates which resources should be shown as completions for the cwd of the terminal.
193
244
  */
194
- constructor(items?: T[], resourceRequestConfig?: TerminalResourceRequestConfig);
245
+ constructor(items: T[], resourceOptions?: TerminalCompletionResourceOptions);
195
246
  }
196
247
 
197
248
  /**
@@ -200,22 +251,52 @@ export module '@theia/plugin' {
200
251
  * When a provider indicates that it wants file/folder resources, the terminal will surface completions for files and
201
252
  * folders that match {@link globPattern} from the provided {@link cwd}.
202
253
  */
203
- export interface TerminalResourceRequestConfig {
254
+ export interface TerminalCompletionResourceOptions {
204
255
  /**
205
256
  * Show files as completion items.
206
257
  */
207
- filesRequested?: boolean;
258
+ showFiles: boolean;
208
259
  /**
209
260
  * Show folders as completion items.
210
261
  */
211
- foldersRequested?: boolean;
262
+ showDirectories: boolean;
212
263
  /**
213
- * A {@link GlobPattern glob pattern} that controls which files suggest should surface.
264
+ * A glob pattern string that controls which files suggest should surface. Note that this will only apply if {@param showFiles} or {@param showDirectories} is set to true.
214
265
  */
215
- globPattern?: GlobPattern;
266
+ globPattern?: string;
216
267
  /**
217
268
  * The cwd from which to request resources.
218
269
  */
219
270
  cwd: Uri;
220
271
  }
272
+
273
+ export namespace window {
274
+ /**
275
+ * Register a completion provider for terminals.
276
+ * @param provider The completion provider.
277
+ * @param triggerCharacters Optional characters that trigger completion. When any of these characters is typed,
278
+ * the completion provider will be invoked. For example, passing `'-'` would cause the provider to be invoked
279
+ * whenever the user types a dash character.
280
+ * @returns A {@link Disposable} that unregisters this provider when being disposed.
281
+ *
282
+ * @example <caption>Register a provider for an extension</caption>
283
+ * window.registerTerminalCompletionProvider({
284
+ * provideTerminalCompletions(terminal, context) {
285
+ * return new TerminalCompletionList([
286
+ * { label: '--version', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }
287
+ * ]);
288
+ * }
289
+ * });
290
+ *
291
+ * @example <caption>Register a provider with trigger characters</caption>
292
+ * window.registerTerminalCompletionProvider({
293
+ * provideTerminalCompletions(terminal, context) {
294
+ * return new TerminalCompletionList([
295
+ * { label: '--help', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }
296
+ * ]);
297
+ * }
298
+ * }, '-');
299
+ */
300
+ export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(provider: TerminalCompletionProvider<T>, ...triggerCharacters: string[]): Disposable;
301
+ }
221
302
  }
@@ -18,10 +18,12 @@
18
18
  * Copyright (c) Microsoft Corporation. All rights reserved.
19
19
  * Licensed under the MIT License. See License.txt in the project root for license information.
20
20
  *--------------------------------------------------------------------------------------------*/
21
- // code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.timeline.d.ts
21
+ // code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.timeline.d.ts
22
22
 
23
23
  export module '@theia/plugin' {
24
24
 
25
+ // https://github.com/microsoft/vscode/issues/84297
26
+
25
27
  export class TimelineItem {
26
28
  /**
27
29
  * A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred.
@@ -41,7 +43,7 @@ export module '@theia/plugin' {
41
43
  id?: string;
42
44
 
43
45
  /**
44
- * The icon path or [ThemeIcon](#ThemeIcon) for the timeline item.
46
+ * The icon path or {@link ThemeIcon} for the timeline item.
45
47
  */
46
48
  iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
47
49
 
@@ -53,10 +55,10 @@ export module '@theia/plugin' {
53
55
  /**
54
56
  * The tooltip text when you hover over the timeline item.
55
57
  */
56
- detail?: string;
58
+ tooltip?: string | MarkdownString | undefined;
57
59
 
58
60
  /**
59
- * The [command](#Command) that should be executed when the timeline item is selected.
61
+ * The {@link Command} that should be executed when the timeline item is selected.
60
62
  */
61
63
  command?: Command;
62
64
 
@@ -65,14 +67,16 @@ export module '@theia/plugin' {
65
67
  * For example, a timeline item is given a context value as `commit`. When contributing actions to `timeline/item/context`
66
68
  * using `menus` extension point, you can specify context value for key `timelineItem` in `when` expression like `timelineItem == commit`.
67
69
  * ```
68
- * "contributes": {
69
- * "menus": {
70
- * "timeline/item/context": [{
71
- * "command": "extension.copyCommitId",
72
- * "when": "timelineItem == commit"
73
- * }]
74
- * }
75
- * }
70
+ * "contributes": {
71
+ * "menus": {
72
+ * "timeline/item/context": [
73
+ * {
74
+ * "command": "extension.copyCommitId",
75
+ * "when": "timelineItem == commit"
76
+ * }
77
+ * ]
78
+ * }
79
+ * }
76
80
  * ```
77
81
  * This will show the `extension.copyCommitId` action only for items where `contextValue` is `commit`.
78
82
  */
@@ -92,7 +96,7 @@ export module '@theia/plugin' {
92
96
 
93
97
  export interface TimelineChangeEvent {
94
98
  /**
95
- * The [uri](#Uri) of the resource for which the timeline changed.
99
+ * The {@link Uri} of the resource for which the timeline changed.
96
100
  */
97
101
  uri: Uri;
98
102
 
@@ -109,10 +113,10 @@ export module '@theia/plugin' {
109
113
  * Use `undefined` to signal that there are no more items to be returned.
110
114
  */
111
115
  readonly cursor: string | undefined;
112
- }
116
+ };
113
117
 
114
118
  /**
115
- * An array of [timeline items](#TimelineItem).
119
+ * An array of {@link TimelineItem timeline items}.
116
120
  */
117
121
  readonly items: readonly TimelineItem[];
118
122
  }
@@ -135,7 +139,7 @@ export module '@theia/plugin' {
135
139
  * An optional event to signal that the timeline for a source has changed.
136
140
  * To signal that the timeline for all resources (uris) has changed, do not pass any argument or pass `undefined`.
137
141
  */
138
- onDidChange?: Event<TimelineChangeEvent | undefined>;
142
+ readonly onDidChange?: Event<TimelineChangeEvent | undefined>;
139
143
 
140
144
  /**
141
145
  * An identifier of the source of the timeline items. This can be used to filter sources.
@@ -148,12 +152,12 @@ export module '@theia/plugin' {
148
152
  readonly label: string;
149
153
 
150
154
  /**
151
- * Provide [timeline items](#TimelineItem) for a [Uri](#Uri).
155
+ * Provide {@link TimelineItem timeline items} for a {@link Uri}.
152
156
  *
153
- * @param uri The [uri](#Uri) of the file to provide the timeline for.
157
+ * @param uri The {@link Uri} of the file to provide the timeline for.
154
158
  * @param options A set of options to determine how results should be returned.
155
159
  * @param token A cancellation token.
156
- * @return The [timeline result](#TimelineResult) or a thenable that resolves to such. The lack of a result
160
+ * @return The {@link TimelineResult timeline result} or a thenable that resolves to such. The lack of a result
157
161
  * can be signaled by returning `undefined`, `null`, or an empty array.
158
162
  */
159
163
  provideTimeline(uri: Uri, options: TimelineOptions, token: CancellationToken): ProviderResult<Timeline>;
@@ -169,7 +173,7 @@ export module '@theia/plugin' {
169
173
  *
170
174
  * @param scheme A scheme or schemes that defines which documents this provider is applicable to. Can be `*` to target all documents.
171
175
  * @param provider A timeline provider.
172
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
176
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
173
177
  */
174
178
  export function registerTimelineProvider(scheme: string | string[], provider: TimelineProvider): Disposable;
175
179
  }