@theia/plugin 1.53.0-next.5 → 1.53.0-next.55
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 +766 -766
- package/package.json +3 -3
- package/src/package.spec.ts +28 -28
- package/src/theia-extra.d.ts +410 -410
- package/src/theia.d.ts +18078 -17684
- package/src/theia.proposed.canonicalUriProvider.d.ts +64 -64
- package/src/theia.proposed.customEditorMove.d.ts +41 -41
- package/src/theia.proposed.debugVisualization.d.ts +189 -189
- package/src/theia.proposed.diffCommand.d.ts +55 -55
- package/src/theia.proposed.documentPaste.d.ts +316 -316
- package/src/theia.proposed.editSessionIdentityProvider.d.ts +89 -89
- package/src/theia.proposed.extensionsAny.d.ts +57 -57
- package/src/theia.proposed.externalUriOpener.d.ts +158 -158
- package/src/theia.proposed.findTextInFiles.d.ts +178 -178
- package/src/theia.proposed.fsChunks.d.ts +32 -32
- package/src/theia.proposed.mappedEditsProvider.d.ts +59 -59
- package/src/theia.proposed.multiDocumentHighlightProvider.ts +82 -82
- package/src/theia.proposed.notebookCellExecutionState.d.ts +68 -68
- package/src/theia.proposed.notebookKernelSource.d.ts +62 -62
- package/src/theia.proposed.notebookMessaging.d.ts +84 -84
- package/src/theia.proposed.portsAttributes.d.ts +115 -115
- package/src/theia.proposed.profileContentHandlers.d.ts +35 -35
- package/src/theia.proposed.resolvers.d.ts +44 -44
- package/src/theia.proposed.scmValidation.d.ts +70 -70
- package/src/theia.proposed.shareProvider.d.ts +92 -92
- package/src/theia.proposed.terminalQuickFixProvider.d.ts +103 -103
- package/src/theia.proposed.textSearchProvider.d.ts +145 -145
- package/src/theia.proposed.timeline.d.ts +177 -177
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/*---------------------------------------------------------------------------------------------
|
|
18
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
-
*--------------------------------------------------------------------------------------------*/
|
|
21
|
-
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts
|
|
22
|
-
|
|
23
|
-
export module '@theia/plugin' {
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Options that can be set on a findTextInFiles search.
|
|
27
|
-
*/
|
|
28
|
-
export interface FindTextInFilesOptions {
|
|
29
|
-
/**
|
|
30
|
-
* A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
|
|
31
|
-
* will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern)
|
|
32
|
-
* to restrict the search results to a [workspace folder](#WorkspaceFolder).
|
|
33
|
-
*/
|
|
34
|
-
include?: GlobPattern;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
|
|
38
|
-
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default excludes will
|
|
39
|
-
* apply.
|
|
40
|
-
*/
|
|
41
|
-
exclude?: GlobPattern;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Whether to use the default and user-configured excludes. Defaults to true.
|
|
45
|
-
*/
|
|
46
|
-
useDefaultExcludes?: boolean;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* The maximum number of results to search for
|
|
50
|
-
*/
|
|
51
|
-
maxResults?: number;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Whether external files that exclude files, like .gitignore, should be respected.
|
|
55
|
-
* See the vscode setting `"search.useIgnoreFiles"`.
|
|
56
|
-
*/
|
|
57
|
-
useIgnoreFiles?: boolean;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Whether global files that exclude files, like .gitignore, should be respected.
|
|
61
|
-
* See the vscode setting `"search.useGlobalIgnoreFiles"`.
|
|
62
|
-
*/
|
|
63
|
-
useGlobalIgnoreFiles?: 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
|
-
* Interpret files using this encoding.
|
|
73
|
-
* See the vscode setting `"files.encoding"`
|
|
74
|
-
*/
|
|
75
|
-
encoding?: string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Options to specify the size of the result text preview.
|
|
79
|
-
*/
|
|
80
|
-
previewOptions?: TextSearchPreviewOptions;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Number of lines of context to include before each match.
|
|
84
|
-
*/
|
|
85
|
-
beforeContext?: number;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Number of lines of context to include after each match.
|
|
89
|
-
*/
|
|
90
|
-
afterContext?: number;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* A match from a text search
|
|
95
|
-
*/
|
|
96
|
-
export interface TextSearchMatch {
|
|
97
|
-
/**
|
|
98
|
-
* The uri for the matching document.
|
|
99
|
-
*/
|
|
100
|
-
uri: Uri;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* The range of the match within the document, or multiple ranges for multiple matches.
|
|
104
|
-
*/
|
|
105
|
-
ranges: Range | Range[];
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* A preview of the text match.
|
|
109
|
-
*/
|
|
110
|
-
preview: TextSearchMatchPreview;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* A preview of the text result.
|
|
115
|
-
*/
|
|
116
|
-
export interface TextSearchMatchPreview {
|
|
117
|
-
/**
|
|
118
|
-
* The matching lines of text, or a portion of the matching line that contains the match.
|
|
119
|
-
*/
|
|
120
|
-
text: string;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* The Range within `text` corresponding to the text of the match.
|
|
124
|
-
* The number of matches must match the TextSearchMatch's range property.
|
|
125
|
-
*/
|
|
126
|
-
matches: Range | Range[];
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* A line of context surrounding a TextSearchMatch.
|
|
131
|
-
*/
|
|
132
|
-
export interface TextSearchContext {
|
|
133
|
-
/**
|
|
134
|
-
* The uri for the matching document.
|
|
135
|
-
*/
|
|
136
|
-
uri: Uri;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* One line of text.
|
|
140
|
-
* previewOptions.charsPerLine applies to this
|
|
141
|
-
*/
|
|
142
|
-
text: string;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* The line number of this line of context.
|
|
146
|
-
*/
|
|
147
|
-
lineNumber: number;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export type TextSearchResult = TextSearchMatch | TextSearchContext;
|
|
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 [`TextSearchOptions`](#TextSearchOptions) 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
|
-
export namespace workspace {
|
|
167
|
-
/**
|
|
168
|
-
* Find text in files across all [workspace folders] in the workspace
|
|
169
|
-
* @param query What to search
|
|
170
|
-
* @param optionsOrCallback
|
|
171
|
-
* @param callbackOrToken
|
|
172
|
-
* @param token
|
|
173
|
-
*/
|
|
174
|
-
export function findTextInFiles(query: TextSearchQuery, optionsOrCallback: FindTextInFilesOptions | ((result: TextSearchResult) => void),
|
|
175
|
-
callbackOrToken?: CancellationToken | ((result: TextSearchResult) => void), token?: CancellationToken): Promise<TextSearchComplete>;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Options that can be set on a findTextInFiles search.
|
|
27
|
+
*/
|
|
28
|
+
export interface FindTextInFilesOptions {
|
|
29
|
+
/**
|
|
30
|
+
* A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
|
|
31
|
+
* will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern)
|
|
32
|
+
* to restrict the search results to a [workspace folder](#WorkspaceFolder).
|
|
33
|
+
*/
|
|
34
|
+
include?: GlobPattern;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
|
|
38
|
+
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default excludes will
|
|
39
|
+
* apply.
|
|
40
|
+
*/
|
|
41
|
+
exclude?: GlobPattern;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether to use the default and user-configured excludes. Defaults to true.
|
|
45
|
+
*/
|
|
46
|
+
useDefaultExcludes?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The maximum number of results to search for
|
|
50
|
+
*/
|
|
51
|
+
maxResults?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Whether external files that exclude files, like .gitignore, should be respected.
|
|
55
|
+
* See the vscode setting `"search.useIgnoreFiles"`.
|
|
56
|
+
*/
|
|
57
|
+
useIgnoreFiles?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whether global files that exclude files, like .gitignore, should be respected.
|
|
61
|
+
* See the vscode setting `"search.useGlobalIgnoreFiles"`.
|
|
62
|
+
*/
|
|
63
|
+
useGlobalIgnoreFiles?: 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
|
+
* Interpret files using this encoding.
|
|
73
|
+
* See the vscode setting `"files.encoding"`
|
|
74
|
+
*/
|
|
75
|
+
encoding?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Options to specify the size of the result text preview.
|
|
79
|
+
*/
|
|
80
|
+
previewOptions?: TextSearchPreviewOptions;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Number of lines of context to include before each match.
|
|
84
|
+
*/
|
|
85
|
+
beforeContext?: number;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Number of lines of context to include after each match.
|
|
89
|
+
*/
|
|
90
|
+
afterContext?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A match from a text search
|
|
95
|
+
*/
|
|
96
|
+
export interface TextSearchMatch {
|
|
97
|
+
/**
|
|
98
|
+
* The uri for the matching document.
|
|
99
|
+
*/
|
|
100
|
+
uri: Uri;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The range of the match within the document, or multiple ranges for multiple matches.
|
|
104
|
+
*/
|
|
105
|
+
ranges: Range | Range[];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A preview of the text match.
|
|
109
|
+
*/
|
|
110
|
+
preview: TextSearchMatchPreview;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A preview of the text result.
|
|
115
|
+
*/
|
|
116
|
+
export interface TextSearchMatchPreview {
|
|
117
|
+
/**
|
|
118
|
+
* The matching lines of text, or a portion of the matching line that contains the match.
|
|
119
|
+
*/
|
|
120
|
+
text: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The Range within `text` corresponding to the text of the match.
|
|
124
|
+
* The number of matches must match the TextSearchMatch's range property.
|
|
125
|
+
*/
|
|
126
|
+
matches: Range | Range[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* A line of context surrounding a TextSearchMatch.
|
|
131
|
+
*/
|
|
132
|
+
export interface TextSearchContext {
|
|
133
|
+
/**
|
|
134
|
+
* The uri for the matching document.
|
|
135
|
+
*/
|
|
136
|
+
uri: Uri;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* One line of text.
|
|
140
|
+
* previewOptions.charsPerLine applies to this
|
|
141
|
+
*/
|
|
142
|
+
text: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The line number of this line of context.
|
|
146
|
+
*/
|
|
147
|
+
lineNumber: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type TextSearchResult = TextSearchMatch | TextSearchContext;
|
|
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 [`TextSearchOptions`](#TextSearchOptions) 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
|
+
export namespace workspace {
|
|
167
|
+
/**
|
|
168
|
+
* Find text in files across all [workspace folders] in the workspace
|
|
169
|
+
* @param query What to search
|
|
170
|
+
* @param optionsOrCallback
|
|
171
|
+
* @param callbackOrToken
|
|
172
|
+
* @param token
|
|
173
|
+
*/
|
|
174
|
+
export function findTextInFiles(query: TextSearchQuery, optionsOrCallback: FindTextInFilesOptions | ((result: TextSearchResult) => void),
|
|
175
|
+
callbackOrToken?: CancellationToken | ((result: TextSearchResult) => void), token?: CancellationToken): Promise<TextSearchComplete>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/*---------------------------------------------------------------------------------------------
|
|
18
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
-
*--------------------------------------------------------------------------------------------*/
|
|
21
|
-
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.fsChunks.d.ts
|
|
22
|
-
|
|
23
|
-
export module '@theia/plugin' {
|
|
24
|
-
|
|
25
|
-
export interface FileSystemProvider {
|
|
26
|
-
open?(resource: Uri, options: { create: boolean }): number | Thenable<number>;
|
|
27
|
-
close?(fd: number): void | Thenable<void>;
|
|
28
|
-
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
|
29
|
-
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.fsChunks.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
export interface FileSystemProvider {
|
|
26
|
+
open?(resource: Uri, options: { create: boolean }): number | Thenable<number>;
|
|
27
|
+
close?(fd: number): void | Thenable<void>;
|
|
28
|
+
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
|
29
|
+
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2024 STMicroelectronics and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/*---------------------------------------------------------------------------------------------
|
|
18
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
-
*--------------------------------------------------------------------------------------------*/
|
|
21
|
-
|
|
22
|
-
export module '@theia/plugin' {
|
|
23
|
-
|
|
24
|
-
export interface DocumentContextItem {
|
|
25
|
-
readonly uri: Uri;
|
|
26
|
-
readonly version: number;
|
|
27
|
-
readonly ranges: Range[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface MappedEditsContext {
|
|
31
|
-
documents: DocumentContextItem[][];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Interface for providing mapped edits for a given document.
|
|
36
|
-
*/
|
|
37
|
-
export interface MappedEditsProvider {
|
|
38
|
-
/**
|
|
39
|
-
* Provide mapped edits for a given document.
|
|
40
|
-
* @param document The document to provide mapped edits for.
|
|
41
|
-
* @param codeBlocks Code blocks that come from an LLM's reply.
|
|
42
|
-
* "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks
|
|
43
|
-
* and let the lang server decide what to do with them.
|
|
44
|
-
* @param context The context for providing mapped edits.
|
|
45
|
-
* @param token A cancellation token.
|
|
46
|
-
* @returns A provider result of text edits.
|
|
47
|
-
*/
|
|
48
|
-
provideMappedEdits(
|
|
49
|
-
document: TextDocument,
|
|
50
|
-
codeBlocks: string[],
|
|
51
|
-
context: MappedEditsContext,
|
|
52
|
-
token: CancellationToken
|
|
53
|
-
): ProviderResult<WorkspaceEdit | null>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export namespace chat {
|
|
57
|
-
export function registerMappedEditsProvider(documentSelector: DocumentSelector, provider: MappedEditsProvider): Disposable;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 STMicroelectronics and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
|
|
22
|
+
export module '@theia/plugin' {
|
|
23
|
+
|
|
24
|
+
export interface DocumentContextItem {
|
|
25
|
+
readonly uri: Uri;
|
|
26
|
+
readonly version: number;
|
|
27
|
+
readonly ranges: Range[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface MappedEditsContext {
|
|
31
|
+
documents: DocumentContextItem[][];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Interface for providing mapped edits for a given document.
|
|
36
|
+
*/
|
|
37
|
+
export interface MappedEditsProvider {
|
|
38
|
+
/**
|
|
39
|
+
* Provide mapped edits for a given document.
|
|
40
|
+
* @param document The document to provide mapped edits for.
|
|
41
|
+
* @param codeBlocks Code blocks that come from an LLM's reply.
|
|
42
|
+
* "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks
|
|
43
|
+
* and let the lang server decide what to do with them.
|
|
44
|
+
* @param context The context for providing mapped edits.
|
|
45
|
+
* @param token A cancellation token.
|
|
46
|
+
* @returns A provider result of text edits.
|
|
47
|
+
*/
|
|
48
|
+
provideMappedEdits(
|
|
49
|
+
document: TextDocument,
|
|
50
|
+
codeBlocks: string[],
|
|
51
|
+
context: MappedEditsContext,
|
|
52
|
+
token: CancellationToken
|
|
53
|
+
): ProviderResult<WorkspaceEdit | null>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export namespace chat {
|
|
57
|
+
export function registerMappedEditsProvider(documentSelector: DocumentSelector, provider: MappedEditsProvider): Disposable;
|
|
58
|
+
}
|
|
59
|
+
}
|