reactive-vscode 0.2.0 → 0.2.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/README.md +2 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +222 -207
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
5
|
[![License][license-src]][license-href]
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<img src="./docs/public/header.png" width="60%" />
|
|
8
8
|
|
|
9
9
|
**Develop VSCode extension with Vue Reactivity API**
|
|
10
10
|
|
|
11
11
|
- [**Documentation**](https://kermanx.github.io/reactive-vscode/)
|
|
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
|
+
- [**Examples**](https://kermanx.github.io/reactive-vscode/examples/)
|
|
14
15
|
|
|
15
16
|
### Project Status
|
|
16
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ import { WritableComputedRef } from '@reactive-vscode/reactivity';
|
|
|
62
62
|
|
|
63
63
|
/* Excluded from this release type: activateCbs */
|
|
64
64
|
|
|
65
|
+
export declare type Awaitable<T> = T | Promise<T>;
|
|
66
|
+
|
|
65
67
|
export declare interface Commands extends Record<string, (...args: any[]) => any> {
|
|
66
68
|
'vscode.open': (uri: Uri) => void;
|
|
67
69
|
}
|
|
@@ -430,7 +432,21 @@ export declare function useDocumentText(doc: MaybeRefOrGetter<TextDocument | und
|
|
|
430
432
|
*
|
|
431
433
|
* @category editor
|
|
432
434
|
*/
|
|
433
|
-
export declare function useEditorDecorations(editor: MaybeRefOrGetter<Nullable<TextEditor>>, decorationTypeOrOptions: TextEditorDecorationType | DecorationRenderOptions,
|
|
435
|
+
export declare function useEditorDecorations(editor: MaybeRefOrGetter<Nullable<TextEditor>>, decorationTypeOrOptions: TextEditorDecorationType | DecorationRenderOptions, decorations: MaybeRef<readonly Range[] | readonly DecorationOptions[]> | ((editor: TextEditor) => Awaitable<readonly Range[] | readonly DecorationOptions[]>), options?: UseEditorDecorationsOptions): {
|
|
436
|
+
/**
|
|
437
|
+
* Manually trigger the decoration update.
|
|
438
|
+
*/
|
|
439
|
+
update: () => Promise<void>;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export declare interface UseEditorDecorationsOptions {
|
|
443
|
+
/**
|
|
444
|
+
* The triggers to update the decorations.
|
|
445
|
+
*
|
|
446
|
+
* @default ['effect', 'documentChanged']
|
|
447
|
+
*/
|
|
448
|
+
updateOn?: ('effect' | 'documentChanged')[];
|
|
449
|
+
}
|
|
434
450
|
|
|
435
451
|
/**
|
|
436
452
|
* @category utilities
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
1
|
+
import { getCurrentScope as L, onScopeDispose as P, shallowRef as d, effectScope as Q, computed as g, reactive as U, toValue as o, watchEffect as C, watch as b, ref as y, shallowReactive as q, toRaw as Y, isRef as G } from "@reactive-vscode/reactivity";
|
|
2
2
|
export * from "@reactive-vscode/reactivity";
|
|
3
|
-
import { workspace as D, commands as
|
|
3
|
+
import { workspace as D, commands as A, window as l, debug as W, extensions as V, comments as J, env as E, EventEmitter as N, tasks as x, Uri as X, languages as Z, ColorThemeKind as O, l10n as F } from "vscode";
|
|
4
4
|
function _(e) {
|
|
5
|
-
return
|
|
5
|
+
return L() ? (P(e), !0) : !1;
|
|
6
6
|
}
|
|
7
7
|
function $(e, t) {
|
|
8
8
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -22,11 +22,11 @@ function h(e) {
|
|
|
22
22
|
return () => t ?? (t = e());
|
|
23
23
|
}
|
|
24
24
|
const M = [];
|
|
25
|
-
function
|
|
25
|
+
function ge(e) {
|
|
26
26
|
M.push(e);
|
|
27
27
|
}
|
|
28
28
|
const k = d(null), I = Q();
|
|
29
|
-
function
|
|
29
|
+
function me(e) {
|
|
30
30
|
return {
|
|
31
31
|
activate: (t) => (k.value = t, I.run(() => (j.map((n) => n(t)), e()))),
|
|
32
32
|
deactivate: () => {
|
|
@@ -40,59 +40,59 @@ function B(e) {
|
|
|
40
40
|
}
|
|
41
41
|
function ee(e, t, n) {
|
|
42
42
|
const a = !e, i = D.getConfiguration(a ? void 0 : e, n);
|
|
43
|
-
function r(
|
|
44
|
-
const m = d(
|
|
43
|
+
function r(c, f) {
|
|
44
|
+
const m = d(f), w = g({
|
|
45
45
|
get: () => m.value,
|
|
46
|
-
set: (
|
|
47
|
-
m.value =
|
|
46
|
+
set: (v) => {
|
|
47
|
+
m.value = v, i.update(c, v);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
return w.update = async (
|
|
51
|
-
await i.update(
|
|
52
|
-
}, w.set = (
|
|
53
|
-
m.value =
|
|
50
|
+
return w.update = async (v, T, p) => {
|
|
51
|
+
await i.update(c, v, T, p), w.value = v;
|
|
52
|
+
}, w.set = (v) => {
|
|
53
|
+
m.value = v;
|
|
54
54
|
}, w;
|
|
55
55
|
}
|
|
56
56
|
const s = Object.fromEntries(
|
|
57
|
-
Object.keys(t).map((
|
|
57
|
+
Object.keys(t).map((c) => [c, r(c, i.get(c))])
|
|
58
58
|
);
|
|
59
59
|
return B(() => {
|
|
60
60
|
u(D.onDidChangeConfiguration(
|
|
61
|
-
a ? (
|
|
62
|
-
const
|
|
61
|
+
a ? (c) => {
|
|
62
|
+
const f = D.getConfiguration();
|
|
63
63
|
for (const m in t)
|
|
64
|
-
|
|
65
|
-
} : (
|
|
66
|
-
if (!
|
|
64
|
+
c.affectsConfiguration(m) && s[m].set(f.get(m));
|
|
65
|
+
} : (c) => {
|
|
66
|
+
if (!c.affectsConfiguration(e))
|
|
67
67
|
return;
|
|
68
|
-
const
|
|
68
|
+
const f = D.getConfiguration(e);
|
|
69
69
|
for (const m in t)
|
|
70
|
-
|
|
70
|
+
c.affectsConfiguration(`${e}.${m}`) && s[m].set(f.get(m));
|
|
71
71
|
}
|
|
72
72
|
));
|
|
73
73
|
}), s;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function he(e, t, n) {
|
|
76
76
|
const a = ee(e, t, n);
|
|
77
77
|
return U({
|
|
78
78
|
...a,
|
|
79
|
-
$update(i, r, s,
|
|
80
|
-
return a[i].update(r, s,
|
|
79
|
+
$update(i, r, s, c) {
|
|
80
|
+
return a[i].update(r, s, c);
|
|
81
81
|
},
|
|
82
82
|
$set(i, r) {
|
|
83
83
|
return a[i].set(r);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ce(e, t) {
|
|
88
88
|
const n = d(null), a = [], i = (r) => (...s) => n.value ? n.value[r](...s) : (a.push([r, s]), null);
|
|
89
89
|
return B(() => {
|
|
90
|
-
n.value =
|
|
90
|
+
n.value = ue(e, t);
|
|
91
91
|
for (const [r, s] of a)
|
|
92
92
|
n.value[r](...s);
|
|
93
93
|
}), {
|
|
94
94
|
logger: n,
|
|
95
|
-
outputChannel:
|
|
95
|
+
outputChannel: g(() => {
|
|
96
96
|
var r;
|
|
97
97
|
return (r = n.value) == null ? void 0 : r.outputChannel;
|
|
98
98
|
}),
|
|
@@ -107,8 +107,8 @@ function he(e, t) {
|
|
|
107
107
|
hide: i("hide")
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function be(e, ...t) {
|
|
111
|
+
return A.executeCommand(e, ...t);
|
|
112
112
|
}
|
|
113
113
|
function te(e, t = !1) {
|
|
114
114
|
const n = k.value;
|
|
@@ -116,63 +116,88 @@ function te(e, t = !1) {
|
|
|
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
|
-
function
|
|
120
|
-
return
|
|
119
|
+
function we(e, t = !1) {
|
|
120
|
+
return g(() => te(o(e), t));
|
|
121
121
|
}
|
|
122
122
|
function u(e) {
|
|
123
|
-
return (
|
|
123
|
+
return (L() ?? I).cleanups.push(e.dispose.bind(e)), e;
|
|
124
124
|
}
|
|
125
125
|
const ne = h(() => {
|
|
126
|
-
const e = d(
|
|
127
|
-
return u(
|
|
126
|
+
const e = d(l.activeColorTheme);
|
|
127
|
+
return u(l.onDidChangeActiveColorTheme((t) => {
|
|
128
128
|
e.value = t;
|
|
129
129
|
})), e;
|
|
130
|
-
}),
|
|
130
|
+
}), De = h(() => {
|
|
131
131
|
const e = d(W.activeDebugSession);
|
|
132
132
|
return u(W.onDidChangeActiveDebugSession((t) => {
|
|
133
133
|
e.value = t;
|
|
134
|
-
})),
|
|
134
|
+
})), g(() => e.value);
|
|
135
135
|
}), ae = h(() => {
|
|
136
|
-
const e = d(
|
|
137
|
-
return u(
|
|
136
|
+
const e = d(l.activeTextEditor);
|
|
137
|
+
return u(l.onDidChangeActiveTextEditor((t) => {
|
|
138
138
|
e.value = t;
|
|
139
139
|
})), e;
|
|
140
140
|
});
|
|
141
|
-
function ie(e
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
function ie(e) {
|
|
142
|
+
var n;
|
|
143
|
+
const t = d((n = o(e)) == null ? void 0 : n.getText());
|
|
144
|
+
return C(() => {
|
|
145
|
+
var a;
|
|
146
|
+
t.value = (a = o(e)) == null ? void 0 : a.getText();
|
|
147
|
+
}), u(D.onDidChangeTextDocument((a) => {
|
|
148
|
+
a.document === o(e) && (t.value = a.document.getText());
|
|
149
|
+
})), t;
|
|
150
|
+
}
|
|
151
|
+
function re(e, t, n, a = {}) {
|
|
152
|
+
const {
|
|
153
|
+
updateOn: i = ["effect", "documentChanged"]
|
|
154
|
+
} = a, r = "key" in t ? t : u(l.createTextEditorDecorationType(t)), s = async () => {
|
|
155
|
+
const f = o(e);
|
|
156
|
+
f && f.setDecorations(
|
|
157
|
+
r,
|
|
158
|
+
typeof n == "function" ? await n(f) : o(n)
|
|
159
|
+
);
|
|
160
|
+
}, c = i.includes("documentChanged") ? ie(() => {
|
|
161
|
+
var f;
|
|
162
|
+
return (f = o(e)) == null ? void 0 : f.document;
|
|
163
|
+
}) : null;
|
|
164
|
+
return i.includes("effect") ? C(async () => {
|
|
165
|
+
c == null || c.value, await s();
|
|
166
|
+
}) : c && b(c, s), {
|
|
167
|
+
/**
|
|
168
|
+
* Manually trigger the decoration update.
|
|
169
|
+
*/
|
|
170
|
+
update: s
|
|
171
|
+
};
|
|
147
172
|
}
|
|
148
|
-
function
|
|
173
|
+
function Te(e, t) {
|
|
149
174
|
const n = ae();
|
|
150
|
-
|
|
175
|
+
re(n, e, t);
|
|
151
176
|
}
|
|
152
|
-
const
|
|
153
|
-
const e = d(
|
|
154
|
-
return u(
|
|
177
|
+
const pe = h(() => {
|
|
178
|
+
const e = d(l.activeNotebookEditor);
|
|
179
|
+
return u(l.onDidChangeActiveNotebookEditor((t) => {
|
|
155
180
|
e.value = t;
|
|
156
181
|
})), e;
|
|
157
182
|
}), Se = h(() => {
|
|
158
|
-
const e = d(
|
|
159
|
-
return u(
|
|
183
|
+
const e = d(l.activeTerminal);
|
|
184
|
+
return u(l.onDidChangeActiveTerminal((t) => {
|
|
160
185
|
e.value = t;
|
|
161
186
|
})), e;
|
|
162
|
-
}),
|
|
187
|
+
}), Ee = h(() => {
|
|
163
188
|
const e = d(V.all);
|
|
164
189
|
return u(V.onDidChange(() => {
|
|
165
190
|
e.value = V.all;
|
|
166
|
-
})),
|
|
191
|
+
})), g(() => e.value);
|
|
167
192
|
});
|
|
168
|
-
function
|
|
169
|
-
u(
|
|
193
|
+
function oe(e, t) {
|
|
194
|
+
u(A.registerCommand(e, t));
|
|
170
195
|
}
|
|
171
196
|
function xe(e) {
|
|
172
197
|
for (const [t, n] of Object.entries(e))
|
|
173
|
-
n &&
|
|
198
|
+
n && oe(t, n);
|
|
174
199
|
}
|
|
175
|
-
function
|
|
200
|
+
function ke(e, t) {
|
|
176
201
|
return u(J.createCommentController(e, t));
|
|
177
202
|
}
|
|
178
203
|
function H(e) {
|
|
@@ -181,20 +206,20 @@ function H(e) {
|
|
|
181
206
|
return b(e, () => {
|
|
182
207
|
var a;
|
|
183
208
|
t.value = (a = o(e)) == null ? void 0 : a.state;
|
|
184
|
-
}), u(
|
|
209
|
+
}), u(l.onDidChangeTerminalState((a) => {
|
|
185
210
|
a === o(e) && (t.value = a.state);
|
|
186
|
-
})),
|
|
211
|
+
})), g(() => t.value);
|
|
187
212
|
}
|
|
188
|
-
function
|
|
189
|
-
const t =
|
|
213
|
+
function ye(...e) {
|
|
214
|
+
const t = y(null);
|
|
190
215
|
function n() {
|
|
191
216
|
return !!t.value && t.value.exitStatus == null;
|
|
192
217
|
}
|
|
193
218
|
function a() {
|
|
194
|
-
return n() ? t.value : t.value =
|
|
219
|
+
return n() ? t.value : t.value = l.createTerminal(...e);
|
|
195
220
|
}
|
|
196
|
-
function i(
|
|
197
|
-
a().sendText(
|
|
221
|
+
function i(c) {
|
|
222
|
+
a().sendText(c);
|
|
198
223
|
}
|
|
199
224
|
function r() {
|
|
200
225
|
a().show();
|
|
@@ -212,29 +237,19 @@ function ke(...e) {
|
|
|
212
237
|
};
|
|
213
238
|
}
|
|
214
239
|
const Re = h(() => {
|
|
215
|
-
const e = d(
|
|
216
|
-
return u(
|
|
240
|
+
const e = d(E.shell);
|
|
241
|
+
return u(E.onDidChangeShell((t) => {
|
|
217
242
|
e.value = t;
|
|
218
|
-
})),
|
|
243
|
+
})), g(() => e.value);
|
|
219
244
|
});
|
|
220
|
-
function
|
|
221
|
-
var n;
|
|
222
|
-
const t = d((n = o(e)) == null ? void 0 : n.getText());
|
|
223
|
-
return C(() => {
|
|
224
|
-
var a;
|
|
225
|
-
t.value = (a = o(e)) == null ? void 0 : a.getText();
|
|
226
|
-
}), u(D.onDidChangeTextDocument((a) => {
|
|
227
|
-
a.document === o(e) && (t.value = a.document.getText());
|
|
228
|
-
})), t;
|
|
229
|
-
}
|
|
230
|
-
function p(e, t) {
|
|
245
|
+
function S(e, t) {
|
|
231
246
|
const n = (a, i, r) => {
|
|
232
247
|
u(e(a, i, r));
|
|
233
248
|
};
|
|
234
249
|
return t == null || t.forEach((a) => n(a)), n;
|
|
235
250
|
}
|
|
236
|
-
function
|
|
237
|
-
const n = Array.isArray(e) ? e : t ?? [], a = u(Array.isArray(e) || e == null ? new
|
|
251
|
+
function R(e, t = []) {
|
|
252
|
+
const n = Array.isArray(e) ? e : t ?? [], a = u(Array.isArray(e) || e == null ? new N() : e), i = S(a.event, n);
|
|
238
253
|
for (const r of n)
|
|
239
254
|
i(r);
|
|
240
255
|
return {
|
|
@@ -243,8 +258,8 @@ function A(e, t = []) {
|
|
|
243
258
|
addListener: i
|
|
244
259
|
};
|
|
245
260
|
}
|
|
246
|
-
async function
|
|
247
|
-
const t = k.value.secrets, n =
|
|
261
|
+
async function Ae(e) {
|
|
262
|
+
const t = k.value.secrets, n = y(await t.get(e));
|
|
248
263
|
return n.set = async (a) => {
|
|
249
264
|
n.value = a, await t.store(e, a);
|
|
250
265
|
}, n.remove = async () => {
|
|
@@ -256,13 +271,13 @@ async function ye(e) {
|
|
|
256
271
|
}), n;
|
|
257
272
|
}
|
|
258
273
|
function Ve(e) {
|
|
259
|
-
return
|
|
274
|
+
return g(() => x.fetchTasks(o(e)));
|
|
260
275
|
}
|
|
261
276
|
function Ie(e) {
|
|
262
|
-
return
|
|
277
|
+
return g(() => X.file(o(e)));
|
|
263
278
|
}
|
|
264
279
|
function Pe(e, t) {
|
|
265
|
-
const n = new
|
|
280
|
+
const n = new N(), a = d();
|
|
266
281
|
C(() => {
|
|
267
282
|
a.value && n.fire(), a.value = o(t);
|
|
268
283
|
}), u(Z.registerFoldingRangeProvider(
|
|
@@ -270,67 +285,67 @@ function Pe(e, t) {
|
|
|
270
285
|
{
|
|
271
286
|
onDidChangeFoldingRanges: n.event,
|
|
272
287
|
provideFoldingRanges(i, r, s) {
|
|
273
|
-
var
|
|
274
|
-
return (
|
|
288
|
+
var c;
|
|
289
|
+
return (c = a.value) == null ? void 0 : c.call(a, i, r, s);
|
|
275
290
|
}
|
|
276
291
|
}
|
|
277
292
|
));
|
|
278
293
|
}
|
|
279
294
|
function We(e, t, n, a) {
|
|
280
|
-
const i = q(/* @__PURE__ */ new Map()), r =
|
|
281
|
-
const
|
|
282
|
-
return Array.isArray(
|
|
295
|
+
const i = q(/* @__PURE__ */ new Map()), r = R(), s = R(), c = R(), f = g(() => {
|
|
296
|
+
const v = o(e);
|
|
297
|
+
return Array.isArray(v) ? v : v instanceof Set ? Array.from(v) : [v];
|
|
283
298
|
});
|
|
284
299
|
function m() {
|
|
285
|
-
const
|
|
286
|
-
for (const [T,
|
|
287
|
-
|
|
288
|
-
for (const T of
|
|
300
|
+
const v = f.value;
|
|
301
|
+
for (const [T, p] of i)
|
|
302
|
+
v.includes(T) || (p.dispose(), i.delete(T));
|
|
303
|
+
for (const T of v)
|
|
289
304
|
if (!i.has(T)) {
|
|
290
|
-
const
|
|
305
|
+
const p = D.createFileSystemWatcher(
|
|
291
306
|
T,
|
|
292
307
|
o(t) || !1,
|
|
293
308
|
o(n) || !1,
|
|
294
309
|
o(a) || !1
|
|
295
310
|
);
|
|
296
|
-
|
|
311
|
+
p.onDidCreate(r.fire), p.onDidChange(s.fire), p.onDidDelete(c.fire);
|
|
297
312
|
}
|
|
298
313
|
}
|
|
299
314
|
function w() {
|
|
300
|
-
for (const
|
|
301
|
-
|
|
315
|
+
for (const v of i.values())
|
|
316
|
+
v.dispose();
|
|
302
317
|
i.clear();
|
|
303
318
|
}
|
|
304
|
-
return b(
|
|
319
|
+
return b(f, m), b([t, n, a], () => {
|
|
305
320
|
w(), m();
|
|
306
321
|
}), P(w), {
|
|
307
322
|
watchers: i,
|
|
308
323
|
onDidCreate: r.event,
|
|
309
324
|
onDidChange: s.event,
|
|
310
|
-
onDidDelete:
|
|
325
|
+
onDidDelete: c.event
|
|
311
326
|
};
|
|
312
327
|
}
|
|
313
|
-
const
|
|
328
|
+
const Oe = h(() => {
|
|
314
329
|
const e = ne();
|
|
315
|
-
return
|
|
316
|
-
}),
|
|
317
|
-
const e = d(
|
|
318
|
-
return u(
|
|
330
|
+
return g(() => e.value.kind === O.Dark || e.value.kind === O.HighContrast);
|
|
331
|
+
}), Fe = h(() => {
|
|
332
|
+
const e = d(E.isTelemetryEnabled);
|
|
333
|
+
return u(E.onDidChangeTelemetryEnabled((t) => {
|
|
319
334
|
e.value = t;
|
|
320
|
-
})),
|
|
335
|
+
})), g(() => e.value);
|
|
321
336
|
});
|
|
322
|
-
function
|
|
323
|
-
return
|
|
337
|
+
function Le(e, ...t) {
|
|
338
|
+
return g(() => typeof t[0] == "object" ? F.t(o(e), Y(t[0])) : F.t(o(e), ...t.map(o)));
|
|
324
339
|
}
|
|
325
|
-
function
|
|
326
|
-
return u(
|
|
340
|
+
function se(e, t) {
|
|
341
|
+
return u(l.createOutputChannel(e, t));
|
|
327
342
|
}
|
|
328
|
-
function
|
|
329
|
-
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"), r = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"),
|
|
330
|
-
return `${n}-${a}-${i} ${r}:${s}:${
|
|
343
|
+
function Ne(e) {
|
|
344
|
+
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"), r = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), c = String(t.getSeconds()).padStart(2, "0"), f = String(t.getMilliseconds()).padStart(3, "0");
|
|
345
|
+
return `${n}-${a}-${i} ${r}:${s}:${c}.${f} [${e}] `;
|
|
331
346
|
}
|
|
332
|
-
function
|
|
333
|
-
const n = t.outputChannel ??
|
|
347
|
+
function ue(e, t = {}) {
|
|
348
|
+
const n = t.outputChannel ?? se(e), a = (i) => (...r) => {
|
|
334
349
|
var s;
|
|
335
350
|
n.appendLine((((s = t.getPrefix) == null ? void 0 : s.call(t, i)) ?? "") + r.join(" "));
|
|
336
351
|
};
|
|
@@ -349,20 +364,20 @@ function se(e, t = {}) {
|
|
|
349
364
|
};
|
|
350
365
|
}
|
|
351
366
|
const $e = h(() => {
|
|
352
|
-
const e = d(
|
|
353
|
-
return u(
|
|
367
|
+
const e = d(E.logLevel);
|
|
368
|
+
return u(E.onDidChangeLogLevel((t) => {
|
|
354
369
|
e.value = t;
|
|
355
|
-
})),
|
|
370
|
+
})), g(() => e.value);
|
|
356
371
|
});
|
|
357
|
-
function
|
|
372
|
+
function ce(e) {
|
|
358
373
|
var n;
|
|
359
374
|
const t = d(((n = o(e)) == null ? void 0 : n.selections) ?? []);
|
|
360
375
|
return b(e, () => {
|
|
361
376
|
var a;
|
|
362
377
|
t.value = ((a = o(e)) == null ? void 0 : a.selections) ?? [];
|
|
363
|
-
}), u(
|
|
378
|
+
}), u(l.onDidChangeNotebookEditorSelection((a) => {
|
|
364
379
|
a.notebookEditor === o(e) && (t.value = a.selections);
|
|
365
|
-
})),
|
|
380
|
+
})), g({
|
|
366
381
|
get() {
|
|
367
382
|
return t.value;
|
|
368
383
|
},
|
|
@@ -374,8 +389,8 @@ function ue(e) {
|
|
|
374
389
|
});
|
|
375
390
|
}
|
|
376
391
|
function Me(e) {
|
|
377
|
-
const t =
|
|
378
|
-
return
|
|
392
|
+
const t = ce(e);
|
|
393
|
+
return g({
|
|
379
394
|
get() {
|
|
380
395
|
return t.value[0];
|
|
381
396
|
},
|
|
@@ -390,19 +405,19 @@ function je(e) {
|
|
|
390
405
|
return b(e, () => {
|
|
391
406
|
var a;
|
|
392
407
|
t.value = ((a = o(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
393
|
-
}), u(
|
|
408
|
+
}), u(l.onDidChangeNotebookEditorVisibleRanges((a) => {
|
|
394
409
|
a.notebookEditor === o(e) && (t.value = a.visibleRanges);
|
|
395
|
-
})),
|
|
410
|
+
})), g(() => t.value);
|
|
396
411
|
}
|
|
397
412
|
const Be = h(() => {
|
|
398
|
-
const e = d(
|
|
413
|
+
const e = d(l.terminals);
|
|
399
414
|
function t() {
|
|
400
|
-
e.value =
|
|
415
|
+
e.value = l.terminals;
|
|
401
416
|
}
|
|
402
|
-
return u(
|
|
417
|
+
return u(l.onDidOpenTerminal(t)), u(l.onDidCloseTerminal(t)), e;
|
|
403
418
|
});
|
|
404
419
|
function He(e = {}) {
|
|
405
|
-
const t = u(
|
|
420
|
+
const t = u(l.createQuickPick()), n = S(t.onDidChangeActive), a = S(t.onDidChangeSelection), i = S(t.onDidAccept), r = S(t.onDidHide), s = S(t.onDidTriggerButton), c = S(t.onDidChangeValue);
|
|
406
421
|
[
|
|
407
422
|
"items",
|
|
408
423
|
"buttons",
|
|
@@ -417,29 +432,29 @@ function He(e = {}) {
|
|
|
417
432
|
"matchOnDescription",
|
|
418
433
|
"matchOnDetail",
|
|
419
434
|
"keepScrollPosition"
|
|
420
|
-
].forEach((
|
|
421
|
-
e[
|
|
435
|
+
].forEach((v) => {
|
|
436
|
+
e[v] && C(() => t[v] = o(e[v]));
|
|
422
437
|
}), e.value && (t.value = e.value);
|
|
423
|
-
const
|
|
424
|
-
|
|
438
|
+
const f = d(t.value);
|
|
439
|
+
c((v) => f.value = v), e.activeItems && (t.activeItems = e.activeItems);
|
|
425
440
|
const m = d(t.activeItems);
|
|
426
|
-
n((
|
|
441
|
+
n((v) => m.value = v), e.selectedItems && (t.selectedItems = e.selectedItems);
|
|
427
442
|
const w = d(t.selectedItems);
|
|
428
|
-
return a((
|
|
443
|
+
return a((v) => w.value = v), {
|
|
429
444
|
...t,
|
|
430
445
|
onDidChangeActive: n,
|
|
431
446
|
onDidChangeSelection: a,
|
|
432
447
|
onDidAccept: i,
|
|
433
448
|
onDidHide: r,
|
|
434
449
|
onDidTriggerButton: s,
|
|
435
|
-
onDidChangeValue:
|
|
436
|
-
value:
|
|
450
|
+
onDidChangeValue: c,
|
|
451
|
+
value: f,
|
|
437
452
|
activeItems: m,
|
|
438
453
|
selectedItems: w
|
|
439
454
|
};
|
|
440
455
|
}
|
|
441
456
|
function ze(e) {
|
|
442
|
-
const t = u(e.id ?
|
|
457
|
+
const t = u(e.id ? l.createStatusBarItem(e.id, e.alignment, e.priority) : l.createStatusBarItem(e.alignment, e.priority));
|
|
443
458
|
function n(a) {
|
|
444
459
|
const i = e[a];
|
|
445
460
|
i != null && C(() => t[a] = o(i));
|
|
@@ -455,14 +470,14 @@ function ze(e) {
|
|
|
455
470
|
].forEach(n), t;
|
|
456
471
|
}
|
|
457
472
|
const Ke = h(() => {
|
|
458
|
-
const e = d(
|
|
473
|
+
const e = d(x.taskExecutions);
|
|
459
474
|
function t() {
|
|
460
|
-
e.value =
|
|
475
|
+
e.value = x.taskExecutions;
|
|
461
476
|
}
|
|
462
|
-
return u(
|
|
477
|
+
return u(x.onDidStartTask(t)), u(x.onDidEndTask(t)), g(() => e.value);
|
|
463
478
|
});
|
|
464
479
|
function Qe(...e) {
|
|
465
|
-
const t = u(
|
|
480
|
+
const t = u(l.createTerminal(...e));
|
|
466
481
|
return {
|
|
467
482
|
terminal: t,
|
|
468
483
|
get name() {
|
|
@@ -483,23 +498,23 @@ function Qe(...e) {
|
|
|
483
498
|
state: H(t)
|
|
484
499
|
};
|
|
485
500
|
}
|
|
486
|
-
function
|
|
487
|
-
u(
|
|
501
|
+
function le(e, t) {
|
|
502
|
+
u(A.registerTextEditorCommand(e, t));
|
|
488
503
|
}
|
|
489
504
|
function Ue(e) {
|
|
490
505
|
for (const [t, n] of Object.entries(e))
|
|
491
|
-
|
|
506
|
+
le(t, n);
|
|
492
507
|
}
|
|
493
|
-
function
|
|
508
|
+
function de(e, t) {
|
|
494
509
|
var a;
|
|
495
510
|
const n = d(((a = o(e)) == null ? void 0 : a.selections) ?? []);
|
|
496
511
|
return b(e, () => {
|
|
497
512
|
var i;
|
|
498
513
|
n.value = ((i = o(e)) == null ? void 0 : i.selections) ?? [];
|
|
499
|
-
}), u(
|
|
514
|
+
}), u(l.onDidChangeTextEditorSelection((i) => {
|
|
500
515
|
const r = o(e), s = o(t);
|
|
501
516
|
i.textEditor === r && (!s || s.includes(i.kind)) && (n.value = i.selections);
|
|
502
|
-
})),
|
|
517
|
+
})), g({
|
|
503
518
|
get() {
|
|
504
519
|
return n.value;
|
|
505
520
|
},
|
|
@@ -511,8 +526,8 @@ function le(e, t) {
|
|
|
511
526
|
});
|
|
512
527
|
}
|
|
513
528
|
function qe(e, t) {
|
|
514
|
-
const n =
|
|
515
|
-
return
|
|
529
|
+
const n = de(e, t);
|
|
530
|
+
return g({
|
|
516
531
|
get() {
|
|
517
532
|
return n.value[0];
|
|
518
533
|
},
|
|
@@ -527,9 +542,9 @@ function Ye(e) {
|
|
|
527
542
|
return b(e, () => {
|
|
528
543
|
var a;
|
|
529
544
|
t.value = (a = o(e)) == null ? void 0 : a.viewColumn;
|
|
530
|
-
}), u(
|
|
545
|
+
}), u(l.onDidChangeTextEditorViewColumn((a) => {
|
|
531
546
|
a.textEditor === o(e) && (t.value = a.viewColumn);
|
|
532
|
-
})),
|
|
547
|
+
})), g(() => t.value);
|
|
533
548
|
}
|
|
534
549
|
function Ge(e) {
|
|
535
550
|
var n;
|
|
@@ -537,9 +552,9 @@ function Ge(e) {
|
|
|
537
552
|
return b(e, () => {
|
|
538
553
|
var a;
|
|
539
554
|
t.value = ((a = o(e)) == null ? void 0 : a.visibleRanges) ?? [];
|
|
540
|
-
}), u(
|
|
555
|
+
}), u(l.onDidChangeTextEditorVisibleRanges((a) => {
|
|
541
556
|
a.textEditor === o(e) && (t.value = a.visibleRanges);
|
|
542
|
-
})),
|
|
557
|
+
})), g(() => t.value);
|
|
543
558
|
}
|
|
544
559
|
function z(e, t) {
|
|
545
560
|
C(() => {
|
|
@@ -555,9 +570,9 @@ function K(e, t) {
|
|
|
555
570
|
}
|
|
556
571
|
const Je = $(
|
|
557
572
|
(e, t, n) => {
|
|
558
|
-
const a =
|
|
573
|
+
const a = R();
|
|
559
574
|
b(t, () => a.fire()), n != null && n.watchSource && b(n.watchSource, () => a.fire());
|
|
560
|
-
const i = /* @__PURE__ */ new WeakMap(), r = u(
|
|
575
|
+
const i = /* @__PURE__ */ new WeakMap(), r = u(l.createTreeView(e, {
|
|
561
576
|
...n,
|
|
562
577
|
treeDataProvider: {
|
|
563
578
|
...n,
|
|
@@ -566,8 +581,8 @@ const Je = $(
|
|
|
566
581
|
return s.treeItem;
|
|
567
582
|
},
|
|
568
583
|
getChildren(s) {
|
|
569
|
-
var
|
|
570
|
-
return s ? ((
|
|
584
|
+
var c;
|
|
585
|
+
return s ? ((c = s.children) == null || c.forEach((f) => i.set(f, s)), s.children) : o(t);
|
|
571
586
|
},
|
|
572
587
|
getParent(s) {
|
|
573
588
|
return i.get(s);
|
|
@@ -580,7 +595,7 @@ const Je = $(
|
|
|
580
595
|
);
|
|
581
596
|
function Xe(e) {
|
|
582
597
|
var a;
|
|
583
|
-
const t =
|
|
598
|
+
const t = y((a = o(e)) == null ? void 0 : a.visible);
|
|
584
599
|
function n() {
|
|
585
600
|
var i;
|
|
586
601
|
t.value = (i = o(e)) == null ? void 0 : i.visible;
|
|
@@ -591,33 +606,33 @@ function Xe(e) {
|
|
|
591
606
|
const s = r.onDidChangeVisibility(n);
|
|
592
607
|
i(() => s.dispose());
|
|
593
608
|
}
|
|
594
|
-
}), C(n),
|
|
609
|
+
}), C(n), g(() => !!t.value);
|
|
595
610
|
}
|
|
596
611
|
const Ze = h(() => {
|
|
597
|
-
const e = d(
|
|
598
|
-
return u(
|
|
612
|
+
const e = d(l.visibleNotebookEditors);
|
|
613
|
+
return u(l.onDidChangeVisibleNotebookEditors((t) => {
|
|
599
614
|
e.value = t;
|
|
600
615
|
})), e;
|
|
601
616
|
}), _e = h(() => {
|
|
602
|
-
const e = d(
|
|
603
|
-
return u(
|
|
617
|
+
const e = d(l.visibleTextEditors);
|
|
618
|
+
return u(l.onDidChangeVisibleTextEditors((t) => {
|
|
604
619
|
e.value = t;
|
|
605
620
|
})), e;
|
|
606
621
|
});
|
|
607
622
|
function et(e, t, n = !0) {
|
|
608
|
-
const a = G(t) ? t : typeof t == "function" ?
|
|
623
|
+
const a = G(t) ? t : typeof t == "function" ? g(t) : y(t);
|
|
609
624
|
return C(() => {
|
|
610
|
-
o(n) &&
|
|
625
|
+
o(n) && A.executeCommand("setContext", e, a.value);
|
|
611
626
|
}), a;
|
|
612
627
|
}
|
|
613
628
|
const tt = $(
|
|
614
629
|
(e, t, n) => {
|
|
615
630
|
const a = d(), i = d();
|
|
616
|
-
u(
|
|
631
|
+
u(l.registerWebviewViewProvider(
|
|
617
632
|
e,
|
|
618
633
|
{
|
|
619
|
-
resolveWebviewView(
|
|
620
|
-
a.value =
|
|
634
|
+
resolveWebviewView(f, m) {
|
|
635
|
+
a.value = f, i.value = m, n != null && n.onDidReceiveMessage && f.webview.onDidReceiveMessage(n.onDidReceiveMessage);
|
|
621
636
|
}
|
|
622
637
|
},
|
|
623
638
|
{
|
|
@@ -626,98 +641,98 @@ const tt = $(
|
|
|
626
641
|
}
|
|
627
642
|
}
|
|
628
643
|
));
|
|
629
|
-
const r =
|
|
644
|
+
const r = y(0);
|
|
630
645
|
function s() {
|
|
631
646
|
r.value++;
|
|
632
647
|
}
|
|
633
648
|
if (C(() => {
|
|
634
649
|
a.value && (a.value.webview.html = `${o(t)}<!--${r.value}-->`);
|
|
635
650
|
}), n != null && n.webviewOptions) {
|
|
636
|
-
const
|
|
651
|
+
const f = n.webviewOptions;
|
|
637
652
|
C(() => {
|
|
638
|
-
a.value && (a.value.webview.options = o(
|
|
653
|
+
a.value && (a.value.webview.options = o(f));
|
|
639
654
|
});
|
|
640
655
|
}
|
|
641
656
|
n != null && n.title && K(a, n.title), n != null && n.badge && z(a, n.badge);
|
|
642
|
-
function
|
|
657
|
+
function c(f) {
|
|
643
658
|
var m;
|
|
644
|
-
return (m = a.value) == null ? void 0 : m.webview.postMessage(
|
|
659
|
+
return (m = a.value) == null ? void 0 : m.webview.postMessage(f);
|
|
645
660
|
}
|
|
646
|
-
return { view: a, context: i, postMessage:
|
|
661
|
+
return { view: a, context: i, postMessage: c, forceRefresh: s };
|
|
647
662
|
},
|
|
648
663
|
(e) => e
|
|
649
664
|
), nt = h(() => {
|
|
650
|
-
const e = d(
|
|
651
|
-
return u(
|
|
665
|
+
const e = d(l.state);
|
|
666
|
+
return u(l.onDidChangeWindowState((t) => {
|
|
652
667
|
e.value = t;
|
|
653
668
|
})), {
|
|
654
|
-
focused:
|
|
655
|
-
active:
|
|
669
|
+
focused: g(() => e.value.focused),
|
|
670
|
+
active: g(() => e.value.active)
|
|
656
671
|
};
|
|
657
672
|
}), at = h(() => {
|
|
658
673
|
const e = d(D.workspaceFolders);
|
|
659
674
|
return u(D.onDidChangeWorkspaceFolders(() => {
|
|
660
675
|
e.value = D.workspaceFolders;
|
|
661
|
-
})),
|
|
676
|
+
})), g(() => e.value);
|
|
662
677
|
});
|
|
663
678
|
export {
|
|
664
679
|
j as activateCbs,
|
|
665
680
|
$ as createKeyedComposable,
|
|
666
681
|
h as createSingletonComposable,
|
|
667
682
|
M as deactivateCbs,
|
|
668
|
-
|
|
683
|
+
he as defineConfigObject,
|
|
669
684
|
ee as defineConfigs,
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
685
|
+
me as defineExtension,
|
|
686
|
+
Ce as defineLogger,
|
|
687
|
+
be as executeCommand,
|
|
673
688
|
k as extensionContext,
|
|
674
689
|
I as extensionScope,
|
|
675
|
-
|
|
690
|
+
Ne as getDefaultLoggerPrefix,
|
|
676
691
|
B as onActivate,
|
|
677
|
-
|
|
692
|
+
ge as onDeactivate,
|
|
678
693
|
_ as tryOnScopeDispose,
|
|
679
|
-
|
|
694
|
+
we as useAbsolutePath,
|
|
680
695
|
ne as useActiveColorTheme,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
696
|
+
De as useActiveDebugSession,
|
|
697
|
+
Te as useActiveEditorDecorations,
|
|
698
|
+
pe as useActiveNotebookEditor,
|
|
684
699
|
Se as useActiveTerminal,
|
|
685
700
|
ae as useActiveTextEditor,
|
|
686
|
-
|
|
687
|
-
|
|
701
|
+
Ee as useAllExtensions,
|
|
702
|
+
oe as useCommand,
|
|
688
703
|
xe as useCommands,
|
|
689
|
-
|
|
690
|
-
|
|
704
|
+
ke as useCommentController,
|
|
705
|
+
ye as useControlledTerminal,
|
|
691
706
|
Re as useDefaultShell,
|
|
692
707
|
u as useDisposable,
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
708
|
+
ie as useDocumentText,
|
|
709
|
+
re as useEditorDecorations,
|
|
710
|
+
S as useEvent,
|
|
711
|
+
R as useEventEmitter,
|
|
712
|
+
Ae as useExtensionSecret,
|
|
698
713
|
Ve as useFetchTasks,
|
|
699
714
|
Ie as useFileUri,
|
|
700
715
|
Pe as useFoldingRangeProvider,
|
|
701
716
|
We as useFsWatcher,
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
717
|
+
Oe as useIsDarkTheme,
|
|
718
|
+
Fe as useIsTelemetryEnabled,
|
|
719
|
+
Le as useL10nText,
|
|
705
720
|
$e as useLogLevel,
|
|
706
|
-
|
|
721
|
+
ue as useLogger,
|
|
707
722
|
Me as useNotebookEditorSelection,
|
|
708
|
-
|
|
723
|
+
ce as useNotebookEditorSelections,
|
|
709
724
|
je as useNotebookEditorVisibleRanges,
|
|
710
725
|
Be as useOpenedTerminals,
|
|
711
|
-
|
|
726
|
+
se as useOutputChannel,
|
|
712
727
|
He as useQuickPick,
|
|
713
728
|
ze as useStatusBarItem,
|
|
714
729
|
Ke as useTaskExecutions,
|
|
715
730
|
Qe as useTerminal,
|
|
716
731
|
H as useTerminalState,
|
|
717
|
-
|
|
732
|
+
le as useTextEditorCommand,
|
|
718
733
|
Ue as useTextEditorCommands,
|
|
719
734
|
qe as useTextEditorSelection,
|
|
720
|
-
|
|
735
|
+
de as useTextEditorSelections,
|
|
721
736
|
Ye as useTextEditorViewColumn,
|
|
722
737
|
Ge as useTextEditorVisibleRanges,
|
|
723
738
|
Je as useTreeView,
|
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.1",
|
|
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.
|
|
40
|
+
"@reactive-vscode/reactivity": "0.2.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.14.2",
|