@opensumi/sumi 2.12.1-next-079c1930
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 +1 -0
- package/build.ts +18 -0
- package/index.d.ts +5 -0
- package/manifest.json +414 -0
- package/package.json +18 -0
- package/sumi-browser.d.ts +273 -0
- package/sumi-worker/sumi-worker.d.ts +2788 -0
- package/sumi-worker/worker.command.d.ts +86 -0
- package/sumi-worker/worker.comments.d.ts +273 -0
- package/sumi-worker/worker.doc.d.ts +356 -0
- package/sumi-worker/worker.editor.d.ts +725 -0
- package/sumi-worker/worker.extensions.d.ts +63 -0
- package/sumi-worker/worker.language.d.ts +2220 -0
- package/sumi-worker/worker.window.d.ts +318 -0
- package/sumi-worker.d.ts +7 -0
- package/sumi.d.ts +822 -0
- package/vscode/typings/vscode.authentication.d.ts +231 -0
- package/vscode/typings/vscode.command.d.ts +86 -0
- package/vscode/typings/vscode.comments.d.ts +292 -0
- package/vscode/typings/vscode.d.ts +3789 -0
- package/vscode/typings/vscode.debug.d.ts +684 -0
- package/vscode/typings/vscode.doc.d.ts +272 -0
- package/vscode/typings/vscode.editor.d.ts +1017 -0
- package/vscode/typings/vscode.env.d.ts +153 -0
- package/vscode/typings/vscode.extension.d.ts +67 -0
- package/vscode/typings/vscode.language.d.ts +2630 -0
- package/vscode/typings/vscode.message.d.ts +195 -0
- package/vscode/typings/vscode.proposed.d.ts +662 -0
- package/vscode/typings/vscode.quickpick.d.ts +491 -0
- package/vscode/typings/vscode.scm.d.ts +254 -0
- package/vscode/typings/vscode.tasks.d.ts +676 -0
- package/vscode/typings/vscode.theme.d.ts +370 -0
- package/vscode/typings/vscode.window.d.ts +870 -0
- package/vscode/typings/vscode.workspace.d.ts +664 -0
- package/vscode/typings-pending/vscode.d.ts +27 -0
- package/vscode/typings-pending/vscode.proposed.d.ts +3 -0
- package/vscode.d.ts +23 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API OWENR: 木农
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
declare module 'vscode' {
|
|
6
|
+
/**
|
|
7
|
+
* Represents a text document, such as a source file. Text documents have
|
|
8
|
+
* [lines](#TextLine) and knowledge about an underlying resource like a file.
|
|
9
|
+
*/
|
|
10
|
+
export interface TextDocument {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The associated uri for this document.
|
|
14
|
+
*
|
|
15
|
+
* *Note* that most documents use the `file`-scheme, which means they are files on disk. However, **not** all documents are
|
|
16
|
+
* saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.
|
|
17
|
+
*
|
|
18
|
+
* @see [FileSystemProvider](#FileSystemProvider)
|
|
19
|
+
* @see [TextDocumentContentProvider](#TextDocumentContentProvider)
|
|
20
|
+
*/
|
|
21
|
+
readonly uri: Uri;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The file system path of the associated resource. Shorthand
|
|
25
|
+
* notation for [TextDocument.uri.fsPath](#TextDocument.uri). Independent of the uri scheme.
|
|
26
|
+
*/
|
|
27
|
+
readonly fileName: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Is this document representing an untitled file which has never been saved yet. *Note* that
|
|
31
|
+
* this does not mean the document will be saved to disk, use [`uri.scheme`](#Uri.scheme)
|
|
32
|
+
* to figure out where a document will be [saved](#FileSystemProvider), e.g. `file`, `ftp` etc.
|
|
33
|
+
*/
|
|
34
|
+
readonly isUntitled: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The identifier of the language associated with this document.
|
|
38
|
+
*/
|
|
39
|
+
readonly languageId: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The version number of this document (it will strictly increase after each
|
|
43
|
+
* change, including undo/redo).
|
|
44
|
+
*/
|
|
45
|
+
readonly version: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* `true` if there are unpersisted changes.
|
|
49
|
+
*/
|
|
50
|
+
readonly isDirty: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* `true` if the document have been closed. A closed document isn't synchronized anymore
|
|
54
|
+
* and won't be re-used when the same resource is opened again.
|
|
55
|
+
*/
|
|
56
|
+
readonly isClosed: boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Save the underlying file.
|
|
60
|
+
*
|
|
61
|
+
* @return A promise that will resolve to true when the file
|
|
62
|
+
* has been saved. If the file was not dirty or the save failed,
|
|
63
|
+
* will return false.
|
|
64
|
+
*/
|
|
65
|
+
save(): Thenable<boolean>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The [end of line](#EndOfLine) sequence that is predominately
|
|
69
|
+
* used in this document.
|
|
70
|
+
*/
|
|
71
|
+
readonly eol: EndOfLine;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The number of lines in this document.
|
|
75
|
+
*/
|
|
76
|
+
readonly lineCount: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns a text line denoted by the line number. Note
|
|
80
|
+
* that the returned object is *not* live and changes to the
|
|
81
|
+
* document are not reflected.
|
|
82
|
+
*
|
|
83
|
+
* @param line A line number in [0, lineCount).
|
|
84
|
+
* @return A [line](#TextLine).
|
|
85
|
+
*/
|
|
86
|
+
lineAt(line: number): TextLine;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns a text line denoted by the position. Note
|
|
90
|
+
* that the returned object is *not* live and changes to the
|
|
91
|
+
* document are not reflected.
|
|
92
|
+
*
|
|
93
|
+
* The position will be [adjusted](#TextDocument.validatePosition).
|
|
94
|
+
*
|
|
95
|
+
* @see [TextDocument.lineAt](#TextDocument.lineAt)
|
|
96
|
+
* @param position A position.
|
|
97
|
+
* @return A [line](#TextLine).
|
|
98
|
+
*/
|
|
99
|
+
lineAt(position: Position): TextLine;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Converts the position to a zero-based offset.
|
|
103
|
+
*
|
|
104
|
+
* The position will be [adjusted](#TextDocument.validatePosition).
|
|
105
|
+
*
|
|
106
|
+
* @param position A position.
|
|
107
|
+
* @return A valid zero-based offset.
|
|
108
|
+
*/
|
|
109
|
+
offsetAt(position: Position): number;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Converts a zero-based offset to a position.
|
|
113
|
+
*
|
|
114
|
+
* @param offset A zero-based offset.
|
|
115
|
+
* @return A valid [position](#Position).
|
|
116
|
+
*/
|
|
117
|
+
positionAt(offset: number): Position;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Get the text of this document. A substring can be retrieved by providing
|
|
121
|
+
* a range. The range will be [adjusted](#TextDocument.validateRange).
|
|
122
|
+
*
|
|
123
|
+
* @param range Include only the text included by the range.
|
|
124
|
+
* @return The text inside the provided range or the entire text.
|
|
125
|
+
*/
|
|
126
|
+
getText(range?: Range): string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get a word-range at the given position. By default words are defined by
|
|
130
|
+
* common separators, like space, -, _, etc. In addition, per language custom
|
|
131
|
+
* [word definitions](#LanguageConfiguration.wordPattern) can be defined. It
|
|
132
|
+
* is also possible to provide a custom regular expression.
|
|
133
|
+
*
|
|
134
|
+
* * *Note 1:* A custom regular expression must not match the empty string and
|
|
135
|
+
* if it does, it will be ignored.
|
|
136
|
+
* * *Note 2:* A custom regular expression will fail to match multiline strings
|
|
137
|
+
* and in the name of speed regular expressions should not match words with
|
|
138
|
+
* spaces. Use [`TextLine.text`](#TextLine.text) for more complex, non-wordy, scenarios.
|
|
139
|
+
*
|
|
140
|
+
* The position will be [adjusted](#TextDocument.validatePosition).
|
|
141
|
+
*
|
|
142
|
+
* @param position A position.
|
|
143
|
+
* @param regex Optional regular expression that describes what a word is.
|
|
144
|
+
* @return A range spanning a word, or `undefined`.
|
|
145
|
+
*/
|
|
146
|
+
getWordRangeAtPosition(position: Position, regex?: RegExp): Range | undefined;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Ensure a range is completely contained in this document.
|
|
150
|
+
*
|
|
151
|
+
* @param range A range.
|
|
152
|
+
* @return The given range or a new, adjusted range.
|
|
153
|
+
*/
|
|
154
|
+
validateRange(range: Range): Range;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Ensure a position is contained in the range of this document.
|
|
158
|
+
*
|
|
159
|
+
* @param position A position.
|
|
160
|
+
* @return The given position or a new, adjusted position.
|
|
161
|
+
*/
|
|
162
|
+
validatePosition(position: Position): Position;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* A text document content provider allows to add readonly documents
|
|
167
|
+
* to the editor, such as source from a dll or generated html from md.
|
|
168
|
+
*
|
|
169
|
+
* Content providers are [registered](#workspace.registerTextDocumentContentProvider)
|
|
170
|
+
* for a [uri-scheme](#Uri.scheme). When a uri with that scheme is to
|
|
171
|
+
* be [loaded](#workspace.openTextDocument) the content provider is
|
|
172
|
+
* asked.
|
|
173
|
+
*/
|
|
174
|
+
export interface TextDocumentContentProvider {
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* An event to signal a resource has changed.
|
|
178
|
+
*/
|
|
179
|
+
onDidChange?: Event<Uri>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Provide textual content for a given uri.
|
|
183
|
+
*
|
|
184
|
+
* The editor will use the returned string-content to create a readonly
|
|
185
|
+
* [document](#TextDocument). Resources allocated should be released when
|
|
186
|
+
* the corresponding document has been [closed](#workspace.onDidCloseTextDocument).
|
|
187
|
+
*
|
|
188
|
+
* **Note**: The contents of the created [document](#TextDocument) might not be
|
|
189
|
+
* identical to the provided text due to end-of-line-sequence normalization.
|
|
190
|
+
*
|
|
191
|
+
* @param uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for.
|
|
192
|
+
* @param token A cancellation token.
|
|
193
|
+
* @return A string or a thenable that resolves to such.
|
|
194
|
+
*/
|
|
195
|
+
provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult<string>;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* An event describing an individual change in the text of a [document](#TextDocument).
|
|
200
|
+
*/
|
|
201
|
+
export interface TextDocumentContentChangeEvent {
|
|
202
|
+
/**
|
|
203
|
+
* The range that got replaced.
|
|
204
|
+
*/
|
|
205
|
+
range: Range;
|
|
206
|
+
/**
|
|
207
|
+
* The offset of the range that got replaced.
|
|
208
|
+
*/
|
|
209
|
+
rangeOffset: number;
|
|
210
|
+
/**
|
|
211
|
+
* The length of the range that got replaced.
|
|
212
|
+
*/
|
|
213
|
+
rangeLength: number;
|
|
214
|
+
/**
|
|
215
|
+
* The new text for the range.
|
|
216
|
+
*/
|
|
217
|
+
text: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* An event that is fired when a [document](#TextDocument) will be saved.
|
|
223
|
+
*
|
|
224
|
+
* To make modifications to the document before it is being saved, call the
|
|
225
|
+
* [`waitUntil`](#TextDocumentWillSaveEvent.waitUntil)-function with a thenable
|
|
226
|
+
* that resolves to an array of [text edits](#TextEdit).
|
|
227
|
+
*/
|
|
228
|
+
export interface TextDocumentWillSaveEvent {
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The document that will be saved.
|
|
232
|
+
*/
|
|
233
|
+
readonly document: TextDocument;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The reason why save was triggered.
|
|
237
|
+
*/
|
|
238
|
+
readonly reason: TextDocumentSaveReason;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Allows to pause the event loop and to apply [pre-save-edits](#TextEdit).
|
|
242
|
+
* Edits of subsequent calls to this function will be applied in order. The
|
|
243
|
+
* edits will be *ignored* if concurrent modifications of the document happened.
|
|
244
|
+
*
|
|
245
|
+
* *Note:* This function can only be called during event dispatch and not
|
|
246
|
+
* in an asynchronous manner:
|
|
247
|
+
*
|
|
248
|
+
* ```ts
|
|
249
|
+
* workspace.onWillSaveTextDocument(event => {
|
|
250
|
+
* // async, will *throw* an error
|
|
251
|
+
* setTimeout(() => event.waitUntil(promise));
|
|
252
|
+
*
|
|
253
|
+
* // sync, OK
|
|
254
|
+
* event.waitUntil(promise);
|
|
255
|
+
* })
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @param thenable A thenable that resolves to [pre-save-edits](#TextEdit).
|
|
259
|
+
*/
|
|
260
|
+
waitUntil(thenable: Thenable<TextEdit[]>): void;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Allows to pause the event loop until the provided thenable resolved.
|
|
264
|
+
*
|
|
265
|
+
* *Note:* This function can only be called during event dispatch.
|
|
266
|
+
*
|
|
267
|
+
* @param thenable A thenable that delays saving.
|
|
268
|
+
*/
|
|
269
|
+
waitUntil(thenable: Thenable<any>): void;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
}
|