reactive-vscode 0.2.4 → 0.2.6-beta.1
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/dist/index.d.ts +50 -37
- package/dist/index.js +94 -91
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="vscode" />
|
|
2
|
-
|
|
3
1
|
import { ColorTheme } from 'vscode';
|
|
4
2
|
import { CommentController } from 'vscode';
|
|
5
3
|
import { ComputedRef } from '@reactive-vscode/reactivity';
|
|
@@ -175,8 +173,23 @@ export declare function defineLogger(name: string, options?: UseLoggerOptions):
|
|
|
175
173
|
replace: (value: string) => void;
|
|
176
174
|
clear: () => void;
|
|
177
175
|
show: {
|
|
178
|
-
(preserveFocus?: boolean
|
|
179
|
-
(column?: ViewColumn
|
|
176
|
+
(preserveFocus?: boolean): void;
|
|
177
|
+
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
178
|
+
};
|
|
179
|
+
hide: () => void;
|
|
180
|
+
} | null, {
|
|
181
|
+
outputChannel: OutputChannel;
|
|
182
|
+
createLoggerFunc: (type: string) => (...message: any[]) => void;
|
|
183
|
+
info: (...message: any[]) => void;
|
|
184
|
+
warn: (...message: any[]) => void;
|
|
185
|
+
error: (...message: any[]) => void;
|
|
186
|
+
append: (value: string) => void;
|
|
187
|
+
appendLine: (value: string) => void;
|
|
188
|
+
replace: (value: string) => void;
|
|
189
|
+
clear: () => void;
|
|
190
|
+
show: {
|
|
191
|
+
(preserveFocus?: boolean): void;
|
|
192
|
+
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
180
193
|
};
|
|
181
194
|
hide: () => void;
|
|
182
195
|
} | null>;
|
|
@@ -199,7 +212,7 @@ export declare function defineLogger(name: string, options?: UseLoggerOptions):
|
|
|
199
212
|
*/
|
|
200
213
|
export declare function executeCommand<K extends Extract<keyof Commands, string>>(command: K, ...args: Parameters<Commands[K]>): Thenable<unknown>;
|
|
201
214
|
|
|
202
|
-
export declare const extensionContext: ShallowRef<ExtensionContext | null>;
|
|
215
|
+
export declare const extensionContext: ShallowRef<ExtensionContext | null, ExtensionContext | null>;
|
|
203
216
|
|
|
204
217
|
/* Excluded from this release type: extensionScope */
|
|
205
218
|
|
|
@@ -336,7 +349,7 @@ export declare function useAbsolutePath(relativePath: MaybeRefOrGetter<string>,
|
|
|
336
349
|
/**
|
|
337
350
|
* @reactive `window.activeColorTheme`
|
|
338
351
|
*/
|
|
339
|
-
export declare const useActiveColorTheme: () => ShallowRef<ColorTheme>;
|
|
352
|
+
export declare const useActiveColorTheme: () => ShallowRef<ColorTheme, ColorTheme>;
|
|
340
353
|
|
|
341
354
|
/**
|
|
342
355
|
* @reactive `debug.activeDebugSession`
|
|
@@ -354,19 +367,19 @@ export declare function useActiveEditorDecorations(decorationTypeOrOptions: Text
|
|
|
354
367
|
* @reactive `window.activeNotebookEditor`
|
|
355
368
|
* @category editor
|
|
356
369
|
*/
|
|
357
|
-
export declare const useActiveNotebookEditor: () => ShallowRef<NotebookEditor | undefined>;
|
|
370
|
+
export declare const useActiveNotebookEditor: () => ShallowRef<NotebookEditor | undefined, NotebookEditor | undefined>;
|
|
358
371
|
|
|
359
372
|
/**
|
|
360
373
|
* @reactive `window.activeTerminal`
|
|
361
374
|
* @category terminal
|
|
362
375
|
*/
|
|
363
|
-
export declare const useActiveTerminal: () => ShallowRef<Terminal | undefined>;
|
|
376
|
+
export declare const useActiveTerminal: () => ShallowRef<Terminal | undefined, Terminal | undefined>;
|
|
364
377
|
|
|
365
378
|
/**
|
|
366
379
|
* @reactive `window.activeTextEditor`
|
|
367
380
|
* @category editor
|
|
368
381
|
*/
|
|
369
|
-
export declare const useActiveTextEditor: () => ShallowRef<TextEditor | undefined>;
|
|
382
|
+
export declare const useActiveTextEditor: () => ShallowRef<TextEditor | undefined, TextEditor | undefined>;
|
|
370
383
|
|
|
371
384
|
/**
|
|
372
385
|
* @reactive `extensions.all`
|
|
@@ -429,7 +442,7 @@ export declare function useDisposable<T extends Disposable_2>(disposable: T): T;
|
|
|
429
442
|
* @reactive `TextDocument.getText`
|
|
430
443
|
* @category document
|
|
431
444
|
*/
|
|
432
|
-
export declare function useDocumentText(doc: MaybeRefOrGetter<TextDocument | undefined>): ShallowRef<string | undefined>;
|
|
445
|
+
export declare function useDocumentText(doc: MaybeRefOrGetter<TextDocument | undefined>): ShallowRef<string | undefined, string | undefined>;
|
|
433
446
|
|
|
434
447
|
/**
|
|
435
448
|
* Reactively set decorations on the given editor. See `vscode::TextEditor.setDecorations`.
|
|
@@ -478,7 +491,7 @@ declare interface UseEventEmitterReturn<T> {
|
|
|
478
491
|
* @reactive `ExtensionContext.secrets`
|
|
479
492
|
* @category extension
|
|
480
493
|
*/
|
|
481
|
-
export declare function useExtensionSecret(key: string): Promise<Ref<string | undefined> & {
|
|
494
|
+
export declare function useExtensionSecret(key: string): Promise<Ref<string | undefined, string | undefined> & {
|
|
482
495
|
set: (newValue: string) => Promise<void>;
|
|
483
496
|
remove: () => Promise<void>;
|
|
484
497
|
}>;
|
|
@@ -546,8 +559,8 @@ export declare function useLogger(name: string, options?: UseLoggerOptions): {
|
|
|
546
559
|
replace: (value: string) => void;
|
|
547
560
|
clear: () => void;
|
|
548
561
|
show: {
|
|
549
|
-
(preserveFocus?: boolean
|
|
550
|
-
(column?: ViewColumn
|
|
562
|
+
(preserveFocus?: boolean): void;
|
|
563
|
+
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
551
564
|
};
|
|
552
565
|
hide: () => void;
|
|
553
566
|
};
|
|
@@ -566,13 +579,13 @@ export declare const useLogLevel: () => ComputedRef<LogLevel>;
|
|
|
566
579
|
* @reactive `NotebookEditor.selection`
|
|
567
580
|
* @category editor
|
|
568
581
|
*/
|
|
569
|
-
export declare function useNotebookEditorSelection(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<NotebookRange>;
|
|
582
|
+
export declare function useNotebookEditorSelection(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<NotebookRange, NotebookRange>;
|
|
570
583
|
|
|
571
584
|
/**
|
|
572
585
|
* @reactive `NotebookEditor.selections`
|
|
573
586
|
* @category editor
|
|
574
587
|
*/
|
|
575
|
-
export declare function useNotebookEditorSelections(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<readonly NotebookRange[]>;
|
|
588
|
+
export declare function useNotebookEditorSelections(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<readonly NotebookRange[], readonly NotebookRange[]>;
|
|
576
589
|
|
|
577
590
|
/**
|
|
578
591
|
* @reactive `NotebookEditor.visibleRanges`
|
|
@@ -584,7 +597,7 @@ export declare function useNotebookEditorVisibleRanges(notebookEditor: MaybeNull
|
|
|
584
597
|
* @reactive `window.terminals`
|
|
585
598
|
* @category terminal
|
|
586
599
|
*/
|
|
587
|
-
export declare const useOpenedTerminals: () => ShallowRef<readonly Terminal[]>;
|
|
600
|
+
export declare const useOpenedTerminals: () => ShallowRef<readonly Terminal[], readonly Terminal[]>;
|
|
588
601
|
|
|
589
602
|
/**
|
|
590
603
|
* @reactive `window.createOutputChannel`
|
|
@@ -598,15 +611,15 @@ export declare function useOutputChannel(name: string, languageId?: string): Out
|
|
|
598
611
|
* @reactive `window.createQuickPick`
|
|
599
612
|
*/
|
|
600
613
|
export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPickOptions<T>): {
|
|
601
|
-
onDidChangeActive: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
602
|
-
onDidChangeSelection: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
603
|
-
onDidAccept: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
604
|
-
onDidHide: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
605
|
-
onDidTriggerButton: (listener: (e: QuickInputButton) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
606
|
-
onDidChangeValue: (listener: (e: string) => any, thisArgs?: any, disposables?: Disposable_2[]
|
|
607
|
-
value: ShallowRef<string>;
|
|
608
|
-
activeItems: ShallowRef<readonly T[]>;
|
|
609
|
-
selectedItems: ShallowRef<readonly T[]>;
|
|
614
|
+
onDidChangeActive: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
615
|
+
onDidChangeSelection: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
616
|
+
onDidAccept: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
617
|
+
onDidHide: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
618
|
+
onDidTriggerButton: (listener: (e: QuickInputButton) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
619
|
+
onDidChangeValue: (listener: (e: string) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
620
|
+
value: ShallowRef<string, string>;
|
|
621
|
+
activeItems: ShallowRef<readonly T[], readonly T[]>;
|
|
622
|
+
selectedItems: ShallowRef<readonly T[], readonly T[]>;
|
|
610
623
|
placeholder: string | undefined;
|
|
611
624
|
buttons: readonly QuickInputButton[];
|
|
612
625
|
onDidTriggerItemButton: Event_2<QuickPickItemButtonEvent<T>>;
|
|
@@ -614,7 +627,7 @@ export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPic
|
|
|
614
627
|
canSelectMany: boolean;
|
|
615
628
|
matchOnDescription: boolean;
|
|
616
629
|
matchOnDetail: boolean;
|
|
617
|
-
keepScrollPosition?: boolean
|
|
630
|
+
keepScrollPosition?: boolean;
|
|
618
631
|
title: string | undefined;
|
|
619
632
|
step: number | undefined;
|
|
620
633
|
totalSteps: number | undefined;
|
|
@@ -688,13 +701,13 @@ export declare function useTextEditorCommands(commands: Record<string, TextEdito
|
|
|
688
701
|
* @reactive `TextEditor.selection`
|
|
689
702
|
* @category editor
|
|
690
703
|
*/
|
|
691
|
-
export declare function useTextEditorSelection(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<Selection>;
|
|
704
|
+
export declare function useTextEditorSelection(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<Selection, Selection>;
|
|
692
705
|
|
|
693
706
|
/**
|
|
694
707
|
* @reactive `TextEditor.selections`
|
|
695
708
|
* @category editor
|
|
696
709
|
*/
|
|
697
|
-
export declare function useTextEditorSelections(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<readonly Selection[]>;
|
|
710
|
+
export declare function useTextEditorSelections(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<readonly Selection[], readonly Selection[]>;
|
|
698
711
|
|
|
699
712
|
/**
|
|
700
713
|
* @reactive `TextEditor.viewColumn`
|
|
@@ -749,18 +762,18 @@ export declare function useViewVisibility(view: MaybeNullableRefOrGetter<ViewWit
|
|
|
749
762
|
* @reactive `window.visibleNotebookEditors`
|
|
750
763
|
* @category editor
|
|
751
764
|
*/
|
|
752
|
-
export declare const useVisibleNotebookEditors: () => ShallowRef<readonly NotebookEditor[]>;
|
|
765
|
+
export declare const useVisibleNotebookEditors: () => ShallowRef<readonly NotebookEditor[], readonly NotebookEditor[]>;
|
|
753
766
|
|
|
754
767
|
/**
|
|
755
768
|
* @reactive `window.visibleTextEditors`
|
|
756
769
|
* @category editor
|
|
757
770
|
*/
|
|
758
|
-
export declare const useVisibleTextEditors: () => ShallowRef<readonly TextEditor[]>;
|
|
759
|
-
|
|
760
|
-
export declare function useVscodeContext<T>(name: string, value: ComputedRef<T> | (() => T), shouldUpdate?: MaybeRefOrGetter<boolean>): ComputedRef<T>;
|
|
771
|
+
export declare const useVisibleTextEditors: () => ShallowRef<readonly TextEditor[], readonly TextEditor[]>;
|
|
761
772
|
|
|
762
773
|
export declare function useVscodeContext<T>(name: string, value: WritableComputedRef<T>, shouldUpdate?: MaybeRefOrGetter<boolean>): WritableComputedRef<T>;
|
|
763
774
|
|
|
775
|
+
export declare function useVscodeContext<T>(name: string, value: ComputedRef<T> | (() => T), shouldUpdate?: MaybeRefOrGetter<boolean>): ComputedRef<T>;
|
|
776
|
+
|
|
764
777
|
export declare function useVscodeContext<T>(name: string, value: MaybeRef<T>, shouldUpdate?: MaybeRefOrGetter<boolean>): Ref<T>;
|
|
765
778
|
|
|
766
779
|
/**
|
|
@@ -770,9 +783,9 @@ export declare function useVscodeContext<T>(name: string, value: MaybeRef<T>, sh
|
|
|
770
783
|
*/
|
|
771
784
|
export declare function useWebviewPanel(viewType: string, title: MaybeRefOrGetter<string>, html: MaybeRefOrGetter<string>, showOptions: Parameters<typeof window.createWebviewPanel>[2], options?: WebviewPanelRegisterOptions): {
|
|
772
785
|
panel: WebviewPanel;
|
|
773
|
-
context: ShallowRef<unknown>;
|
|
774
|
-
active: Ref<boolean>;
|
|
775
|
-
visible: Ref<boolean>;
|
|
786
|
+
context: ShallowRef<unknown, unknown>;
|
|
787
|
+
active: Ref<boolean, boolean>;
|
|
788
|
+
visible: Ref<boolean, boolean>;
|
|
776
789
|
postMessage: (message: any) => Thenable<boolean>;
|
|
777
790
|
forceRefresh: () => void;
|
|
778
791
|
};
|
|
@@ -783,8 +796,8 @@ export declare function useWebviewPanel(viewType: string, title: MaybeRefOrGette
|
|
|
783
796
|
* @category view
|
|
784
797
|
*/
|
|
785
798
|
export declare const useWebviewView: (viewId: string, html: MaybeRefOrGetter<string>, options?: WebviewViewRegisterOptions | undefined) => {
|
|
786
|
-
view: ShallowRef<WebviewView | undefined>;
|
|
787
|
-
context: ShallowRef<WebviewViewResolveContext<unknown> | undefined>;
|
|
799
|
+
view: ShallowRef<WebviewView | undefined, WebviewView | undefined>;
|
|
800
|
+
context: ShallowRef<WebviewViewResolveContext<unknown> | undefined, WebviewViewResolveContext<unknown> | undefined>;
|
|
788
801
|
postMessage: (message: any) => Thenable<boolean> | undefined;
|
|
789
802
|
forceRefresh: () => void;
|
|
790
803
|
};
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,13 @@ function N(e, t) {
|
|
|
8
8
|
const n = /* @__PURE__ */ new Map();
|
|
9
9
|
return (...a) => {
|
|
10
10
|
const i = t(...a);
|
|
11
|
-
let
|
|
12
|
-
return
|
|
11
|
+
let s = n.get(i);
|
|
12
|
+
return s ? s.refCount++ : (s = {
|
|
13
13
|
data: e(...a),
|
|
14
14
|
refCount: 1
|
|
15
|
-
}, n.set(i,
|
|
16
|
-
--
|
|
17
|
-
}),
|
|
15
|
+
}, n.set(i, s)), _(() => {
|
|
16
|
+
--s.refCount === 0 && n.delete(i);
|
|
17
|
+
}), s.data;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
function m(e) {
|
|
@@ -40,7 +40,7 @@ function B(e) {
|
|
|
40
40
|
}
|
|
41
41
|
function ee(e, t, n) {
|
|
42
42
|
const a = !e, i = T.getConfiguration(a ? void 0 : e, n);
|
|
43
|
-
function
|
|
43
|
+
function s(o, f) {
|
|
44
44
|
const h = d(f), w = g({
|
|
45
45
|
get: () => h.value,
|
|
46
46
|
set: (v) => {
|
|
@@ -54,10 +54,10 @@ function ee(e, t, n) {
|
|
|
54
54
|
}, w;
|
|
55
55
|
}
|
|
56
56
|
const c = Object.fromEntries(
|
|
57
|
-
Object.keys(t).map((o) => [o,
|
|
57
|
+
Object.keys(t).map((o) => [o, s(o, i.get(o))])
|
|
58
58
|
);
|
|
59
59
|
return B(() => {
|
|
60
|
-
|
|
60
|
+
u(T.onDidChangeConfiguration(
|
|
61
61
|
a ? (o) => {
|
|
62
62
|
const f = T.getConfiguration();
|
|
63
63
|
for (const h in t)
|
|
@@ -76,25 +76,25 @@ function me(e, t, n) {
|
|
|
76
76
|
const a = ee(e, t, n);
|
|
77
77
|
return U({
|
|
78
78
|
...a,
|
|
79
|
-
$update(i,
|
|
80
|
-
return a[i].update(
|
|
79
|
+
$update(i, s, c, o) {
|
|
80
|
+
return a[i].update(s, c, o);
|
|
81
81
|
},
|
|
82
|
-
$set(i,
|
|
83
|
-
return a[i].set(
|
|
82
|
+
$set(i, s) {
|
|
83
|
+
return a[i].set(s);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function be(e, t) {
|
|
88
|
-
const n = d(null), a = [], i = (
|
|
88
|
+
const n = d(null), a = [], i = (s) => (...c) => n.value ? n.value[s](...c) : (a.push([s, c]), null);
|
|
89
89
|
return B(() => {
|
|
90
|
-
n.value =
|
|
91
|
-
for (const [
|
|
92
|
-
n.value[
|
|
90
|
+
n.value = ue(e, t);
|
|
91
|
+
for (const [s, c] of a)
|
|
92
|
+
n.value[s](...c);
|
|
93
93
|
}), {
|
|
94
94
|
logger: n,
|
|
95
95
|
outputChannel: g(() => {
|
|
96
|
-
var
|
|
97
|
-
return (
|
|
96
|
+
var s;
|
|
97
|
+
return (s = n.value) == null ? void 0 : s.outputChannel;
|
|
98
98
|
}),
|
|
99
99
|
info: i("info"),
|
|
100
100
|
warn: i("warn"),
|
|
@@ -119,22 +119,22 @@ function te(e, t = !1) {
|
|
|
119
119
|
function Ce(e, t = !1) {
|
|
120
120
|
return g(() => te(r(e), t));
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function u(e) {
|
|
123
123
|
return ($() ?? I).cleanups.push(e.dispose.bind(e)), e;
|
|
124
124
|
}
|
|
125
125
|
const ne = m(() => {
|
|
126
126
|
const e = d(l.activeColorTheme);
|
|
127
|
-
return
|
|
127
|
+
return u(l.onDidChangeActiveColorTheme((t) => {
|
|
128
128
|
e.value = t;
|
|
129
129
|
})), e;
|
|
130
130
|
}), De = m(() => {
|
|
131
131
|
const e = d(P.activeDebugSession);
|
|
132
|
-
return
|
|
132
|
+
return u(P.onDidChangeActiveDebugSession((t) => {
|
|
133
133
|
e.value = t;
|
|
134
134
|
})), g(() => e.value);
|
|
135
135
|
}), ae = m(() => {
|
|
136
136
|
const e = d(l.activeTextEditor);
|
|
137
|
-
return
|
|
137
|
+
return u(l.onDidChangeActiveTextEditor((t) => {
|
|
138
138
|
e.value = t;
|
|
139
139
|
})), e;
|
|
140
140
|
});
|
|
@@ -144,17 +144,17 @@ function ie(e) {
|
|
|
144
144
|
return b(() => {
|
|
145
145
|
var a;
|
|
146
146
|
t.value = (a = r(e)) == null ? void 0 : a.getText();
|
|
147
|
-
}),
|
|
147
|
+
}), u(T.onDidChangeTextDocument((a) => {
|
|
148
148
|
a.document === r(e) && (t.value = a.document.getText());
|
|
149
149
|
})), t;
|
|
150
150
|
}
|
|
151
151
|
function re(e, t, n, a = {}) {
|
|
152
152
|
const {
|
|
153
153
|
updateOn: i = ["effect", "documentChanged"]
|
|
154
|
-
} = a,
|
|
154
|
+
} = a, s = "key" in t ? t : u(l.createTextEditorDecorationType(t)), c = async () => {
|
|
155
155
|
const f = r(e);
|
|
156
156
|
f && f.setDecorations(
|
|
157
|
-
|
|
157
|
+
s,
|
|
158
158
|
typeof n == "function" ? await n(f) : r(n)
|
|
159
159
|
);
|
|
160
160
|
}, o = i.includes("documentChanged") ? ie(() => {
|
|
@@ -176,29 +176,29 @@ function Te(e, t) {
|
|
|
176
176
|
}
|
|
177
177
|
const Se = m(() => {
|
|
178
178
|
const e = d(l.activeNotebookEditor);
|
|
179
|
-
return
|
|
179
|
+
return u(l.onDidChangeActiveNotebookEditor((t) => {
|
|
180
180
|
e.value = t;
|
|
181
181
|
})), e;
|
|
182
182
|
}), xe = m(() => {
|
|
183
183
|
const e = d(l.activeTerminal);
|
|
184
|
-
return
|
|
184
|
+
return u(l.onDidChangeActiveTerminal((t) => {
|
|
185
185
|
e.value = t;
|
|
186
186
|
})), e;
|
|
187
187
|
}), Ee = m(() => {
|
|
188
188
|
const e = d(V.all);
|
|
189
|
-
return
|
|
189
|
+
return u(V.onDidChange(() => {
|
|
190
190
|
e.value = V.all;
|
|
191
191
|
})), g(() => e.value);
|
|
192
192
|
});
|
|
193
193
|
function ce(e, t) {
|
|
194
|
-
|
|
194
|
+
u(A.registerCommand(e, t));
|
|
195
195
|
}
|
|
196
196
|
function pe(e) {
|
|
197
197
|
for (const [t, n] of Object.entries(e))
|
|
198
198
|
n && ce(t, n);
|
|
199
199
|
}
|
|
200
200
|
function ke(e, t) {
|
|
201
|
-
return
|
|
201
|
+
return u(J.createCommentController(e, t));
|
|
202
202
|
}
|
|
203
203
|
function z(e) {
|
|
204
204
|
var n;
|
|
@@ -206,7 +206,7 @@ function z(e) {
|
|
|
206
206
|
return D(e, () => {
|
|
207
207
|
var a;
|
|
208
208
|
t.value = (a = r(e)) == null ? void 0 : a.state;
|
|
209
|
-
}),
|
|
209
|
+
}), u(l.onDidChangeTerminalState((a) => {
|
|
210
210
|
a === r(e) && (t.value = a.state);
|
|
211
211
|
})), g(() => t.value);
|
|
212
212
|
}
|
|
@@ -221,7 +221,7 @@ function Re(...e) {
|
|
|
221
221
|
function i(o) {
|
|
222
222
|
a().sendText(o);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function s() {
|
|
225
225
|
a().show();
|
|
226
226
|
}
|
|
227
227
|
function c() {
|
|
@@ -230,7 +230,7 @@ function Re(...e) {
|
|
|
230
230
|
return W(c), {
|
|
231
231
|
terminal: t,
|
|
232
232
|
getIsActive: n,
|
|
233
|
-
show:
|
|
233
|
+
show: s,
|
|
234
234
|
sendText: i,
|
|
235
235
|
close: c,
|
|
236
236
|
state: z(t)
|
|
@@ -238,20 +238,20 @@ function Re(...e) {
|
|
|
238
238
|
}
|
|
239
239
|
const ye = m(() => {
|
|
240
240
|
const e = d(p.shell);
|
|
241
|
-
return
|
|
241
|
+
return u(p.onDidChangeShell((t) => {
|
|
242
242
|
e.value = t;
|
|
243
243
|
})), g(() => e.value);
|
|
244
244
|
});
|
|
245
245
|
function E(e, t) {
|
|
246
|
-
const n = (a, i,
|
|
247
|
-
|
|
246
|
+
const n = (a, i, s) => {
|
|
247
|
+
u(e(a, i, s));
|
|
248
248
|
};
|
|
249
249
|
return t == null || t.forEach((a) => n(a)), n;
|
|
250
250
|
}
|
|
251
251
|
function y(e, t = []) {
|
|
252
|
-
const n = Array.isArray(e) ? e : t ?? [], a =
|
|
253
|
-
for (const
|
|
254
|
-
i(
|
|
252
|
+
const n = Array.isArray(e) ? e : t ?? [], a = u(Array.isArray(e) || e == null ? new L() : e), i = E(a.event, n);
|
|
253
|
+
for (const s of n)
|
|
254
|
+
i(s);
|
|
255
255
|
return {
|
|
256
256
|
event: a.event,
|
|
257
257
|
fire: a.fire.bind(a),
|
|
@@ -264,7 +264,7 @@ async function Ae(e) {
|
|
|
264
264
|
n.value = a, await t.store(e, a);
|
|
265
265
|
}, n.remove = async () => {
|
|
266
266
|
n.value = void 0, await t.delete(e);
|
|
267
|
-
},
|
|
267
|
+
}, u(t.onDidChange(async (a) => {
|
|
268
268
|
a.key === e && (n.value = await t.get(e));
|
|
269
269
|
})), D(n, (a) => {
|
|
270
270
|
a === void 0 ? t.delete(e) : t.store(e, a);
|
|
@@ -280,19 +280,19 @@ function We(e, t) {
|
|
|
280
280
|
const n = new L(), a = d();
|
|
281
281
|
b(() => {
|
|
282
282
|
a.value && n.fire(), a.value = r(t);
|
|
283
|
-
}),
|
|
283
|
+
}), u(Z.registerFoldingRangeProvider(
|
|
284
284
|
e,
|
|
285
285
|
{
|
|
286
286
|
onDidChangeFoldingRanges: n.event,
|
|
287
|
-
provideFoldingRanges(i,
|
|
287
|
+
provideFoldingRanges(i, s, c) {
|
|
288
288
|
var o;
|
|
289
|
-
return (o = a.value) == null ? void 0 : o.call(a, i,
|
|
289
|
+
return (o = a.value) == null ? void 0 : o.call(a, i, s, c);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
));
|
|
293
293
|
}
|
|
294
294
|
function Oe(e, t, n, a) {
|
|
295
|
-
const i = q(/* @__PURE__ */ new Map()),
|
|
295
|
+
const i = q(/* @__PURE__ */ new Map()), s = y(), c = y(), o = y(), f = g(() => {
|
|
296
296
|
const v = r(e);
|
|
297
297
|
return Array.isArray(v) ? v : v instanceof Set ? Array.from(v) : [v];
|
|
298
298
|
});
|
|
@@ -308,7 +308,7 @@ function Oe(e, t, n, a) {
|
|
|
308
308
|
r(n) || !1,
|
|
309
309
|
r(a) || !1
|
|
310
310
|
);
|
|
311
|
-
S.onDidCreate(
|
|
311
|
+
S.onDidCreate(s.fire), S.onDidChange(c.fire), S.onDidDelete(o.fire), i.set(C, S);
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
function w() {
|
|
@@ -316,7 +316,7 @@ function Oe(e, t, n, a) {
|
|
|
316
316
|
v.dispose();
|
|
317
317
|
i.clear();
|
|
318
318
|
}
|
|
319
|
-
return D(f, h), D(
|
|
319
|
+
return h(), D(f, h), D(
|
|
320
320
|
() => [
|
|
321
321
|
r(t),
|
|
322
322
|
r(n),
|
|
@@ -327,7 +327,7 @@ function Oe(e, t, n, a) {
|
|
|
327
327
|
}
|
|
328
328
|
), W(w), {
|
|
329
329
|
watchers: i,
|
|
330
|
-
onDidCreate:
|
|
330
|
+
onDidCreate: s.event,
|
|
331
331
|
onDidChange: c.event,
|
|
332
332
|
onDidDelete: o.event
|
|
333
333
|
};
|
|
@@ -337,24 +337,24 @@ const Pe = m(() => {
|
|
|
337
337
|
return g(() => e.value.kind === M.Dark || e.value.kind === M.HighContrast);
|
|
338
338
|
}), Me = m(() => {
|
|
339
339
|
const e = d(p.isTelemetryEnabled);
|
|
340
|
-
return
|
|
340
|
+
return u(p.onDidChangeTelemetryEnabled((t) => {
|
|
341
341
|
e.value = t;
|
|
342
342
|
})), g(() => e.value);
|
|
343
343
|
});
|
|
344
344
|
function Fe(e, ...t) {
|
|
345
345
|
return g(() => typeof t[0] == "object" ? F.t(r(e), Y(t[0])) : F.t(r(e), ...t.map(r)));
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
return
|
|
347
|
+
function se(e, t) {
|
|
348
|
+
return u(l.createOutputChannel(e, t));
|
|
349
349
|
}
|
|
350
350
|
function $e(e) {
|
|
351
|
-
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"),
|
|
352
|
-
return `${n}-${a}-${i} ${
|
|
351
|
+
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"), s = String(t.getHours()).padStart(2, "0"), c = String(t.getMinutes()).padStart(2, "0"), o = String(t.getSeconds()).padStart(2, "0"), f = String(t.getMilliseconds()).padStart(3, "0");
|
|
352
|
+
return `${n}-${a}-${i} ${s}:${c}:${o}.${f} [${e}] `;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
const n = t.outputChannel ??
|
|
354
|
+
function ue(e, t = {}) {
|
|
355
|
+
const n = t.outputChannel ?? se(e), a = (i) => (...s) => {
|
|
356
356
|
var c;
|
|
357
|
-
n.appendLine((((c = t.getPrefix) == null ? void 0 : c.call(t, i)) ?? "") +
|
|
357
|
+
n.appendLine((((c = t.getPrefix) == null ? void 0 : c.call(t, i)) ?? "") + s.join(" "));
|
|
358
358
|
};
|
|
359
359
|
return {
|
|
360
360
|
outputChannel: n,
|
|
@@ -372,7 +372,7 @@ function se(e, t = {}) {
|
|
|
372
372
|
}
|
|
373
373
|
const Le = m(() => {
|
|
374
374
|
const e = d(p.logLevel);
|
|
375
|
-
return
|
|
375
|
+
return u(p.onDidChangeLogLevel((t) => {
|
|
376
376
|
e.value = t;
|
|
377
377
|
})), g(() => e.value);
|
|
378
378
|
});
|
|
@@ -382,7 +382,7 @@ function oe(e) {
|
|
|
382
382
|
return D(e, () => {
|
|
383
383
|
var a;
|
|
384
384
|
t.value = ((a = r(e)) == null ? void 0 : a.selections) ?? [];
|
|
385
|
-
}),
|
|
385
|
+
}), u(l.onDidChangeNotebookEditorSelection((a) => {
|
|
386
386
|
a.notebookEditor === r(e) && (t.value = a.selections);
|
|
387
387
|
})), g({
|
|
388
388
|
get() {
|
|
@@ -412,7 +412,7 @@ function He(e) {
|
|
|
412
412
|
return D(e, () => {
|
|
413
413
|
var a;
|
|
414
414
|
t.value = ((a = r(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
415
|
-
}),
|
|
415
|
+
}), u(l.onDidChangeNotebookEditorVisibleRanges((a) => {
|
|
416
416
|
a.notebookEditor === r(e) && (t.value = a.visibleRanges);
|
|
417
417
|
})), g(() => t.value);
|
|
418
418
|
}
|
|
@@ -421,10 +421,10 @@ const je = m(() => {
|
|
|
421
421
|
function t() {
|
|
422
422
|
e.value = l.terminals;
|
|
423
423
|
}
|
|
424
|
-
return
|
|
424
|
+
return u(l.onDidOpenTerminal(t)), u(l.onDidCloseTerminal(t)), e;
|
|
425
425
|
});
|
|
426
426
|
function Be(e = {}) {
|
|
427
|
-
const t =
|
|
427
|
+
const t = u(l.createQuickPick()), n = E(t.onDidChangeActive), a = E(t.onDidChangeSelection), i = E(t.onDidAccept), s = E(t.onDidHide), c = E(t.onDidTriggerButton), o = E(t.onDidChangeValue);
|
|
428
428
|
[
|
|
429
429
|
"items",
|
|
430
430
|
"buttons",
|
|
@@ -452,7 +452,7 @@ function Be(e = {}) {
|
|
|
452
452
|
onDidChangeActive: n,
|
|
453
453
|
onDidChangeSelection: a,
|
|
454
454
|
onDidAccept: i,
|
|
455
|
-
onDidHide:
|
|
455
|
+
onDidHide: s,
|
|
456
456
|
onDidTriggerButton: c,
|
|
457
457
|
onDidChangeValue: o,
|
|
458
458
|
value: f,
|
|
@@ -461,7 +461,7 @@ function Be(e = {}) {
|
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
function ze(e) {
|
|
464
|
-
const t =
|
|
464
|
+
const t = u(e.id ? l.createStatusBarItem(e.id, e.alignment, e.priority) : l.createStatusBarItem(e.alignment, e.priority));
|
|
465
465
|
function n(a) {
|
|
466
466
|
const i = e[a];
|
|
467
467
|
i != null && b(() => t[a] = r(i));
|
|
@@ -481,10 +481,10 @@ const Ke = m(() => {
|
|
|
481
481
|
function t() {
|
|
482
482
|
e.value = k.taskExecutions;
|
|
483
483
|
}
|
|
484
|
-
return
|
|
484
|
+
return u(k.onDidStartTask(t)), u(k.onDidEndTask(t)), g(() => e.value);
|
|
485
485
|
});
|
|
486
486
|
function Qe(...e) {
|
|
487
|
-
const t =
|
|
487
|
+
const t = u(l.createTerminal(...e));
|
|
488
488
|
return {
|
|
489
489
|
terminal: t,
|
|
490
490
|
get name() {
|
|
@@ -499,6 +499,9 @@ function Qe(...e) {
|
|
|
499
499
|
get exitStatus() {
|
|
500
500
|
return t.exitStatus;
|
|
501
501
|
},
|
|
502
|
+
get shellIntegration() {
|
|
503
|
+
return t.shellIntegration;
|
|
504
|
+
},
|
|
502
505
|
sendText: t.sendText.bind(t),
|
|
503
506
|
show: t.show.bind(t),
|
|
504
507
|
hide: t.hide.bind(t),
|
|
@@ -506,7 +509,7 @@ function Qe(...e) {
|
|
|
506
509
|
};
|
|
507
510
|
}
|
|
508
511
|
function le(e, t) {
|
|
509
|
-
|
|
512
|
+
u(A.registerTextEditorCommand(e, t));
|
|
510
513
|
}
|
|
511
514
|
function Ue(e) {
|
|
512
515
|
for (const [t, n] of Object.entries(e))
|
|
@@ -518,17 +521,17 @@ function de(e, t) {
|
|
|
518
521
|
return D(e, () => {
|
|
519
522
|
var i;
|
|
520
523
|
n.value = ((i = r(e)) == null ? void 0 : i.selections) ?? [];
|
|
521
|
-
}),
|
|
522
|
-
const
|
|
523
|
-
i.textEditor ===
|
|
524
|
+
}), u(l.onDidChangeTextEditorSelection((i) => {
|
|
525
|
+
const s = r(e), c = r(t);
|
|
526
|
+
i.textEditor === s && (!c || c.includes(i.kind)) && (n.value = i.selections);
|
|
524
527
|
})), g({
|
|
525
528
|
get() {
|
|
526
529
|
return n.value;
|
|
527
530
|
},
|
|
528
531
|
set(i) {
|
|
529
532
|
n.value = i;
|
|
530
|
-
const
|
|
531
|
-
|
|
533
|
+
const s = r(e);
|
|
534
|
+
s && (s.selections = i);
|
|
532
535
|
}
|
|
533
536
|
});
|
|
534
537
|
}
|
|
@@ -549,7 +552,7 @@ function Ye(e) {
|
|
|
549
552
|
return D(e, () => {
|
|
550
553
|
var a;
|
|
551
554
|
t.value = (a = r(e)) == null ? void 0 : a.viewColumn;
|
|
552
|
-
}),
|
|
555
|
+
}), u(l.onDidChangeTextEditorViewColumn((a) => {
|
|
553
556
|
a.textEditor === r(e) && (t.value = a.viewColumn);
|
|
554
557
|
})), g(() => t.value);
|
|
555
558
|
}
|
|
@@ -559,7 +562,7 @@ function Ge(e) {
|
|
|
559
562
|
return D(e, () => {
|
|
560
563
|
var a;
|
|
561
564
|
t.value = ((a = r(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
562
|
-
}),
|
|
565
|
+
}), u(l.onDidChangeTextEditorVisibleRanges((a) => {
|
|
563
566
|
a.textEditor === r(e) && (t.value = a.visibleRanges);
|
|
564
567
|
})), g(() => t.value);
|
|
565
568
|
}
|
|
@@ -579,7 +582,7 @@ const Je = N(
|
|
|
579
582
|
(e, t, n) => {
|
|
580
583
|
const a = y();
|
|
581
584
|
D(t, () => a.fire()), n != null && n.watchSource && D(n.watchSource, () => a.fire());
|
|
582
|
-
const i = /* @__PURE__ */ new WeakMap(),
|
|
585
|
+
const i = /* @__PURE__ */ new WeakMap(), s = u(l.createTreeView(e, {
|
|
583
586
|
...n,
|
|
584
587
|
treeDataProvider: {
|
|
585
588
|
...n,
|
|
@@ -596,7 +599,7 @@ const Je = N(
|
|
|
596
599
|
}
|
|
597
600
|
}
|
|
598
601
|
}));
|
|
599
|
-
return n != null && n.title && O(
|
|
602
|
+
return n != null && n.title && O(s, n.title), n != null && n.badge && K(s, n.badge), s;
|
|
600
603
|
},
|
|
601
604
|
(e) => e
|
|
602
605
|
);
|
|
@@ -608,21 +611,21 @@ function Xe(e) {
|
|
|
608
611
|
t.value = (i = r(e)) == null ? void 0 : i.visible;
|
|
609
612
|
}
|
|
610
613
|
return b((i) => {
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
const c =
|
|
614
|
+
const s = r(e);
|
|
615
|
+
if (s) {
|
|
616
|
+
const c = s.onDidChangeVisibility(n);
|
|
614
617
|
i(() => c.dispose());
|
|
615
618
|
}
|
|
616
619
|
}), b(n), g(() => !!t.value);
|
|
617
620
|
}
|
|
618
621
|
const Ze = m(() => {
|
|
619
622
|
const e = d(l.visibleNotebookEditors);
|
|
620
|
-
return
|
|
623
|
+
return u(l.onDidChangeVisibleNotebookEditors((t) => {
|
|
621
624
|
e.value = t;
|
|
622
625
|
})), e;
|
|
623
626
|
}), _e = m(() => {
|
|
624
627
|
const e = d(l.visibleTextEditors);
|
|
625
|
-
return
|
|
628
|
+
return u(l.onDidChangeVisibleTextEditors((t) => {
|
|
626
629
|
e.value = t;
|
|
627
630
|
})), e;
|
|
628
631
|
});
|
|
@@ -633,7 +636,7 @@ function et(e, t, n = !0) {
|
|
|
633
636
|
}), a;
|
|
634
637
|
}
|
|
635
638
|
function tt(e, t, n, a, i) {
|
|
636
|
-
const
|
|
639
|
+
const s = d(), c = u(l.createWebviewPanel(
|
|
637
640
|
e,
|
|
638
641
|
r(t),
|
|
639
642
|
a,
|
|
@@ -661,14 +664,14 @@ function tt(e, t, n, a, i) {
|
|
|
661
664
|
return c.webview.postMessage(C);
|
|
662
665
|
}
|
|
663
666
|
const w = x(c.active), v = x(c.visible);
|
|
664
|
-
return
|
|
667
|
+
return u(c.onDidChangeViewState(() => {
|
|
665
668
|
w.value = c.active, v.value = c.visible;
|
|
666
|
-
})), { panel: c, context:
|
|
669
|
+
})), { panel: c, context: s, active: w, visible: v, postMessage: h, forceRefresh: f };
|
|
667
670
|
}
|
|
668
671
|
const nt = N(
|
|
669
672
|
(e, t, n) => {
|
|
670
673
|
const a = d(), i = d();
|
|
671
|
-
|
|
674
|
+
u(l.registerWebviewViewProvider(
|
|
672
675
|
e,
|
|
673
676
|
{
|
|
674
677
|
resolveWebviewView(f, h) {
|
|
@@ -681,12 +684,12 @@ const nt = N(
|
|
|
681
684
|
}
|
|
682
685
|
}
|
|
683
686
|
));
|
|
684
|
-
const
|
|
687
|
+
const s = x(0);
|
|
685
688
|
function c() {
|
|
686
|
-
|
|
689
|
+
s.value++;
|
|
687
690
|
}
|
|
688
691
|
if (b(() => {
|
|
689
|
-
a.value && (a.value.webview.html = `${r(t)}<!--${
|
|
692
|
+
a.value && (a.value.webview.html = `${r(t)}<!--${s.value}-->`);
|
|
690
693
|
}), n != null && n.webviewOptions) {
|
|
691
694
|
const f = n.webviewOptions;
|
|
692
695
|
b(() => {
|
|
@@ -703,7 +706,7 @@ const nt = N(
|
|
|
703
706
|
(e) => e
|
|
704
707
|
), at = m(() => {
|
|
705
708
|
const e = d(l.state);
|
|
706
|
-
return
|
|
709
|
+
return u(l.onDidChangeWindowState((t) => {
|
|
707
710
|
e.value = t;
|
|
708
711
|
})), {
|
|
709
712
|
focused: g(() => e.value.focused),
|
|
@@ -711,7 +714,7 @@ const nt = N(
|
|
|
711
714
|
};
|
|
712
715
|
}), it = m(() => {
|
|
713
716
|
const e = d(T.workspaceFolders);
|
|
714
|
-
return
|
|
717
|
+
return u(T.onDidChangeWorkspaceFolders(() => {
|
|
715
718
|
e.value = T.workspaceFolders;
|
|
716
719
|
})), g(() => e.value);
|
|
717
720
|
});
|
|
@@ -744,7 +747,7 @@ export {
|
|
|
744
747
|
ke as useCommentController,
|
|
745
748
|
Re as useControlledTerminal,
|
|
746
749
|
ye as useDefaultShell,
|
|
747
|
-
|
|
750
|
+
u as useDisposable,
|
|
748
751
|
ie as useDocumentText,
|
|
749
752
|
re as useEditorDecorations,
|
|
750
753
|
E as useEvent,
|
|
@@ -758,12 +761,12 @@ export {
|
|
|
758
761
|
Me as useIsTelemetryEnabled,
|
|
759
762
|
Fe as useL10nText,
|
|
760
763
|
Le as useLogLevel,
|
|
761
|
-
|
|
764
|
+
ue as useLogger,
|
|
762
765
|
Ne as useNotebookEditorSelection,
|
|
763
766
|
oe as useNotebookEditorSelections,
|
|
764
767
|
He as useNotebookEditorVisibleRanges,
|
|
765
768
|
je as useOpenedTerminals,
|
|
766
|
-
|
|
769
|
+
se as useOutputChannel,
|
|
767
770
|
Be as useQuickPick,
|
|
768
771
|
ze as useStatusBarItem,
|
|
769
772
|
Ke as useTaskExecutions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactive-vscode",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6-beta.1",
|
|
5
5
|
"description": "Develop VSCode extension with Vue Reactivity API",
|
|
6
6
|
"author": "_Kerman <kermanx@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"@types/vscode": "^1.89.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@reactive-vscode/reactivity": "0.2.
|
|
40
|
+
"@reactive-vscode/reactivity": "0.2.6-beta.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/node": "^20.
|
|
44
|
-
"@types/vscode": "^1.
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"vite": "^5.
|
|
47
|
-
"vite-plugin-dts": "^
|
|
43
|
+
"@types/node": "^20.16.10",
|
|
44
|
+
"@types/vscode": "^1.93.0",
|
|
45
|
+
"typescript": "^5.6.2",
|
|
46
|
+
"vite": "^5.4.8",
|
|
47
|
+
"vite-plugin-dts": "^4.2.1"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"typecheck": "tsc --noEmit",
|