@codingame/monaco-vscode-api 1.83.14 → 1.83.15

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 (130) 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 +966 -955
  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/scm/browser/dirtydiffDecorator.js +564 -11
  21. package/vscode/src/vs/workbench/contrib/scm/common/scm.js +9 -1
  22. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +1 -0
  23. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +594 -2
  24. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +307 -1
  25. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +10 -0
  26. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +2 -37
  27. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +2 -73
  28. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +1 -5
  29. package/vscode/src/vs/workbench/services/textfile/common/textfiles.js +6 -2
  30. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +174 -0
  31. package/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts +49 -0
  32. package/vscode-dts/vscode.proposed.authGetSessions.d.ts +62 -0
  33. package/vscode-dts/vscode.proposed.authSession.d.ts +13 -0
  34. package/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts +47 -0
  35. package/vscode-dts/vscode.proposed.chat.d.ts +25 -0
  36. package/vscode-dts/vscode.proposed.chatAgents.d.ts +39 -0
  37. package/vscode-dts/vscode.proposed.chatProvider.d.ts +38 -0
  38. package/vscode-dts/vscode.proposed.chatRequestAccess.d.ts +47 -0
  39. package/vscode-dts/vscode.proposed.chatSlashCommands.d.ts +47 -0
  40. package/vscode-dts/vscode.proposed.chatVariables.d.ts +35 -0
  41. package/vscode-dts/vscode.proposed.codiconDecoration.d.ts +48 -0
  42. package/vscode-dts/vscode.proposed.commentsDraftState.d.ts +18 -0
  43. package/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts +6 -0
  44. package/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts +10 -0
  45. package/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +8 -0
  46. package/vscode-dts/vscode.proposed.contribEditSessions.d.ts +8 -0
  47. package/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts +6 -0
  48. package/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts +6 -0
  49. package/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts +6 -0
  50. package/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts +6 -0
  51. package/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts +6 -0
  52. package/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts +6 -0
  53. package/vscode-dts/vscode.proposed.contribShareMenu.d.ts +7 -0
  54. package/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts +8 -0
  55. package/vscode-dts/vscode.proposed.contribViewsRemote.d.ts +6 -0
  56. package/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts +6 -0
  57. package/vscode-dts/vscode.proposed.customEditorMove.d.ts +29 -0
  58. package/vscode-dts/vscode.proposed.debugFocus.d.ts +74 -0
  59. package/vscode-dts/vscode.proposed.diffCommand.d.ts +38 -0
  60. package/vscode-dts/vscode.proposed.diffContentOptions.d.ts +16 -0
  61. package/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts +13 -0
  62. package/vscode-dts/vscode.proposed.documentPaste.d.ts +111 -0
  63. package/vscode-dts/vscode.proposed.dropMetadata.d.ts +60 -0
  64. package/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts +71 -0
  65. package/vscode-dts/vscode.proposed.editorInsets.d.ts +22 -0
  66. package/vscode-dts/vscode.proposed.extensionRuntime.d.ts +24 -0
  67. package/vscode-dts/vscode.proposed.extensionsAny.d.ts +40 -0
  68. package/vscode-dts/vscode.proposed.externalUriOpener.d.ts +163 -0
  69. package/vscode-dts/vscode.proposed.fileComments.d.ts +85 -0
  70. package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +67 -0
  71. package/vscode-dts/vscode.proposed.findTextInFiles.d.ts +104 -0
  72. package/vscode-dts/vscode.proposed.fsChunks.d.ts +16 -0
  73. package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +31 -0
  74. package/vscode-dts/vscode.proposed.idToken.d.ts +16 -0
  75. package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +71 -0
  76. package/vscode-dts/vscode.proposed.interactive.d.ts +227 -0
  77. package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +70 -0
  78. package/vscode-dts/vscode.proposed.interactiveWindow.d.ts +25 -0
  79. package/vscode-dts/vscode.proposed.ipc.d.ts +37 -0
  80. package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +42 -0
  81. package/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts +52 -0
  82. package/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts +17 -0
  83. package/vscode-dts/vscode.proposed.notebookDeprecated.d.ts +16 -0
  84. package/vscode-dts/vscode.proposed.notebookExecution.d.ts +39 -0
  85. package/vscode-dts/vscode.proposed.notebookKernelSource.d.ts +46 -0
  86. package/vscode-dts/vscode.proposed.notebookLiveShare.d.ts +21 -0
  87. package/vscode-dts/vscode.proposed.notebookMessaging.d.ts +68 -0
  88. package/vscode-dts/vscode.proposed.notebookMime.d.ts +33 -0
  89. package/vscode-dts/vscode.proposed.portsAttributes.d.ts +100 -0
  90. package/vscode-dts/vscode.proposed.profileContentHandlers.d.ts +19 -0
  91. package/vscode-dts/vscode.proposed.quickDiffProvider.d.ts +17 -0
  92. package/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts +16 -0
  93. package/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts +16 -0
  94. package/vscode-dts/vscode.proposed.readonlyMessage.d.ts +14 -0
  95. package/vscode-dts/vscode.proposed.resolvers.d.ts +371 -0
  96. package/vscode-dts/vscode.proposed.saveEditor.d.ts +35 -0
  97. package/vscode-dts/vscode.proposed.scmActionButton.d.ts +19 -0
  98. package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +77 -0
  99. package/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts +22 -0
  100. package/vscode-dts/vscode.proposed.scmTextDocument.d.ts +19 -0
  101. package/vscode-dts/vscode.proposed.scmValidation.d.ts +60 -0
  102. package/vscode-dts/vscode.proposed.shareProvider.d.ts +74 -0
  103. package/vscode-dts/vscode.proposed.showLocal.d.ts +19 -0
  104. package/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts +25 -0
  105. package/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts +16 -0
  106. package/vscode-dts/vscode.proposed.telemetry.d.ts +36 -0
  107. package/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts +32 -0
  108. package/vscode-dts/vscode.proposed.terminalDimensions.d.ts +39 -0
  109. package/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts +46 -0
  110. package/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +83 -0
  111. package/vscode-dts/vscode.proposed.terminalSelection.d.ts +16 -0
  112. package/vscode-dts/vscode.proposed.testCoverage.d.ts +198 -0
  113. package/vscode-dts/vscode.proposed.testMessageContextValue.d.ts +45 -0
  114. package/vscode-dts/vscode.proposed.testObserver.d.ts +184 -0
  115. package/vscode-dts/vscode.proposed.textSearchProvider.d.ts +281 -0
  116. package/vscode-dts/vscode.proposed.timeline.d.ts +163 -0
  117. package/vscode-dts/vscode.proposed.tokenInformation.d.ts +26 -0
  118. package/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts +30 -0
  119. package/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts +28 -0
  120. package/vscode-dts/vscode.proposed.treeViewReveal.d.ts +13 -0
  121. package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +44 -0
  122. package/vscode-dts/vscode.proposed.tunnels.d.ts +64 -0
  123. package/vscode-dts/vscode.proposed.windowActivity.d.ts +17 -0
  124. package/vscode-dts/vscode.proposed.workspaceTrust.d.ts +30 -0
  125. package/vscode/src/vs/base/common/ternarySearchTree.d.ts +0 -46
  126. package/vscode/src/vs/base/common/uriIpc.d.ts +0 -10
  127. package/vscode/src/vs/platform/workspace/common/editSessions.d.ts +0 -7
  128. package/vscode/src/vs/workbench/services/extensions/common/proxyIdentifier.d.ts +0 -44
  129. package/vscode/src/vs/workbench/services/search/common/search.d.ts +0 -52
  130. package/vscode.proposed.d.ts +0 -4787
