reactive-vscode 0.2.0-beta.8 → 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/dist/index.js +28 -27
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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
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
4
|
function _(e) {
|
|
@@ -41,17 +41,17 @@ function j(e) {
|
|
|
41
41
|
function ee(e, t, n) {
|
|
42
42
|
const a = !e, i = w.getConfiguration(a ? void 0 : e, n);
|
|
43
43
|
function o(l, f) {
|
|
44
|
-
const h = d(f),
|
|
44
|
+
const h = d(f), C = v({
|
|
45
45
|
get: () => h.value,
|
|
46
46
|
set: (g) => {
|
|
47
47
|
h.value = g, i.update(l, g);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
return
|
|
51
|
-
await i.update(l, g, U, J),
|
|
52
|
-
},
|
|
50
|
+
return C.update = async (g, U, J) => {
|
|
51
|
+
await i.update(l, g, U, J), C.value = g;
|
|
52
|
+
}, C.set = (g) => {
|
|
53
53
|
h.value = g;
|
|
54
|
-
},
|
|
54
|
+
}, C;
|
|
55
55
|
}
|
|
56
56
|
const s = Object.fromEntries(
|
|
57
57
|
Object.keys(t).map((l) => [l, o(l, i.get(l))])
|
|
@@ -140,7 +140,7 @@ const ne = m(() => {
|
|
|
140
140
|
});
|
|
141
141
|
function ie(e, t, n) {
|
|
142
142
|
const a = "key" in t ? t : c.createTextEditorDecorationType(t);
|
|
143
|
-
|
|
143
|
+
b(() => {
|
|
144
144
|
var i;
|
|
145
145
|
(i = r(e)) == null || i.setDecorations(a, r(n));
|
|
146
146
|
});
|
|
@@ -220,7 +220,7 @@ const Re = m(() => {
|
|
|
220
220
|
function Ae(e) {
|
|
221
221
|
var n;
|
|
222
222
|
const t = d((n = r(e)) == null ? void 0 : n.getText());
|
|
223
|
-
return
|
|
223
|
+
return b(() => {
|
|
224
224
|
var a;
|
|
225
225
|
t.value = (a = r(e)) == null ? void 0 : a.getText();
|
|
226
226
|
}), u(w.onDidChangeTextDocument((a) => {
|
|
@@ -294,7 +294,7 @@ function Pe(e) {
|
|
|
294
294
|
}
|
|
295
295
|
function Ne(e, t) {
|
|
296
296
|
const n = new L(), a = d();
|
|
297
|
-
|
|
297
|
+
b(() => {
|
|
298
298
|
a.value && n.fire(), a.value = r(t);
|
|
299
299
|
}), u(Z.registerFoldingRangeProvider(
|
|
300
300
|
e,
|
|
@@ -309,14 +309,14 @@ function Ne(e, t) {
|
|
|
309
309
|
}
|
|
310
310
|
function Oe(e, t, n, a) {
|
|
311
311
|
const i = F(/* @__PURE__ */ new Map()), o = k(), s = k(), l = k();
|
|
312
|
-
return
|
|
312
|
+
return b(() => {
|
|
313
313
|
const f = r(e), h = Array.isArray(f) ? f : [f];
|
|
314
|
-
for (const [
|
|
315
|
-
h.includes(
|
|
316
|
-
for (const
|
|
317
|
-
if (!i.has(
|
|
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
318
|
const g = w.createFileSystemWatcher(
|
|
319
|
-
|
|
319
|
+
C,
|
|
320
320
|
r(t) || !1,
|
|
321
321
|
r(n) || !1,
|
|
322
322
|
r(a) || !1
|
|
@@ -326,6 +326,7 @@ function Oe(e, t, n, a) {
|
|
|
326
326
|
}), V(() => {
|
|
327
327
|
for (const f of i.values())
|
|
328
328
|
f.dispose();
|
|
329
|
+
i.clear();
|
|
329
330
|
}), {
|
|
330
331
|
watchers: i,
|
|
331
332
|
onDidCreate: o.event,
|
|
@@ -441,14 +442,14 @@ function qe(e = {}) {
|
|
|
441
442
|
"matchOnDetail",
|
|
442
443
|
"keepScrollPosition"
|
|
443
444
|
].forEach((g) => {
|
|
444
|
-
e[g] &&
|
|
445
|
+
e[g] && b(() => t[g] = r(e[g]));
|
|
445
446
|
}), e.value && (t.value = e.value);
|
|
446
447
|
const f = d(t.value);
|
|
447
448
|
l((g) => f.value = g), e.activeItems && (t.activeItems = e.activeItems);
|
|
448
449
|
const h = d(t.activeItems);
|
|
449
450
|
n((g) => h.value = g), e.selectedItems && (t.selectedItems = e.selectedItems);
|
|
450
|
-
const
|
|
451
|
-
return a((g) =>
|
|
451
|
+
const C = d(t.selectedItems);
|
|
452
|
+
return a((g) => C.value = g), {
|
|
452
453
|
...t,
|
|
453
454
|
onDidChangeActive: n,
|
|
454
455
|
onDidChangeSelection: a,
|
|
@@ -458,14 +459,14 @@ function qe(e = {}) {
|
|
|
458
459
|
onDidChangeValue: l,
|
|
459
460
|
value: f,
|
|
460
461
|
activeItems: h,
|
|
461
|
-
selectedItems:
|
|
462
|
+
selectedItems: C
|
|
462
463
|
};
|
|
463
464
|
}
|
|
464
465
|
function Ue(e) {
|
|
465
466
|
const t = u(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority));
|
|
466
467
|
function n(a) {
|
|
467
468
|
const i = e[a];
|
|
468
|
-
i != null &&
|
|
469
|
+
i != null && b(() => t[a] = r(i));
|
|
469
470
|
}
|
|
470
471
|
return [
|
|
471
472
|
"name",
|
|
@@ -565,13 +566,13 @@ function Ge(e) {
|
|
|
565
566
|
})), v(() => t.value);
|
|
566
567
|
}
|
|
567
568
|
function H(e, t) {
|
|
568
|
-
|
|
569
|
+
b(() => {
|
|
569
570
|
const n = r(e);
|
|
570
571
|
n && (n.badge = r(t));
|
|
571
572
|
});
|
|
572
573
|
}
|
|
573
574
|
function q(e, t) {
|
|
574
|
-
|
|
575
|
+
b(() => {
|
|
575
576
|
const n = r(e);
|
|
576
577
|
n && (n.title = r(t));
|
|
577
578
|
});
|
|
@@ -608,13 +609,13 @@ function Ze(e) {
|
|
|
608
609
|
var i;
|
|
609
610
|
t.value = (i = r(e)) == null ? void 0 : i.visible;
|
|
610
611
|
}
|
|
611
|
-
return
|
|
612
|
+
return b((i) => {
|
|
612
613
|
const o = r(e);
|
|
613
614
|
if (o) {
|
|
614
615
|
const s = o.onDidChangeVisibility(n);
|
|
615
616
|
i(() => s.dispose());
|
|
616
617
|
}
|
|
617
|
-
}),
|
|
618
|
+
}), b(n), v(() => !!t.value);
|
|
618
619
|
}
|
|
619
620
|
const _e = m(() => {
|
|
620
621
|
const e = d(c.visibleNotebookEditors);
|
|
@@ -629,7 +630,7 @@ const _e = m(() => {
|
|
|
629
630
|
});
|
|
630
631
|
function tt(e, t, n = !0) {
|
|
631
632
|
const a = Y(t) ? t : typeof t == "function" ? v(t) : x(t);
|
|
632
|
-
return
|
|
633
|
+
return b(() => {
|
|
633
634
|
r(n) && y.executeCommand("setContext", e, a.value);
|
|
634
635
|
}), a;
|
|
635
636
|
}
|
|
@@ -653,11 +654,11 @@ const nt = W(
|
|
|
653
654
|
function s() {
|
|
654
655
|
o.value++;
|
|
655
656
|
}
|
|
656
|
-
if (
|
|
657
|
+
if (b(() => {
|
|
657
658
|
a.value && (a.value.webview.html = `${r(t)}<!--${o.value}-->`);
|
|
658
659
|
}), n != null && n.webviewOptions) {
|
|
659
660
|
const f = n.webviewOptions;
|
|
660
|
-
|
|
661
|
+
b(() => {
|
|
661
662
|
a.value && (a.value.webview.options = r(f));
|
|
662
663
|
});
|
|
663
664
|
}
|
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",
|