cdeops 12.0.1-alpha.21 → 12.0.3-alpha.80
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/client.d.ts +176 -10
- package/package.json +2 -2
- package/src/cdeops.d.ts +1209 -1235
- package/src/cdeops.proposed.d.ts +1 -4
- package/src/subscription.d.ts +20 -25
package/src/cdeops.d.ts
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
+
/* eslint-disable no-irregular-whitespace */
|
|
2
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
3
|
+
/* eslint-disable no-use-before-define */
|
|
4
|
+
/* eslint-disable import/no-mutable-exports */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
7
|
+
/* eslint-disable max-classes-per-file */
|
|
1
8
|
/// <reference path="./subscription.d.ts"/>
|
|
2
9
|
|
|
3
|
-
import { Subscribable } from
|
|
4
|
-
|
|
10
|
+
import { Subscribable } from 'cdeops';
|
|
5
11
|
|
|
6
12
|
declare module 'cdeops' {
|
|
13
|
+
/**
|
|
14
|
+
* A universal resource identifier representing either a file on disk
|
|
15
|
+
* or another resource, like untitled resources.
|
|
16
|
+
*/
|
|
17
|
+
export class Uri {
|
|
18
|
+
/**
|
|
19
|
+
* Create an URI from a string, e.g. `http://www.msft.com/some/path`,
|
|
20
|
+
* `file:///usr/home`, or `scheme:with/path`.
|
|
21
|
+
*
|
|
22
|
+
* @see [Uri.toString](#Uri.toString)
|
|
23
|
+
* @param value The string value of an Uri.
|
|
24
|
+
* @return A new Uri instance.
|
|
25
|
+
*/
|
|
26
|
+
static parse(value: string): Uri;
|
|
7
27
|
|
|
8
|
-
|
|
9
|
-
* A universal resource identifier representing either a file on disk
|
|
10
|
-
* or another resource, like untitled resources.
|
|
11
|
-
*/
|
|
12
|
-
export class Uri {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create an URI from a string, e.g. `http://www.msft.com/some/path`,
|
|
16
|
-
* `file:///usr/home`, or `scheme:with/path`.
|
|
17
|
-
*
|
|
18
|
-
* @see [Uri.toString](#Uri.toString)
|
|
19
|
-
* @param value The string value of an Uri.
|
|
20
|
-
* @return A new Uri instance.
|
|
21
|
-
*/
|
|
22
|
-
static parse(value: string): Uri;
|
|
23
|
-
|
|
24
|
-
/**
|
|
28
|
+
/**
|
|
25
29
|
* Create an URI from a file system path. The [scheme](#Uri.scheme)
|
|
26
30
|
* will be `file`.
|
|
27
31
|
*
|
|
@@ -43,41 +47,41 @@ declare module 'cdeops' {
|
|
|
43
47
|
* @param path A file system or UNC path.
|
|
44
48
|
* @return A new Uri instance.
|
|
45
49
|
*/
|
|
46
|
-
|
|
50
|
+
static file(path: string): Uri;
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Use the `file` and `parse` factory functions to create new `Uri` objects.
|
|
54
|
+
*/
|
|
55
|
+
private constructor(scheme: string, authority: string, path: string, query: string, fragment: string);
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Scheme is the `http` part of `http://www.msft.com/some/path?query#fragment`.
|
|
59
|
+
* The part before the first colon.
|
|
60
|
+
*/
|
|
61
|
+
readonly scheme: string;
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Authority is the `www.msft.com` part of `http://www.msft.com/some/path?query#fragment`.
|
|
65
|
+
* The part between the first double slashes and the next slash.
|
|
66
|
+
*/
|
|
67
|
+
readonly authority: string;
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Path is the `/some/path` part of `http://www.msft.com/some/path?query#fragment`.
|
|
71
|
+
*/
|
|
72
|
+
readonly path: string;
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Query is the `query` part of `http://www.msft.com/some/path?query#fragment`.
|
|
76
|
+
*/
|
|
77
|
+
readonly query: string;
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Fragment is the `fragment` part of `http://www.msft.com/some/path?query#fragment`.
|
|
81
|
+
*/
|
|
82
|
+
readonly fragment: string;
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
/**
|
|
81
85
|
* The string representing the corresponding file system path of this Uri.
|
|
82
86
|
*
|
|
83
87
|
* Will handle UNC paths and normalize windows drive letters to lower-case. Also
|
|
@@ -97,1058 +101,1033 @@ declare module 'cdeops' {
|
|
|
97
101
|
u.fsPath === '\\server\c$\folder\file.txt'
|
|
98
102
|
```
|
|
99
103
|
*/
|
|
100
|
-
|
|
104
|
+
readonly fsPath: string;
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Derive a new Uri from this Uri.
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* let file = Uri.parse('before:some/file/path');
|
|
111
|
+
* let other = file.with({ scheme: 'after' });
|
|
112
|
+
* assert.ok(other.toString() === 'after:some/file/path');
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param change An object that describes a change to this Uri. To unset components use `null` or
|
|
116
|
+
* the empty string.
|
|
117
|
+
* @return A new Uri that reflects the given change. Will return `this` Uri if the change
|
|
118
|
+
* is not changing anything.
|
|
119
|
+
*/
|
|
120
|
+
with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): Uri;
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Returns a string representation of this Uri. The representation and normalization
|
|
124
|
+
* of a URI depends on the scheme.
|
|
125
|
+
*
|
|
126
|
+
* * The resulting string can be safely used with [Uri.parse](#Uri.parse).
|
|
127
|
+
* * The resulting string shall *not* be used for display purposes.
|
|
128
|
+
*
|
|
129
|
+
* *Note* that the implementation will encode _aggressive_ which often leads to unexpected,
|
|
130
|
+
* but not incorrect, results. For instance, colons are encoded to `%3A` which might be unexpected
|
|
131
|
+
* in file-uri. Also `&` and `=` will be encoded which might be unexpected for http-uris. For stability
|
|
132
|
+
* reasons this cannot be changed anymore. If you suffer from too aggressive encoding you should use
|
|
133
|
+
* the `skipEncoding`-argument: `uri.toString(true)`.
|
|
134
|
+
*
|
|
135
|
+
* @param skipEncoding Do not percentage-encode the result, defaults to `false`. Note that
|
|
136
|
+
* the `#` and `?` characters occurring in the path will always be encoded.
|
|
137
|
+
* @returns A string representation of this Uri.
|
|
138
|
+
*/
|
|
139
|
+
toString(skipEncoding?: boolean): string;
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Returns a JSON representation of this Uri.
|
|
143
|
+
*
|
|
144
|
+
* @return An object.
|
|
145
|
+
*/
|
|
146
|
+
toJSON(): any;
|
|
147
|
+
}
|
|
144
148
|
|
|
149
|
+
/**
|
|
150
|
+
* A relative pattern is a helper to construct glob patterns that are matched
|
|
151
|
+
* relatively to a base path. The base path can either be an absolute file path
|
|
152
|
+
* or a [workspace folder](#OrganizationResource).
|
|
153
|
+
*/
|
|
154
|
+
export class RelativePattern {
|
|
155
|
+
/**
|
|
156
|
+
* A base file path to which this pattern will be matched against relatively.
|
|
157
|
+
*/
|
|
158
|
+
base: string;
|
|
145
159
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
/**
|
|
161
|
+
* A file glob pattern like `*.{ts,js}` that will be matched on file paths
|
|
162
|
+
* relative to the base path.
|
|
163
|
+
*
|
|
164
|
+
* Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,
|
|
165
|
+
* the file glob pattern will match on `index.js`.
|
|
166
|
+
*/
|
|
167
|
+
pattern: string;
|
|
152
168
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Creates a new relative pattern object with a base path and pattern to match. This pattern
|
|
171
|
+
* will be matched on file paths relative to the base path.
|
|
172
|
+
*
|
|
173
|
+
* @param base A base file path to which this pattern will be matched against relatively.
|
|
174
|
+
* @param pattern A file glob pattern like `*.{ts,js}` that will be matched on file paths
|
|
175
|
+
* relative to the base path.
|
|
176
|
+
*/
|
|
177
|
+
constructor(base: OrganizationResource | string, pattern: string);
|
|
178
|
+
}
|
|
157
179
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
180
|
+
/**
|
|
181
|
+
* A file glob pattern to match file paths against. This can either be a glob pattern string
|
|
182
|
+
* (like `**/*.{ts,js}` or `*.{ts,js}`) or a [relative pattern](#RelativePattern).
|
|
183
|
+
*
|
|
184
|
+
* Glob patterns can have the following syntax:
|
|
185
|
+
* * `*` to match one or more characters in a path segment
|
|
186
|
+
* * `?` to match on one character in a path segment
|
|
187
|
+
* * `**` to match any number of path segments, including none
|
|
188
|
+
* * `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
|
|
189
|
+
* * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
|
|
190
|
+
* * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
|
|
191
|
+
*/
|
|
192
|
+
export type GlobPattern = string | RelativePattern;
|
|
166
193
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
* Glob patterns can have the following syntax:
|
|
183
|
-
* * `*` to match one or more characters in a path segment
|
|
184
|
-
* * `?` to match on one character in a path segment
|
|
185
|
-
* * `**` to match any number of path segments, including none
|
|
186
|
-
* * `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
|
|
187
|
-
* * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
|
|
188
|
-
* * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
|
|
189
|
-
*/
|
|
190
|
-
export type GlobPattern = string | RelativePattern;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Represents a type which can release resources, such
|
|
195
|
-
* as event listening or a timer.
|
|
196
|
-
*/
|
|
197
|
-
export class Disposable {
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Combine many disposable-likes into one. Use this method
|
|
201
|
-
* when having objects with a dispose function which are not
|
|
202
|
-
* instances of Disposable.
|
|
203
|
-
*
|
|
204
|
-
* @param disposableLikes Objects that have at least a `dispose`-function member.
|
|
205
|
-
* @return Returns a new disposable which, upon dispose, will
|
|
206
|
-
* dispose all provided disposables.
|
|
207
|
-
*/
|
|
208
|
-
static from(...disposableLikes: { dispose: () => any }[]): Disposable;
|
|
194
|
+
/**
|
|
195
|
+
* Represents a type which can release resources, such
|
|
196
|
+
* as event listening or a timer.
|
|
197
|
+
*/
|
|
198
|
+
export class Disposable {
|
|
199
|
+
/**
|
|
200
|
+
* Combine many disposable-likes into one. Use this method
|
|
201
|
+
* when having objects with a dispose function which are not
|
|
202
|
+
* instances of Disposable.
|
|
203
|
+
*
|
|
204
|
+
* @param disposableLikes Objects that have at least a `dispose`-function member.
|
|
205
|
+
* @return Returns a new disposable which, upon dispose, will
|
|
206
|
+
* dispose all provided disposables.
|
|
207
|
+
*/
|
|
208
|
+
static from(...disposableLikes: { dispose: () => any }[]): Disposable;
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
/**
|
|
211
|
+
* Creates a new Disposable calling the provided function
|
|
212
|
+
* on dispose.
|
|
213
|
+
* @param callOnDispose Function that disposes something.
|
|
214
|
+
*/
|
|
215
|
+
constructor(callOnDispose: Function);
|
|
216
216
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Represents a typed event.
|
|
226
|
-
*
|
|
227
|
-
* A function that represents an event to which you subscribe by calling it with
|
|
228
|
-
* a listener function as argument.
|
|
229
|
-
*
|
|
230
|
-
* @sample `item.onDidChange(function(event) { console.log("Event happened: " + event); });`
|
|
231
|
-
*/
|
|
232
|
-
export interface Event<T> {
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* A function that represents an event to which you subscribe by calling it with
|
|
236
|
-
* a listener function as argument.
|
|
237
|
-
*
|
|
238
|
-
* @param listener The listener function will be called when the event happens.
|
|
239
|
-
* @param thisArgs The `this`-argument which will be used when calling the event listener.
|
|
240
|
-
* @param disposables An array to which a [disposable](#Disposable) will be added.
|
|
241
|
-
* @return A disposable which unsubscribes the event listener.
|
|
242
|
-
*/
|
|
243
|
-
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* An event emitter can be used to create and manage an [event](#Event) for others
|
|
248
|
-
* to subscribe to. One emitter always owns one event.
|
|
249
|
-
*
|
|
250
|
-
* Use this class if you want to provide event from within your extension, for instance
|
|
251
|
-
* inside a [TextDocumentContentProvider](#TextDocumentContentProvider) or when providing
|
|
252
|
-
* API to other extensions.
|
|
253
|
-
*/
|
|
254
|
-
export class EventEmitter<T> {
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* The event listeners can subscribe to.
|
|
258
|
-
*/
|
|
259
|
-
event: Event<T>;
|
|
217
|
+
/**
|
|
218
|
+
* Dispose this object.
|
|
219
|
+
*/
|
|
220
|
+
dispose(): any;
|
|
221
|
+
}
|
|
260
222
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Represents a typed event.
|
|
225
|
+
*
|
|
226
|
+
* A function that represents an event to which you subscribe by calling it with
|
|
227
|
+
* a listener function as argument.
|
|
228
|
+
*
|
|
229
|
+
* @sample `item.onDidChange(function(event) { console.log("Event happened: " + event); });`
|
|
230
|
+
*/
|
|
231
|
+
export interface Event<T> {
|
|
232
|
+
/**
|
|
233
|
+
* A function that represents an event to which you subscribe by calling it with
|
|
234
|
+
* a listener function as argument.
|
|
235
|
+
*
|
|
236
|
+
* @param listener The listener function will be called when the event happens.
|
|
237
|
+
* @param thisArgs The `this`-argument which will be used when calling the event listener.
|
|
238
|
+
* @param disposables An array to which a [disposable](#Disposable) will be added.
|
|
239
|
+
* @return A disposable which unsubscribes the event listener.
|
|
240
|
+
*/
|
|
241
|
+
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
|
|
242
|
+
}
|
|
268
243
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
*/
|
|
283
|
-
export interface CancellationToken {
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Is `true` when the token has been cancelled, `false` otherwise.
|
|
287
|
-
*/
|
|
288
|
-
isCancellationRequested: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* An event emitter can be used to create and manage an [event](#Event) for others
|
|
246
|
+
* to subscribe to. One emitter always owns one event.
|
|
247
|
+
*
|
|
248
|
+
* Use this class if you want to provide event from within your extension, for instance
|
|
249
|
+
* inside a [TextDocumentContentProvider](#TextDocumentContentProvider) or when providing
|
|
250
|
+
* API to other extensions.
|
|
251
|
+
*/
|
|
252
|
+
export class EventEmitter<T> {
|
|
253
|
+
/**
|
|
254
|
+
* The event listeners can subscribe to.
|
|
255
|
+
*/
|
|
256
|
+
event: Event<T>;
|
|
289
257
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
258
|
+
/**
|
|
259
|
+
* Notify all subscribers of the [event](#EventEmitter.event). Failure
|
|
260
|
+
* of one or more listener will not fail this function call.
|
|
261
|
+
*
|
|
262
|
+
* @param data The event object.
|
|
263
|
+
*/
|
|
264
|
+
fire(data?: T): void;
|
|
295
265
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
266
|
+
/**
|
|
267
|
+
* Dispose this object and free resources.
|
|
268
|
+
*/
|
|
269
|
+
dispose(): void;
|
|
270
|
+
}
|
|
300
271
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
272
|
+
/**
|
|
273
|
+
* A cancellation token is passed to an asynchronous or long running
|
|
274
|
+
* operation to request cancellation, like cancelling a request
|
|
275
|
+
* for completion items because the user continued to type.
|
|
276
|
+
*
|
|
277
|
+
* To get an instance of a `CancellationToken` use a
|
|
278
|
+
* [CancellationTokenSource](#CancellationTokenSource).
|
|
279
|
+
*/
|
|
280
|
+
export interface CancellationToken {
|
|
281
|
+
/**
|
|
282
|
+
* Is `true` when the token has been cancelled, `false` otherwise.
|
|
283
|
+
*/
|
|
284
|
+
isCancellationRequested: boolean;
|
|
305
285
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
286
|
+
/**
|
|
287
|
+
* An [event](#Event) which fires upon cancellation.
|
|
288
|
+
*/
|
|
289
|
+
onCancellationRequested: Event<any>;
|
|
290
|
+
}
|
|
310
291
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
292
|
+
/**
|
|
293
|
+
* A cancellation source creates and controls a [cancellation token](#CancellationToken).
|
|
294
|
+
*/
|
|
295
|
+
export class CancellationTokenSource {
|
|
296
|
+
/**
|
|
297
|
+
* The cancellation token of this source.
|
|
298
|
+
*/
|
|
299
|
+
token: CancellationToken;
|
|
316
300
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
uniqueName: string;
|
|
322
|
-
url: string;
|
|
323
|
-
}
|
|
301
|
+
/**
|
|
302
|
+
* Signal cancellation on the token.
|
|
303
|
+
*/
|
|
304
|
+
cancel(): void;
|
|
324
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Dispose object and free resources.
|
|
308
|
+
*/
|
|
309
|
+
dispose(): void;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface Member {
|
|
313
|
+
displayName: string;
|
|
314
|
+
id: string;
|
|
315
|
+
imageUrl: string;
|
|
316
|
+
uniqueName: string;
|
|
317
|
+
url: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface DateRange {
|
|
321
|
+
/**
|
|
322
|
+
* End of the date range.
|
|
323
|
+
*/
|
|
324
|
+
end: Date;
|
|
325
|
+
/**
|
|
326
|
+
* Start of the date range.
|
|
327
|
+
*/
|
|
328
|
+
start: Date;
|
|
329
|
+
}
|
|
325
330
|
|
|
331
|
+
/**
|
|
332
|
+
* The severity level of a log message
|
|
333
|
+
*/
|
|
334
|
+
export enum LogLevel {
|
|
335
|
+
Trace = 1,
|
|
336
|
+
Debug = 2,
|
|
337
|
+
Info = 3,
|
|
338
|
+
Warning = 4,
|
|
339
|
+
Error = 5,
|
|
340
|
+
Critical = 6,
|
|
341
|
+
Off = 7,
|
|
342
|
+
}
|
|
326
343
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
start: Date;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* The severity level of a log message
|
|
340
|
-
*/
|
|
341
|
-
export enum LogLevel {
|
|
342
|
-
Trace = 1,
|
|
343
|
-
Debug = 2,
|
|
344
|
-
Info = 3,
|
|
345
|
-
Warning = 4,
|
|
346
|
-
Error = 5,
|
|
347
|
-
Critical = 6,
|
|
348
|
-
Off = 7
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* An event describing a change to the set of [orgnaization resources](#orgnaization.workspaceResources).
|
|
353
|
-
*/
|
|
354
|
-
export interface OrganizationResourcesChangeEvent {
|
|
355
|
-
/**
|
|
356
|
-
* Added orgnaization resources.
|
|
357
|
-
*/
|
|
358
|
-
readonly added: OrganizationResource[];
|
|
344
|
+
/**
|
|
345
|
+
* An event describing a change to the set of [orgnaization resources](#orgnaization.workspaceResources).
|
|
346
|
+
*/
|
|
347
|
+
export interface OrganizationResourcesChangeEvent {
|
|
348
|
+
/**
|
|
349
|
+
* Added orgnaization resources.
|
|
350
|
+
*/
|
|
351
|
+
readonly added: OrganizationResource[];
|
|
359
352
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Removed orgnaization resources.
|
|
355
|
+
*/
|
|
356
|
+
readonly removed: OrganizationResource[];
|
|
357
|
+
}
|
|
365
358
|
|
|
359
|
+
/**
|
|
360
|
+
* Represents a worksapce, such as a source file. Workspace have
|
|
361
|
+
* [projects](#Project) and knowledge about an underlying resource like a file.
|
|
362
|
+
*/
|
|
363
|
+
export interface Workspace {
|
|
364
|
+
/**
|
|
365
|
+
* The associated uri for this document.
|
|
366
|
+
*
|
|
367
|
+
* *Note* that most documents use the `file`-scheme, which means they are files on disk. However, **not** all documents are
|
|
368
|
+
* saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.
|
|
369
|
+
*
|
|
370
|
+
* @see [FileSystemProvider](#FileSystemProvider)
|
|
371
|
+
* @see [TextDocumentContentProvider](#TextDocumentContentProvider)
|
|
372
|
+
*/
|
|
373
|
+
readonly uri?: Uri;
|
|
366
374
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
export interface Workspace {
|
|
375
|
+
/**
|
|
376
|
+
* The name of orgnaization
|
|
377
|
+
*/
|
|
378
|
+
readonly name?: string;
|
|
372
379
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
*
|
|
379
|
-
* @see [FileSystemProvider](#FileSystemProvider)
|
|
380
|
-
* @see [TextDocumentContentProvider](#TextDocumentContentProvider)
|
|
381
|
-
*/
|
|
382
|
-
readonly uri?: Uri;
|
|
380
|
+
/**
|
|
381
|
+
* The version number of this document (it will strictly increase after each
|
|
382
|
+
* change, including undo/redo).
|
|
383
|
+
*/
|
|
384
|
+
readonly version?: number;
|
|
383
385
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
/**
|
|
387
|
+
* `true` if the orgnaization have been closed. A closed orgnaization isn't synchronized anymore
|
|
388
|
+
* and won't be re-used when the same resource is opened again.
|
|
389
|
+
*/
|
|
390
|
+
readonly isClosed?: boolean;
|
|
388
391
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
/**
|
|
393
|
+
* Save the underlying changes.
|
|
394
|
+
*
|
|
395
|
+
* @return A promise that will resolve to true when the configuration
|
|
396
|
+
* has been saved. If the file was not dirty or the save failed,
|
|
397
|
+
* will return false.
|
|
398
|
+
*/
|
|
399
|
+
save?(): Promise<boolean>;
|
|
400
|
+
}
|
|
394
401
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
* of the resource that has been opened. There is no organization when just a file but not a
|
|
415
|
-
* resource has been opened.
|
|
416
|
-
*
|
|
417
|
-
* The organiation offers support for [listening](#orgnaization.createFileSystemWatcher) to fs
|
|
418
|
-
* events and for [finding](#orgnaization.findFiles) files. Both perform well and run _outside_
|
|
419
|
-
* the editor-process so that they should be always used instead of nodejs-equivalents.
|
|
420
|
-
*/
|
|
421
|
-
export namespace organization {
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* ~~The resource that is open in the editor. `undefined` when no resource
|
|
425
|
-
* has been opened.~~
|
|
426
|
-
*
|
|
427
|
-
* @deprecated Use [`organizationResource`](#organization.organizationResource) instead.
|
|
428
|
-
*
|
|
429
|
-
* @readonly
|
|
430
|
-
*/
|
|
431
|
-
export let rootPath: string | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* Namespace for dealing with the current organization. A organization is the representation
|
|
404
|
+
* of the resource that has been opened. There is no organization when just a file but not a
|
|
405
|
+
* resource has been opened.
|
|
406
|
+
*
|
|
407
|
+
* The organiation offers support for [listening](#orgnaization.createFileSystemWatcher) to fs
|
|
408
|
+
* events and for [finding](#orgnaization.findFiles) files. Both perform well and run _outside_
|
|
409
|
+
* the editor-process so that they should be always used instead of nodejs-equivalents.
|
|
410
|
+
*/
|
|
411
|
+
export namespace organization {
|
|
412
|
+
/**
|
|
413
|
+
* ~~The resource that is open in the editor. `undefined` when no resource
|
|
414
|
+
* has been opened.~~
|
|
415
|
+
*
|
|
416
|
+
* @deprecated Use [`organizationResource`](#organization.organizationResource) instead.
|
|
417
|
+
*
|
|
418
|
+
* @readonly
|
|
419
|
+
*/
|
|
420
|
+
export let rootPath: string | undefined;
|
|
432
421
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
422
|
+
/**
|
|
423
|
+
* List of organization resources or `undefined` when no resource is open.
|
|
424
|
+
* *Note* that the first entry corresponds to the value of `rootPath`.
|
|
425
|
+
*
|
|
426
|
+
* @readonly
|
|
427
|
+
*/
|
|
428
|
+
export let organizationResources: OrganizationResource[] | undefined;
|
|
440
429
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
430
|
+
/**
|
|
431
|
+
* The name of the orgnaization. `undefined` when no resource
|
|
432
|
+
* has been opened.
|
|
433
|
+
*
|
|
434
|
+
* @readonly
|
|
435
|
+
*/
|
|
436
|
+
export let name: string | undefined;
|
|
448
437
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
438
|
+
/**
|
|
439
|
+
* An event that is emitted when a orgnaization resource is added or removed.
|
|
440
|
+
*/
|
|
441
|
+
export const onDidChangeOrganizationResources: Event<OrganizationResourcesChangeEvent>;
|
|
453
442
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
443
|
+
/**
|
|
444
|
+
* Returns the [orgnaization resource](#OrganizationResource) that contains a given uri.
|
|
445
|
+
* * returns `undefined` when the given uri doesn't match any orgnaization resource
|
|
446
|
+
* * returns the *input* when the given uri is a orgnaization resource itself
|
|
447
|
+
*
|
|
448
|
+
* @param uri An uri.
|
|
449
|
+
* @return A orgnaization resource or `undefined`
|
|
450
|
+
*/
|
|
451
|
+
export function getOrganizationResource(uri: Uri): OrganizationResource | undefined;
|
|
463
452
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
453
|
+
/**
|
|
454
|
+
* This method replaces `deleteCount` [orgnaization resource](#orgnaization.workspaceResources) starting at index `start`
|
|
455
|
+
* by an optional set of `workspaceResourcesToAdd` on the `vscode.orgnaization.workspaceResources` array. This "splice"
|
|
456
|
+
* behavior can be used to add, remove and change orgnaization resources in a single operation.
|
|
457
|
+
*
|
|
458
|
+
* If the first orgnaization resource is added, removed or changed, the currently executing extensions (including the
|
|
459
|
+
* one that called this method) will be terminated and restarted so that the (deprecated) `rootPath` property is
|
|
460
|
+
* updated to point to the first orgnaization resource.
|
|
461
|
+
*
|
|
462
|
+
* Use the [`onDidChangeOrganizationResources()`](#onDidChangeOrganizationResources) event to get notified when the
|
|
463
|
+
* orgnaization resources have been updated.
|
|
464
|
+
*
|
|
465
|
+
* **Example:** adding a new orgnaization resource at the end of orgnaization resources
|
|
466
|
+
* ```typescript
|
|
467
|
+
* orgnaization.updateOrganizationResources(orgnaization.workspaceResources ? orgnaization.workspaceResources.length : 0, null, { uri: ...});
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
* **Example:** removing the first orgnaization resource
|
|
471
|
+
* ```typescript
|
|
472
|
+
* orgnaization.updateOrganizationResources(0, 1);
|
|
473
|
+
* ```
|
|
474
|
+
*
|
|
475
|
+
* **Example:** replacing an existing orgnaization resource with a new one
|
|
476
|
+
* ```typescript
|
|
477
|
+
* orgnaization.updateOrganizationResources(0, 1, { uri: ...});
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* It is valid to remove an existing orgnaization resource and add it again with a different name
|
|
481
|
+
* to rename that resource.
|
|
482
|
+
*
|
|
483
|
+
* **Note:** it is not valid to call [updateOrganizationResources()](#updateOrganizationResources) multiple times
|
|
484
|
+
* without waiting for the [`onDidChangeOrganizationResources()`](#onDidChangeOrganizationResources) to fire.
|
|
485
|
+
*
|
|
486
|
+
* @param start the zero-based location in the list of currently opened [orgnaization resources](#OrganizationResource)
|
|
487
|
+
* from which to start deleting orgnaization resources.
|
|
488
|
+
* @param deleteCount the optional number of orgnaization resources to remove.
|
|
489
|
+
* @param workspaceResourcesToAdd the optional variable set of orgnaization resources to add in place of the deleted ones.
|
|
490
|
+
* Each orgnaization is identified with a mandatory URI and an optional name.
|
|
491
|
+
* @return true if the operation was successfully started and false otherwise if arguments were used that would result
|
|
492
|
+
* in invalid orgnaization resource state (e.g. 2 resources with the same URI).
|
|
493
|
+
*/
|
|
494
|
+
export function updateOrganizationResources(
|
|
495
|
+
start: number,
|
|
496
|
+
deleteCount: number | undefined | null,
|
|
497
|
+
...workspaceResourcesToAdd: { uri: Uri; name?: string }[]
|
|
498
|
+
): boolean;
|
|
499
|
+
|
|
500
|
+
// /**
|
|
501
|
+
// * Register a repository provider.
|
|
502
|
+
// *
|
|
503
|
+
// * Only one provider can be registered per scheme.
|
|
504
|
+
// *
|
|
505
|
+
// * @param scheme The uri-scheme to register for.
|
|
506
|
+
// * @param provider A content provider.
|
|
507
|
+
// * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
508
|
+
// */
|
|
509
|
+
// export function registerRepositoryProvider(scheme: string, provider: TextDocumentContentProvider): Disposable;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Get a orgnaization configuration object.
|
|
513
|
+
*
|
|
514
|
+
* When a section-identifier is provided only that part of the configuration
|
|
515
|
+
* is returned. Dots in the section-identifier are interpreted as child-access,
|
|
516
|
+
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
|
|
517
|
+
*
|
|
518
|
+
* When a resource is provided, configuration scoped to that resource is returned.
|
|
519
|
+
*
|
|
520
|
+
* @param section A dot-separated identifier.
|
|
521
|
+
* @param resource A resource for which the configuration is asked for
|
|
522
|
+
* @return The full configuration or a subset.
|
|
523
|
+
*/
|
|
524
|
+
export function getConfiguration(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* An event that is emitted when the [configuration](#OrganizationConfiguration) changed.
|
|
528
|
+
*/
|
|
529
|
+
export const onDidChangeConfiguration: Subscribable<ConfigurationChangeEvent>;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Get a orgnaization configuration object.
|
|
533
|
+
*
|
|
534
|
+
* When a section-identifier is provided only that part of the configuration
|
|
535
|
+
* is returned. Dots in the section-identifier are interpreted as child-access,
|
|
536
|
+
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
|
|
537
|
+
*
|
|
538
|
+
* When a resource is provided, configuration scoped to that resource is returned.
|
|
539
|
+
*
|
|
540
|
+
* @param section A dot-separated identifier.
|
|
541
|
+
* @param resource A resource for which the configuration is asked for
|
|
542
|
+
* @return The full configuration or a subset.
|
|
543
|
+
*/
|
|
544
|
+
export function getConfigurationRole(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* An event that is emitted when the [configuration](#OrganizationConfiguration) changed.
|
|
548
|
+
*/
|
|
549
|
+
export const onDidChangeConfigurationRole: Event<ConfigurationChangeEvent>;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Get a orgnaization configuration object.
|
|
553
|
+
*
|
|
554
|
+
* When a section-identifier is provided only that part of the configuration
|
|
555
|
+
* is returned. Dots in the section-identifier are interpreted as child-access,
|
|
556
|
+
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
|
|
557
|
+
*
|
|
558
|
+
* When a resource is provided, configuration scoped to that resource is returned.
|
|
559
|
+
*
|
|
560
|
+
* @param section A dot-separated identifier.
|
|
561
|
+
* @param resource A resource for which the configuration is asked for
|
|
562
|
+
* @return The full configuration or a subset.
|
|
563
|
+
*/
|
|
564
|
+
export function getConfigurationPolicy(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* An event that is emitted when the [configuration](#OrganizationConfiguration) changed.
|
|
568
|
+
*/
|
|
569
|
+
export const onDidChangeConfigurationPolicy: Event<ConfigurationChangeEvent>;
|
|
570
|
+
// /**
|
|
571
|
+
// * ~~Register a task provider.~~
|
|
572
|
+
// *
|
|
573
|
+
// * @deprecated Use the corresponding function on the `tasks` namespace instead
|
|
574
|
+
// *
|
|
575
|
+
// * @param type The task kind type this provider is registered for.
|
|
576
|
+
// * @param provider A task provider.
|
|
577
|
+
// * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
578
|
+
// */
|
|
579
|
+
// export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Register a filesystem provider for a given scheme, e.g. `ftp`.
|
|
583
|
+
*
|
|
584
|
+
* There can only be one provider per scheme and an error is being thrown when a scheme
|
|
585
|
+
* has been claimed by another provider or when it is reserved.
|
|
586
|
+
*
|
|
587
|
+
* @param scheme The uri-[scheme](#Uri.scheme) the provider registers for.
|
|
588
|
+
* @param provider The filesystem provider.
|
|
589
|
+
* @param options Immutable metadata about the provider.
|
|
590
|
+
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
591
|
+
*/
|
|
592
|
+
// export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean }): Disposable;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* The configuration scope which can be a
|
|
597
|
+
* a `resource`
|
|
598
|
+
*/
|
|
599
|
+
export type ConfigurationScope = Uri | OrganizationResource | { uri?: Uri; machineId: string };
|
|
600
|
+
/**
|
|
601
|
+
* An event describing the change in Configuration
|
|
602
|
+
*/
|
|
603
|
+
export interface ConfigurationChangeEvent {
|
|
604
|
+
/**
|
|
605
|
+
* Returns `true` if the given section for the given resource (if provided) is affected.
|
|
606
|
+
*
|
|
607
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
608
|
+
* @param resoruce A resource Uri.
|
|
609
|
+
* @return `true` if the given section for the given resource (if provided) is affected.
|
|
610
|
+
*/
|
|
611
|
+
affectsConfiguration(section: string, resoruce?: Uri): boolean;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* A organization resource is one of potentially many resources opened.
|
|
616
|
+
*/
|
|
617
|
+
export interface OrganizationResource {
|
|
618
|
+
/**
|
|
619
|
+
*
|
|
620
|
+
*/
|
|
621
|
+
readonly uri: Uri;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Then name of this organization resource. Defaults to
|
|
625
|
+
* the basename of its [uri-path](#Uri.path)
|
|
626
|
+
*/
|
|
627
|
+
readonly name: string;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* The ordinal number of this organization resource.
|
|
631
|
+
*/
|
|
632
|
+
readonly index: number;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Represents an extension.
|
|
637
|
+
*
|
|
638
|
+
* To get an instance of an `Extension` use [getExtension](#extendiosn.getExtension).
|
|
639
|
+
*/
|
|
640
|
+
export interface Extension<T> {
|
|
641
|
+
/**
|
|
642
|
+
* The canonical extension identifier in the form of: `publisher.name`.
|
|
643
|
+
*/
|
|
644
|
+
readonly id: string;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* The absolute file path of the directory containing this extension.
|
|
648
|
+
*/
|
|
649
|
+
readonly extensionPath: string;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* `true` if the extension has been activated.
|
|
653
|
+
*/
|
|
654
|
+
readonly isActive: boolean;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* The parsed contents of the extenion's package.json.
|
|
658
|
+
*/
|
|
659
|
+
readonly packageJSON: any;
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* The public API exported by this extension. It is an invalid action
|
|
663
|
+
* to access this field before this extension has been activated.
|
|
664
|
+
*/
|
|
665
|
+
readonly exports: T;
|
|
506
666
|
|
|
667
|
+
/**
|
|
668
|
+
* Activates the extension and returns its public API.
|
|
669
|
+
*
|
|
670
|
+
* @return A promise that will resolve when this extension has been activated.
|
|
671
|
+
*/
|
|
672
|
+
activate(): Promise<T>;
|
|
673
|
+
}
|
|
507
674
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
675
|
+
/**
|
|
676
|
+
* An extension context is a collection of utilities private to an
|
|
677
|
+
* extension.
|
|
678
|
+
*
|
|
679
|
+
* An instance of an `ExtensionContext` is provided as the first
|
|
680
|
+
* parameter to the `activate`-call of an extension.
|
|
681
|
+
*/
|
|
682
|
+
export interface ExtensionContext {
|
|
683
|
+
/**
|
|
684
|
+
* An array to which disposables can be added. When this
|
|
685
|
+
* extension is deactivated the disposables will be disposed.
|
|
686
|
+
*/
|
|
687
|
+
subscrtiptions: { dispose(): any }[];
|
|
518
688
|
|
|
689
|
+
/**
|
|
690
|
+
* A memento object that stores state in the context
|
|
691
|
+
* of the currently opened [orgnaization]($orgnaization.workspaceResources).
|
|
692
|
+
*/
|
|
693
|
+
workspaceState: Memento;
|
|
519
694
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
|
|
526
|
-
*
|
|
527
|
-
* When a resource is provided, configuration scoped to that resource is returned.
|
|
528
|
-
*
|
|
529
|
-
* @param section A dot-separated identifier.
|
|
530
|
-
* @param resource A resource for which the configuration is asked for
|
|
531
|
-
* @return The full configuration or a subset.
|
|
532
|
-
*/
|
|
533
|
-
export function getConfiguration(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
695
|
+
/**
|
|
696
|
+
* A memento object that stores state independent
|
|
697
|
+
* of the current opened [orgnaization](#orgnaization.)
|
|
698
|
+
*/
|
|
699
|
+
globalState: Memento;
|
|
534
700
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
701
|
+
/**
|
|
702
|
+
* The absolute file path of the directory containing the extension.
|
|
703
|
+
*/
|
|
704
|
+
extensionPath: string;
|
|
539
705
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
* When a resource is provided, configuration scoped to that resource is returned.
|
|
548
|
-
*
|
|
549
|
-
* @param section A dot-separated identifier.
|
|
550
|
-
* @param resource A resource for which the configuration is asked for
|
|
551
|
-
* @return The full configuration or a subset.
|
|
552
|
-
*/
|
|
553
|
-
export function getConfigurationRole(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
706
|
+
/**
|
|
707
|
+
* Get the absolute path of a resource contained in the extension.
|
|
708
|
+
*
|
|
709
|
+
* @param relativePath A relative path to a resource contained in the extension.
|
|
710
|
+
* @return The absolute path of the resoruce.
|
|
711
|
+
*/
|
|
712
|
+
asAbsolutePath(relativePath: string): string;
|
|
554
713
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
* is returned. Dots in the section-identifier are interpreted as child-access,
|
|
565
|
-
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
|
|
566
|
-
*
|
|
567
|
-
* When a resource is provided, configuration scoped to that resource is returned.
|
|
568
|
-
*
|
|
569
|
-
* @param section A dot-separated identifier.
|
|
570
|
-
* @param resource A resource for which the configuration is asked for
|
|
571
|
-
* @return The full configuration or a subset.
|
|
572
|
-
*/
|
|
573
|
-
export function getConfigurationPolicy(section?: string, resource?: Uri | null): OrganizationConfiguration;
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* An event that is emitted when the [configuration](#OrganizationConfiguration) changed.
|
|
577
|
-
*/
|
|
578
|
-
export const onDidChangeConfigurationPolicy: Event<ConfigurationChangeEvent>;
|
|
579
|
-
// /**
|
|
580
|
-
// * ~~Register a task provider.~~
|
|
581
|
-
// *
|
|
582
|
-
// * @deprecated Use the corresponding function on the `tasks` namespace instead
|
|
583
|
-
// *
|
|
584
|
-
// * @param type The task kind type this provider is registered for.
|
|
585
|
-
// * @param provider A task provider.
|
|
586
|
-
// * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
587
|
-
// */
|
|
588
|
-
// export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Register a filesystem provider for a given scheme, e.g. `ftp`.
|
|
592
|
-
*
|
|
593
|
-
* There can only be one provider per scheme and an error is being thrown when a scheme
|
|
594
|
-
* has been claimed by another provider or when it is reserved.
|
|
595
|
-
*
|
|
596
|
-
* @param scheme The uri-[scheme](#Uri.scheme) the provider registers for.
|
|
597
|
-
* @param provider The filesystem provider.
|
|
598
|
-
* @param options Immutable metadata about the provider.
|
|
599
|
-
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
600
|
-
*/
|
|
601
|
-
// export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean }): Disposable;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* The configuration scope which can be a
|
|
606
|
-
* a `resource`
|
|
607
|
-
*/
|
|
608
|
-
export type ConfigurationScope = Uri | OrganizationResource | { uri?: Uri; machineId: string };
|
|
609
|
-
/**
|
|
610
|
-
* An event describing the change in Configuration
|
|
611
|
-
*/
|
|
612
|
-
export interface ConfigurationChangeEvent {
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Returns `true` if the given section for the given resource (if provided) is affected.
|
|
616
|
-
*
|
|
617
|
-
* @param section Configuration name, supports _dotted_ names.
|
|
618
|
-
* @param resoruce A resource Uri.
|
|
619
|
-
* @return `true` if the given section for the given resource (if provided) is affected.
|
|
620
|
-
*/
|
|
621
|
-
affectsConfiguration(section: string, resoruce?: Uri): boolean;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* A organization resource is one of potentially many resources opened.
|
|
626
|
-
*/
|
|
627
|
-
export interface OrganizationResource {
|
|
628
|
-
/**
|
|
629
|
-
*
|
|
630
|
-
*/
|
|
631
|
-
readonly uri: Uri;
|
|
714
|
+
/**
|
|
715
|
+
* An absolute file path of a orgnaization specific directory in which the extension
|
|
716
|
+
* can store private state. The directory might not exist on disk and creation is
|
|
717
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
718
|
+
*
|
|
719
|
+
* Use [`workspaceState`](#ExtensionContext.workspaceState) or
|
|
720
|
+
* [`globalState`](#ExtensionContext.globalState) to store key value data.
|
|
721
|
+
*/
|
|
722
|
+
storagePath: string | undefined;
|
|
632
723
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
724
|
+
/**
|
|
725
|
+
* An absolute file path of a directory in which the extension can create log files.
|
|
726
|
+
* The directory might not exist on disk and creation is up to the extension. However,
|
|
727
|
+
* the parent directory is guaranteed to be existent.
|
|
728
|
+
*/
|
|
729
|
+
logPath: string;
|
|
730
|
+
}
|
|
638
731
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
732
|
+
/**
|
|
733
|
+
* Namespace for dealing with installed extensions. Extensions are represented
|
|
734
|
+
* by an [extension](#Extension)-interface which enables reflection on them.
|
|
735
|
+
*
|
|
736
|
+
* Extension writers can provide APIs to other extensions by returning their API public
|
|
737
|
+
* surface from the `activate`-call.
|
|
738
|
+
*
|
|
739
|
+
* ```javascript
|
|
740
|
+
* export function activate(context: vscode.ExtensionContext) {
|
|
741
|
+
* let api = {
|
|
742
|
+
* sum(a, b) {
|
|
743
|
+
* return a + b;
|
|
744
|
+
* },
|
|
745
|
+
* mul(a, b) {
|
|
746
|
+
* return a * b;
|
|
747
|
+
* }
|
|
748
|
+
* };
|
|
749
|
+
* // 'export' public api-surface
|
|
750
|
+
* return api;
|
|
751
|
+
* }
|
|
752
|
+
* ```
|
|
753
|
+
* When depending on the API of another extension add an `extensionDependency`-entry
|
|
754
|
+
* to `package.json`, and use the [getExtension](#extensions.getExtension)-function
|
|
755
|
+
* and the [exports](#Extension.exports)-property, like below:
|
|
756
|
+
*
|
|
757
|
+
* ```javascript
|
|
758
|
+
* let mathExt = extensions.getExtension('genius.math');
|
|
759
|
+
* let importedApi = mathExt.exports;
|
|
760
|
+
*
|
|
761
|
+
* console.log(importedApi.mul(42, 1));
|
|
762
|
+
* ```
|
|
763
|
+
*/
|
|
764
|
+
export namespace extensions {
|
|
765
|
+
/**
|
|
766
|
+
* Get an extension by its full identifier in the form of: `publisher.name`.
|
|
767
|
+
*
|
|
768
|
+
* @param extensionId An extension identifier.
|
|
769
|
+
* @return An extension or `undefined`.
|
|
770
|
+
*/
|
|
771
|
+
export function getExtension(extensionId: string): Extension<any> | undefined;
|
|
656
772
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
773
|
+
/**
|
|
774
|
+
* Get an extension its full identifier in the form of: `publisher.name`.
|
|
775
|
+
*
|
|
776
|
+
* @param extensionId An extension identifier.
|
|
777
|
+
* @return An extension or `undefined`.
|
|
778
|
+
*/
|
|
779
|
+
export function getExtension<T>(extensionId: string): Extension<T> | undefined;
|
|
661
780
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
781
|
+
/**
|
|
782
|
+
* All extensions currently known to the system.
|
|
783
|
+
*/
|
|
784
|
+
export let all: Extension<any>[];
|
|
785
|
+
}
|
|
666
786
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
787
|
+
/**
|
|
788
|
+
* A memento represents a storage utility. It can store and retreive
|
|
789
|
+
* values.
|
|
790
|
+
*/
|
|
791
|
+
export interface Memento {
|
|
792
|
+
/**
|
|
793
|
+
* Return a value
|
|
794
|
+
*
|
|
795
|
+
* @param key A string.
|
|
796
|
+
* @return The stored value or `undefined`.
|
|
797
|
+
*/
|
|
798
|
+
get<T>(key: string): T | undefined;
|
|
671
799
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
800
|
+
/**
|
|
801
|
+
* Return a value.
|
|
802
|
+
*
|
|
803
|
+
* @param key A string.
|
|
804
|
+
* @param defaultValue A value that should be returned when there is no
|
|
805
|
+
* value (`unefined`) with the given key.
|
|
806
|
+
* @return The stored value or the defaultValue.
|
|
807
|
+
*/
|
|
808
|
+
get<T>(key: string, defaultValue: T): T;
|
|
677
809
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* An extension context is a collection of utilities private to an
|
|
688
|
-
* extension.
|
|
689
|
-
*
|
|
690
|
-
* An instance of an `ExtensionContext` is provided as the first
|
|
691
|
-
* parameter to the `activate`-call of an extension.
|
|
692
|
-
*/
|
|
693
|
-
export interface ExtensionContext {
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* An array to which disposables can be added. When this
|
|
697
|
-
* extension is deactivated the disposables will be disposed.
|
|
698
|
-
*/
|
|
699
|
-
subscrtiptions: { dispose(): any }[];
|
|
810
|
+
/**
|
|
811
|
+
* Store a value. The value must be JSON-stringifyable.
|
|
812
|
+
*
|
|
813
|
+
* @param key A string.
|
|
814
|
+
* @param value A value. MUST not contain cyclic references.
|
|
815
|
+
*/
|
|
816
|
+
update(key: string, value: any): Promise<void>;
|
|
817
|
+
}
|
|
700
818
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
819
|
+
export interface Configuration<C extends object> {
|
|
820
|
+
/**
|
|
821
|
+
* Returns a value at a specific key in the configuration.
|
|
822
|
+
*
|
|
823
|
+
* @template C The configuration schema.
|
|
824
|
+
* @template K Valid key on the coniguration object.
|
|
825
|
+
* @param key The name of the configuration property to get.
|
|
826
|
+
* @return The configuration value, or `undefined`.
|
|
827
|
+
*/
|
|
828
|
+
get<K extends keyof C>(key: K): Readonly<C[K]> | undefined;
|
|
706
829
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
830
|
+
/**
|
|
831
|
+
* Updates the configuration value for the given key. The udpated configuration value is persisted by the
|
|
832
|
+
* client.
|
|
833
|
+
*
|
|
834
|
+
* @template C The configuration schema.
|
|
835
|
+
* @template K Valid key on the configuration object.
|
|
836
|
+
* @param key The name of the configuration property to udpate.
|
|
837
|
+
* @param value The new value, or undefined to remove it.
|
|
838
|
+
* @return A promise that resolves when the client acknowledges the udpate.
|
|
839
|
+
*/
|
|
840
|
+
update<K extends keyof C>(key: K, value: C[K] | undefined): Promise<void>;
|
|
712
841
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
842
|
+
/**
|
|
843
|
+
* The configuration value as a plain object.
|
|
844
|
+
*/
|
|
845
|
+
readonly value: Readonly<C>;
|
|
846
|
+
}
|
|
717
847
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
848
|
+
/**
|
|
849
|
+
* The configuration settings.
|
|
850
|
+
*
|
|
851
|
+
* It ma be merged from the following sources of settings, in order:
|
|
852
|
+
*
|
|
853
|
+
* Default settings
|
|
854
|
+
* Global settings
|
|
855
|
+
* Organization settings (for all organizations the user is a member of)
|
|
856
|
+
* User settings
|
|
857
|
+
* Repository settings
|
|
858
|
+
* Directory settings
|
|
859
|
+
*/
|
|
860
|
+
export namespace configuration {
|
|
861
|
+
/**
|
|
862
|
+
* Return the full configuration object.
|
|
863
|
+
*
|
|
864
|
+
* @template C The configuration schema.
|
|
865
|
+
* @return The full configuration object.
|
|
866
|
+
*/
|
|
867
|
+
export function get<C extends object = { [key: string]: any }>(): Configuration<C>;
|
|
735
868
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
* by an [extension](#Extension)-interface which enables reflection on them.
|
|
747
|
-
*
|
|
748
|
-
* Extension writers can provide APIs to other extensions by returning their API public
|
|
749
|
-
* surface from the `activate`-call.
|
|
750
|
-
*
|
|
751
|
-
* ```javascript
|
|
752
|
-
* export function activate(context: vscode.ExtensionContext) {
|
|
753
|
-
* let api = {
|
|
754
|
-
* sum(a, b) {
|
|
755
|
-
* return a + b;
|
|
756
|
-
* },
|
|
757
|
-
* mul(a, b) {
|
|
758
|
-
* return a * b;
|
|
759
|
-
* }
|
|
760
|
-
* };
|
|
761
|
-
* // 'export' public api-surface
|
|
762
|
-
* return api;
|
|
763
|
-
* }
|
|
764
|
-
* ```
|
|
765
|
-
* When depending on the API of another extension add an `extensionDependency`-entry
|
|
766
|
-
* to `package.json`, and use the [getExtension](#extensions.getExtension)-function
|
|
767
|
-
* and the [exports](#Extension.exports)-property, like below:
|
|
768
|
-
*
|
|
769
|
-
* ```javascript
|
|
770
|
-
* let mathExt = extensions.getExtension('genius.math');
|
|
771
|
-
* let importedApi = mathExt.exports;
|
|
772
|
-
*
|
|
773
|
-
* console.log(importedApi.mul(42, 1));
|
|
774
|
-
* ```
|
|
775
|
-
*/
|
|
776
|
-
export namespace extensions {
|
|
777
|
-
|
|
778
|
-
/**
|
|
779
|
-
* Get an extension by its full identifier in the form of: `publisher.name`.
|
|
780
|
-
*
|
|
781
|
-
* @param extensionId An extension identifier.
|
|
782
|
-
* @return An extension or `undefined`.
|
|
783
|
-
*/
|
|
784
|
-
export function getExtension(extensionId: string): Extension<any> | undefined;
|
|
869
|
+
/**
|
|
870
|
+
* Subscribe to changes to the configuration. The {@link next} callback is called when any configuration
|
|
871
|
+
* value changes (and synchronously immediately). Call {@link get} in the callback to obtain the new
|
|
872
|
+
* configuration values.
|
|
873
|
+
*
|
|
874
|
+
* @template C The configuration schema.
|
|
875
|
+
* @return An unsubscribable to stop calling the callback for configuration changes.
|
|
876
|
+
*/
|
|
877
|
+
export function subscribe(next: () => void): Unsubscribable;
|
|
878
|
+
}
|
|
785
879
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
880
|
+
/**
|
|
881
|
+
* The configuration target
|
|
882
|
+
*/
|
|
883
|
+
export enum ConfigurationTarget {
|
|
884
|
+
/**
|
|
885
|
+
* Global configuration
|
|
886
|
+
*/
|
|
887
|
+
Global = 1,
|
|
793
888
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}
|
|
889
|
+
/**
|
|
890
|
+
* Organization configuration
|
|
891
|
+
*/
|
|
892
|
+
Organization = 2,
|
|
799
893
|
|
|
894
|
+
/**
|
|
895
|
+
* Organization resource configuration
|
|
896
|
+
*/
|
|
897
|
+
OrganizationResource = 3,
|
|
898
|
+
}
|
|
800
899
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
900
|
+
/**
|
|
901
|
+
* A provider result represents the values that a provider, such as the {@link HoverProvider}, may return. The
|
|
902
|
+
* result may be a single value, a Promise that resolves to a single value, a Subscribable that emits zero
|
|
903
|
+
* or more values, or an AsyncIterable that yeilds zero or more values.
|
|
904
|
+
*/
|
|
905
|
+
export type ProviderResult<T> =
|
|
906
|
+
| T
|
|
907
|
+
| undefined
|
|
908
|
+
| null
|
|
909
|
+
| Promise<T | undefined | null>
|
|
910
|
+
| Subscribable<T | undefined | null>
|
|
911
|
+
| AsyncIterable<T | undefined | null>;
|
|
912
|
+
|
|
913
|
+
/** The kinds of markup that can be used. */
|
|
914
|
+
export enum MarkupKind {
|
|
915
|
+
PlainText = 'plaintext',
|
|
916
|
+
Markdown = 'markdown',
|
|
917
|
+
}
|
|
806
918
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
get<T>(key: string): T | undefined;
|
|
814
|
-
|
|
815
|
-
/**
|
|
816
|
-
* Return a value.
|
|
817
|
-
*
|
|
818
|
-
* @param key A string.
|
|
819
|
-
* @param defaultValue A value that should be returned when there is no
|
|
820
|
-
* value (`unefined`) with the given key.
|
|
821
|
-
* @return The stored value or the defaultValue.
|
|
822
|
-
*/
|
|
823
|
-
get<T>(key: string, defaultValue: T): T;
|
|
919
|
+
/**
|
|
920
|
+
* A view is a page or partial page.
|
|
921
|
+
*/
|
|
922
|
+
export interface View {
|
|
923
|
+
/** The title of the view. */
|
|
924
|
+
title: string;
|
|
824
925
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
*
|
|
828
|
-
* @param key A string.
|
|
829
|
-
* @param value A value. MUST not contain cyclic references.
|
|
830
|
-
*/
|
|
831
|
-
update(key: string, value: any): Promise<void>;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
export interface Configuration<C extends object> {
|
|
835
|
-
/**
|
|
836
|
-
* Returns a value at a specific key in the configuration.
|
|
837
|
-
*
|
|
838
|
-
* @template C The configuration schema.
|
|
839
|
-
* @template K Valid key on the coniguration object.
|
|
840
|
-
* @param key The name of the configuration property to get.
|
|
841
|
-
* @return The configuration value, or `undefined`.
|
|
842
|
-
*/
|
|
843
|
-
get<K extends keyof C>(key: K): Readonly<C[K]> | undefined;
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* Updates the configuration value for the given key. The udpated configuration value is persisted by the
|
|
847
|
-
* client.
|
|
848
|
-
*
|
|
849
|
-
* @template C The configuration schema.
|
|
850
|
-
* @template K Valid key on the configuration object.
|
|
851
|
-
* @param key The name of the configuration property to udpate.
|
|
852
|
-
* @param value The new value, or undefined to remove it.
|
|
853
|
-
* @return A promise that resolves when the client acknowledges the udpate.
|
|
854
|
-
*/
|
|
855
|
-
update<K extends keyof C>(key: K, value: C[K] | undefined): Promise<void>;
|
|
926
|
+
/** An optional subtitle displayed under the title. */
|
|
927
|
+
subtitle?: string;
|
|
856
928
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
* Default settings
|
|
870
|
-
* Global settings
|
|
871
|
-
* Organization settings (for all organizations the user is a member of)
|
|
872
|
-
* User settings
|
|
873
|
-
* Repository settings
|
|
874
|
-
* Directory settings
|
|
875
|
-
*/
|
|
876
|
-
export namespace configuration {
|
|
877
|
-
/**
|
|
878
|
-
* Return the full configuration object.
|
|
879
|
-
*
|
|
880
|
-
* @template C The configuration schema.
|
|
881
|
-
* @return The full configuration object.
|
|
882
|
-
*/
|
|
883
|
-
export function get<C extends object = { [key: string]: any }>(): Configuration<C>;
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* Subscribe to changes to the configuration. The {@link next} callback is called when any configuration
|
|
887
|
-
* value changes (and synchronously immediately). Call {@link get} in the callback to obtain the new
|
|
888
|
-
* configuration values.
|
|
889
|
-
*
|
|
890
|
-
* @template C The configuration schema.
|
|
891
|
-
* @return An unsubscribable to stop calling the callback for configuration changes.
|
|
892
|
-
*/
|
|
893
|
-
export function subscribe(next: () => void): Unsubscribable;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* The configuration target
|
|
898
|
-
*/
|
|
899
|
-
export enum ConfigurationTarget {
|
|
900
|
-
/**
|
|
901
|
-
* Global configuration
|
|
902
|
-
*/
|
|
903
|
-
Global = 1,
|
|
929
|
+
/**
|
|
930
|
+
* The content sections of the view. The sections are rendered in order.
|
|
931
|
+
*
|
|
932
|
+
* Support for non-MarkupContent elements is experimental and subject to change or removal
|
|
933
|
+
* without notice.
|
|
934
|
+
*/
|
|
935
|
+
content: (
|
|
936
|
+
| MarkupContent
|
|
937
|
+
| ChartContent
|
|
938
|
+
| { component: string; props: { [name: string]: string | number | boolean | null | undefined } }
|
|
939
|
+
)[];
|
|
940
|
+
}
|
|
904
941
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
942
|
+
/**
|
|
943
|
+
* A view provider registered with {@link cdeops.app.registerViewProvider}.
|
|
944
|
+
*/
|
|
945
|
+
export type ViewProvider = HomepageViewProvider | GlobalPageViewProvider;
|
|
909
946
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
* A provider result represents the values that a provider, such as the {@link HoverProvider}, may return. The
|
|
919
|
-
* result may be a single value, a Promise that resolves to a single value, a Subscribable that emits zero
|
|
920
|
-
* or more values, or an AsyncIterable that yeilds zero or more values.
|
|
921
|
-
*/
|
|
922
|
-
export type ProviderResult<T> =
|
|
923
|
-
| T
|
|
924
|
-
| undefined
|
|
925
|
-
| null
|
|
926
|
-
| Promise<T | undefined | null>
|
|
927
|
-
| Subscribable<T | undefined | null>
|
|
928
|
-
| AsyncIterable<T | undefined | null>;
|
|
929
|
-
|
|
930
|
-
/** The kinds of markup that can be used. */
|
|
931
|
-
export enum MarkupKind {
|
|
932
|
-
PlainText = 'plaintext',
|
|
933
|
-
Markdown = 'markdown',
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* A view is a page or partial page.
|
|
938
|
-
*/
|
|
939
|
-
export interface View {
|
|
940
|
-
/** The title of the view. */
|
|
941
|
-
title: string;
|
|
942
|
-
|
|
943
|
-
/** An optional subtitle displayed under the title. */
|
|
944
|
-
subtitle?: string
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* The content sections of the view. The sections are rendered in order.
|
|
948
|
-
*
|
|
949
|
-
* Support for non-MarkupContent elements is experimental and subject to change or removal
|
|
950
|
-
* without notice.
|
|
951
|
-
*/
|
|
952
|
-
content: (
|
|
953
|
-
| MarkupContent
|
|
954
|
-
| ChartContent
|
|
955
|
-
| { component: string; props: { [name: string]: string | number | boolean | null | undefined } }
|
|
956
|
-
)[]
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
/**
|
|
960
|
-
* A view provider registered with {@link cdeops.app.registerViewProvider}.
|
|
961
|
-
*/
|
|
962
|
-
export type ViewProvider =
|
|
963
|
-
| HomepageViewProvider
|
|
964
|
-
| GlobalPageViewProvider;
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
/**
|
|
968
|
-
* A panel view created by {@link codeops.app.createPanelView}
|
|
969
|
-
*/
|
|
970
|
-
export interface PanelView extends Unsubscribable {
|
|
971
|
-
/**
|
|
972
|
-
* The title of the panel view.
|
|
973
|
-
*/
|
|
974
|
-
title: string;
|
|
947
|
+
/**
|
|
948
|
+
* A panel view created by {@link codeops.app.createPanelView}
|
|
949
|
+
*/
|
|
950
|
+
export interface PanelView extends Unsubscribable {
|
|
951
|
+
/**
|
|
952
|
+
* The title of the panel view.
|
|
953
|
+
*/
|
|
954
|
+
title: string;
|
|
975
955
|
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
956
|
+
/**
|
|
957
|
+
* The content to show in the panel view. Markdown is supported.
|
|
958
|
+
*/
|
|
959
|
+
content: string;
|
|
980
960
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
961
|
+
/**
|
|
962
|
+
* The priority of this panel view. A higher value means that the item is shown near the begining (usually
|
|
963
|
+
* the left side).
|
|
964
|
+
*/
|
|
965
|
+
priority: number;
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Display the results of the location provider (with the given ID) in this panel below the
|
|
969
|
+
* {@link PanelView#contents}.
|
|
970
|
+
*
|
|
971
|
+
* Experimental. Subject ot change or removal without notice.
|
|
972
|
+
*
|
|
973
|
+
* @internal
|
|
974
|
+
*/
|
|
975
|
+
component: { locationProvider: string } | null;
|
|
976
|
+
}
|
|
997
977
|
|
|
998
|
-
|
|
978
|
+
export type ChartContent = LineChartContent<any, string> | BarChartContent<any, string> | PieChartContent<any>;
|
|
999
979
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
980
|
+
export interface ChartAxis<K extends keyof D, D extends object> {
|
|
981
|
+
/** The key in the data object. */
|
|
982
|
+
dataKey: K;
|
|
1003
983
|
|
|
1004
|
-
|
|
1005
|
-
|
|
984
|
+
/** The scale of the axis. */
|
|
985
|
+
scale?: 'time' | 'linear';
|
|
1006
986
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
987
|
+
/** The type of the data key. */
|
|
988
|
+
type: 'number' | 'category';
|
|
989
|
+
}
|
|
1010
990
|
|
|
1011
|
-
|
|
1012
|
-
|
|
991
|
+
export interface LineChartContent<D extends object, XK extends keyof D> {
|
|
992
|
+
chart: 'line';
|
|
1013
993
|
|
|
1014
|
-
|
|
1015
|
-
|
|
994
|
+
/** An array of data objects, with one element for each step on the X axis. */
|
|
995
|
+
data: D[];
|
|
1016
996
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
997
|
+
/** The series (lines) of the chart. */
|
|
998
|
+
series: {
|
|
999
|
+
/** The key in each data object for the values this line should be calculated from. */
|
|
1000
|
+
dataKey: keyof D;
|
|
1021
1001
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1002
|
+
/** The name of the line shown in the legend and tooltip. */
|
|
1003
|
+
name?: string;
|
|
1024
1004
|
|
|
1025
1005
|
/**
|
|
1026
1006
|
* The link URLs for each data point.
|
|
1027
1007
|
* A link URL should take the user to more details about the specific data point.
|
|
1028
1008
|
*/
|
|
1029
|
-
|
|
1009
|
+
linkURLs?: string[];
|
|
1030
1010
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1011
|
+
/** The CSS color of the line. */
|
|
1012
|
+
stroke?: string;
|
|
1013
|
+
}[];
|
|
1034
1014
|
|
|
1035
|
-
|
|
1036
|
-
|
|
1015
|
+
xAxis: ChartAxis<XK, D>;
|
|
1016
|
+
}
|
|
1037
1017
|
|
|
1038
|
-
|
|
1039
|
-
|
|
1018
|
+
export interface BarChartContent<D extends object, XK extends keyof D> {
|
|
1019
|
+
chart: 'bar';
|
|
1040
1020
|
|
|
1041
|
-
|
|
1042
|
-
|
|
1021
|
+
/** An array of data objects, with one element for each step on the X axis. */
|
|
1022
|
+
data: D[];
|
|
1043
1023
|
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1024
|
+
/** The series of the chart. */
|
|
1025
|
+
series: {
|
|
1026
|
+
/** The key in each data object for the values this bar should be calculated from. */
|
|
1027
|
+
dataKey: keyof D;
|
|
1048
1028
|
|
|
1049
1029
|
/**
|
|
1050
1030
|
* An optional stack id of each bar.
|
|
1051
1031
|
* When two bars have the same same `stackId`, the two bars are stacked in order.
|
|
1052
1032
|
*/
|
|
1053
|
-
|
|
1033
|
+
stackId?: string;
|
|
1054
1034
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1035
|
+
/** The name of the series, shown in the legend. */
|
|
1036
|
+
name?: string;
|
|
1057
1037
|
|
|
1058
1038
|
/**
|
|
1059
1039
|
* The link URLs for each bar.
|
|
1060
1040
|
* A link URL should take the user to more details about the specific data point.
|
|
1061
1041
|
*/
|
|
1062
|
-
|
|
1042
|
+
linkURLs?: string[];
|
|
1063
1043
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1044
|
+
/** The CSS fill color of the line. */
|
|
1045
|
+
fill?: string;
|
|
1046
|
+
}[];
|
|
1067
1047
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1048
|
+
xAxis: ChartAxis<XK, D>;
|
|
1049
|
+
}
|
|
1070
1050
|
|
|
1071
|
-
|
|
1072
|
-
|
|
1051
|
+
export interface PieChartContent<D extends object> {
|
|
1052
|
+
chart: 'pie';
|
|
1073
1053
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1054
|
+
pies: {
|
|
1055
|
+
/** The key of each sector's va lue. */
|
|
1056
|
+
dataKey: keyof D;
|
|
1077
1057
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1058
|
+
/** The key of each sector's name. */
|
|
1059
|
+
nameKey: keyof D;
|
|
1080
1060
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1061
|
+
/** The key of each sector's fill color. */
|
|
1062
|
+
fillKey?: keyof D;
|
|
1083
1063
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
/** T he key of each sector's link URL. */
|
|
1088
|
-
linkURLKey?: keyof D
|
|
1089
|
-
}[]
|
|
1090
|
-
}
|
|
1064
|
+
/** An array of data objects, with one element for each pie sector. */
|
|
1065
|
+
data: D[];
|
|
1091
1066
|
|
|
1067
|
+
/** T he key of each sector's link URL. */
|
|
1068
|
+
linkURLKey?: keyof D;
|
|
1069
|
+
}[];
|
|
1070
|
+
}
|
|
1092
1071
|
|
|
1093
1072
|
/**
|
|
1094
1073
|
* Human-readable text that supports various kinds of formatting.
|
|
1095
1074
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1075
|
+
export interface MarkupContent {
|
|
1076
|
+
/** The marked up text. */
|
|
1077
|
+
value: string;
|
|
1099
1078
|
|
|
1100
1079
|
/**
|
|
1101
1080
|
* The kind of markup used.
|
|
1102
1081
|
*
|
|
1103
1082
|
* @default MarkupKind.Markdown
|
|
1104
1083
|
*/
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
/**
|
|
1115
|
-
* Provide content for the view.
|
|
1116
|
-
*/
|
|
1117
|
-
provideView(context: {}): ProviderResult<View>;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
/**
|
|
1121
|
-
* Experimental global view provider. Global view providers are shown on a dedicated page in the app.
|
|
1122
|
-
* This API is experimental and is subject to change or removal without notice.
|
|
1123
|
-
*/
|
|
1124
|
-
export interface GlobalPageViewProvider {
|
|
1125
|
-
readonly where: 'global/page';
|
|
1126
|
-
|
|
1127
|
-
/**
|
|
1128
|
-
* Provide content for the view.
|
|
1129
|
-
*
|
|
1130
|
-
* @param params Parameters from the page (such as URL query parameters). The schema of these parameters is
|
|
1131
|
-
* experimental and subject to change without notice.
|
|
1132
|
-
* @returns The view content.
|
|
1133
|
-
*/
|
|
1134
|
-
provideView(context: { [param: string]: string }): ProviderResult<View>;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
/**
|
|
1138
|
-
* A text document, such as a file in a repository.
|
|
1139
|
-
*/
|
|
1140
|
-
export interface TextDocument {
|
|
1141
|
-
/**
|
|
1142
|
-
* The URI of the text document.
|
|
1143
|
-
*/
|
|
1144
|
-
readonly uri: string;
|
|
1084
|
+
kind?: MarkupKind;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Experimental view provider shown on the homepage.
|
|
1088
|
+
* This API is experimental and is subject to change or removal without notice.
|
|
1089
|
+
*/
|
|
1090
|
+
export interface HomepageViewProvider {
|
|
1091
|
+
readonly where: 'homepage';
|
|
1145
1092
|
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1093
|
+
/**
|
|
1094
|
+
* Provide content for the view.
|
|
1095
|
+
*/
|
|
1096
|
+
provideView(context: {}): ProviderResult<View>;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Experimental global view provider. Global view providers are shown on a dedicated page in the app.
|
|
1101
|
+
* This API is experimental and is subject to change or removal without notice.
|
|
1102
|
+
*/
|
|
1103
|
+
export interface GlobalPageViewProvider {
|
|
1104
|
+
readonly where: 'global/page';
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* Provide content for the view.
|
|
1108
|
+
*
|
|
1109
|
+
* @param params Parameters from the page (such as URL query parameters). The schema of these parameters is
|
|
1110
|
+
* experimental and subject to change without notice.
|
|
1111
|
+
* @returns The view content.
|
|
1112
|
+
*/
|
|
1113
|
+
provideView(context: { [param: string]: string }): ProviderResult<View>;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* A text document, such as a file in a repository.
|
|
1118
|
+
*/
|
|
1119
|
+
export interface TextDocument {
|
|
1120
|
+
/**
|
|
1121
|
+
* The URI of the text document.
|
|
1122
|
+
*/
|
|
1123
|
+
readonly uri: string;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* The language of the text document.
|
|
1127
|
+
*/
|
|
1128
|
+
readonly languageId: string;
|
|
1150
1129
|
|
|
1151
|
-
|
|
1130
|
+
/**
|
|
1152
1131
|
* The text contents of the text document.
|
|
1153
1132
|
*
|
|
1154
1133
|
* When using the [Sourcegraph browser
|
|
@@ -1156,7 +1135,7 @@ declare module 'cdeops' {
|
|
|
1156
1135
|
* `undefined` because determining the text contents (in general) is not possible without
|
|
1157
1136
|
* additional access to the code host API. In the future, this limitation may be removed.
|
|
1158
1137
|
*/
|
|
1159
|
-
readonly text: string | undefined
|
|
1138
|
+
readonly text: string | undefined;
|
|
1160
1139
|
|
|
1161
1140
|
/**
|
|
1162
1141
|
* Convert the position to a zero-based offset.
|
|
@@ -1167,16 +1146,16 @@ declare module 'cdeops' {
|
|
|
1167
1146
|
* @returns A valid zero-based offset.
|
|
1168
1147
|
* @throws if {@link TextDocument#text} is undefined.
|
|
1169
1148
|
*/
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1149
|
+
offsetAt(position: Position): number;
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1173
1152
|
* Convert a zero-based offset to a position.
|
|
1174
1153
|
*
|
|
1175
1154
|
* @param offset A zero-based offset.
|
|
1176
1155
|
* @returns A valid {@link Position}.
|
|
1177
1156
|
* @throws if {@link TextDocument#text} is undefined.
|
|
1178
1157
|
*/
|
|
1179
|
-
positionAt(offset: number): Position
|
|
1158
|
+
positionAt(offset: number): Position;
|
|
1180
1159
|
|
|
1181
1160
|
/**
|
|
1182
1161
|
* Ensure a position is contained in the range of this document. If not, adjust it so that
|
|
@@ -1186,7 +1165,7 @@ declare module 'cdeops' {
|
|
|
1186
1165
|
* @returns The given position or a new, adjusted position.
|
|
1187
1166
|
* @throws if {@link TextDocument#text} is undefined.
|
|
1188
1167
|
*/
|
|
1189
|
-
validatePosition(position: Position): Position
|
|
1168
|
+
validatePosition(position: Position): Position;
|
|
1190
1169
|
|
|
1191
1170
|
/**
|
|
1192
1171
|
* Ensure a range is completely contained in this document.
|
|
@@ -1195,8 +1174,8 @@ declare module 'cdeops' {
|
|
|
1195
1174
|
* @returns The given range or a new, adjusted range.
|
|
1196
1175
|
* @throws if {@link TextDocument#text} is undefined.
|
|
1197
1176
|
*/
|
|
1198
|
-
|
|
1199
|
-
|
|
1177
|
+
validateRange(range: Range): Range;
|
|
1178
|
+
|
|
1200
1179
|
/**
|
|
1201
1180
|
* Get the range of the word at the given position.
|
|
1202
1181
|
*
|
|
@@ -1205,7 +1184,7 @@ declare module 'cdeops' {
|
|
|
1205
1184
|
* @param position A position.
|
|
1206
1185
|
* @returns A range spanning a word, or `undefined`.
|
|
1207
1186
|
*/
|
|
1208
|
-
getWordRangeAtPosition(position: Position): Range | undefined
|
|
1187
|
+
getWordRangeAtPosition(position: Position): Range | undefined;
|
|
1209
1188
|
|
|
1210
1189
|
/**
|
|
1211
1190
|
* Get the substring of text content from the provided range.
|
|
@@ -1213,130 +1192,126 @@ declare module 'cdeops' {
|
|
|
1213
1192
|
* @param range A range
|
|
1214
1193
|
* @returns The text inside the provided range, or the whole text if no range is provided
|
|
1215
1194
|
*/
|
|
1216
|
-
getText(range?: Range): string | undefined
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
* The type of a notification shown through {@link Window.showNotification}.
|
|
1223
|
-
*/
|
|
1224
|
-
export enum NotificationType {
|
|
1195
|
+
getText(range?: Range): string | undefined;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* The type of a notification shown through {@link Window.showNotification}.
|
|
1199
|
+
*/
|
|
1200
|
+
export enum NotificationType {
|
|
1225
1201
|
/**
|
|
1226
1202
|
* An error message.
|
|
1227
1203
|
*/
|
|
1228
|
-
|
|
1204
|
+
Error = 1,
|
|
1229
1205
|
/**
|
|
1230
1206
|
* A warning message.
|
|
1231
1207
|
*/
|
|
1232
|
-
|
|
1208
|
+
Warning = 2,
|
|
1233
1209
|
/**
|
|
1234
1210
|
* An info message.
|
|
1235
1211
|
*/
|
|
1236
|
-
|
|
1212
|
+
Info = 3,
|
|
1237
1213
|
/**
|
|
1238
1214
|
* A log message.
|
|
1239
1215
|
*/
|
|
1240
|
-
|
|
1216
|
+
Log = 4,
|
|
1241
1217
|
/**
|
|
1242
1218
|
* A success message.
|
|
1243
1219
|
*/
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1220
|
+
Success = 5,
|
|
1221
|
+
}
|
|
1222
|
+
export interface Directory {
|
|
1223
|
+
/**
|
|
1224
|
+
* The URI of the directory.
|
|
1225
|
+
*
|
|
1226
|
+
* @todo The format of this URI will be changed in teh future. It must not be relied on.
|
|
1227
|
+
*/
|
|
1228
|
+
readonly uri: URL;
|
|
1229
|
+
}
|
|
1255
1230
|
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1231
|
+
export interface ProgressOptions {
|
|
1232
|
+
title?: string;
|
|
1233
|
+
}
|
|
1259
1234
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1235
|
+
export interface Progress {
|
|
1236
|
+
/** Optional message. If not set, the previous message is still shown. */
|
|
1237
|
+
message?: string;
|
|
1263
1238
|
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1239
|
+
/** Integer from 0 to 100. If not set, the previous percentage is still shown. */
|
|
1240
|
+
percentage?: number;
|
|
1241
|
+
}
|
|
1267
1242
|
|
|
1268
|
-
|
|
1243
|
+
export interface ProgressReporter {
|
|
1269
1244
|
/**
|
|
1270
1245
|
* Updates the progress display with a new message and/or percentage.
|
|
1271
1246
|
*/
|
|
1272
|
-
|
|
1247
|
+
next(status: Progress): void;
|
|
1273
1248
|
|
|
1274
1249
|
/**
|
|
1275
1250
|
* Turns the progress display into an error display for the given error or message.
|
|
1276
1251
|
* Use if the operation failed.
|
|
1277
1252
|
* No further progress updates can be sent after this.
|
|
1278
1253
|
*/
|
|
1279
|
-
|
|
1254
|
+
error(error: any): void;
|
|
1280
1255
|
|
|
1281
1256
|
/**
|
|
1282
1257
|
* Completes the progress bar and hides the display.
|
|
1283
1258
|
* Sending a percentage of 100 has the same effect.
|
|
1284
1259
|
* No further progress updates can be sent after this.
|
|
1285
1260
|
*/
|
|
1286
|
-
|
|
1287
|
-
|
|
1261
|
+
complete(): void;
|
|
1262
|
+
}
|
|
1288
1263
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1264
|
+
export interface DirectoryViewer {
|
|
1265
|
+
readonly type: 'DirectoryViewer';
|
|
1291
1266
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1267
|
+
/**
|
|
1268
|
+
* The directory shown in the directory viewer.
|
|
1269
|
+
* The currently only exposes the URI of the directory.
|
|
1270
|
+
*/
|
|
1271
|
+
readonly directory: Directory;
|
|
1272
|
+
}
|
|
1298
1273
|
|
|
1299
|
-
|
|
1274
|
+
/**
|
|
1300
1275
|
* Options for an input box displayed as a result of calling {@link Window#showInputBox}.
|
|
1301
1276
|
*/
|
|
1302
|
-
|
|
1277
|
+
export interface InputBoxOptions {
|
|
1303
1278
|
/**
|
|
1304
1279
|
* The text that describes what input the user should provide.
|
|
1305
1280
|
*/
|
|
1306
|
-
|
|
1281
|
+
prompt?: string;
|
|
1307
1282
|
|
|
1308
1283
|
/**
|
|
1309
1284
|
* The pre-filled input value for the input box.
|
|
1310
1285
|
*/
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
/**
|
|
1315
|
-
* A user interface component in an applciation window.
|
|
1316
|
-
*
|
|
1317
|
-
* Each {@link ViewComponent} has a distinct {@link ViewComponent#type} value that indicates what kind of
|
|
1318
|
-
* component it is ({@link CodeEditor}, etc.).
|
|
1319
|
-
*/
|
|
1320
|
-
export type ViewComponent = DirectoryViewer;
|
|
1321
|
-
|
|
1322
|
-
/**
|
|
1323
|
-
* A window in the client application that is running the extension.
|
|
1324
|
-
*/
|
|
1325
|
-
export interface Window {
|
|
1326
|
-
/**
|
|
1327
|
-
* The user interface view components that are visible in the window.
|
|
1328
|
-
*/
|
|
1329
|
-
visibleViewComponents: ViewComponent[];
|
|
1286
|
+
value?: string;
|
|
1287
|
+
}
|
|
1330
1288
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1289
|
+
/**
|
|
1290
|
+
* A user interface component in an applciation window.
|
|
1291
|
+
*
|
|
1292
|
+
* Each {@link ViewComponent} has a distinct {@link ViewComponent#type} value that indicates what kind of
|
|
1293
|
+
* component it is ({@link CodeEditor}, etc.).
|
|
1294
|
+
*/
|
|
1295
|
+
export type ViewComponent = DirectoryViewer;
|
|
1335
1296
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1297
|
+
/**
|
|
1298
|
+
* A window in the client application that is running the extension.
|
|
1299
|
+
*/
|
|
1300
|
+
export interface Window {
|
|
1301
|
+
/**
|
|
1302
|
+
* The user interface view components that are visible in the window.
|
|
1303
|
+
*/
|
|
1304
|
+
visibleViewComponents: ViewComponent[];
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* The currently active view component in the window.
|
|
1308
|
+
*/
|
|
1309
|
+
activeViewComponent: ViewComponent | undefined;
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* An event that is fired when the active view component changes.
|
|
1313
|
+
*/
|
|
1314
|
+
activeViewComponentChanges: Subscribable<ViewComponent | undefined>;
|
|
1340
1315
|
|
|
1341
1316
|
/**
|
|
1342
1317
|
* Show a notification message to the user that does not require interaction or steal focus.
|
|
@@ -1344,7 +1319,7 @@ declare module 'cdeops' {
|
|
|
1344
1319
|
* @param message The message to show. Markdown is supported.
|
|
1345
1320
|
* @param type a {@link NotificationType} affecting the display of the notification.
|
|
1346
1321
|
*/
|
|
1347
|
-
|
|
1322
|
+
showNotification(message: string, type: NotificationType): void;
|
|
1348
1323
|
|
|
1349
1324
|
/**
|
|
1350
1325
|
* Show progress in the window. Progress is shown while running the given callback
|
|
@@ -1355,7 +1330,7 @@ declare module 'cdeops' {
|
|
|
1355
1330
|
*
|
|
1356
1331
|
* @returns The Promise the task-callback returned.
|
|
1357
1332
|
*/
|
|
1358
|
-
|
|
1333
|
+
withProgress<R>(options: ProgressOptions, task: (reporter: ProgressReporter) => Promise<R>): Promise<R>;
|
|
1359
1334
|
|
|
1360
1335
|
/**
|
|
1361
1336
|
* Show progress in the window. The returned ProgressReporter can be used to update the
|
|
@@ -1363,7 +1338,7 @@ declare module 'cdeops' {
|
|
|
1363
1338
|
*
|
|
1364
1339
|
* @returns A ProgressReporter that allows updating the progress display.
|
|
1365
1340
|
*/
|
|
1366
|
-
|
|
1341
|
+
showProgress(options: ProgressOptions): Promise<ProgressReporter>;
|
|
1367
1342
|
|
|
1368
1343
|
/**
|
|
1369
1344
|
* Show a modal message to the user that the user must dismiss before continuing.
|
|
@@ -1371,7 +1346,7 @@ declare module 'cdeops' {
|
|
|
1371
1346
|
* @param message The message to show.
|
|
1372
1347
|
* @returns A promise that resolves when the user dismisses the message.
|
|
1373
1348
|
*/
|
|
1374
|
-
|
|
1349
|
+
showMessage(message: string): Promise<void>;
|
|
1375
1350
|
|
|
1376
1351
|
/**
|
|
1377
1352
|
* Displays an input box to ask the user for input.
|
|
@@ -1382,168 +1357,167 @@ declare module 'cdeops' {
|
|
|
1382
1357
|
* @param options Configures the behavior of the input box.
|
|
1383
1358
|
* @returns The string provided by the user, or `undefined` if the input box was canceled.
|
|
1384
1359
|
*/
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1360
|
+
showInputBox(options?: InputBoxOptions): Promise<string | undefined>;
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* The client application that is running the extension.
|
|
1364
|
+
*/
|
|
1365
|
+
export namespace app {
|
|
1366
|
+
/**
|
|
1367
|
+
* The currently active window or `undefined`. The active window is the window that has focus, or when
|
|
1368
|
+
* none has focus, the window that was most recently focussed.
|
|
1369
|
+
*/
|
|
1370
|
+
export const activeWindow: Window | undefined;
|
|
1396
1371
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1372
|
+
/**
|
|
1373
|
+
* An event that is fired when the currently active window changes.
|
|
1374
|
+
*/
|
|
1375
|
+
export const activeWIndowChanges: Subscribable<Window | undefined>;
|
|
1401
1376
|
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
/**
|
|
1410
|
-
* Create a panel view for the view contribution with the given {@link id}.
|
|
1411
|
-
*
|
|
1412
|
-
* @todo Consider requiring extensions to specify these statically in package.json's contributions section
|
|
1413
|
-
* to improve the activation experience.
|
|
1414
|
-
*
|
|
1415
|
-
* @param id The ID of the view. This may be shown to the user (e.g., in the URL fragment when the pane is
|
|
1416
|
-
* active).
|
|
1417
|
-
* @returns The panel view.
|
|
1418
|
-
*/
|
|
1419
|
-
export function createPanelView(id: string): PanelView;
|
|
1420
|
-
|
|
1421
|
-
/**
|
|
1422
|
-
* Register a view provider, which provides the contents of a view.
|
|
1423
|
-
*
|
|
1424
|
-
* This API is experimental and is subject to change or removal without notice.
|
|
1425
|
-
*
|
|
1426
|
-
* @param id The ID of the view.
|
|
1427
|
-
* @param provider A view provider.
|
|
1428
|
-
* @returns An unsubscribable to unregister this provider.
|
|
1429
|
-
*/
|
|
1430
|
-
export function registerViewProvider(id: string, provider: ViewProvider): Unsubscribable;
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
}
|
|
1434
|
-
/**
|
|
1435
|
-
* Represents the configuration. It is a merged view of
|
|
1436
|
-
*
|
|
1437
|
-
* - Default configuration
|
|
1438
|
-
* - Global configuration
|
|
1439
|
-
* - Organization configuration (if available)
|
|
1440
|
-
* - Organization resource configuration of the requested resource (if available)
|
|
1441
|
-
*
|
|
1442
|
-
* *Global configuration* conmes from User Settings and shadows Default.
|
|
1443
|
-
*
|
|
1444
|
-
* *Configuration Resource configuration* comes from `.cdecode` resource under one of the [organization resources](#organization.organizationResources).
|
|
1445
|
-
*
|
|
1446
|
-
* *Note:* Organization and Organization Resoruce configurations contains `launch` and `tasks` settings. Their basename will be
|
|
1447
|
-
* part of the section identifier. The following snippets shows how to retrieve all configurations
|
|
1448
|
-
* from `launch.json`:
|
|
1449
|
-
*
|
|
1450
|
-
* ```ts
|
|
1451
|
-
* // lanuch.json configuration
|
|
1452
|
-
* const config = organization.getConfiguration('launch', );
|
|
1453
|
-
*
|
|
1454
|
-
* // retrieve values
|
|
1455
|
-
* const values = config.get('configurations');
|
|
1456
|
-
* ```
|
|
1457
|
-
*
|
|
1458
|
-
* Refer to [Settings](https://code.cdmbase.com/docs/getstarted/settigns) for more information.
|
|
1459
|
-
*/
|
|
1460
|
-
export interface OrganizationConfiguration {
|
|
1461
|
-
|
|
1462
|
-
/**
|
|
1463
|
-
* Return a value from this configuration.
|
|
1464
|
-
*
|
|
1465
|
-
* @param section Configuration name, supports _dotted_ names.
|
|
1466
|
-
* @return The value `section` deontes or `undefined`.
|
|
1467
|
-
*/
|
|
1468
|
-
get<T>(section: string): T | undefined;
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
* Return a value from this configuration.
|
|
1472
|
-
*
|
|
1473
|
-
* @param section Configuration name, supports _dotted_ names.
|
|
1474
|
-
* @param defaultValue A value should be returned when no value could be found, is `undefined`.
|
|
1475
|
-
* @return The value `section` denotes or the default.
|
|
1476
|
-
*/
|
|
1477
|
-
get<T>(section: string, defaultValue: T): T;
|
|
1377
|
+
/**
|
|
1378
|
+
* All application windows that are accessible by the extension.
|
|
1379
|
+
*
|
|
1380
|
+
* @readonly
|
|
1381
|
+
*/
|
|
1382
|
+
export const windows: Window[];
|
|
1478
1383
|
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
* a orgnaization-specific value and a resource-specific value.
|
|
1491
|
-
*
|
|
1492
|
-
* The *effective* value (returned by [`get`](#OrganizationConfiguration.get))
|
|
1493
|
-
* is computed like this: `defaultValue` overwritten by `globalValue`,
|
|
1494
|
-
* `globalValue` overwritten by `organizationValue`. `organizationValue` overwritten by `organizationResourceValue`.
|
|
1495
|
-
* Refer to [Settings Inheritance](https://cdecode.com/docs/getstarted/settings)
|
|
1496
|
-
* for more information.
|
|
1497
|
-
*
|
|
1498
|
-
* *Note:* The configuration name must denote a leaf in the configuration tree
|
|
1499
|
-
* (`editor.fontSize` vs `editor`) otherwise no result is returned.
|
|
1500
|
-
*
|
|
1501
|
-
* @param section Configuration name, supports _dotted_ names.
|
|
1502
|
-
* @return Information about a configuration setting or `undefined`.
|
|
1503
|
-
*/
|
|
1504
|
-
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T, organizationValue?: T, organizationResourceValue?: T } | undefined;
|
|
1505
|
-
|
|
1506
|
-
/**
|
|
1507
|
-
* Update a configuration value. The updated configuration values are persisted.
|
|
1508
|
-
*
|
|
1509
|
-
* A value can be changed in
|
|
1510
|
-
*
|
|
1511
|
-
* - [Global configuration](#ConfigurationTarget.Global): Changes the value for all instances of the editor.
|
|
1512
|
-
* - [Organization configuration](#ConfigurationTarget.Organization): Changes the value for current organization, if available.
|
|
1513
|
-
* - [Organization resource configuration](#ConfigurationTarget.OrganizationResource): Changes the value for the
|
|
1514
|
-
* [Organization resource](#organization.organizationResources) to which the current [configuration](#OrganizationConfiguration) is scoped to.
|
|
1515
|
-
*
|
|
1516
|
-
* *Note 1:* Setting a global value in the presence of a more specific orgnaization value
|
|
1517
|
-
* has no observable effect in that organization, but in others. Settin a organization value
|
|
1518
|
-
* in the presence of a more specific resource value has no observable effect for the resources
|
|
1519
|
-
* under respective [resource](#organization.organizationResources), but in others. Refer to
|
|
1520
|
-
* [Settings Inheritance](https://code.cdebase.com/docs/getstarted/settigns) for more information.
|
|
1521
|
-
*
|
|
1522
|
-
* *Note 2:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)`
|
|
1523
|
-
*
|
|
1524
|
-
* Will throw error when
|
|
1525
|
-
* - Writing a configuration which is not registered.
|
|
1526
|
-
* - Writing a configuration to organization or resource target when no organization is opened
|
|
1527
|
-
* - Writing a configuration to resource target when there is no resoruce settings
|
|
1528
|
-
* - Writing a resource target without passing a resoruce when getting the configuration (`organization.getConfiguration(section, resource)`)
|
|
1529
|
-
* - Writing a window configuration a resource target
|
|
1530
|
-
*
|
|
1531
|
-
* @param section Configuration name, supports _dotted_ names.
|
|
1532
|
-
* @param value The new value.
|
|
1533
|
-
* @param configurationTarget The [configuration target](#ConfigurationTarget) or a boolean value.
|
|
1534
|
-
* - If `true` configuraiton target is `ConfigurationTarget.Global`.
|
|
1535
|
-
* - If `false` configuration target is `ConfigurationTarget.Organization`.
|
|
1536
|
-
* - If `undefined` or `null` configuration target is
|
|
1537
|
-
* `ConfigurationTarget.OrganizationResource` when configuration is resource specific
|
|
1538
|
-
* `ConfigurationTarget.Organization` otherwise.
|
|
1539
|
-
*/
|
|
1540
|
-
update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean): Promise<void>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Create a panel view for the view contribution with the given {@link id}.
|
|
1386
|
+
*
|
|
1387
|
+
* @todo Consider requiring extensions to specify these statically in package.json's contributions section
|
|
1388
|
+
* to improve the activation experience.
|
|
1389
|
+
*
|
|
1390
|
+
* @param id The ID of the view. This may be shown to the user (e.g., in the URL fragment when the pane is
|
|
1391
|
+
* active).
|
|
1392
|
+
* @returns The panel view.
|
|
1393
|
+
*/
|
|
1394
|
+
export function createPanelView(id: string): PanelView;
|
|
1541
1395
|
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1396
|
+
/**
|
|
1397
|
+
* Register a view provider, which provides the contents of a view.
|
|
1398
|
+
*
|
|
1399
|
+
* This API is experimental and is subject to change or removal without notice.
|
|
1400
|
+
*
|
|
1401
|
+
* @param id The ID of the view.
|
|
1402
|
+
* @param provider A view provider.
|
|
1403
|
+
* @returns An unsubscribable to unregister this provider.
|
|
1404
|
+
*/
|
|
1405
|
+
export function registerViewProvider(id: string, provider: ViewProvider): Unsubscribable;
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Represents the configuration. It is a merged view of
|
|
1409
|
+
*
|
|
1410
|
+
* - Default configuration
|
|
1411
|
+
* - Global configuration
|
|
1412
|
+
* - Organization configuration (if available)
|
|
1413
|
+
* - Organization resource configuration of the requested resource (if available)
|
|
1414
|
+
*
|
|
1415
|
+
* *Global configuration* conmes from User Settings and shadows Default.
|
|
1416
|
+
*
|
|
1417
|
+
* *Configuration Resource configuration* comes from `.cdecode` resource under one of the [organization resources](#organization.organizationResources).
|
|
1418
|
+
*
|
|
1419
|
+
* *Note:* Organization and Organization Resoruce configurations contains `launch` and `tasks` settings. Their basename will be
|
|
1420
|
+
* part of the section identifier. The following snippets shows how to retrieve all configurations
|
|
1421
|
+
* from `launch.json`:
|
|
1422
|
+
*
|
|
1423
|
+
* ```ts
|
|
1424
|
+
* // lanuch.json configuration
|
|
1425
|
+
* const config = organization.getConfiguration('launch', );
|
|
1426
|
+
*
|
|
1427
|
+
* // retrieve values
|
|
1428
|
+
* const values = config.get('configurations');
|
|
1429
|
+
* ```
|
|
1430
|
+
*
|
|
1431
|
+
* Refer to [Settings](https://code.cdmbase.com/docs/getstarted/settigns) for more information.
|
|
1432
|
+
*/
|
|
1433
|
+
export interface OrganizationConfiguration {
|
|
1434
|
+
/**
|
|
1435
|
+
* Return a value from this configuration.
|
|
1436
|
+
*
|
|
1437
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
1438
|
+
* @return The value `section` deontes or `undefined`.
|
|
1439
|
+
*/
|
|
1440
|
+
get<T>(section: string): T | undefined;
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* Return a value from this configuration.
|
|
1444
|
+
*
|
|
1445
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
1446
|
+
* @param defaultValue A value should be returned when no value could be found, is `undefined`.
|
|
1447
|
+
* @return The value `section` denotes or the default.
|
|
1448
|
+
*/
|
|
1449
|
+
get<T>(section: string, defaultValue: T): T;
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Check if this configuration has a certain value.
|
|
1453
|
+
*
|
|
1454
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
1455
|
+
* @return `true` If the section doesn't resolve to `undefined`.
|
|
1456
|
+
*/
|
|
1457
|
+
has(section: string): boolean;
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* Retrieve all information about a configuration setting. A configuration value
|
|
1461
|
+
* often consists of a *default* value, a global or installation-wide value,
|
|
1462
|
+
* a orgnaization-specific value and a resource-specific value.
|
|
1463
|
+
*
|
|
1464
|
+
* The *effective* value (returned by [`get`](#OrganizationConfiguration.get))
|
|
1465
|
+
* is computed like this: `defaultValue` overwritten by `globalValue`,
|
|
1466
|
+
* `globalValue` overwritten by `organizationValue`. `organizationValue` overwritten by `organizationResourceValue`.
|
|
1467
|
+
* Refer to [Settings Inheritance](https://cdecode.com/docs/getstarted/settings)
|
|
1468
|
+
* for more information.
|
|
1469
|
+
*
|
|
1470
|
+
* *Note:* The configuration name must denote a leaf in the configuration tree
|
|
1471
|
+
* (`editor.fontSize` vs `editor`) otherwise no result is returned.
|
|
1472
|
+
*
|
|
1473
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
1474
|
+
* @return Information about a configuration setting or `undefined`.
|
|
1475
|
+
*/
|
|
1476
|
+
inspect<T>(
|
|
1477
|
+
section: string,
|
|
1478
|
+
):
|
|
1479
|
+
| { key: string; defaultValue?: T; globalValue?: T; organizationValue?: T; organizationResourceValue?: T }
|
|
1480
|
+
| undefined;
|
|
1548
1481
|
|
|
1482
|
+
/**
|
|
1483
|
+
* Update a configuration value. The updated configuration values are persisted.
|
|
1484
|
+
*
|
|
1485
|
+
* A value can be changed in
|
|
1486
|
+
*
|
|
1487
|
+
* - [Global configuration](#ConfigurationTarget.Global): Changes the value for all instances of the editor.
|
|
1488
|
+
* - [Organization configuration](#ConfigurationTarget.Organization): Changes the value for current organization, if available.
|
|
1489
|
+
* - [Organization resource configuration](#ConfigurationTarget.OrganizationResource): Changes the value for the
|
|
1490
|
+
* [Organization resource](#organization.organizationResources) to which the current [configuration](#OrganizationConfiguration) is scoped to.
|
|
1491
|
+
*
|
|
1492
|
+
* *Note 1:* Setting a global value in the presence of a more specific orgnaization value
|
|
1493
|
+
* has no observable effect in that organization, but in others. Settin a organization value
|
|
1494
|
+
* in the presence of a more specific resource value has no observable effect for the resources
|
|
1495
|
+
* under respective [resource](#organization.organizationResources), but in others. Refer to
|
|
1496
|
+
* [Settings Inheritance](https://code.cdebase.com/docs/getstarted/settigns) for more information.
|
|
1497
|
+
*
|
|
1498
|
+
* *Note 2:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)`
|
|
1499
|
+
*
|
|
1500
|
+
* Will throw error when
|
|
1501
|
+
* - Writing a configuration which is not registered.
|
|
1502
|
+
* - Writing a configuration to organization or resource target when no organization is opened
|
|
1503
|
+
* - Writing a configuration to resource target when there is no resoruce settings
|
|
1504
|
+
* - Writing a resource target without passing a resoruce when getting the configuration (`organization.getConfiguration(section, resource)`)
|
|
1505
|
+
* - Writing a window configuration a resource target
|
|
1506
|
+
*
|
|
1507
|
+
* @param section Configuration name, supports _dotted_ names.
|
|
1508
|
+
* @param value The new value.
|
|
1509
|
+
* @param configurationTarget The [configuration target](#ConfigurationTarget) or a boolean value.
|
|
1510
|
+
* - If `true` configuraiton target is `ConfigurationTarget.Global`.
|
|
1511
|
+
* - If `false` configuration target is `ConfigurationTarget.Organization`.
|
|
1512
|
+
* - If `undefined` or `null` configuration target is
|
|
1513
|
+
* `ConfigurationTarget.OrganizationResource` when configuration is resource specific
|
|
1514
|
+
* `ConfigurationTarget.Organization` otherwise.
|
|
1515
|
+
*/
|
|
1516
|
+
update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean): Promise<void>;
|
|
1549
1517
|
|
|
1518
|
+
/**
|
|
1519
|
+
* Readable dictionary that backs this configuration.
|
|
1520
|
+
*/
|
|
1521
|
+
readonly [key: string]: any;
|
|
1522
|
+
}
|
|
1523
|
+
}
|