@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.
Files changed (37) hide show
  1. package/README.md +1 -0
  2. package/build.ts +18 -0
  3. package/index.d.ts +5 -0
  4. package/manifest.json +414 -0
  5. package/package.json +18 -0
  6. package/sumi-browser.d.ts +273 -0
  7. package/sumi-worker/sumi-worker.d.ts +2788 -0
  8. package/sumi-worker/worker.command.d.ts +86 -0
  9. package/sumi-worker/worker.comments.d.ts +273 -0
  10. package/sumi-worker/worker.doc.d.ts +356 -0
  11. package/sumi-worker/worker.editor.d.ts +725 -0
  12. package/sumi-worker/worker.extensions.d.ts +63 -0
  13. package/sumi-worker/worker.language.d.ts +2220 -0
  14. package/sumi-worker/worker.window.d.ts +318 -0
  15. package/sumi-worker.d.ts +7 -0
  16. package/sumi.d.ts +822 -0
  17. package/vscode/typings/vscode.authentication.d.ts +231 -0
  18. package/vscode/typings/vscode.command.d.ts +86 -0
  19. package/vscode/typings/vscode.comments.d.ts +292 -0
  20. package/vscode/typings/vscode.d.ts +3789 -0
  21. package/vscode/typings/vscode.debug.d.ts +684 -0
  22. package/vscode/typings/vscode.doc.d.ts +272 -0
  23. package/vscode/typings/vscode.editor.d.ts +1017 -0
  24. package/vscode/typings/vscode.env.d.ts +153 -0
  25. package/vscode/typings/vscode.extension.d.ts +67 -0
  26. package/vscode/typings/vscode.language.d.ts +2630 -0
  27. package/vscode/typings/vscode.message.d.ts +195 -0
  28. package/vscode/typings/vscode.proposed.d.ts +662 -0
  29. package/vscode/typings/vscode.quickpick.d.ts +491 -0
  30. package/vscode/typings/vscode.scm.d.ts +254 -0
  31. package/vscode/typings/vscode.tasks.d.ts +676 -0
  32. package/vscode/typings/vscode.theme.d.ts +370 -0
  33. package/vscode/typings/vscode.window.d.ts +870 -0
  34. package/vscode/typings/vscode.workspace.d.ts +664 -0
  35. package/vscode/typings-pending/vscode.d.ts +27 -0
  36. package/vscode/typings-pending/vscode.proposed.d.ts +3 -0
  37. package/vscode.d.ts +23 -0
