@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,86 @@
|
|
|
1
|
+
declare module 'sumi-worker' {
|
|
2
|
+
/**
|
|
3
|
+
* Represents a reference to a command. Provides a title which
|
|
4
|
+
* will be used to represent a command in the UI and, optionally,
|
|
5
|
+
* an array of arguments which will be passed to the command handler
|
|
6
|
+
* function when invoked.
|
|
7
|
+
*/
|
|
8
|
+
export interface Command {
|
|
9
|
+
/**
|
|
10
|
+
* Title of the command, like `save`.
|
|
11
|
+
*/
|
|
12
|
+
title: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The identifier of the actual command handler.
|
|
16
|
+
* @see [commands.registerCommand](#commands.registerCommand).
|
|
17
|
+
*/
|
|
18
|
+
command: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A tooltip for the command, when represented in the UI.
|
|
22
|
+
*/
|
|
23
|
+
tooltip?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Arguments that the command handler should be
|
|
27
|
+
* invoked with.
|
|
28
|
+
*/
|
|
29
|
+
arguments?: any[];
|
|
30
|
+
}
|
|
31
|
+
export namespace commands {
|
|
32
|
+
/**
|
|
33
|
+
* Registers a command that can be invoked via a keyboard shortcut,
|
|
34
|
+
* a menu item, an action, or directly.
|
|
35
|
+
*
|
|
36
|
+
* Registering a command with an existing command identifier twice
|
|
37
|
+
* will cause an error.
|
|
38
|
+
*
|
|
39
|
+
* @param command A unique identifier for the command.
|
|
40
|
+
* @param callback A command handler function.
|
|
41
|
+
* @param thisArg The `this` context used when invoking the handler function.
|
|
42
|
+
* @return Disposable which unregisters this command on disposal.
|
|
43
|
+
*/
|
|
44
|
+
export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Executes the command denoted by the given command identifier.
|
|
48
|
+
*
|
|
49
|
+
* * *Note 1:* When executing an editor command not all types are allowed to
|
|
50
|
+
* be passed as arguments. Allowed are the primitive types `string`, `boolean`,
|
|
51
|
+
* `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
|
|
52
|
+
* * *Note 2:* There are no restrictions when executing commands that have been contributed
|
|
53
|
+
* by extensions.
|
|
54
|
+
*
|
|
55
|
+
* @param command Identifier of the command to execute.
|
|
56
|
+
* @param rest Parameters passed to the command function.
|
|
57
|
+
* @return A thenable that resolves to the returned value of the given command. `undefined` when
|
|
58
|
+
* the command handler function doesn't return anything.
|
|
59
|
+
*/
|
|
60
|
+
export function executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Retrieve the list of all available commands. Commands starting an underscore are
|
|
64
|
+
* treated as internal commands.
|
|
65
|
+
*
|
|
66
|
+
* @param filterInternal Set `true` to not see internal commands (starting with an underscore)
|
|
67
|
+
* @return Thenable that resolves to a list of command ids.
|
|
68
|
+
*/
|
|
69
|
+
export function getCommands(filterInternal?: boolean): Thenable<string[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Registers a text editor command that can be invoked via a keyboard shortcut,
|
|
72
|
+
* a menu item, an action, or directly.
|
|
73
|
+
*
|
|
74
|
+
* Text editor commands are different from ordinary [commands](#commands.registerCommand) as
|
|
75
|
+
* they only execute when there is an active editor when the command is called. Also, the
|
|
76
|
+
* command handler of an editor command has access to the active editor and to an
|
|
77
|
+
* [edit](#TextEditorEdit)-builder.
|
|
78
|
+
*
|
|
79
|
+
* @param command A unique identifier for the command.
|
|
80
|
+
* @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit).
|
|
81
|
+
* @param thisArg The `this` context used when invoking the handler function.
|
|
82
|
+
* @return Disposable which unregisters this command on disposal.
|
|
83
|
+
*/
|
|
84
|
+
export function registerTextEditorCommand(command: string, callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void, thisArg?: any): Disposable;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
declare module 'sumi-worker' {
|
|
2
|
+
//#region Comments
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Collapsible state of a [comment thread](#CommentThread)
|
|
6
|
+
*/
|
|
7
|
+
export enum CommentThreadCollapsibleState {
|
|
8
|
+
/**
|
|
9
|
+
* Determines an item is collapsed
|
|
10
|
+
*/
|
|
11
|
+
Collapsed = 0,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Determines an item is expanded
|
|
15
|
+
*/
|
|
16
|
+
Expanded = 1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Comment mode of a [comment](#Comment)
|
|
21
|
+
*/
|
|
22
|
+
export enum CommentMode {
|
|
23
|
+
/**
|
|
24
|
+
* Displays the comment editor
|
|
25
|
+
*/
|
|
26
|
+
Editing = 0,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Displays the preview of the comment
|
|
30
|
+
*/
|
|
31
|
+
Preview = 1,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A collection of [comments](#Comment) representing a conversation at a particular range in a document.
|
|
36
|
+
*/
|
|
37
|
+
export interface CommentThread {
|
|
38
|
+
/**
|
|
39
|
+
* The uri of the document the thread has been created on.
|
|
40
|
+
*/
|
|
41
|
+
readonly uri: Uri;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The range the comment thread is located within the document. The thread icon will be shown
|
|
45
|
+
* at the first line of the range.
|
|
46
|
+
*/
|
|
47
|
+
range: Range;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The ordered comments of the thread.
|
|
51
|
+
*/
|
|
52
|
+
comments: ReadonlyArray<Comment>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Whether the thread should be collapsed or expanded when opening the document.
|
|
56
|
+
* Defaults to Collapsed.
|
|
57
|
+
*/
|
|
58
|
+
collapsibleState: CommentThreadCollapsibleState;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Whether the thread supports reply.
|
|
62
|
+
* Defaults to true.
|
|
63
|
+
*/
|
|
64
|
+
canReply: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Context value of the comment thread. This can be used to contribute thread specific actions.
|
|
68
|
+
* For example, a comment thread is given a context value as `editable`. When contributing actions to `comments/commentThread/title`
|
|
69
|
+
* using `menus` extension point, you can specify context value for key `commentThread` in `when` expression like `commentThread == editable`.
|
|
70
|
+
* ```
|
|
71
|
+
* "contributes": {
|
|
72
|
+
* "menus": {
|
|
73
|
+
* "comments/commentThread/title": [
|
|
74
|
+
* {
|
|
75
|
+
* "command": "extension.deleteCommentThread",
|
|
76
|
+
* "when": "commentThread == editable"
|
|
77
|
+
* }
|
|
78
|
+
* ]
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
* This will show action `extension.deleteCommentThread` only for comment threads with `contextValue` is `editable`.
|
|
83
|
+
*/
|
|
84
|
+
contextValue?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The optional human-readable label describing the [Comment Thread](#CommentThread)
|
|
88
|
+
*/
|
|
89
|
+
label?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Dispose this comment thread.
|
|
93
|
+
*
|
|
94
|
+
* Once disposed, this comment thread will be removed from visible editors and Comment Panel when approriate.
|
|
95
|
+
*/
|
|
96
|
+
dispose(): void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Author information of a [comment](#Comment)
|
|
101
|
+
*/
|
|
102
|
+
export interface CommentAuthorInformation {
|
|
103
|
+
/**
|
|
104
|
+
* The display name of the author of the comment
|
|
105
|
+
*/
|
|
106
|
+
name: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The optional icon path for the author
|
|
110
|
+
*/
|
|
111
|
+
iconPath?: Uri;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Reactions of a [comment](#Comment)
|
|
116
|
+
*/
|
|
117
|
+
export interface CommentReaction {
|
|
118
|
+
/**
|
|
119
|
+
* The human-readable label for the reaction
|
|
120
|
+
*/
|
|
121
|
+
readonly label: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Icon for the reaction shown in UI.
|
|
125
|
+
*/
|
|
126
|
+
readonly iconPath: string | Uri;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The number of users who have reacted to this reaction
|
|
130
|
+
*/
|
|
131
|
+
readonly count: number;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Whether the [author](CommentAuthorInformation) of the comment has reacted to this reaction
|
|
135
|
+
*/
|
|
136
|
+
readonly authorHasReacted: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A comment is displayed within the editor or the Comments Panel, depending on how it is provided.
|
|
141
|
+
*/
|
|
142
|
+
export interface Comment {
|
|
143
|
+
/**
|
|
144
|
+
* The human-readable comment body
|
|
145
|
+
*/
|
|
146
|
+
body: string | MarkdownString;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* [Comment mode](#CommentMode) of the comment
|
|
150
|
+
*/
|
|
151
|
+
mode: CommentMode;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The [author information](#CommentAuthorInformation) of the comment
|
|
155
|
+
*/
|
|
156
|
+
author: CommentAuthorInformation;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Context value of the comment. This can be used to contribute comment specific actions.
|
|
160
|
+
* For example, a comment is given a context value as `editable`. When contributing actions to `comments/comment/title`
|
|
161
|
+
* using `menus` extension point, you can specify context value for key `comment` in `when` expression like `comment == editable`.
|
|
162
|
+
* ```json
|
|
163
|
+
* "contributes": {
|
|
164
|
+
* "menus": {
|
|
165
|
+
* "comments/comment/title": [
|
|
166
|
+
* {
|
|
167
|
+
* "command": "extension.deleteComment",
|
|
168
|
+
* "when": "comment == editable"
|
|
169
|
+
* }
|
|
170
|
+
* ]
|
|
171
|
+
* }
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
* This will show action `extension.deleteComment` only for comments with `contextValue` is `editable`.
|
|
175
|
+
*/
|
|
176
|
+
contextValue?: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Optional reactions of the [comment](#Comment)
|
|
180
|
+
*/
|
|
181
|
+
// TODO: 还未实现
|
|
182
|
+
reactions?: CommentReaction[];
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Optional label describing the [Comment](#Comment)
|
|
186
|
+
* Label will be rendered next to authorName if exists.
|
|
187
|
+
*/
|
|
188
|
+
label?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Command argument for actions registered in `comments/commentThread/context`.
|
|
193
|
+
*/
|
|
194
|
+
export interface CommentReply {
|
|
195
|
+
/**
|
|
196
|
+
* The active [comment thread](#CommentThread)
|
|
197
|
+
*/
|
|
198
|
+
thread: CommentThread;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The value in the comment editor
|
|
202
|
+
*/
|
|
203
|
+
text: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Commenting range provider for a [comment controller](#CommentController).
|
|
208
|
+
*/
|
|
209
|
+
export interface CommentingRangeProvider {
|
|
210
|
+
/**
|
|
211
|
+
* Provide a list of ranges which allow new comment threads creation or null for a given document
|
|
212
|
+
*/
|
|
213
|
+
provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult<Range[]>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* A comment controller is able to provide [comments](#CommentThread) support to the editor and
|
|
218
|
+
* provide users various ways to interact with comments.
|
|
219
|
+
*/
|
|
220
|
+
export interface CommentController {
|
|
221
|
+
/**
|
|
222
|
+
* The id of this comment controller.
|
|
223
|
+
*/
|
|
224
|
+
readonly id: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The human-readable label of this comment controller.
|
|
228
|
+
*/
|
|
229
|
+
readonly label: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Optional commenting range provider. Provide a list [ranges](#Range) which support commenting to any given resource uri.
|
|
233
|
+
*
|
|
234
|
+
* If not provided, users can leave comments in any document opened in the editor.
|
|
235
|
+
*/
|
|
236
|
+
commentingRangeProvider?: CommentingRangeProvider;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Create a [comment thread](#CommentThread). The comment thread will be displayed in visible text editors (if the resource matches)
|
|
240
|
+
* and Comments Panel once created.
|
|
241
|
+
*
|
|
242
|
+
* @param uri The uri of the document the thread has been created on.
|
|
243
|
+
* @param range The range the comment thread is located within the document.
|
|
244
|
+
* @param comments The ordered comments of the thread.
|
|
245
|
+
*/
|
|
246
|
+
createCommentThread(uri: Uri, range: Range, comments: Comment[]): CommentThread;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Optional reaction handler for creating and deleting reactions on a [comment](#Comment).
|
|
250
|
+
*/
|
|
251
|
+
// TODO: 还未实现
|
|
252
|
+
reactionHandler?: (comment: Comment, reaction: CommentReaction) => Promise<void>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Dispose this comment controller.
|
|
256
|
+
*
|
|
257
|
+
* Once disposed, all [comment threads](#CommentThread) created by this comment controller will also be removed from the editor
|
|
258
|
+
* and Comments Panel.
|
|
259
|
+
*/
|
|
260
|
+
dispose(): void;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
namespace comments {
|
|
264
|
+
/**
|
|
265
|
+
* Creates a new [comment controller](#CommentController) instance.
|
|
266
|
+
*
|
|
267
|
+
* @param id An `id` for the comment controller.
|
|
268
|
+
* @param label A human-readable string for the comment controller.
|
|
269
|
+
* @return An instance of [comment controller](#CommentController).
|
|
270
|
+
*/
|
|
271
|
+
export function createCommentController(id: string, label: string): CommentController;
|
|
272
|
+
}
|
|
273
|
+
}
|