@codingame/monaco-vscode-rollup-vsix-plugin 4.5.2 → 5.0.1

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.
@@ -7,62 +7,124 @@ declare module 'vscode' {
7
7
 
8
8
  // https://github.com/microsoft/vscode/issues/145234
9
9
 
10
+ /**
11
+ * A command that was executed in a terminal.
12
+ */
10
13
  export interface TerminalShellExecution {
11
- // TODO: This is circular, is that fine? Should we add a `TerminalShellExecutionEvent`?
12
14
  /**
13
- * The {@link Terminal} the command was executed in.
14
- */
15
- readonly terminal: Terminal;
16
-
17
- /**
18
- * The full command line that was executed, including both the command and arguments.
19
- * The accuracy of this value depends on the shell integration implementation:
15
+ * The command line that was executed. The {@link TerminalShellExecutionCommandLineConfidence confidence}
16
+ * of this value depends on the specific shell's shell integration implementation. This
17
+ * value may become more accurate after {@link window.onDidEndTerminalShellExecution} is
18
+ * fired.
20
19
  *
21
- * - It may be undefined or the empty string until {@link onDidEndTerminalShellExecution} is
22
- * fired.
23
- * - It may be inaccurate initially if the command line is pulled from the buffer directly
24
- * via the [`OSC 633/133 ; A`, `B` and `C` sequences](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st).
25
- * - It may contain line continuation characters and/or parts of the right prompt.
26
- * - It may be inaccurate if the shell integration does not support command line reporting
27
- * via the [`OSC 633 ; E` sequence](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st).
20
+ * @example
21
+ * // Log the details of the command line on start and end
22
+ * window.onDidStartTerminalShellExecution(event => {
23
+ * const commandLine = event.execution.commandLine;
24
+ * console.log(`Command started\n${summarizeCommandLine(commandLine)}`);
25
+ * });
26
+ * window.onDidEndTerminalShellExecution(event => {
27
+ * const commandLine = event.execution.commandLine;
28
+ * console.log(`Command ended\n${summarizeCommandLine(commandLine)}`);
29
+ * });
30
+ * function summarizeCommandLine(commandLine: TerminalShellExecutionCommandLine) {
31
+ * return [
32
+ * ` Command line: ${command.ommandLine.value}`,
33
+ * ` Confidence: ${command.ommandLine.confidence}`,
34
+ * ` Trusted: ${command.ommandLine.isTrusted}
35
+ * ].join('\n');
36
+ * }
28
37
  */
29
- readonly commandLine: string | undefined;
38
+ readonly commandLine: TerminalShellExecutionCommandLine;
30
39
 
31
40
  /**
32
41
  * The working directory that was reported by the shell when this command executed. This
33
- * will be a {@link Uri} if the string reported by the shell can reliably be mapped to the
34
- * connected machine. This requires the shell integration to support working directory
35
- * reporting via the [`OSC 633 ; P`](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st)
36
- * or `OSC 1337 ; CurrentDir=<Cwd> ST` sequences.
37
- */
38
- readonly cwd: Uri | string | undefined;
39
-
40
- /**
41
- * The exit code reported by the shell.
42
+ * {@link Uri} may represent a file on another machine (eg. ssh into another machine). This
43
+ * requires the shell integration to support working directory reporting.
42
44
  */
43
- readonly exitCode: Thenable<number | undefined>;
45
+ readonly cwd: Uri | undefined;
44
46
 
45
47
  /**
46
48
  * Creates a stream of raw data (including escape sequences) that is written to the
47
- * terminal. This will only include data that was written after `stream` was called for the
48
- * first time, ie. you must call `dataStream` immediately after the command is executed via
49
- * {@link executeCommand} or {@link onDidStartTerminalShellExecution} to not miss any data.
49
+ * terminal. This will only include data that was written after `read` was called for
50
+ * the first time, ie. you must call `read` immediately after the command is executed via
51
+ * {@link TerminalShellIntegration.executeCommand} or
52
+ * {@link window.onDidStartTerminalShellExecution} to not miss any data.
50
53
  *
51
54
  * @example
52
55
  * // Log all data written to the terminal for a command
53
56
  * const command = term.shellIntegration.executeCommand({ commandLine: 'echo "Hello world"' });
54
- * const stream = command.createDataStream();
57
+ * const stream = command.read();
55
58
  * for await (const data of stream) {
56
59
  * console.log(data);
57
60
  * }
58
61
  */
59
- createDataStream(): AsyncIterable<string>;
62
+ read(): AsyncIterable<string>;
63
+ }
64
+
65
+ /**
66
+ * A command line that was executed in a terminal.
67
+ */
68
+ export interface TerminalShellExecutionCommandLine {
69
+ /**
70
+ * The full command line that was executed, including both the command and its arguments.
71
+ */
72
+ readonly value: string;
73
+
74
+ /**
75
+ * Whether the command line value came from a trusted source and is therefore safe to
76
+ * execute without user additional confirmation, such as a notification that asks "Do you
77
+ * want to execute (command)?". This verification is likely only needed if you are going to
78
+ * execute the command again.
79
+ *
80
+ * This is `true` only when the command line was reported explicitly by the shell
81
+ * integration script (ie. {@link TerminalShellExecutionCommandLineConfidence.High high confidence})
82
+ * and it used a nonce for verification.
83
+ */
84
+ readonly isTrusted: boolean;
85
+
86
+ /**
87
+ * The confidence of the command line value which is determined by how the value was
88
+ * obtained. This depends upon the implementation of the shell integration script.
89
+ */
90
+ readonly confidence: TerminalShellExecutionCommandLineConfidence;
91
+ }
92
+
93
+ /**
94
+ * The confidence of a {@link TerminalShellExecutionCommandLine} value.
95
+ */
96
+ enum TerminalShellExecutionCommandLineConfidence {
97
+ /**
98
+ * The command line value confidence is low. This means that the value was read from the
99
+ * terminal buffer using markers reported by the shell integration script. Additionally one
100
+ * of the following conditions will be met:
101
+ *
102
+ * - The command started on the very left-most column which is unusual, or
103
+ * - The command is multi-line which is more difficult to accurately detect due to line
104
+ * continuation characters and right prompts.
105
+ * - Command line markers were not reported by the shell integration script.
106
+ */
107
+ Low = 0,
108
+
109
+ /**
110
+ * The command line value confidence is medium. This means that the value was read from the
111
+ * terminal buffer using markers reported by the shell integration script. The command is
112
+ * single-line and does not start on the very left-most column (which is unusual).
113
+ */
114
+ Medium = 1,
115
+
116
+ /**
117
+ * The command line value confidence is high. This means that the value was explicitly sent
118
+ * from the shell integration script or the command was executed via the
119
+ * {@link TerminalShellIntegration.executeCommand} API.
120
+ */
121
+ High = 2
60
122
  }
61
123
 
62
124
  export interface Terminal {
63
125
  /**
64
126
  * An object that contains [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)-powered
65
- * features for the terminal. This will always be undefined immediately after the terminal
127
+ * features for the terminal. This will always be `undefined` immediately after the terminal
66
128
  * is created. Listen to {@link window.onDidActivateTerminalShellIntegration} to be notified
67
129
  * when shell integration is activated for a terminal.
68
130
  *
@@ -73,13 +135,16 @@ declare module 'vscode' {
73
135
  readonly shellIntegration: TerminalShellIntegration | undefined;
74
136
  }
75
137
 
138
+ /**
139
+ * [Shell integration](https://code.visualstudio.com/docs/terminal/shell-integration)-powered capabilities owned by a terminal.
140
+ */
76
141
  export interface TerminalShellIntegration {
77
- // TODO: Is this fine to share the TerminalShellIntegrationChangeEvent event?
78
142
  /**
79
- * The current working directory of the terminal. This will be a {@link Uri} if the string
80
- * reported by the shell can reliably be mapped to the connected machine.
143
+ * The current working directory of the terminal. This {@link Uri} may represent a file on
144
+ * another machine (eg. ssh into another machine). This requires the shell integration to
145
+ * support working directory reporting.
81
146
  */
82
- readonly cwd: Uri | string | undefined;
147
+ readonly cwd: Uri | undefined;
83
148
 
84
149
  /**
85
150
  * Execute a command, sending ^C as necessary to interrupt any running command if needed.
@@ -178,12 +243,53 @@ declare module 'vscode' {
178
243
  * The terminal that shell integration has been activated in.
179
244
  */
180
245
  readonly terminal: Terminal;
246
+
181
247
  /**
182
248
  * The shell integration object.
183
249
  */
184
250
  readonly shellIntegration: TerminalShellIntegration;
185
251
  }
186
252
 
253
+ export interface TerminalShellExecutionStartEvent {
254
+ /**
255
+ * The terminal that shell integration has been activated in.
256
+ */
257
+ readonly terminal: Terminal;
258
+
259
+ /**
260
+ * The shell integration object.
261
+ */
262
+ readonly shellIntegration: TerminalShellIntegration;
263
+
264
+ /**
265
+ * The terminal shell execution that has ended.
266
+ */
267
+ readonly execution: TerminalShellExecution;
268
+ }
269
+
270
+ export interface TerminalShellExecutionEndEvent {
271
+ /**
272
+ * The terminal that shell integration has been activated in.
273
+ */
274
+ readonly terminal: Terminal;
275
+
276
+ /**
277
+ * The shell integration object.
278
+ */
279
+ readonly shellIntegration: TerminalShellIntegration;
280
+
281
+ /**
282
+ * The terminal shell execution that has ended.
283
+ */
284
+ readonly execution: TerminalShellExecution;
285
+
286
+ /**
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.
289
+ */
290
+ readonly exitCode: number | undefined;
291
+ }
292
+
187
293
  export namespace window {
188
294
  /**
189
295
  * Fires when shell integration activates or one of its properties changes in a terminal.
@@ -195,13 +301,13 @@ declare module 'vscode' {
195
301
  * [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) is
196
302
  * activated for the terminal.
197
303
  */
198
- export const onDidStartTerminalShellExecution: Event<TerminalShellExecution>;
304
+ export const onDidStartTerminalShellExecution: Event<TerminalShellExecutionStartEvent>;
199
305
 
200
306
  /**
201
307
  * This will be fired when a terminal command is ended. This event will fire only when
202
308
  * [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) is
203
309
  * activated for the terminal.
204
310
  */
205
- export const onDidEndTerminalShellExecution: Event<TerminalShellExecution>;
311
+ export const onDidEndTerminalShellExecution: Event<TerminalShellExecutionEndEvent>;
206
312
  }
207
313
  }
@@ -0,0 +1,28 @@
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
+ // See https://github.com/microsoft/vscode/issues/209491
9
+
10
+ export class TestRunRequest2 extends TestRunRequest {
11
+ /**
12
+ * Controls how test Test Results view is focused. If true, the editor
13
+ * will keep the maintain the user's focus. If false, the editor will
14
+ * prefer to move focus into the Test Results view, although
15
+ * this may be configured by users.
16
+ */
17
+ readonly preserveFocus: boolean;
18
+
19
+ /**
20
+ * @param include Array of specific tests to run, or undefined to run all tests
21
+ * @param exclude An array of tests to exclude from the run.
22
+ * @param profile The run profile used for this request.
23
+ * @param continuous Whether to run tests continuously as source changes.
24
+ * @param preserveFocus Whether to preserve the user's focus when the run is started
25
+ */
26
+ constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean);
27
+ }
28
+ }
@@ -1,65 +0,0 @@
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/179430
9
-
10
-
11
- /**
12
- * TODO:
13
- * - Add ctor(insertText: string | SnippetString, title?: string, kind?: DocumentPasteEditKind); Can't be done as this is an extension to an existing class
14
- * - Update provider to return multiple edits
15
- */
16
-
17
- export interface DocumentDropEdit {
18
- /**
19
- * Human readable label that describes the edit.
20
- */
21
- title?: string;
22
-
23
- /**
24
- * {@link DocumentPasteEditKind Kind} of the edit.
25
- *
26
- * Used to identify specific types of edits.
27
- *
28
- * TODO: use own type?
29
- */
30
- kind: DocumentPasteEditKind;
31
-
32
- /**
33
- * The mime type from the {@link DataTransfer} that this edit applies.
34
- *
35
- * TODO: Should this be taken from `dropMimeTypes` instead?
36
- */
37
- handledMimeType?: string;
38
-
39
- /**
40
- * Controls the ordering or multiple paste edits. If this provider yield to edits, it will be shown lower in the list.
41
- */
42
- yieldTo?: ReadonlyArray<DocumentPasteEditKind>;
43
- }
44
-
45
- export interface DocumentDropEditProviderMetadata {
46
- readonly providedDropEditKinds?: readonly DocumentPasteEditKind[];
47
-
48
- /**
49
- * List of {@link DataTransfer} mime types that the provider can handle.
50
- *
51
- * This can either be an exact mime type such as `image/png`, or a wildcard pattern such as `image/*`.
52
- *
53
- * Use `text/uri-list` for resources dropped from the explorer or other tree views in the workbench.
54
- *
55
- * Use `files` to indicate that the provider should be invoked if any {@link DataTransferFile files} are present in the {@link DataTransfer}.
56
- * Note that {@link DataTransferFile} entries are only created when dropping content from outside the editor, such as
57
- * from the operating system.
58
- */
59
- readonly dropMimeTypes: readonly string[];
60
- }
61
-
62
- export namespace languages {
63
- export function registerDocumentDropEditProvider(selector: DocumentSelector, provider: DocumentDropEditProvider, metadata?: DocumentDropEditProviderMetadata): Disposable;
64
- }
65
- }
@@ -1,57 +0,0 @@
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/46726
9
-
10
- export interface IssueUriRequestHandler {
11
- /**
12
- *Handle the request by the issue reporter for the Uri you want to direct the user to.
13
- */
14
- handleIssueUrlRequest(): ProviderResult<Uri>;
15
- }
16
-
17
- export interface IssueDataProvider {
18
- /**
19
- * Provide the data to be used in the issue reporter.
20
- */
21
- provideIssueData(token: CancellationToken): ProviderResult<string>;
22
-
23
- /**
24
- * Provide the template to be used in the description of issue reporter.
25
- */
26
- provideIssueTemplate(token: CancellationToken): ProviderResult<string>;
27
- }
28
-
29
- export namespace env {
30
- /**
31
- * Register an {@link IssueUriRequestHandler}. By registering an issue uri request handler,
32
- * you can direct the built-in issue reporter to your issue reporting web experience of choice.
33
- * The Uri that the handler returns will be opened in the user's browser.
34
- *
35
- * Examples of this include:
36
- * - Using GitHub Issue Forms or GitHub Discussions you can pre-fill the issue creation with relevant information from the current workspace using query parameters
37
- * - Directing to a different web form that isn't on GitHub for reporting issues
38
- *
39
- * @param handler the issue uri request handler to register for this extension.
40
- */
41
- export function registerIssueUriRequestHandler(handler: IssueUriRequestHandler): Disposable;
42
-
43
- /**
44
- * Register an {@link IssueDataProvider}. By registering an issue data provider,
45
- * you can provide additional information to the built-in issue reporter.
46
- * The repo url must be provided by package.json's repository field.
47
- *
48
- * Examples:
49
- * - Provide additional information about the current workspace, current extension, current user, or OS
50
- * - Provide data in the form of a string to the secondary description/data text box of the issue reporter.
51
- * - Provide a template for the description of the issue reporter
52
- *
53
- * @param provider the issue data provider to register for this extension.
54
- */
55
- export function registerIssueDataProvider(provider: IssueDataProvider): Disposable;
56
- }
57
- }
@@ -1,17 +0,0 @@
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/181569 @connor4312
9
-
10
- export interface WindowState {
11
- /**
12
- * Indicates whether the window has been interacted with recently. This will
13
- * change immediately on activity, or after a short time of user inactivity.
14
- */
15
- readonly active: boolean;
16
- }
17
- }