@@ -0,0 +1,198 @@
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/123713
9
+
10
+ export interface TestRun {
11
+ /**
12
+ * Test coverage provider for this result. An extension can defer setting
13
+ * this until after a run is complete and coverage is available.
14
+ */
15
+ coverageProvider?: TestCoverageProvider;
16
+ // ...
17
+ }
18
+
19
+ /**
20
+ * Provides information about test coverage for a test result.
21
+ * Methods on the provider will not be called until the test run is complete
22
+ */
23
+ export interface TestCoverageProvider<T extends FileCoverage = FileCoverage> {
24
+ /**
25
+ * Returns coverage information for all files involved in the test run.
26
+ * @param token A cancellation token.
27
+ * @return Coverage metadata for all files involved in the test.
28
+ */
29
+ provideFileCoverage(token: CancellationToken): ProviderResult<T[]>;
30
+
31
+ /**
32
+ * Give a FileCoverage to fill in more data, namely {@link FileCoverage.detailedCoverage}.
33
+ * The editor will only resolve a FileCoverage once, and only if detailedCoverage
34
+ * is undefined.
35
+ *
36
+ * @param coverage A coverage object obtained from {@link provideFileCoverage}
37
+ * @param token A cancellation token.
38
+ * @return The resolved file coverage, or a thenable that resolves to one. It
39
+ * is OK to return the given `coverage`. When no result is returned, the
40
+ * given `coverage` will be used.
41
+ */
42
+ resolveFileCoverage?(coverage: T, token: CancellationToken): ProviderResult<T>;
43
+ }
44
+
45
+ /**
46
+ * A class that contains information about a covered resource. A count can
47
+ * be give for lines, branches, and functions in a file.
48
+ */
49
+ export class CoveredCount {
50
+ /**
51
+ * Number of items covered in the file.
52
+ */
53
+ covered: number;
54
+ /**
55
+ * Total number of covered items in the file.
56
+ */
57
+ total: number;
58
+
59
+ /**
60
+ * @param covered Value for {@link CovereredCount.covered}
61
+ * @param total Value for {@link CovereredCount.total}
62
+ */
63
+ constructor(covered: number, total: number);
64
+ }
65
+
66
+ /**
67
+ * Contains coverage metadata for a file.
68
+ */
69
+ export class FileCoverage {
70
+ /**
71
+ * File URI.
72
+ */
73
+ readonly uri: Uri;
74
+
75
+ /**
76
+ * Statement coverage information. If the reporter does not provide statement
77
+ * coverage information, this can instead be used to represent line coverage.
78
+ */
79
+ statementCoverage: CoveredCount;
80
+
81
+ /**
82
+ * Branch coverage information.
83
+ */
84
+ branchCoverage?: CoveredCount;
85
+
86
+ /**
87
+ * Function coverage information.
88
+ */
89
+ functionCoverage?: CoveredCount;
90
+
91
+ /**
92
+ * Detailed, per-statement coverage. If this is undefined, the editor will
93
+ * call {@link TestCoverageProvider.resolveFileCoverage} when necessary.
94
+ */
95
+ detailedCoverage?: DetailedCoverage[];
96
+
97
+ /**
98
+ * Creates a {@link FileCoverage} instance with counts filled in from
99
+ * the coverage details.
100
+ * @param uri Covered file URI
101
+ * @param detailed Detailed coverage information
102
+ */
103
+ static fromDetails(uri: Uri, details: readonly DetailedCoverage[]): FileCoverage;
104
+
105
+ /**
106
+ * @param uri Covered file URI
107
+ * @param statementCoverage Statement coverage information. If the reporter
108
+ * does not provide statement coverage information, this can instead be
109
+ * used to represent line coverage.
110
+ * @param branchCoverage Branch coverage information
111
+ * @param functionCoverage Function coverage information
112
+ */
113
+ constructor(
114
+ uri: Uri,
115
+ statementCoverage: CoveredCount,
116
+ branchCoverage?: CoveredCount,
117
+ functionCoverage?: CoveredCount,
118
+ );
119
+ }
120
+
121
+ /**
122
+ * Contains coverage information for a single statement or line.
123
+ */
124
+ export class StatementCoverage {
125
+ /**
126
+ * The number of times this statement was executed. If zero, the
127
+ * statement will be marked as un-covered.
128
+ */
129
+ executionCount: number;
130
+
131
+ /**
132
+ * Statement location.
133
+ */
134
+ location: Position | Range;
135
+
136
+ /**
137
+ * Coverage from branches of this line or statement. If it's not a
138
+ * conditional, this will be empty.
139
+ */
140
+ branches: BranchCoverage[];
141
+
142
+ /**
143
+ * @param location The statement position.
144
+ * @param executionCount The number of times this statement was
145
+ * executed. If zero, the statement will be marked as un-covered.
146
+ * @param branches Coverage from branches of this line. If it's not a
147
+ * conditional, this should be omitted.
148
+ */
149
+ constructor(executionCount: number, location: Position | Range, branches?: BranchCoverage[]);
150
+ }
151
+
152
+ /**
153
+ * Contains coverage information for a branch of a {@link StatementCoverage}.
154
+ */
155
+ export class BranchCoverage {
156
+ /**
157
+ * The number of times this branch was executed. If zero, the
158
+ * branch will be marked as un-covered.
159
+ */
160
+ executionCount: number;
161
+
162
+ /**
163
+ * Branch location.
164
+ */
165
+ location?: Position | Range;
166
+
167
+ /**
168
+ * @param executionCount The number of times this branch was executed.
169
+ * @param location The branch position.
170
+ */
171
+ constructor(executionCount: number, location?: Position | Range);
172
+ }
173
+
174
+ /**
175
+ * Contains coverage information for a function or method.
176
+ */
177
+ export class FunctionCoverage {
178
+ /**
179
+ * The number of times this function was executed. If zero, the
180
+ * function will be marked as un-covered.
181
+ */
182
+ executionCount: number;
183
+
184
+ /**
185
+ * Function location.
186
+ */
187
+ location: Position | Range;
188
+
189
+ /**
190
+ * @param executionCount The number of times this function was executed.
191
+ * @param location The function position.
192
+ */
193
+ constructor(executionCount: number, location: Position | Range);
194
+ }
195
+
196
+ export type DetailedCoverage = StatementCoverage | FunctionCoverage;
197
+
198
+ }
@@ -0,0 +1,45 @@
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/190277
9
+
10
+ export class TestMessage2 extends TestMessage {
11
+
12
+ /**
13
+ * Context value of the test item. This can be used to contribute message-
14
+ * specific actions to the test peek view. The value set here can be found
15
+ * in the `testMessage` property of the following `menus` contribution points:
16
+ *
17
+ * - `testing/message/context` - context menu for the message in the results tree
18
+ * - `testing/message/content` - a prominent button overlaying editor content where
19
+ * the message is displayed.
20
+ *
21
+ * For example:
22
+ *
23
+ * ```json
24
+ * "contributes": {
25
+ * "menus": {
26
+ * "testing/message/content": [
27
+ * {
28
+ * "command": "extension.deleteCommentThread",
29
+ * "when": "testMessage == canApplyRichDiff"
30
+ * }
31
+ * ]
32
+ * }
33
+ * }
34
+ * ```
35
+ *
36
+ * The command will be called with an object containing:
37
+ * - `test`: the {@link TestItem} the message is associated with, *if* it
38
+ * is still present in the {@link TestController.items} collection.
39
+ * - `message`: the {@link TestMessage} instance.
40
+ */
41
+ contextValue?: string;
42
+
43
+ // ...
44
+ }
45
+ }
@@ -0,0 +1,184 @@
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/107467
9
+
10
+ export namespace tests {
11
+ /**
12
+ * Requests that tests be run by their controller.
13
+ * @param run Run options to use.
14
+ * @param token Cancellation token for the test run
15
+ */
16
+ export function runTests(run: TestRunRequest, token?: CancellationToken): Thenable<void>;
17
+
18
+ /**
19
+ * Returns an observer that watches and can request tests.
20
+ */
21
+ export function createTestObserver(): TestObserver;
22
+ /**
23
+ * List of test results stored by the editor, sorted in descending
24
+ * order by their `completedAt` time.
25
+ */
26
+ export const testResults: ReadonlyArray<TestRunResult>;
27
+
28
+ /**
29
+ * Event that fires when the {@link testResults} array is updated.
30
+ */
31
+ export const onDidChangeTestResults: Event<void>;
32
+ }
33
+
34
+ export interface TestObserver {
35
+ /**
36
+ * List of tests returned by test provider for files in the workspace.
37
+ */
38
+ readonly tests: ReadonlyArray<TestItem>;
39
+
40
+ /**
41
+ * An event that fires when an existing test in the collection changes, or
42
+ * null if a top-level test was added or removed. When fired, the consumer
43
+ * should check the test item and all its children for changes.
44
+ */
45
+ readonly onDidChangeTest: Event<TestsChangeEvent>;
46
+
47
+ /**
48
+ * Dispose of the observer, allowing the editor to eventually tell test
49
+ * providers that they no longer need to update tests.
50
+ */
51
+ dispose(): void;
52
+ }
53
+
54
+ export interface TestsChangeEvent {
55
+ /**
56
+ * List of all tests that are newly added.
57
+ */
58
+ readonly added: ReadonlyArray<TestItem>;
59
+
60
+ /**
61
+ * List of existing tests that have updated.
62
+ */
63
+ readonly updated: ReadonlyArray<TestItem>;
64
+
65
+ /**
66
+ * List of existing tests that have been removed.
67
+ */
68
+ readonly removed: ReadonlyArray<TestItem>;
69
+ }
70
+
71
+ /**
72
+ * TestResults can be provided to the editor in {@link tests.publishTestResult},
73
+ * or read from it in {@link tests.testResults}.
74
+ *
75
+ * The results contain a 'snapshot' of the tests at the point when the test
76
+ * run is complete. Therefore, information such as its {@link Range} may be
77
+ * out of date. If the test still exists in the workspace, consumers can use
78
+ * its `id` to correlate the result instance with the living test.
79
+ */
80
+ export interface TestRunResult {
81
+ /**
82
+ * Unix milliseconds timestamp at which the test run was completed.
83
+ */
84
+ readonly completedAt: number;
85
+
86
+ /**
87
+ * Optional raw output from the test run.
88
+ */
89
+ readonly output?: string;
90
+
91
+ /**
92
+ * List of test results. The items in this array are the items that
93
+ * were passed in the {@link tests.runTests} method.
94
+ */
95
+ readonly results: ReadonlyArray<Readonly<TestResultSnapshot>>;
96
+ }
97
+
98
+ /**
99
+ * A {@link TestItem}-like interface with an associated result, which appear
100
+ * or can be provided in {@link TestResult} interfaces.
101
+ */
102
+ export interface TestResultSnapshot {
103
+ /**
104
+ * Unique identifier that matches that of the associated TestItem.
105
+ * This is used to correlate test results and tests in the document with
106
+ * those in the workspace (test explorer).
107
+ */
108
+ readonly id: string;
109
+
110
+ /**
111
+ * Parent of this item.
112
+ */
113
+ readonly parent?: TestResultSnapshot;
114
+
115
+ /**
116
+ * URI this TestItem is associated with. May be a file or file.
117
+ */
118
+ readonly uri?: Uri;
119
+
120
+ /**
121
+ * Display name describing the test case.
122
+ */
123
+ readonly label: string;
124
+
125
+ /**
126
+ * Optional description that appears next to the label.
127
+ */
128
+ readonly description?: string;
129
+
130
+ /**
131
+ * Location of the test item in its `uri`. This is only meaningful if the
132
+ * `uri` points to a file.
133
+ */
134
+ readonly range?: Range;
135
+
136
+ /**
137
+ * State of the test in each task. In the common case, a test will only
138
+ * be executed in a single task and the length of this array will be 1.
139
+ */
140
+ readonly taskStates: ReadonlyArray<TestSnapshotTaskState>;
141
+
142
+ /**
143
+ * Optional list of nested tests for this item.
144
+ */
145
+ readonly children: Readonly<TestResultSnapshot>[];
146
+ }
147
+
148
+ export interface TestSnapshotTaskState {
149
+ /**
150
+ * Current result of the test.
151
+ */
152
+ readonly state: TestResultState;
153
+
154
+ /**
155
+ * The number of milliseconds the test took to run. This is set once the
156
+ * `state` is `Passed`, `Failed`, or `Errored`.
157
+ */
158
+ readonly duration?: number;
159
+
160
+ /**
161
+ * Associated test run message. Can, for example, contain assertion
162
+ * failure information if the test fails.
163
+ */
164
+ readonly messages: ReadonlyArray<TestMessage>;
165
+ }
166
+
167
+ /**
168
+ * Possible states of tests in a test run.
169
+ */
170
+ export enum TestResultState {
171
+ // Test will be run, but is not currently running.
172
+ Queued = 1,
173
+ // Test is currently running
174
+ Running = 2,
175
+ // Test run has passed
176
+ Passed = 3,
177
+ // Test run has failed (on an assertion)
178
+ Failed = 4,
179
+ // Test run has been skipped
180
+ Skipped = 5,
181
+ // Test run failed for some other reason (compilation error, timeout, etc)
182
+ Errored = 6
183
+ }
184
+ }
@@ -0,0 +1,281 @@
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/59921
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
+ * A file glob pattern to match file paths against.
42
+ * TODO@roblourens merge this with the GlobPattern docs/definition in vscode.d.ts.
43
+ * @see {@link GlobPattern}
44
+ */
45
+ export type GlobString = string;
46
+
47
+ /**
48
+ * Options common to file and text search
49
+ */
50
+ export interface SearchOptions {
51
+ /**
52
+ * The root folder to search within.
53
+ */
54
+ folder: Uri;
55
+
56
+ /**
57
+ * Files that match an `includes` glob pattern should be included in the search.
58
+ */
59
+ includes: GlobString[];
60
+
61
+ /**
62
+ * Files that match an `excludes` glob pattern should be excluded from the search.
63
+ */
64
+ excludes: GlobString[];
65
+
66
+ /**
67
+ * Whether external files that exclude files, like .gitignore, should be respected.
68
+ * See the vscode setting `"search.useIgnoreFiles"`.
69
+ */
70
+ useIgnoreFiles: boolean;
71
+
72
+ /**
73
+ * Whether symlinks should be followed while searching.
74
+ * See the vscode setting `"search.followSymlinks"`.
75
+ */
76
+ followSymlinks: boolean;
77
+
78
+ /**
79
+ * Whether global files that exclude files, like .gitignore, should be respected.
80
+ * See the vscode setting `"search.useGlobalIgnoreFiles"`.
81
+ */
82
+ useGlobalIgnoreFiles: boolean;
83
+
84
+ /**
85
+ * Whether files in parent directories that exclude files, like .gitignore, should be respected.
86
+ * See the vscode setting `"search.useParentIgnoreFiles"`.
87
+ */
88
+ useParentIgnoreFiles: boolean;
89
+ }
90
+
91
+ /**
92
+ * Options to specify the size of the result text preview.
93
+ * These options don't affect the size of the match itself, just the amount of preview text.
94
+ */
95
+ export interface TextSearchPreviewOptions {
96
+ /**
97
+ * The maximum number of lines in the preview.
98
+ * Only search providers that support multiline search will ever return more than one line in the match.
99
+ */
100
+ matchLines: number;
101
+
102
+ /**
103
+ * The maximum number of characters included per line.
104
+ */
105
+ charsPerLine: number;
106
+ }
107
+
108
+ /**
109
+ * Options that apply to text search.
110
+ */
111
+ export interface TextSearchOptions extends SearchOptions {
112
+ /**
113
+ * The maximum number of results to be returned.
114
+ */
115
+ maxResults: number;
116
+
117
+ /**
118
+ * Options to specify the size of the result text preview.
119
+ */
120
+ previewOptions?: TextSearchPreviewOptions;
121
+
122
+ /**
123
+ * Exclude files larger than `maxFileSize` in bytes.
124
+ */
125
+ maxFileSize?: number;
126
+
127
+ /**
128
+ * Interpret files using this encoding.
129
+ * See the vscode setting `"files.encoding"`
130
+ */
131
+ encoding?: string;
132
+
133
+ /**
134
+ * Number of lines of context to include before each match.
135
+ */
136
+ beforeContext?: number;
137
+
138
+ /**
139
+ * Number of lines of context to include after each match.
140
+ */
141
+ afterContext?: number;
142
+ }
143
+
144
+ /**
145
+ * Represents the severity of a TextSearchComplete message.
146
+ */
147
+ export enum TextSearchCompleteMessageType {
148
+ Information = 1,
149
+ Warning = 2,
150
+ }
151
+
152
+ /**
153
+ * A message regarding a completed search.
154
+ */
155
+ export interface TextSearchCompleteMessage {
156
+ /**
157
+ * Markdown text of the message.
158
+ */
159
+ text: string;
160
+ /**
161
+ * Whether the source of the message is trusted, command links are disabled for untrusted message sources.
162
+ * Messaged are untrusted by default.
163
+ */
164
+ trusted?: boolean;
165
+ /**
166
+ * The message type, this affects how the message will be rendered.
167
+ */
168
+ type: TextSearchCompleteMessageType;
169
+ }
170
+
171
+ /**
172
+ * Information collected when text search is complete.
173
+ */
174
+ export interface TextSearchComplete {
175
+ /**
176
+ * Whether the search hit the limit on the maximum number of search results.
177
+ * `maxResults` on {@linkcode TextSearchOptions} specifies the max number of results.
178
+ * - If exactly that number of matches exist, this should be false.
179
+ * - If `maxResults` matches are returned and more exist, this should be true.
180
+ * - If search hits an internal limit which is less than `maxResults`, this should be true.
181
+ */
182
+ limitHit?: boolean;
183
+
184
+ /**
185
+ * Additional information regarding the state of the completed search.
186
+ *
187
+ * Messages with "Information" style support links in markdown syntax:
188
+ * - Click to [run a command](command:workbench.action.OpenQuickPick)
189
+ * - Click to [open a website](https://aka.ms)
190
+ *
191
+ * Commands may optionally return { triggerSearch: true } to signal to the editor that the original search should run be again.
192
+ */
193
+ message?: TextSearchCompleteMessage | TextSearchCompleteMessage[];
194
+ }
195
+
196
+ /**
197
+ * A preview of the text result.
198
+ */
199
+ export interface TextSearchMatchPreview {
200
+ /**
201
+ * The matching lines of text, or a portion of the matching line that contains the match.
202
+ */
203
+ text: string;
204
+
205
+ /**
206
+ * The Range within `text` corresponding to the text of the match.
207
+ * The number of matches must match the TextSearchMatch's range property.
208
+ */
209
+ matches: Range | Range[];
210
+ }
211
+
212
+ /**
213
+ * A match from a text search
214
+ */
215
+ export interface TextSearchMatch {
216
+ /**
217
+ * The uri for the matching document.
218
+ */
219
+ uri: Uri;
220
+
221
+ /**
222
+ * The range of the match within the document, or multiple ranges for multiple matches.
223
+ */
224
+ ranges: Range | Range[];
225
+
226
+ /**
227
+ * A preview of the text match.
228
+ */
229
+ preview: TextSearchMatchPreview;
230
+ }
231
+
232
+ /**
233
+ * A line of context surrounding a TextSearchMatch.
234
+ */
235
+ export interface TextSearchContext {
236
+ /**
237
+ * The uri for the matching document.
238
+ */
239
+ uri: Uri;
240
+
241
+ /**
242
+ * One line of text.
243
+ * previewOptions.charsPerLine applies to this
244
+ */
245
+ text: string;
246
+
247
+ /**
248
+ * The line number of this line of context.
249
+ */
250
+ lineNumber: number;
251
+ }
252
+
253
+ export type TextSearchResult = TextSearchMatch | TextSearchContext;
254
+
255
+ /**
256
+ * A TextSearchProvider provides search results for text results inside files in the workspace.
257
+ */
258
+ export interface TextSearchProvider {
259
+ /**
260
+ * Provide results that match the given text pattern.
261
+ * @param query The parameters for this query.
262
+ * @param options A set of options to consider while searching.
263
+ * @param progress A progress callback that must be invoked for all results.
264
+ * @param token A cancellation token.
265
+ */
266
+ provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress<TextSearchResult>, token: CancellationToken): ProviderResult<TextSearchComplete>;
267
+ }
268
+
269
+ export namespace workspace {
270
+ /**
271
+ * Register a text search provider.
272
+ *
273
+ * Only one provider can be registered per scheme.
274
+ *
275
+ * @param scheme The provider will be invoked for workspace folders that have this file scheme.
276
+ * @param provider The provider.
277
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
278
+ */
279
+ export function registerTextSearchProvider(scheme: string, provider: TextSearchProvider): Disposable;
280
+ }
281
+ }