@@ -0,0 +1,664 @@
1
+
2
+
3
+ declare module 'vscode' {
4
+
5
+ /**
6
+ * An event describing a change to the set of [workspace folders](#workspace.workspaceFolders).
7
+ */
8
+ export interface WorkspaceFoldersChangeEvent {
9
+ /**
10
+ * Added workspace folders.
11
+ */
12
+ readonly added: ReadonlyArray<WorkspaceFolder>;
13
+
14
+ /**
15
+ * Removed workspace folders.
16
+ */
17
+ readonly removed: ReadonlyArray<WorkspaceFolder>;
18
+ }
19
+
20
+ /**
21
+ * Options to configure the behaviour of the [workspace folder](#WorkspaceFolder) pick UI.
22
+ */
23
+ export interface WorkspaceFolderPickOptions {
24
+
25
+ /**
26
+ * An optional string to show as place holder in the input box to guide the user what to pick on.
27
+ */
28
+ placeHolder?: string;
29
+
30
+ /**
31
+ * Set to `true` to keep the picker open when focus moves to another part of the editor or to another window.
32
+ */
33
+ ignoreFocusOut?: boolean;
34
+ }
35
+
36
+ export namespace workspace {
37
+ export const fs: FileSystem;
38
+
39
+
40
+ /**
41
+ * When true, the user has explicitly trusted the contents of the workspace.
42
+ * TODO: 内部无此类需求,先空实现,等有需求再做
43
+ */
44
+ export const isTrusted: boolean;
45
+
46
+ /**
47
+ * Event that fires when the current workspace has been trusted.
48
+ * TODO: 内部无此类需求,先空实现,等有需求再做
49
+ */
50
+ export const onDidGrantWorkspaceTrust: Event<void>;
51
+
52
+ /**
53
+ * Returns the [workspace folder](#WorkspaceFolder) that contains a given uri.
54
+ * * returns `undefined` when the given uri doesn't match any workspace folder
55
+ * * returns the *input* when the given uri is a workspace folder itself
56
+ *
57
+ * @param uri An uri.
58
+ * @return A workspace folder or `undefined`
59
+ */
60
+ export function getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined;
61
+
62
+ /**
63
+ * Make changes to one or many resources or create, delete, and rename resources as defined by the given
64
+ * [workspace edit](#WorkspaceEdit).
65
+ *
66
+ * All changes of a workspace edit are applied in the same order in which they have been added. If
67
+ * multiple textual inserts are made at the same position, these strings appear in the resulting text
68
+ * in the order the 'inserts' were made. Invalid sequences like 'delete file a' -> 'insert text in file a'
69
+ * cause failure of the operation.
70
+ *
71
+ * When applying a workspace edit that consists only of text edits an 'all-or-nothing'-strategy is used.
72
+ * A workspace edit with resource creations or deletions aborts the operation, e.g. consecutive edits will
73
+ * not be attempted, when a single edit fails.
74
+ *
75
+ * @param edit A workspace edit.
76
+ * @return A thenable that resolves when the edit could be applied.
77
+ * @Owner 吭头
78
+ */
79
+ export function applyEdit(edit: WorkspaceEdit): Thenable<boolean>;
80
+
81
+ /**
82
+ * Get a workspace configuration object.
83
+ *
84
+ * When a section-identifier is provided only that part of the configuration
85
+ * is returned. Dots in the section-identifier are interpreted as child-access,
86
+ * like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
87
+ *
88
+ * When a resource is provided, configuration scoped to that resource is returned.
89
+ *
90
+ * @param section A dot-separated identifier.
91
+ * @param resource A resource for which the configuration is asked for
92
+ * @return The full configuration or a subset.
93
+ */
94
+ export function getConfiguration(section?: string, resource?: Uri | null): WorkspaceConfiguration;
95
+
96
+ /**
97
+ * An event that is emitted when the [configuration](#WorkspaceConfiguration) changed.
98
+ */
99
+ export const onDidChangeConfiguration: Event<ConfigurationChangeEvent>;
100
+
101
+ /**
102
+ * Returns the [workspace folder](#WorkspaceFolder) that contains a given uri.
103
+ * * returns `undefined` when the given uri doesn't match any workspace folder
104
+ * * returns the *input* when the given uri is a workspace folder itself
105
+ *
106
+ * @param uri An uri.
107
+ * @return A workspace folder or `undefined`
108
+ */
109
+ export function getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined;
110
+
111
+ /**
112
+ * Opens a document. Will return early if this document is already open. Otherwise
113
+ * the document is loaded and the [didOpen](#workspace.onDidOpenTextDocument)-event fires.
114
+ *
115
+ * The document is denoted by an [uri](#Uri). Depending on the [scheme](#Uri.scheme) the
116
+ * following rules apply:
117
+ * * `file`-scheme: Open a file on disk, will be rejected if the file does not exist or cannot be loaded.
118
+ * * `untitled`-scheme: A new file that should be saved on disk, e.g. `untitled:c:\frodo\new.js`. The language
119
+ * will be derived from the file name.
120
+ * * For all other schemes the registered text document content [providers](#TextDocumentContentProvider) are consulted.
121
+ *
122
+ * *Note* that the lifecycle of the returned document is owned by the editor and not by the extension. That means an
123
+ * [`onDidClose`](#workspace.onDidCloseTextDocument)-event can occur at any time after opening it.
124
+ *
125
+ * @param uri Identifies the resource to open.
126
+ * @return A promise that resolves to a [document](#TextDocument).
127
+ * @Owner 木农
128
+ */
129
+ export function openTextDocument(uri: Uri): Thenable<TextDocument>;
130
+
131
+ /**
132
+ * A short-hand for `openTextDocument(Uri.file(fileName))`.
133
+ *
134
+ * @see [openTextDocument](#openTextDocument)
135
+ * @param fileName A name of a file on disk.
136
+ * @return A promise that resolves to a [document](#TextDocument).
137
+ */
138
+ export function openTextDocument(fileName: string): Thenable<TextDocument>;
139
+
140
+ /**
141
+ * Creates a file system watcher.
142
+ *
143
+ * A glob pattern that filters the file events on their absolute path must be provided. Optionally,
144
+ * flags to ignore certain kinds of events can be provided. To stop listening to events the watcher must be disposed.
145
+ *
146
+ * *Note* that only files within the current [workspace folders](#workspace.workspaceFolders) can be watched.
147
+ *
148
+ * @param globPattern A [glob pattern](#GlobPattern) that is applied to the absolute paths of created, changed,
149
+ * and deleted files. Use a [relative pattern](#RelativePattern) to limit events to a certain [workspace folder](#WorkspaceFolder).
150
+ * @param ignoreCreateEvents Ignore when files have been created.
151
+ * @param ignoreChangeEvents Ignore when files have been changed.
152
+ * @param ignoreDeleteEvents Ignore when files have been deleted.
153
+ * @return A new file system watcher instance.
154
+ * @墨蜇
155
+ */
156
+ export function createFileSystemWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher;
157
+
158
+ /**
159
+ * Register a filesystem provider for a given scheme, e.g. `ftp`.
160
+ *
161
+ * There can only be one provider per scheme and an error is being thrown when a scheme
162
+ * has been claimed by another provider or when it is reserved.
163
+ *
164
+ * @param scheme The uri-[scheme](#Uri.scheme) the provider registers for.
165
+ * @param provider The filesystem provider.
166
+ * @param options Immutable metadata about the provider.
167
+ * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
168
+ * @墨蛰
169
+ */
170
+ export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean }): Disposable;
171
+
172
+ /**
173
+ * Opens an untitled text document. The editor will prompt the user for a file
174
+ * path when the document is to be saved. The `options` parameter allows to
175
+ * specify the *language* and/or the *content* of the document.
176
+ *
177
+ * @param options Options to control how the document will be created.
178
+ * @return A promise that resolves to a [document](#TextDocument).
179
+ */
180
+ export function openTextDocument(options?: { language?: string; content?: string; }): Thenable<TextDocument>;
181
+
182
+ /**
183
+ * Register a text document content provider.
184
+ *
185
+ * Only one provider can be registered per scheme.
186
+ *
187
+ * @param scheme The uri-scheme to register for.
188
+ * @param provider A content provider.
189
+ * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
190
+ */
191
+ export function registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable;
192
+
193
+ /**
194
+ * An event that is emitted when a [text document](#TextDocument) is opened or when the language id
195
+ * of a text document [has been changed](#languages.setTextDocumentLanguage).
196
+ *
197
+ * To add an event listener when a visible text document is opened, use the [TextEditor](#TextEditor) events in the
198
+ * [window](#window) namespace. Note that:
199
+ *
200
+ * - The event is emitted before the [document](#TextDocument) is updated in the
201
+ * [active text editor](#window.activeTextEditor)
202
+ * - When a [text document](#TextDocument) is already open (e.g.: open in another [visible text editor](#window.visibleTextEditors)) this event is not emitted
203
+ *
204
+ */
205
+ export const onDidOpenTextDocument: Event<TextDocument>;
206
+
207
+ /**
208
+ * An event that is emitted when a [text document](#TextDocument) is disposed or when the language id
209
+ * of a text document [has been changed](#languages.setTextDocumentLanguage).
210
+ *
211
+ * To add an event listener when a visible text document is closed, use the [TextEditor](#TextEditor) events in the
212
+ * [window](#window) namespace. Note that this event is not emitted when a [TextEditor](#TextEditor) is closed
213
+ * but the document remains open in another [visible text editor](#window.visibleTextEditors).
214
+ */
215
+ export const onDidCloseTextDocument: Event<TextDocument>;
216
+
217
+ /**
218
+ * An event that is emitted when a [text document](#TextDocument) is changed. This usually happens
219
+ * when the [contents](#TextDocument.getText) changes but also when other things like the
220
+ * [dirty](#TextDocument.isDirty)-state changes.
221
+ */
222
+ export const onDidChangeTextDocument: Event<TextDocumentChangeEvent>;
223
+
224
+ /**
225
+ * An event that is emitted when a [text document](#TextDocument) will be saved to disk.
226
+ *
227
+ * *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
228
+ * might save without firing this event. For instance when shutting down with dirty files.
229
+ *
230
+ * *Note 2:* Subscribers are called sequentially and they can [delay](#TextDocumentWillSaveEvent.waitUntil) saving
231
+ * by registering asynchronous work. Protection against misbehaving listeners is implemented as such:
232
+ * * there is an overall time budget that all listeners share and if that is exhausted no further listener is called
233
+ * * listeners that take a long time or produce errors frequently will not be called anymore
234
+ *
235
+ * The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.
236
+ */
237
+ export const onWillSaveTextDocument: Event<TextDocumentWillSaveEvent>;
238
+
239
+ /**
240
+ * An event that is emitted when a [text document](#TextDocument) is saved to disk.
241
+ */
242
+ export const onDidSaveTextDocument: Event<TextDocument>;
243
+
244
+ /**
245
+ * All text documents currently known to the system.
246
+ * @Owner 木农
247
+ */
248
+ export const textDocuments: TextDocument[];
249
+
250
+ /**
251
+ * Register a text document content provider.
252
+ *
253
+ * Only one provider can be registered per scheme.
254
+ *
255
+ * @param scheme The uri-scheme to register for.
256
+ * @param provider A content provider.
257
+ * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
258
+ */
259
+ export function registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable;
260
+
261
+ /**
262
+ * Find files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
263
+ *
264
+ * @sample `findFiles('**​/*.js', '**​/node_modules/**', 10)`
265
+ * @param include A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
266
+ * will be matched against the file paths of resulting matches relative to their workspace. Use a [relative pattern](#RelativePattern)
267
+ * to restrict the search results to a [workspace folder](#WorkspaceFolder).
268
+ * @param exclude A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
269
+ * will be matched against the file paths of resulting matches relative to their workspace. When `undefined` only default excludes will
270
+ * apply, when `null` no excludes will apply.
271
+ * @param maxResults An upper-bound for the result.
272
+ * @param token A token that can be used to signal cancellation to the underlying search engine.
273
+ * @return A thenable that resolves to an array of resource identifiers. Will return no results if no
274
+ * [workspace folders](#workspace.workspaceFolders) are opened.
275
+ * @墨蜇
276
+ */
277
+ export function findFiles(include: GlobPattern, exclude?: GlobPattern | null, maxResults?: number, token?: CancellationToken): Thenable<Uri[]>;
278
+
279
+
280
+ /**
281
+ * The location of the workspace file, for example:
282
+ *
283
+ * `file:///Users/name/Development/myProject.code-workspace`
284
+ *
285
+ * or
286
+ *
287
+ * `untitled:1555503116870`
288
+ *
289
+ * for a workspace that is untitled and not yet saved.
290
+ *
291
+ * Depending on the workspace that is opened, the value will be:
292
+ * * `undefined` when no workspace or a single folder is opened
293
+ * * the path of the workspace file as `Uri` otherwise. if the workspace
294
+ * is untitled, the returned URI will use the `untitled:` scheme
295
+ *
296
+ * The location can e.g. be used with the `vscode.openFolder` command to
297
+ * open the workspace again after it has been closed.
298
+ *
299
+ * **Example:**
300
+ * ```typescript
301
+ * vscode.commands.executeCommand('vscode.openFolder', uriOfWorkspace);
302
+ * ```
303
+ *
304
+ * **Note:** it is not advised to use `workspace.workspaceFile` to write
305
+ * configuration data into the file. You can use `workspace.getConfiguration().update()`
306
+ * for that purpose which will work both when a single folder is opened as
307
+ * well as an untitled or saved workspace.
308
+ */
309
+ export const workspaceFile: Uri | undefined;
310
+
311
+ /**
312
+ * An event that is emitted when a workspace folder is added or removed.
313
+ */
314
+ export const onDidChangeWorkspaceFolders: Event<WorkspaceFoldersChangeEvent>;
315
+
316
+ /**
317
+ * ~~Register a task provider.~~
318
+ *
319
+ * @deprecated Use the corresponding function on the `tasks` namespace instead
320
+ *
321
+ * @param type The task kind type this provider is registered for.
322
+ * @param provider A task provider.
323
+ * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
324
+ */
325
+ export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;
326
+
327
+ /**
328
+ * Returns the [workspace folder](#WorkspaceFolder) that contains a given uri.
329
+ * * returns `undefined` when the given uri doesn't match any workspace folder
330
+ * * returns the *input* when the given uri is a workspace folder itself
331
+ *
332
+ * @param uri An uri.
333
+ * @return A workspace folder or `undefined`
334
+ * @墨蜇
335
+ */
336
+ export function getWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined;
337
+
338
+
339
+ /**
340
+ * ~~The folder that is open in the editor. `undefined` when no folder
341
+ * has been opened.~~
342
+ *
343
+ * @deprecated Use [`workspaceFolders`](#workspace.workspaceFolders) instead.
344
+ */
345
+ export const rootPath: string | undefined;
346
+
347
+ /**
348
+ * List of workspace folders or `undefined` when no folder is open.
349
+ * *Note* that the first entry corresponds to the value of `rootPath`.
350
+ */
351
+ export const workspaceFolders: WorkspaceFolder[] | undefined;
352
+
353
+ /**
354
+ * The name of the workspace. `undefined` when no folder
355
+ * has been opened.
356
+ * @魁梧
357
+ */
358
+ export const name: string | undefined;
359
+
360
+ /**
361
+ * Returns a path that is relative to the workspace folder or folders.
362
+ *
363
+ * When there are no [workspace folders](#workspace.workspaceFolders) or when the path
364
+ * is not contained in them, the input is returned.
365
+ *
366
+ * @param pathOrUri A path or uri. When a uri is given its [fsPath](#Uri.fsPath) is used.
367
+ * @param includeWorkspaceFolder When `true` and when the given path is contained inside a
368
+ * workspace folder the name of the workspace is prepended. Defaults to `true` when there are
369
+ * multiple workspace folders and `false` otherwise.
370
+ * @return A path relative to the root or the input.
371
+ * @魁梧
372
+ */
373
+ export function asRelativePath(pathOrUri: string | Uri, includeWorkspaceFolder?: boolean): string;
374
+
375
+ /**
376
+ * This method replaces `deleteCount` [workspace folders](#workspace.workspaceFolders) starting at index `start`
377
+ * by an optional set of `workspaceFoldersToAdd` on the `vscode.workspace.workspaceFolders` array. This "splice"
378
+ * behavior can be used to add, remove and change workspace folders in a single operation.
379
+ *
380
+ * If the first workspace folder is added, removed or changed, the currently executing extensions (including the
381
+ * one that called this method) will be terminated and restarted so that the (deprecated) `rootPath` property is
382
+ * updated to point to the first workspace folder.
383
+ *
384
+ * Use the [`onDidChangeWorkspaceFolders()`](#onDidChangeWorkspaceFolders) event to get notified when the
385
+ * workspace folders have been updated.
386
+ *
387
+ * **Example:** adding a new workspace folder at the end of workspace folders
388
+ * ```typescript
389
+ * workspace.updateWorkspaceFolders(workspace.workspaceFolders ? workspace.workspaceFolders.length : 0, null, { uri: ...});
390
+ * ```
391
+ *
392
+ * **Example:** removing the first workspace folder
393
+ * ```typescript
394
+ * workspace.updateWorkspaceFolders(0, 1);
395
+ * ```
396
+ *
397
+ * **Example:** replacing an existing workspace folder with a new one
398
+ * ```typescript
399
+ * workspace.updateWorkspaceFolders(0, 1, { uri: ...});
400
+ * ```
401
+ *
402
+ * It is valid to remove an existing workspace folder and add it again with a different name
403
+ * to rename that folder.
404
+ *
405
+ * **Note:** it is not valid to call [updateWorkspaceFolders()](#updateWorkspaceFolders) multiple times
406
+ * without waiting for the [`onDidChangeWorkspaceFolders()`](#onDidChangeWorkspaceFolders) to fire.
407
+ *
408
+ * @param start the zero-based location in the list of currently opened [workspace folders](#WorkspaceFolder)
409
+ * from which to start deleting workspace folders.
410
+ * @param deleteCount the optional number of workspace folders to remove.
411
+ * @param workspaceFoldersToAdd the optional variable set of workspace folders to add in place of the deleted ones.
412
+ * Each workspace is identified with a mandatory URI and an optional name.
413
+ * @return true if the operation was successfully started and false otherwise if arguments were used that would result
414
+ * in invalid workspace folder state (e.g. 2 folders with the same URI).
415
+ * @魁梧
416
+ */
417
+ export function updateWorkspaceFolders(start: number, deleteCount: number | undefined | null, ...workspaceFoldersToAdd: { uri: Uri, name?: string }[]): boolean;
418
+
419
+ /**
420
+ * Save all dirty files.
421
+ *
422
+ * @param includeUntitled Also save files that have been created during this session.
423
+ * @return A thenable that resolves when the files have been saved.
424
+ */
425
+ export function saveAll(includeUntitled?: boolean): Thenable<boolean>;
426
+
427
+ /**
428
+ * An event that is emitted when files are being created.
429
+ *
430
+ * *Note 1:* This event is triggered by user gestures, like creating a file from the
431
+ * explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api. This event is *not* fired when
432
+ * files change on disk, e.g triggered by another application, or when using the
433
+ * [`workspace.fs`](#FileSystem)-api.
434
+ *
435
+ * *Note 2:* When this event is fired, edits to files that are are being created cannot be applied.
436
+ */
437
+ export const onWillCreateFiles: Event<FileWillCreateEvent>;
438
+
439
+ /**
440
+ * An event that is emitted when files have been created.
441
+ *
442
+ * *Note:* This event is triggered by user gestures, like creating a file from the
443
+ * explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
444
+ * files change on disk, e.g triggered by another application, or when using the
445
+ * [`workspace.fs`](#FileSystem)-api.
446
+ */
447
+ export const onDidCreateFiles: Event<FileCreateEvent>;
448
+
449
+ /**
450
+ * An event that is emitted when files are being deleted.
451
+ *
452
+ * *Note 1:* This event is triggered by user gestures, like deleting a file from the
453
+ * explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
454
+ * files change on disk, e.g triggered by another application, or when using the
455
+ * [`workspace.fs`](#FileSystem)-api.
456
+ *
457
+ * *Note 2:* When deleting a folder with children only one event is fired.
458
+ */
459
+ export const onWillDeleteFiles: Event<FileWillDeleteEvent>;
460
+
461
+ /**
462
+ * An event that is emitted when files have been deleted.
463
+ *
464
+ * *Note 1:* This event is triggered by user gestures, like deleting a file from the
465
+ * explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
466
+ * files change on disk, e.g triggered by another application, or when using the
467
+ * [`workspace.fs`](#FileSystem)-api.
468
+ *
469
+ * *Note 2:* When deleting a folder with children only one event is fired.
470
+ */
471
+ export const onDidDeleteFiles: Event<FileDeleteEvent>;
472
+
473
+ /**
474
+ * An event that is emitted when files are being renamed.
475
+ *
476
+ * *Note 1:* This event is triggered by user gestures, like renaming a file from the
477
+ * explorer, and from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
478
+ * files change on disk, e.g triggered by another application, or when using the
479
+ * [`workspace.fs`](#FileSystem)-api.
480
+ *
481
+ * *Note 2:* When renaming a folder with children only one event is fired.
482
+ */
483
+ export const onWillRenameFiles: Event<FileWillRenameEvent>;
484
+
485
+ /**
486
+ * An event that is emitted when files have been renamed.
487
+ *
488
+ * *Note 1:* This event is triggered by user gestures, like renaming a file from the
489
+ * explorer, and from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
490
+ * files change on disk, e.g triggered by another application, or when using the
491
+ * [`workspace.fs`](#FileSystem)-api.
492
+ *
493
+ * *Note 2:* When renaming a folder with children only one event is fired.
494
+ */
495
+ export const onDidRenameFiles: Event<FileRenameEvent>;
496
+
497
+ }
498
+
499
+ /**
500
+ * An event that is fired when files are going to be created.
501
+ *
502
+ * To make modifications to the workspace before the files are created,
503
+ * call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
504
+ * thenable that resolves to a [workspace edit](#WorkspaceEdit).
505
+ */
506
+ export interface FileWillCreateEvent {
507
+
508
+ /**
509
+ * The files that are going to be created.
510
+ */
511
+ readonly files: ReadonlyArray<Uri>;
512
+
513
+ /**
514
+ * Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
515
+ *
516
+ * *Note:* This function can only be called during event dispatch and not
517
+ * in an asynchronous manner:
518
+ *
519
+ * ```ts
520
+ * workspace.onWillCreateFiles(event => {
521
+ * // async, will *throw* an error
522
+ * setTimeout(() => event.waitUntil(promise));
523
+ *
524
+ * // sync, OK
525
+ * event.waitUntil(promise);
526
+ * })
527
+ * ```
528
+ *
529
+ * @param thenable A thenable that delays saving.
530
+ */
531
+ waitUntil(thenable: Thenable<WorkspaceEdit>): void;
532
+
533
+ /**
534
+ * Allows to pause the event until the provided thenable resolves.
535
+ *
536
+ * *Note:* This function can only be called during event dispatch.
537
+ *
538
+ * @param thenable A thenable that delays saving.
539
+ */
540
+ waitUntil(thenable: Thenable<any>): void;
541
+ }
542
+
543
+ /**
544
+ * An event that is fired after files are created.
545
+ */
546
+ export interface FileCreateEvent {
547
+
548
+ /**
549
+ * The files that got created.
550
+ */
551
+ readonly files: ReadonlyArray<Uri>;
552
+ }
553
+
554
+ /**
555
+ * An event that is fired when files are going to be deleted.
556
+ *
557
+ * To make modifications to the workspace before the files are deleted,
558
+ * call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
559
+ * thenable that resolves to a [workspace edit](#WorkspaceEdit).
560
+ */
561
+ export interface FileWillDeleteEvent {
562
+
563
+ /**
564
+ * The files that are going to be deleted.
565
+ */
566
+ readonly files: ReadonlyArray<Uri>;
567
+
568
+ /**
569
+ * Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
570
+ *
571
+ * *Note:* This function can only be called during event dispatch and not
572
+ * in an asynchronous manner:
573
+ *
574
+ * ```ts
575
+ * workspace.onWillCreateFiles(event => {
576
+ * // async, will *throw* an error
577
+ * setTimeout(() => event.waitUntil(promise));
578
+ *
579
+ * // sync, OK
580
+ * event.waitUntil(promise);
581
+ * })
582
+ * ```
583
+ *
584
+ * @param thenable A thenable that delays saving.
585
+ */
586
+ waitUntil(thenable: Thenable<WorkspaceEdit>): void;
587
+
588
+ /**
589
+ * Allows to pause the event until the provided thenable resolves.
590
+ *
591
+ * *Note:* This function can only be called during event dispatch.
592
+ *
593
+ * @param thenable A thenable that delays saving.
594
+ */
595
+ waitUntil(thenable: Thenable<any>): void;
596
+ }
597
+
598
+ /**
599
+ * An event that is fired after files are deleted.
600
+ */
601
+ export interface FileDeleteEvent {
602
+
603
+ /**
604
+ * The files that got deleted.
605
+ */
606
+ readonly files: ReadonlyArray<Uri>;
607
+ }
608
+
609
+ /**
610
+ * An event that is fired when files are going to be renamed.
611
+ *
612
+ * To make modifications to the workspace before the files are renamed,
613
+ * call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
614
+ * thenable that resolves to a [workspace edit](#WorkspaceEdit).
615
+ */
616
+ export interface FileWillRenameEvent {
617
+
618
+ /**
619
+ * The files that are going to be renamed.
620
+ */
621
+ readonly files: ReadonlyArray<{ oldUri: Uri, newUri: Uri }>;
622
+
623
+ /**
624
+ * Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
625
+ *
626
+ * *Note:* This function can only be called during event dispatch and not
627
+ * in an asynchronous manner:
628
+ *
629
+ * ```ts
630
+ * workspace.onWillCreateFiles(event => {
631
+ * // async, will *throw* an error
632
+ * setTimeout(() => event.waitUntil(promise));
633
+ *
634
+ * // sync, OK
635
+ * event.waitUntil(promise);
636
+ * })
637
+ * ```
638
+ *
639
+ * @param thenable A thenable that delays saving.
640
+ */
641
+ waitUntil(thenable: Thenable<WorkspaceEdit>): void;
642
+
643
+ /**
644
+ * Allows to pause the event until the provided thenable resolves.
645
+ *
646
+ * *Note:* This function can only be called during event dispatch.
647
+ *
648
+ * @param thenable A thenable that delays saving.
649
+ */
650
+ waitUntil(thenable: Thenable<any>): void;
651
+ }
652
+
653
+ /**
654
+ * An event that is fired after files are renamed.
655
+ */
656
+ export interface FileRenameEvent {
657
+
658
+ /**
659
+ * The files that got renamed.
660
+ */
661
+ readonly files: ReadonlyArray<{ oldUri: Uri, newUri: Uri }>;
662
+ }
663
+
664
+ }
@@ -0,0 +1,27 @@
1
+ /// <reference path="./../typings/vscode.editor.d.ts" />
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
7
+
8
+ declare module 'vscode' {
9
+
10
+ /**
11
+ * Defines a port mapping used for localhost inside the webview.
12
+ */
13
+ export interface WebviewPortMapping {
14
+ /**
15
+ * Localhost port to remap inside the webview.
16
+ */
17
+ readonly webviewPort: number;
18
+
19
+ /**
20
+ * Destination port. The `webviewPort` is resolved to this port.
21
+ */
22
+ readonly extensionHostPort: number;
23
+ }
24
+
25
+ //#endregion
26
+ }
27
+
@@ -0,0 +1,3 @@
1
+ declare module 'vscode' {
2
+
3
+ }