reactive-vscode 0.2.0-beta.7 → 0.2.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/index.d.ts +133 -9
- package/dist/index.js +414 -345
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
- [**Why reactive-vscode**](https://kermanx.github.io/reactive-vscode/guide/why)
|
|
13
13
|
- [**All Functions**](https://kermanx.github.io/reactive-vscode/functions/)
|
|
14
14
|
|
|
15
|
+
### Project Status
|
|
16
|
+
|
|
17
|
+
Currently, most of the VSCode APIs are covered, and this project has been used in:
|
|
18
|
+
|
|
19
|
+
- [Slidev for VSCode <sub><sub></sub></sub>](https://github.com/slidevjs/slidev/tree/main/packages/vscode)
|
|
20
|
+
- [Iconify IntelliSense <sub><sub></sub></sub>](https://github.com/antfu/vscode-iconify)
|
|
21
|
+
|
|
22
|
+
The [documentation](https://kermanx.github.io/reactive-vscode/) is complete, and the [VueUse integration](https://kermanx.github.io/reactive-vscode/guide/vueuse.html) is also available.
|
|
23
|
+
|
|
24
|
+
However, the project is still in beta and may have minor API changes. If you encounter any problems, please feel free to [open an issue](https://github.com/KermanX/reactive-vscode/issues/new).
|
|
25
|
+
|
|
15
26
|
### Counter Example
|
|
16
27
|
|
|
17
28
|
```ts
|
|
@@ -70,12 +81,14 @@ export function activate(extensionContext: ExtensionContext) {
|
|
|
70
81
|
|
|
71
82
|
[More examples](https://kermanx.github.io/reactive-vscode/examples/).
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
### License
|
|
74
85
|
|
|
75
86
|
[MIT](./LICENSE) License © 2024-PRESENT [_Kerman](https://github.com/KermanX)
|
|
76
87
|
|
|
77
88
|
Source code in [the `./packages/reactivity` directory](https://github.com/KermanX/reactive-vscode/blob/main/packages/core/src/reactivity) is ported from [`@vue/runtime-core`](https://github.com/vuejs/core/blob/main/packages/runtime-core). Licensed under a [MIT License](https://github.com/vueuse/vueuse/blob/main/LICENSE).
|
|
78
89
|
|
|
90
|
+
Source code in [the `./packages/mock` directory](https://github.com/KermanX/reactive-vscode/blob/main/packages/core/src/mock) references the implementation of [`VSCode`](https://github.com/microsoft/vscode). Licensed under a [MIT License](https://github.com/microsoft/vscode/blob/main/LICENSE.txt).
|
|
91
|
+
|
|
79
92
|
The logo <img src="https://kermanx.github.io/reactive-vscode/logo.svg" width="14"> is modified from [Vue Reactity Artworks](https://github.com/vue-reactivity/art). Licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
|
80
93
|
|
|
81
94
|
Part of the docs website is ported from [VueUse](https://github.com/vueuse/vueuse). Licensed under a [MIT License](https://github.com/vueuse/vueuse/blob/main/LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { EventEmitter } from 'vscode';
|
|
|
16
16
|
import { Extension } from 'vscode';
|
|
17
17
|
import { ExtensionContext } from 'vscode';
|
|
18
18
|
import { ExtensionTerminalOptions } from 'vscode';
|
|
19
|
+
import { FileSystemWatcher } from 'vscode';
|
|
19
20
|
import { FoldingRangeProvider } from 'vscode';
|
|
20
21
|
import { GlobPattern } from 'vscode';
|
|
21
22
|
import { LogLevel } from 'vscode';
|
|
@@ -24,6 +25,9 @@ import { MaybeRefOrGetter } from '@reactive-vscode/reactivity';
|
|
|
24
25
|
import { NotebookEditor } from 'vscode';
|
|
25
26
|
import { NotebookRange } from 'vscode';
|
|
26
27
|
import { OutputChannel } from 'vscode';
|
|
28
|
+
import { QuickInputButton } from 'vscode';
|
|
29
|
+
import { QuickPickItem } from 'vscode';
|
|
30
|
+
import { QuickPickItemButtonEvent } from 'vscode';
|
|
27
31
|
import { Range } from 'vscode';
|
|
28
32
|
import { Ref } from '@reactive-vscode/reactivity';
|
|
29
33
|
import { Selection } from 'vscode';
|
|
@@ -223,6 +227,80 @@ export declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = {
|
|
|
223
227
|
-readonly [K in keyof C]: ParseConfigType<C[K]>;
|
|
224
228
|
};
|
|
225
229
|
|
|
230
|
+
export declare interface QuickPickOptions<T extends QuickPickItem> {
|
|
231
|
+
/**
|
|
232
|
+
* Items to pick from. This can be read and updated by the extension.
|
|
233
|
+
*/
|
|
234
|
+
items?: MaybeRefOrGetter<readonly T[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Buttons for actions in the UI.
|
|
237
|
+
*/
|
|
238
|
+
buttons?: MaybeRefOrGetter<readonly QuickInputButton[]>;
|
|
239
|
+
/**
|
|
240
|
+
* An optional title.
|
|
241
|
+
*/
|
|
242
|
+
title?: MaybeRefOrGetter<string | undefined>;
|
|
243
|
+
/**
|
|
244
|
+
* An optional current step count.
|
|
245
|
+
*/
|
|
246
|
+
step?: MaybeRefOrGetter<number | undefined>;
|
|
247
|
+
/**
|
|
248
|
+
* An optional total step count.
|
|
249
|
+
*/
|
|
250
|
+
totalSteps?: MaybeRefOrGetter<number | undefined>;
|
|
251
|
+
/**
|
|
252
|
+
* If the UI should allow for user input. Defaults to true.
|
|
253
|
+
*
|
|
254
|
+
* Change this to false, e.g., while validating user input or
|
|
255
|
+
* loading data for the next step in user input.
|
|
256
|
+
*/
|
|
257
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
258
|
+
/**
|
|
259
|
+
* If the UI should show a progress indicator. Defaults to false.
|
|
260
|
+
*
|
|
261
|
+
* Change this to true, e.g., while loading more data or validating
|
|
262
|
+
* user input.
|
|
263
|
+
*/
|
|
264
|
+
busy?: MaybeRefOrGetter<boolean>;
|
|
265
|
+
/**
|
|
266
|
+
* If the UI should stay open even when loosing UI focus. Defaults to false.
|
|
267
|
+
* This setting is ignored on iPad and is always false.
|
|
268
|
+
*/
|
|
269
|
+
ignoreFocusOut?: MaybeRefOrGetter<boolean>;
|
|
270
|
+
/**
|
|
271
|
+
* Optional placeholder shown in the filter textbox when no filter has been entered.
|
|
272
|
+
*/
|
|
273
|
+
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
274
|
+
/**
|
|
275
|
+
* If multiple items can be selected at the same time. Defaults to false.
|
|
276
|
+
*/
|
|
277
|
+
canSelectMany?: MaybeRefOrGetter<boolean>;
|
|
278
|
+
/**
|
|
279
|
+
* If the filter text should also be matched against the description of the items. Defaults to false.
|
|
280
|
+
*/
|
|
281
|
+
matchOnDescription?: MaybeRefOrGetter<boolean>;
|
|
282
|
+
/**
|
|
283
|
+
* If the filter text should also be matched against the detail of the items. Defaults to false.
|
|
284
|
+
*/
|
|
285
|
+
matchOnDetail?: MaybeRefOrGetter<boolean>;
|
|
286
|
+
/**
|
|
287
|
+
* An optional flag to maintain the scroll position of the quick pick when the quick pick items are updated. Defaults to false.
|
|
288
|
+
*/
|
|
289
|
+
keepScrollPosition?: MaybeRefOrGetter<boolean>;
|
|
290
|
+
/**
|
|
291
|
+
* Initial value of the filter text.
|
|
292
|
+
*/
|
|
293
|
+
value?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Initial active items. This can be read and updated by the extension.
|
|
296
|
+
*/
|
|
297
|
+
activeItems?: readonly T[];
|
|
298
|
+
/**
|
|
299
|
+
* Initial selected items. This can be read and updated by the extension.
|
|
300
|
+
*/
|
|
301
|
+
selectedItems?: readonly T[];
|
|
302
|
+
}
|
|
303
|
+
|
|
226
304
|
export declare type TextEditorCommandCallback = (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void;
|
|
227
305
|
|
|
228
306
|
declare type ToConfigRefs<C extends object> = {
|
|
@@ -286,6 +364,7 @@ export declare const useActiveTextEditor: () => ShallowRef<TextEditor | undefine
|
|
|
286
364
|
|
|
287
365
|
/**
|
|
288
366
|
* @reactive `extensions.all`
|
|
367
|
+
* @category extension
|
|
289
368
|
*/
|
|
290
369
|
export declare const useAllExtensions: () => ComputedRef<readonly Extension<any>[]>;
|
|
291
370
|
|
|
@@ -357,7 +436,7 @@ export declare function useEditorDecorations(editor: MaybeRefOrGetter<Nullable<T
|
|
|
357
436
|
* @category utilities
|
|
358
437
|
* @reactive `Event`
|
|
359
438
|
*/
|
|
360
|
-
export declare function useEvent<T>(event: Event_2<T>, listeners?: ((e: T) => any)[]):
|
|
439
|
+
export declare function useEvent<T>(event: Event_2<T>, listeners?: ((e: T) => any)[]): (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
361
440
|
|
|
362
441
|
/**
|
|
363
442
|
* @category utilities
|
|
@@ -373,6 +452,17 @@ declare interface UseEventEmitterReturn<T> {
|
|
|
373
452
|
addListener: (listener: (e: T) => any) => void;
|
|
374
453
|
}
|
|
375
454
|
|
|
455
|
+
/**
|
|
456
|
+
* Get a reactive secret value from the extension's secrets.
|
|
457
|
+
*
|
|
458
|
+
* @reactive `ExtensionContext.secrets`
|
|
459
|
+
* @category extension
|
|
460
|
+
*/
|
|
461
|
+
export declare function useExtensionSecret(key: string): Promise<Ref<string | undefined> & {
|
|
462
|
+
set: (newValue: string) => Promise<void>;
|
|
463
|
+
remove: () => Promise<void>;
|
|
464
|
+
}>;
|
|
465
|
+
|
|
376
466
|
/**
|
|
377
467
|
* @reactive `tasks.fetchTasks`
|
|
378
468
|
*/
|
|
@@ -405,17 +495,17 @@ toJSON(): any;
|
|
|
405
495
|
*/
|
|
406
496
|
export declare function useFoldingRangeProvider(selector: DocumentSelector, provideFoldingRanges: MaybeRefOrGetter<FoldingRangeProvider['provideFoldingRanges']>): void;
|
|
407
497
|
|
|
498
|
+
export declare interface UseFSWatcher {
|
|
499
|
+
readonly watchers: ShallowReactive<Map<GlobPattern, FileSystemWatcher>>;
|
|
500
|
+
readonly onDidCreate: Event_2<Uri>;
|
|
501
|
+
readonly onDidChange: Event_2<Uri>;
|
|
502
|
+
readonly onDidDelete: Event_2<Uri>;
|
|
503
|
+
}
|
|
504
|
+
|
|
408
505
|
/**
|
|
409
506
|
* @reactive `workspace.createFileSystemWatcher`
|
|
410
507
|
*/
|
|
411
|
-
export declare function useFsWatcher(globPattern: GlobPattern
|
|
412
|
-
onDidCreate: Event_2<Uri>;
|
|
413
|
-
onDidChange: Event_2<Uri>;
|
|
414
|
-
onDidDelete: Event_2<Uri>;
|
|
415
|
-
ignoreCreateEvents: boolean;
|
|
416
|
-
ignoreChangeEvents: boolean;
|
|
417
|
-
ignoreDeleteEvents: boolean;
|
|
418
|
-
};
|
|
508
|
+
export declare function useFsWatcher(globPattern: MaybeRefOrGetter<GlobPattern | GlobPattern[]>, ignoreCreateEvents?: MaybeNullableRefOrGetter<boolean>, ignoreChangeEvents?: MaybeNullableRefOrGetter<boolean>, ignoreDeleteEvents?: MaybeNullableRefOrGetter<boolean>): UseFSWatcher;
|
|
419
509
|
|
|
420
510
|
/**
|
|
421
511
|
* Determines if the current color theme is dark. See `vscode::ColorTheme.kind`.
|
|
@@ -498,6 +588,40 @@ export declare const useOpenedTerminals: () => ShallowRef<readonly Terminal[]>;
|
|
|
498
588
|
*/
|
|
499
589
|
export declare function useOutputChannel(name: string, languageId?: string): OutputChannel;
|
|
500
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Creates a customizable quick pick UI.
|
|
593
|
+
*
|
|
594
|
+
* @reactive `window.createQuickPick`
|
|
595
|
+
*/
|
|
596
|
+
export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPickOptions<T>): {
|
|
597
|
+
onDidChangeActive: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
598
|
+
onDidChangeSelection: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
599
|
+
onDidAccept: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
600
|
+
onDidHide: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
601
|
+
onDidTriggerButton: (listener: (e: QuickInputButton) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
602
|
+
onDidChangeValue: (listener: (e: string) => any, thisArgs?: any, disposables?: Disposable_2[] | undefined) => void;
|
|
603
|
+
value: ShallowRef<string>;
|
|
604
|
+
activeItems: ShallowRef<readonly T[]>;
|
|
605
|
+
selectedItems: ShallowRef<readonly T[]>;
|
|
606
|
+
placeholder: string | undefined;
|
|
607
|
+
buttons: readonly QuickInputButton[];
|
|
608
|
+
onDidTriggerItemButton: Event_2<QuickPickItemButtonEvent<T>>;
|
|
609
|
+
items: readonly T[];
|
|
610
|
+
canSelectMany: boolean;
|
|
611
|
+
matchOnDescription: boolean;
|
|
612
|
+
matchOnDetail: boolean;
|
|
613
|
+
keepScrollPosition?: boolean | undefined;
|
|
614
|
+
title: string | undefined;
|
|
615
|
+
step: number | undefined;
|
|
616
|
+
totalSteps: number | undefined;
|
|
617
|
+
enabled: boolean;
|
|
618
|
+
busy: boolean;
|
|
619
|
+
ignoreFocusOut: boolean;
|
|
620
|
+
show(): void;
|
|
621
|
+
hide(): void;
|
|
622
|
+
dispose(): void;
|
|
623
|
+
};
|
|
624
|
+
|
|
501
625
|
/**
|
|
502
626
|
* @reactive `window.createStatusBarItem`
|
|
503
627
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
1
|
+
import { getCurrentScope as O, onScopeDispose as V, shallowRef as d, effectScope as K, computed as v, reactive as Q, toValue as r, watchEffect as b, watch as D, ref as x, shallowReactive as F, toRaw as z, isRef as Y } from "@reactive-vscode/reactivity";
|
|
2
2
|
export * from "@reactive-vscode/reactivity";
|
|
3
|
-
import { workspace as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
3
|
+
import { workspace as w, commands as y, window as c, debug as I, extensions as R, comments as G, env as S, EventEmitter as L, tasks as p, Uri as X, languages as Z, ColorThemeKind as P, l10n as N } from "vscode";
|
|
4
|
+
function _(e) {
|
|
5
|
+
return O() ? (V(e), !0) : !1;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function W(e, t) {
|
|
8
8
|
const n = /* @__PURE__ */ new Map();
|
|
9
|
-
return (...
|
|
10
|
-
const i = t(...
|
|
9
|
+
return (...a) => {
|
|
10
|
+
const i = t(...a);
|
|
11
11
|
let o = n.get(i);
|
|
12
12
|
return o ? o.refCount++ : (o = {
|
|
13
|
-
data: e(...
|
|
13
|
+
data: e(...a),
|
|
14
14
|
refCount: 1
|
|
15
|
-
}, n.set(i, o)),
|
|
15
|
+
}, n.set(i, o)), _(() => {
|
|
16
16
|
--o.refCount === 0 && n.delete(i);
|
|
17
17
|
}), o.data;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function m(e) {
|
|
21
21
|
let t;
|
|
22
22
|
return () => t ?? (t = e());
|
|
23
23
|
}
|
|
@@ -25,74 +25,74 @@ const $ = [];
|
|
|
25
25
|
function ge(e) {
|
|
26
26
|
$.push(e);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const E = d(null), A = K();
|
|
29
29
|
function he(e) {
|
|
30
30
|
return {
|
|
31
|
-
activate: (t) => (
|
|
31
|
+
activate: (t) => (E.value = t, A.run(() => (M.map((n) => n(t)), e()))),
|
|
32
32
|
deactivate: () => {
|
|
33
|
-
$.map((t) => t()),
|
|
33
|
+
$.map((t) => t()), A.stop();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
function o(
|
|
44
|
-
const
|
|
45
|
-
get: () =>
|
|
46
|
-
set: (
|
|
47
|
-
|
|
37
|
+
const M = [];
|
|
38
|
+
function j(e) {
|
|
39
|
+
E.value ? e(E.value) : M.push(e);
|
|
40
|
+
}
|
|
41
|
+
function ee(e, t, n) {
|
|
42
|
+
const a = !e, i = w.getConfiguration(a ? void 0 : e, n);
|
|
43
|
+
function o(l, f) {
|
|
44
|
+
const h = d(f), C = v({
|
|
45
|
+
get: () => h.value,
|
|
46
|
+
set: (g) => {
|
|
47
|
+
h.value = g, i.update(l, g);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
return
|
|
51
|
-
await i.update(
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
50
|
+
return C.update = async (g, U, J) => {
|
|
51
|
+
await i.update(l, g, U, J), C.value = g;
|
|
52
|
+
}, C.set = (g) => {
|
|
53
|
+
h.value = g;
|
|
54
|
+
}, C;
|
|
55
55
|
}
|
|
56
56
|
const s = Object.fromEntries(
|
|
57
|
-
Object.keys(t).map((
|
|
57
|
+
Object.keys(t).map((l) => [l, o(l, i.get(l))])
|
|
58
58
|
);
|
|
59
|
-
return
|
|
60
|
-
u(
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
for (const
|
|
64
|
-
|
|
65
|
-
} : (
|
|
66
|
-
if (!
|
|
59
|
+
return j(() => {
|
|
60
|
+
u(w.onDidChangeConfiguration(
|
|
61
|
+
a ? (l) => {
|
|
62
|
+
const f = w.getConfiguration();
|
|
63
|
+
for (const h in t)
|
|
64
|
+
l.affectsConfiguration(h) && s[h].set(f.get(h));
|
|
65
|
+
} : (l) => {
|
|
66
|
+
if (!l.affectsConfiguration(e))
|
|
67
67
|
return;
|
|
68
|
-
const
|
|
69
|
-
for (const
|
|
70
|
-
|
|
68
|
+
const f = w.getConfiguration(e);
|
|
69
|
+
for (const h in t)
|
|
70
|
+
l.affectsConfiguration(`${e}.${h}`) && s[h].set(f.get(h));
|
|
71
71
|
}
|
|
72
72
|
));
|
|
73
73
|
}), s;
|
|
74
74
|
}
|
|
75
75
|
function me(e, t, n) {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
-
...
|
|
79
|
-
$update(i, o, s,
|
|
80
|
-
return
|
|
76
|
+
const a = ee(e, t, n);
|
|
77
|
+
return Q({
|
|
78
|
+
...a,
|
|
79
|
+
$update(i, o, s, l) {
|
|
80
|
+
return a[i].update(o, s, l);
|
|
81
81
|
},
|
|
82
82
|
$set(i, o) {
|
|
83
|
-
return
|
|
83
|
+
return a[i].set(o);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function Ce(e, t) {
|
|
88
|
-
const n =
|
|
89
|
-
return
|
|
90
|
-
n.value =
|
|
91
|
-
for (const [o, s] of
|
|
88
|
+
const n = d(null), a = [], i = (o) => (...s) => n.value ? n.value[o](...s) : (a.push([o, s]), null);
|
|
89
|
+
return j(() => {
|
|
90
|
+
n.value = ue(e, t);
|
|
91
|
+
for (const [o, s] of a)
|
|
92
92
|
n.value[o](...s);
|
|
93
93
|
}), {
|
|
94
94
|
logger: n,
|
|
95
|
-
outputChannel:
|
|
95
|
+
outputChannel: v(() => {
|
|
96
96
|
var o;
|
|
97
97
|
return (o = n.value) == null ? void 0 : o.outputChannel;
|
|
98
98
|
}),
|
|
@@ -108,238 +108,262 @@ function Ce(e, t) {
|
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
function be(e, ...t) {
|
|
111
|
-
return
|
|
111
|
+
return y.executeCommand(e, ...t);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const n =
|
|
113
|
+
function te(e, t = !1) {
|
|
114
|
+
const n = E.value;
|
|
115
115
|
if (!n && !t)
|
|
116
116
|
throw new Error("Cannot get absolute path because the extension is not activated yet");
|
|
117
117
|
return n == null ? void 0 : n.asAbsolutePath(e);
|
|
118
118
|
}
|
|
119
119
|
function we(e, t = !1) {
|
|
120
|
-
return
|
|
120
|
+
return v(() => te(r(e), t));
|
|
121
121
|
}
|
|
122
122
|
function u(e) {
|
|
123
|
-
return (
|
|
123
|
+
return (O() ?? A).cleanups.push(e.dispose.bind(e)), e;
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
const e =
|
|
125
|
+
const ne = m(() => {
|
|
126
|
+
const e = d(c.activeColorTheme);
|
|
127
127
|
return u(c.onDidChangeActiveColorTheme((t) => {
|
|
128
128
|
e.value = t;
|
|
129
129
|
})), e;
|
|
130
|
-
}),
|
|
131
|
-
const e =
|
|
132
|
-
return u(
|
|
130
|
+
}), De = m(() => {
|
|
131
|
+
const e = d(I.activeDebugSession);
|
|
132
|
+
return u(I.onDidChangeActiveDebugSession((t) => {
|
|
133
133
|
e.value = t;
|
|
134
|
-
})),
|
|
135
|
-
}),
|
|
136
|
-
const e =
|
|
134
|
+
})), v(() => e.value);
|
|
135
|
+
}), ae = m(() => {
|
|
136
|
+
const e = d(c.activeTextEditor);
|
|
137
137
|
return u(c.onDidChangeActiveTextEditor((t) => {
|
|
138
138
|
e.value = t;
|
|
139
139
|
})), e;
|
|
140
140
|
});
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
|
|
141
|
+
function ie(e, t, n) {
|
|
142
|
+
const a = "key" in t ? t : c.createTextEditorDecorationType(t);
|
|
143
|
+
b(() => {
|
|
144
144
|
var i;
|
|
145
|
-
(i =
|
|
145
|
+
(i = r(e)) == null || i.setDecorations(a, r(n));
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const n =
|
|
150
|
-
|
|
148
|
+
function Te(e, t) {
|
|
149
|
+
const n = ae();
|
|
150
|
+
ie(n, e, t);
|
|
151
151
|
}
|
|
152
|
-
const Se =
|
|
153
|
-
const e =
|
|
152
|
+
const Se = m(() => {
|
|
153
|
+
const e = d(c.activeNotebookEditor);
|
|
154
154
|
return u(c.onDidChangeActiveNotebookEditor((t) => {
|
|
155
155
|
e.value = t;
|
|
156
156
|
})), e;
|
|
157
|
-
}), pe =
|
|
158
|
-
const e =
|
|
157
|
+
}), pe = m(() => {
|
|
158
|
+
const e = d(c.activeTerminal);
|
|
159
159
|
return u(c.onDidChangeActiveTerminal((t) => {
|
|
160
160
|
e.value = t;
|
|
161
161
|
})), e;
|
|
162
|
-
}),
|
|
163
|
-
const e =
|
|
162
|
+
}), Ee = m(() => {
|
|
163
|
+
const e = d(R.all);
|
|
164
164
|
return u(R.onDidChange(() => {
|
|
165
165
|
e.value = R.all;
|
|
166
|
-
})),
|
|
166
|
+
})), v(() => e.value);
|
|
167
167
|
});
|
|
168
|
-
function
|
|
169
|
-
u(
|
|
168
|
+
function re(e, t) {
|
|
169
|
+
u(y.registerCommand(e, t));
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function xe(e) {
|
|
172
172
|
for (const [t, n] of Object.entries(e))
|
|
173
|
-
n &&
|
|
173
|
+
n && re(t, n);
|
|
174
174
|
}
|
|
175
175
|
function ke(e, t) {
|
|
176
176
|
return u(G.createCommentController(e, t));
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function B(e) {
|
|
179
179
|
var n;
|
|
180
|
-
const t =
|
|
181
|
-
return
|
|
182
|
-
var
|
|
183
|
-
t.value = (
|
|
184
|
-
}), u(c.onDidChangeTerminalState((
|
|
185
|
-
|
|
186
|
-
})),
|
|
187
|
-
}
|
|
188
|
-
function
|
|
189
|
-
const t =
|
|
180
|
+
const t = d((n = r(e)) == null ? void 0 : n.state);
|
|
181
|
+
return D(e, () => {
|
|
182
|
+
var a;
|
|
183
|
+
t.value = (a = r(e)) == null ? void 0 : a.state;
|
|
184
|
+
}), u(c.onDidChangeTerminalState((a) => {
|
|
185
|
+
a === r(e) && (t.value = a.state);
|
|
186
|
+
})), v(() => t.value);
|
|
187
|
+
}
|
|
188
|
+
function ye(...e) {
|
|
189
|
+
const t = x(null);
|
|
190
190
|
function n() {
|
|
191
191
|
return !!t.value && t.value.exitStatus == null;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function a() {
|
|
194
194
|
return n() ? t.value : t.value = c.createTerminal(...e);
|
|
195
195
|
}
|
|
196
|
-
function i(
|
|
197
|
-
|
|
196
|
+
function i(l) {
|
|
197
|
+
a().sendText(l);
|
|
198
198
|
}
|
|
199
199
|
function o() {
|
|
200
|
-
|
|
200
|
+
a().show();
|
|
201
201
|
}
|
|
202
202
|
function s() {
|
|
203
203
|
n() && (t.value.sendText(""), t.value.dispose(), t.value = null);
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return V(s), {
|
|
206
206
|
terminal: t,
|
|
207
207
|
getIsActive: n,
|
|
208
208
|
show: o,
|
|
209
209
|
sendText: i,
|
|
210
210
|
close: s,
|
|
211
|
-
state:
|
|
211
|
+
state: B(t)
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
const
|
|
215
|
-
const e =
|
|
216
|
-
return u(
|
|
214
|
+
const Re = m(() => {
|
|
215
|
+
const e = d(S.shell);
|
|
216
|
+
return u(S.onDidChangeShell((t) => {
|
|
217
217
|
e.value = t;
|
|
218
|
-
})),
|
|
218
|
+
})), v(() => e.value);
|
|
219
219
|
});
|
|
220
|
-
function
|
|
220
|
+
function Ae(e) {
|
|
221
221
|
var n;
|
|
222
|
-
const t =
|
|
223
|
-
return
|
|
224
|
-
var
|
|
225
|
-
t.value = (
|
|
226
|
-
}), u(
|
|
227
|
-
|
|
222
|
+
const t = d((n = r(e)) == null ? void 0 : n.getText());
|
|
223
|
+
return b(() => {
|
|
224
|
+
var a;
|
|
225
|
+
t.value = (a = r(e)) == null ? void 0 : a.getText();
|
|
226
|
+
}), u(w.onDidChangeTextDocument((a) => {
|
|
227
|
+
a.document === r(e) && (t.value = a.document.getText());
|
|
228
228
|
})), t;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
const n = (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return n;
|
|
230
|
+
function T(e, t) {
|
|
231
|
+
const n = (a, i, o) => {
|
|
232
|
+
u(e(a, i, o));
|
|
233
|
+
};
|
|
234
|
+
return t == null || t.forEach((a) => n(a)), n;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
const n = Array.isArray(e) ? e : t ?? [],
|
|
236
|
+
function k(e, t = []) {
|
|
237
|
+
const n = Array.isArray(e) ? e : t ?? [], a = u(Array.isArray(e) || e == null ? new L() : e), i = T(a.event, n);
|
|
238
238
|
for (const o of n)
|
|
239
239
|
i(o);
|
|
240
240
|
return {
|
|
241
|
-
event:
|
|
242
|
-
fire:
|
|
241
|
+
event: a.event,
|
|
242
|
+
fire: a.fire.bind(a),
|
|
243
243
|
addListener: i
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
246
|
+
async function Ve(e) {
|
|
247
|
+
const t = E.value.secrets, n = x(await t.get(e));
|
|
248
|
+
return n.set = async (a) => {
|
|
249
|
+
n.value = a, await t.store(e, a);
|
|
250
|
+
}, n.remove = async () => {
|
|
251
|
+
n.value = void 0, await t.delete(e);
|
|
252
|
+
}, u(t.onDidChange(async (a) => {
|
|
253
|
+
a.key === e && (n.value = await t.get(e));
|
|
254
|
+
})), D(n, (a) => {
|
|
255
|
+
a === void 0 ? t.delete(e) : t.store(e, a);
|
|
256
|
+
}), n;
|
|
257
|
+
}
|
|
258
|
+
function Ie(e) {
|
|
259
|
+
return v(() => p.fetchTasks(r(e)));
|
|
248
260
|
}
|
|
249
261
|
function oe(e) {
|
|
250
|
-
return
|
|
262
|
+
return F({
|
|
251
263
|
get scheme() {
|
|
252
|
-
return
|
|
264
|
+
return r(e).scheme;
|
|
253
265
|
},
|
|
254
266
|
get authority() {
|
|
255
|
-
return
|
|
267
|
+
return r(e).authority;
|
|
256
268
|
},
|
|
257
269
|
get path() {
|
|
258
|
-
return
|
|
270
|
+
return r(e).path;
|
|
259
271
|
},
|
|
260
272
|
get query() {
|
|
261
|
-
return
|
|
273
|
+
return r(e).query;
|
|
262
274
|
},
|
|
263
275
|
get fragment() {
|
|
264
|
-
return
|
|
276
|
+
return r(e).fragment;
|
|
265
277
|
},
|
|
266
278
|
get fsPath() {
|
|
267
|
-
return
|
|
279
|
+
return r(e).fsPath;
|
|
268
280
|
},
|
|
269
281
|
with(t) {
|
|
270
|
-
return
|
|
282
|
+
return r(e).with(t);
|
|
271
283
|
},
|
|
272
284
|
toString() {
|
|
273
|
-
return
|
|
285
|
+
return r(e).toString();
|
|
274
286
|
},
|
|
275
287
|
toJSON() {
|
|
276
|
-
return
|
|
288
|
+
return r(e).toJSON();
|
|
277
289
|
}
|
|
278
290
|
});
|
|
279
291
|
}
|
|
280
|
-
function
|
|
281
|
-
return oe(() =>
|
|
292
|
+
function Pe(e) {
|
|
293
|
+
return oe(() => X.file(r(e)));
|
|
282
294
|
}
|
|
283
|
-
function
|
|
284
|
-
const n = new
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}), u(
|
|
295
|
+
function Ne(e, t) {
|
|
296
|
+
const n = new L(), a = d();
|
|
297
|
+
b(() => {
|
|
298
|
+
a.value && n.fire(), a.value = r(t);
|
|
299
|
+
}), u(Z.registerFoldingRangeProvider(
|
|
288
300
|
e,
|
|
289
301
|
{
|
|
290
302
|
onDidChangeFoldingRanges: n.event,
|
|
291
303
|
provideFoldingRanges(i, o, s) {
|
|
292
|
-
var
|
|
293
|
-
return (
|
|
304
|
+
var l;
|
|
305
|
+
return (l = a.value) == null ? void 0 : l.call(a, i, o, s);
|
|
294
306
|
}
|
|
295
307
|
}
|
|
296
308
|
));
|
|
297
309
|
}
|
|
298
|
-
function
|
|
299
|
-
const i =
|
|
300
|
-
return {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
310
|
+
function Oe(e, t, n, a) {
|
|
311
|
+
const i = F(/* @__PURE__ */ new Map()), o = k(), s = k(), l = k();
|
|
312
|
+
return b(() => {
|
|
313
|
+
const f = r(e), h = Array.isArray(f) ? f : [f];
|
|
314
|
+
for (const [C, g] of i)
|
|
315
|
+
h.includes(C) || (g.dispose(), i.delete(C));
|
|
316
|
+
for (const C of h)
|
|
317
|
+
if (!i.has(C)) {
|
|
318
|
+
const g = w.createFileSystemWatcher(
|
|
319
|
+
C,
|
|
320
|
+
r(t) || !1,
|
|
321
|
+
r(n) || !1,
|
|
322
|
+
r(a) || !1
|
|
323
|
+
);
|
|
324
|
+
g.onDidCreate(o.fire), g.onDidChange(s.fire), g.onDidDelete(l.fire);
|
|
325
|
+
}
|
|
326
|
+
}), V(() => {
|
|
327
|
+
for (const f of i.values())
|
|
328
|
+
f.dispose();
|
|
329
|
+
i.clear();
|
|
330
|
+
}), {
|
|
331
|
+
watchers: i,
|
|
332
|
+
onDidCreate: o.event,
|
|
333
|
+
onDidChange: s.event,
|
|
334
|
+
onDidDelete: l.event
|
|
305
335
|
};
|
|
306
336
|
}
|
|
307
|
-
const Fe =
|
|
308
|
-
const e =
|
|
309
|
-
return
|
|
310
|
-
}),
|
|
311
|
-
const e =
|
|
312
|
-
return u(
|
|
337
|
+
const Fe = m(() => {
|
|
338
|
+
const e = ne();
|
|
339
|
+
return v(() => e.value.kind === P.Dark || e.value.kind === P.HighContrast);
|
|
340
|
+
}), Le = m(() => {
|
|
341
|
+
const e = d(S.isTelemetryEnabled);
|
|
342
|
+
return u(S.onDidChangeTelemetryEnabled((t) => {
|
|
313
343
|
e.value = t;
|
|
314
|
-
})),
|
|
344
|
+
})), v(() => e.value);
|
|
315
345
|
});
|
|
316
|
-
function
|
|
317
|
-
return
|
|
346
|
+
function We(e, ...t) {
|
|
347
|
+
return v(() => typeof t[0] == "object" ? N.t(r(e), z(t[0])) : N.t(r(e), ...t.map(r)));
|
|
318
348
|
}
|
|
319
|
-
|
|
320
|
-
const e = l(T.logLevel);
|
|
321
|
-
return u(T.onDidChangeLogLevel((t) => {
|
|
322
|
-
e.value = t;
|
|
323
|
-
})), f(() => e.value);
|
|
324
|
-
});
|
|
325
|
-
function ue(e, t) {
|
|
349
|
+
function se(e, t) {
|
|
326
350
|
return u(c.createOutputChannel(e, t));
|
|
327
351
|
}
|
|
328
|
-
function
|
|
329
|
-
const t = /* @__PURE__ */ new Date(), n = String(t.getFullYear()).padStart(4, "0"),
|
|
330
|
-
return `${n}-${
|
|
352
|
+
function $e(e) {
|
|
353
|
+
const t = /* @__PURE__ */ new Date(), n = String(t.getFullYear()).padStart(4, "0"), a = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), o = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), l = String(t.getSeconds()).padStart(2, "0"), f = String(t.getMilliseconds()).padStart(3, "0");
|
|
354
|
+
return `${n}-${a}-${i} ${o}:${s}:${l}.${f} [${e}] `;
|
|
331
355
|
}
|
|
332
|
-
function
|
|
333
|
-
const n = t.outputChannel ??
|
|
356
|
+
function ue(e, t = {}) {
|
|
357
|
+
const n = t.outputChannel ?? se(e), a = (i) => (...o) => {
|
|
334
358
|
var s;
|
|
335
359
|
n.appendLine((((s = t.getPrefix) == null ? void 0 : s.call(t, i)) ?? "") + o.join(" "));
|
|
336
360
|
};
|
|
337
361
|
return {
|
|
338
362
|
outputChannel: n,
|
|
339
|
-
createLoggerFunc:
|
|
340
|
-
info:
|
|
341
|
-
warn:
|
|
342
|
-
error:
|
|
363
|
+
createLoggerFunc: a,
|
|
364
|
+
info: a("INFO"),
|
|
365
|
+
warn: a("WARN"),
|
|
366
|
+
error: a("ERROR"),
|
|
343
367
|
append: n.append.bind(n),
|
|
344
368
|
appendLine: n.appendLine.bind(n),
|
|
345
369
|
replace: n.replace.bind(n),
|
|
@@ -348,28 +372,34 @@ function se(e, t = {}) {
|
|
|
348
372
|
hide: n.hide.bind(n)
|
|
349
373
|
};
|
|
350
374
|
}
|
|
375
|
+
const Me = m(() => {
|
|
376
|
+
const e = d(S.logLevel);
|
|
377
|
+
return u(S.onDidChangeLogLevel((t) => {
|
|
378
|
+
e.value = t;
|
|
379
|
+
})), v(() => e.value);
|
|
380
|
+
});
|
|
351
381
|
function ce(e) {
|
|
352
382
|
var n;
|
|
353
|
-
const t =
|
|
354
|
-
return
|
|
355
|
-
var
|
|
356
|
-
t.value = ((
|
|
357
|
-
}), u(c.onDidChangeNotebookEditorSelection((
|
|
358
|
-
|
|
359
|
-
})),
|
|
383
|
+
const t = d(((n = r(e)) == null ? void 0 : n.selections) ?? []);
|
|
384
|
+
return D(e, () => {
|
|
385
|
+
var a;
|
|
386
|
+
t.value = ((a = r(e)) == null ? void 0 : a.selections) ?? [];
|
|
387
|
+
}), u(c.onDidChangeNotebookEditorSelection((a) => {
|
|
388
|
+
a.notebookEditor === r(e) && (t.value = a.selections);
|
|
389
|
+
})), v({
|
|
360
390
|
get() {
|
|
361
391
|
return t.value;
|
|
362
392
|
},
|
|
363
|
-
set(
|
|
364
|
-
t.value =
|
|
365
|
-
const i =
|
|
366
|
-
i && (i.selections =
|
|
393
|
+
set(a) {
|
|
394
|
+
t.value = a;
|
|
395
|
+
const i = r(e);
|
|
396
|
+
i && (i.selections = a);
|
|
367
397
|
}
|
|
368
398
|
});
|
|
369
399
|
}
|
|
370
|
-
function
|
|
400
|
+
function je(e) {
|
|
371
401
|
const t = ce(e);
|
|
372
|
-
return
|
|
402
|
+
return v({
|
|
373
403
|
get() {
|
|
374
404
|
return t.value[0];
|
|
375
405
|
},
|
|
@@ -378,28 +408,65 @@ function Me(e) {
|
|
|
378
408
|
}
|
|
379
409
|
});
|
|
380
410
|
}
|
|
381
|
-
function
|
|
411
|
+
function Be(e) {
|
|
382
412
|
var n;
|
|
383
|
-
const t =
|
|
384
|
-
return
|
|
385
|
-
var
|
|
386
|
-
t.value = ((
|
|
387
|
-
}), u(c.onDidChangeNotebookEditorVisibleRanges((
|
|
388
|
-
|
|
389
|
-
})),
|
|
390
|
-
}
|
|
391
|
-
const
|
|
392
|
-
const e =
|
|
413
|
+
const t = d(((n = r(e)) == null ? void 0 : n.visibleRanges) ?? []);
|
|
414
|
+
return D(e, () => {
|
|
415
|
+
var a;
|
|
416
|
+
t.value = ((a = r(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
417
|
+
}), u(c.onDidChangeNotebookEditorVisibleRanges((a) => {
|
|
418
|
+
a.notebookEditor === r(e) && (t.value = a.visibleRanges);
|
|
419
|
+
})), v(() => t.value);
|
|
420
|
+
}
|
|
421
|
+
const He = m(() => {
|
|
422
|
+
const e = d(c.terminals);
|
|
393
423
|
function t() {
|
|
394
424
|
e.value = c.terminals;
|
|
395
425
|
}
|
|
396
426
|
return u(c.onDidOpenTerminal(t)), u(c.onDidCloseTerminal(t)), e;
|
|
397
427
|
});
|
|
398
|
-
function
|
|
428
|
+
function qe(e = {}) {
|
|
429
|
+
const t = u(c.createQuickPick()), n = T(t.onDidChangeActive), a = T(t.onDidChangeSelection), i = T(t.onDidAccept), o = T(t.onDidHide), s = T(t.onDidTriggerButton), l = T(t.onDidChangeValue);
|
|
430
|
+
[
|
|
431
|
+
"items",
|
|
432
|
+
"buttons",
|
|
433
|
+
"title",
|
|
434
|
+
"step",
|
|
435
|
+
"totalSteps",
|
|
436
|
+
"enabled",
|
|
437
|
+
"busy",
|
|
438
|
+
"ignoreFocusOut",
|
|
439
|
+
"placeholder",
|
|
440
|
+
"canSelectMany",
|
|
441
|
+
"matchOnDescription",
|
|
442
|
+
"matchOnDetail",
|
|
443
|
+
"keepScrollPosition"
|
|
444
|
+
].forEach((g) => {
|
|
445
|
+
e[g] && b(() => t[g] = r(e[g]));
|
|
446
|
+
}), e.value && (t.value = e.value);
|
|
447
|
+
const f = d(t.value);
|
|
448
|
+
l((g) => f.value = g), e.activeItems && (t.activeItems = e.activeItems);
|
|
449
|
+
const h = d(t.activeItems);
|
|
450
|
+
n((g) => h.value = g), e.selectedItems && (t.selectedItems = e.selectedItems);
|
|
451
|
+
const C = d(t.selectedItems);
|
|
452
|
+
return a((g) => C.value = g), {
|
|
453
|
+
...t,
|
|
454
|
+
onDidChangeActive: n,
|
|
455
|
+
onDidChangeSelection: a,
|
|
456
|
+
onDidAccept: i,
|
|
457
|
+
onDidHide: o,
|
|
458
|
+
onDidTriggerButton: s,
|
|
459
|
+
onDidChangeValue: l,
|
|
460
|
+
value: f,
|
|
461
|
+
activeItems: h,
|
|
462
|
+
selectedItems: C
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
function Ue(e) {
|
|
399
466
|
const t = u(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority));
|
|
400
|
-
function n(
|
|
401
|
-
const i = e[
|
|
402
|
-
i != null &&
|
|
467
|
+
function n(a) {
|
|
468
|
+
const i = e[a];
|
|
469
|
+
i != null && b(() => t[a] = r(i));
|
|
403
470
|
}
|
|
404
471
|
return [
|
|
405
472
|
"name",
|
|
@@ -411,14 +478,14 @@ function He(e) {
|
|
|
411
478
|
"accessibilityInformation"
|
|
412
479
|
].forEach(n), t;
|
|
413
480
|
}
|
|
414
|
-
const
|
|
415
|
-
const e =
|
|
481
|
+
const Je = m(() => {
|
|
482
|
+
const e = d(p.taskExecutions);
|
|
416
483
|
function t() {
|
|
417
|
-
e.value =
|
|
484
|
+
e.value = p.taskExecutions;
|
|
418
485
|
}
|
|
419
|
-
return u(
|
|
486
|
+
return u(p.onDidStartTask(t)), u(p.onDidEndTask(t)), v(() => e.value);
|
|
420
487
|
});
|
|
421
|
-
function
|
|
488
|
+
function Ke(...e) {
|
|
422
489
|
const t = u(c.createTerminal(...e));
|
|
423
490
|
return {
|
|
424
491
|
terminal: t,
|
|
@@ -437,144 +504,144 @@ function qe(...e) {
|
|
|
437
504
|
sendText: t.sendText.bind(t),
|
|
438
505
|
show: t.show.bind(t),
|
|
439
506
|
hide: t.hide.bind(t),
|
|
440
|
-
state:
|
|
507
|
+
state: B(t)
|
|
441
508
|
};
|
|
442
509
|
}
|
|
443
510
|
function le(e, t) {
|
|
444
|
-
u(
|
|
511
|
+
u(y.registerTextEditorCommand(e, t));
|
|
445
512
|
}
|
|
446
|
-
function
|
|
513
|
+
function Qe(e) {
|
|
447
514
|
for (const [t, n] of Object.entries(e))
|
|
448
515
|
le(t, n);
|
|
449
516
|
}
|
|
450
517
|
function de(e, t) {
|
|
451
|
-
var
|
|
452
|
-
const n =
|
|
453
|
-
return
|
|
518
|
+
var a;
|
|
519
|
+
const n = d(((a = r(e)) == null ? void 0 : a.selections) ?? []);
|
|
520
|
+
return D(e, () => {
|
|
454
521
|
var i;
|
|
455
|
-
n.value = ((i =
|
|
522
|
+
n.value = ((i = r(e)) == null ? void 0 : i.selections) ?? [];
|
|
456
523
|
}), u(c.onDidChangeTextEditorSelection((i) => {
|
|
457
|
-
const o =
|
|
524
|
+
const o = r(e), s = r(t);
|
|
458
525
|
i.textEditor === o && (!s || s.includes(i.kind)) && (n.value = i.selections);
|
|
459
|
-
})),
|
|
526
|
+
})), v({
|
|
460
527
|
get() {
|
|
461
528
|
return n.value;
|
|
462
529
|
},
|
|
463
530
|
set(i) {
|
|
464
531
|
n.value = i;
|
|
465
|
-
const o =
|
|
532
|
+
const o = r(e);
|
|
466
533
|
o && (o.selections = i);
|
|
467
534
|
}
|
|
468
535
|
});
|
|
469
536
|
}
|
|
470
|
-
function
|
|
537
|
+
function ze(e, t) {
|
|
471
538
|
const n = de(e, t);
|
|
472
|
-
return
|
|
539
|
+
return v({
|
|
473
540
|
get() {
|
|
474
541
|
return n.value[0];
|
|
475
542
|
},
|
|
476
|
-
set(
|
|
477
|
-
n.value = n.value.toSpliced(0, 1,
|
|
543
|
+
set(a) {
|
|
544
|
+
n.value = n.value.toSpliced(0, 1, a);
|
|
478
545
|
}
|
|
479
546
|
});
|
|
480
547
|
}
|
|
481
|
-
function ze(e) {
|
|
482
|
-
var n;
|
|
483
|
-
const t = l((n = a(e)) == null ? void 0 : n.viewColumn);
|
|
484
|
-
return b(e, () => {
|
|
485
|
-
var r;
|
|
486
|
-
t.value = (r = a(e)) == null ? void 0 : r.viewColumn;
|
|
487
|
-
}), u(c.onDidChangeTextEditorViewColumn((r) => {
|
|
488
|
-
r.textEditor === a(e) && (t.value = r.viewColumn);
|
|
489
|
-
})), f(() => t.value);
|
|
490
|
-
}
|
|
491
548
|
function Ye(e) {
|
|
492
549
|
var n;
|
|
493
|
-
const t =
|
|
494
|
-
return
|
|
495
|
-
var
|
|
496
|
-
t.value = (
|
|
497
|
-
}), u(c.
|
|
498
|
-
|
|
499
|
-
})),
|
|
500
|
-
}
|
|
501
|
-
function
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
550
|
+
const t = d((n = r(e)) == null ? void 0 : n.viewColumn);
|
|
551
|
+
return D(e, () => {
|
|
552
|
+
var a;
|
|
553
|
+
t.value = (a = r(e)) == null ? void 0 : a.viewColumn;
|
|
554
|
+
}), u(c.onDidChangeTextEditorViewColumn((a) => {
|
|
555
|
+
a.textEditor === r(e) && (t.value = a.viewColumn);
|
|
556
|
+
})), v(() => t.value);
|
|
557
|
+
}
|
|
558
|
+
function Ge(e) {
|
|
559
|
+
var n;
|
|
560
|
+
const t = d(((n = r(e)) == null ? void 0 : n.visibleRanges) ?? []);
|
|
561
|
+
return D(e, () => {
|
|
562
|
+
var a;
|
|
563
|
+
t.value = ((a = r(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
564
|
+
}), u(c.onDidChangeTextEditorVisibleRanges((a) => {
|
|
565
|
+
a.textEditor === r(e) && (t.value = a.visibleRanges);
|
|
566
|
+
})), v(() => t.value);
|
|
567
|
+
}
|
|
568
|
+
function H(e, t) {
|
|
569
|
+
b(() => {
|
|
570
|
+
const n = r(e);
|
|
571
|
+
n && (n.badge = r(t));
|
|
505
572
|
});
|
|
506
573
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
509
|
-
const n =
|
|
510
|
-
n && (n.title =
|
|
574
|
+
function q(e, t) {
|
|
575
|
+
b(() => {
|
|
576
|
+
const n = r(e);
|
|
577
|
+
n && (n.title = r(t));
|
|
511
578
|
});
|
|
512
579
|
}
|
|
513
|
-
const
|
|
580
|
+
const Xe = W(
|
|
514
581
|
(e, t, n) => {
|
|
515
|
-
const
|
|
516
|
-
|
|
582
|
+
const a = k();
|
|
583
|
+
D(t, () => a.fire()), n != null && n.watchSource && D(n.watchSource, () => a.fire());
|
|
517
584
|
const i = /* @__PURE__ */ new WeakMap(), o = u(c.createTreeView(e, {
|
|
518
585
|
...n,
|
|
519
586
|
treeDataProvider: {
|
|
520
587
|
...n,
|
|
521
|
-
onDidChangeTreeData:
|
|
588
|
+
onDidChangeTreeData: a.event,
|
|
522
589
|
getTreeItem(s) {
|
|
523
590
|
return s.treeItem;
|
|
524
591
|
},
|
|
525
592
|
getChildren(s) {
|
|
526
|
-
var
|
|
527
|
-
return s ? ((
|
|
593
|
+
var l;
|
|
594
|
+
return s ? ((l = s.children) == null || l.forEach((f) => i.set(f, s)), s.children) : r(t);
|
|
528
595
|
},
|
|
529
596
|
getParent(s) {
|
|
530
597
|
return i.get(s);
|
|
531
598
|
}
|
|
532
599
|
}
|
|
533
600
|
}));
|
|
534
|
-
return n != null && n.title &&
|
|
601
|
+
return n != null && n.title && q(o, n.title), n != null && n.badge && H(o, n.badge), o;
|
|
535
602
|
},
|
|
536
603
|
(e) => e
|
|
537
604
|
);
|
|
538
|
-
function
|
|
539
|
-
var
|
|
540
|
-
const t =
|
|
605
|
+
function Ze(e) {
|
|
606
|
+
var a;
|
|
607
|
+
const t = x((a = r(e)) == null ? void 0 : a.visible);
|
|
541
608
|
function n() {
|
|
542
609
|
var i;
|
|
543
|
-
t.value = (i =
|
|
610
|
+
t.value = (i = r(e)) == null ? void 0 : i.visible;
|
|
544
611
|
}
|
|
545
|
-
return
|
|
546
|
-
const o =
|
|
612
|
+
return b((i) => {
|
|
613
|
+
const o = r(e);
|
|
547
614
|
if (o) {
|
|
548
615
|
const s = o.onDidChangeVisibility(n);
|
|
549
616
|
i(() => s.dispose());
|
|
550
617
|
}
|
|
551
|
-
}),
|
|
618
|
+
}), b(n), v(() => !!t.value);
|
|
552
619
|
}
|
|
553
|
-
const
|
|
554
|
-
const e =
|
|
620
|
+
const _e = m(() => {
|
|
621
|
+
const e = d(c.visibleNotebookEditors);
|
|
555
622
|
return u(c.onDidChangeVisibleNotebookEditors((t) => {
|
|
556
623
|
e.value = t;
|
|
557
624
|
})), e;
|
|
558
|
-
}),
|
|
559
|
-
const e =
|
|
625
|
+
}), et = m(() => {
|
|
626
|
+
const e = d(c.visibleTextEditors);
|
|
560
627
|
return u(c.onDidChangeVisibleTextEditors((t) => {
|
|
561
628
|
e.value = t;
|
|
562
629
|
})), e;
|
|
563
630
|
});
|
|
564
|
-
function
|
|
565
|
-
const
|
|
566
|
-
return
|
|
567
|
-
|
|
568
|
-
}),
|
|
631
|
+
function tt(e, t, n = !0) {
|
|
632
|
+
const a = Y(t) ? t : typeof t == "function" ? v(t) : x(t);
|
|
633
|
+
return b(() => {
|
|
634
|
+
r(n) && y.executeCommand("setContext", e, a.value);
|
|
635
|
+
}), a;
|
|
569
636
|
}
|
|
570
|
-
const
|
|
637
|
+
const nt = W(
|
|
571
638
|
(e, t, n) => {
|
|
572
|
-
const
|
|
639
|
+
const a = d(), i = d();
|
|
573
640
|
u(c.registerWebviewViewProvider(
|
|
574
641
|
e,
|
|
575
642
|
{
|
|
576
|
-
resolveWebviewView(
|
|
577
|
-
|
|
643
|
+
resolveWebviewView(f, h) {
|
|
644
|
+
a.value = f, i.value = h, n != null && n.onDidReceiveMessage && f.webview.onDidReceiveMessage(n.onDidReceiveMessage);
|
|
578
645
|
}
|
|
579
646
|
},
|
|
580
647
|
{
|
|
@@ -583,107 +650,109 @@ const et = O(
|
|
|
583
650
|
}
|
|
584
651
|
}
|
|
585
652
|
));
|
|
586
|
-
const o =
|
|
653
|
+
const o = x(0);
|
|
587
654
|
function s() {
|
|
588
655
|
o.value++;
|
|
589
656
|
}
|
|
590
|
-
if (
|
|
591
|
-
|
|
657
|
+
if (b(() => {
|
|
658
|
+
a.value && (a.value.webview.html = `${r(t)}<!--${o.value}-->`);
|
|
592
659
|
}), n != null && n.webviewOptions) {
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
|
|
660
|
+
const f = n.webviewOptions;
|
|
661
|
+
b(() => {
|
|
662
|
+
a.value && (a.value.webview.options = r(f));
|
|
596
663
|
});
|
|
597
664
|
}
|
|
598
|
-
n != null && n.title &&
|
|
599
|
-
function
|
|
600
|
-
var
|
|
601
|
-
return (
|
|
665
|
+
n != null && n.title && q(a, n.title), n != null && n.badge && H(a, n.badge);
|
|
666
|
+
function l(f) {
|
|
667
|
+
var h;
|
|
668
|
+
return (h = a.value) == null ? void 0 : h.webview.postMessage(f);
|
|
602
669
|
}
|
|
603
|
-
return { view:
|
|
670
|
+
return { view: a, context: i, postMessage: l, forceRefresh: s };
|
|
604
671
|
},
|
|
605
672
|
(e) => e
|
|
606
|
-
),
|
|
607
|
-
const e =
|
|
673
|
+
), at = m(() => {
|
|
674
|
+
const e = d(c.state);
|
|
608
675
|
return u(c.onDidChangeWindowState((t) => {
|
|
609
676
|
e.value = t;
|
|
610
677
|
})), {
|
|
611
|
-
focused:
|
|
612
|
-
active:
|
|
678
|
+
focused: v(() => e.value.focused),
|
|
679
|
+
active: v(() => e.value.active)
|
|
613
680
|
};
|
|
614
|
-
}),
|
|
615
|
-
const e =
|
|
616
|
-
return u(
|
|
617
|
-
e.value =
|
|
618
|
-
})),
|
|
681
|
+
}), it = m(() => {
|
|
682
|
+
const e = d(w.workspaceFolders);
|
|
683
|
+
return u(w.onDidChangeWorkspaceFolders(() => {
|
|
684
|
+
e.value = w.workspaceFolders;
|
|
685
|
+
})), v(() => e.value);
|
|
619
686
|
});
|
|
620
687
|
export {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
688
|
+
M as activateCbs,
|
|
689
|
+
W as createKeyedComposable,
|
|
690
|
+
m as createSingletonComposable,
|
|
624
691
|
$ as deactivateCbs,
|
|
625
692
|
me as defineConfigObject,
|
|
626
|
-
|
|
693
|
+
ee as defineConfigs,
|
|
627
694
|
he as defineExtension,
|
|
628
695
|
Ce as defineLogger,
|
|
629
696
|
be as executeCommand,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
697
|
+
E as extensionContext,
|
|
698
|
+
A as extensionScope,
|
|
699
|
+
$e as getDefaultLoggerPrefix,
|
|
700
|
+
j as onActivate,
|
|
634
701
|
ge as onDeactivate,
|
|
635
|
-
|
|
702
|
+
_ as tryOnScopeDispose,
|
|
636
703
|
we as useAbsolutePath,
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
704
|
+
ne as useActiveColorTheme,
|
|
705
|
+
De as useActiveDebugSession,
|
|
706
|
+
Te as useActiveEditorDecorations,
|
|
640
707
|
Se as useActiveNotebookEditor,
|
|
641
708
|
pe as useActiveTerminal,
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
709
|
+
ae as useActiveTextEditor,
|
|
710
|
+
Ee as useAllExtensions,
|
|
711
|
+
re as useCommand,
|
|
712
|
+
xe as useCommands,
|
|
646
713
|
ke as useCommentController,
|
|
647
|
-
|
|
648
|
-
|
|
714
|
+
ye as useControlledTerminal,
|
|
715
|
+
Re as useDefaultShell,
|
|
649
716
|
u as useDisposable,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
717
|
+
Ae as useDocumentText,
|
|
718
|
+
ie as useEditorDecorations,
|
|
719
|
+
T as useEvent,
|
|
720
|
+
k as useEventEmitter,
|
|
721
|
+
Ve as useExtensionSecret,
|
|
722
|
+
Ie as useFetchTasks,
|
|
723
|
+
Pe as useFileUri,
|
|
724
|
+
Ne as useFoldingRangeProvider,
|
|
725
|
+
Oe as useFsWatcher,
|
|
658
726
|
Fe as useIsDarkTheme,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
727
|
+
Le as useIsTelemetryEnabled,
|
|
728
|
+
We as useL10nText,
|
|
729
|
+
Me as useLogLevel,
|
|
730
|
+
ue as useLogger,
|
|
731
|
+
je as useNotebookEditorSelection,
|
|
664
732
|
ce as useNotebookEditorSelections,
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
Ue as
|
|
670
|
-
|
|
671
|
-
|
|
733
|
+
Be as useNotebookEditorVisibleRanges,
|
|
734
|
+
He as useOpenedTerminals,
|
|
735
|
+
se as useOutputChannel,
|
|
736
|
+
qe as useQuickPick,
|
|
737
|
+
Ue as useStatusBarItem,
|
|
738
|
+
Je as useTaskExecutions,
|
|
739
|
+
Ke as useTerminal,
|
|
740
|
+
B as useTerminalState,
|
|
672
741
|
le as useTextEditorCommand,
|
|
673
|
-
|
|
674
|
-
|
|
742
|
+
Qe as useTextEditorCommands,
|
|
743
|
+
ze as useTextEditorSelection,
|
|
675
744
|
de as useTextEditorSelections,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
745
|
+
Ye as useTextEditorViewColumn,
|
|
746
|
+
Ge as useTextEditorVisibleRanges,
|
|
747
|
+
Xe as useTreeView,
|
|
679
748
|
oe as useUri,
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
749
|
+
H as useViewBadge,
|
|
750
|
+
q as useViewTitle,
|
|
751
|
+
Ze as useViewVisibility,
|
|
752
|
+
_e as useVisibleNotebookEditors,
|
|
753
|
+
et as useVisibleTextEditors,
|
|
754
|
+
tt as useVscodeContext,
|
|
755
|
+
nt as useWebviewView,
|
|
756
|
+
at as useWindowState,
|
|
757
|
+
it as useWorkspaceFolders
|
|
689
758
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactive-vscode",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.0-beta.
|
|
4
|
+
"version": "0.2.0-beta.9",
|
|
5
5
|
"description": "Develop VSCode extension with Vue Reactivity API",
|
|
6
6
|
"author": "_Kerman <kermanx@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/vscode": "^1.89.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@reactive-vscode/reactivity": "0.2.0-beta.
|
|
40
|
+
"@reactive-vscode/reactivity": "0.2.0-beta.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.14.2",
|