reactive-vscode 0.2.3 → 0.2.5
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 +11 -13
- package/dist/index.js +122 -119
- 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,8 @@ 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;
|
|
180
178
|
};
|
|
181
179
|
hide: () => void;
|
|
182
180
|
} | null>;
|
|
@@ -546,8 +544,8 @@ export declare function useLogger(name: string, options?: UseLoggerOptions): {
|
|
|
546
544
|
replace: (value: string) => void;
|
|
547
545
|
clear: () => void;
|
|
548
546
|
show: {
|
|
549
|
-
(preserveFocus?: boolean
|
|
550
|
-
(column?: ViewColumn
|
|
547
|
+
(preserveFocus?: boolean): void;
|
|
548
|
+
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
551
549
|
};
|
|
552
550
|
hide: () => void;
|
|
553
551
|
};
|
|
@@ -598,12 +596,12 @@ export declare function useOutputChannel(name: string, languageId?: string): Out
|
|
|
598
596
|
* @reactive `window.createQuickPick`
|
|
599
597
|
*/
|
|
600
598
|
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[]
|
|
599
|
+
onDidChangeActive: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
600
|
+
onDidChangeSelection: (listener: (e: readonly T[]) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
601
|
+
onDidAccept: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
602
|
+
onDidHide: (listener: (e: void) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
603
|
+
onDidTriggerButton: (listener: (e: QuickInputButton) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
604
|
+
onDidChangeValue: (listener: (e: string) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
607
605
|
value: ShallowRef<string>;
|
|
608
606
|
activeItems: ShallowRef<readonly T[]>;
|
|
609
607
|
selectedItems: ShallowRef<readonly T[]>;
|
|
@@ -614,7 +612,7 @@ export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPic
|
|
|
614
612
|
canSelectMany: boolean;
|
|
615
613
|
matchOnDescription: boolean;
|
|
616
614
|
matchOnDetail: boolean;
|
|
617
|
-
keepScrollPosition?: boolean
|
|
615
|
+
keepScrollPosition?: boolean;
|
|
618
616
|
title: string | undefined;
|
|
619
617
|
step: number | undefined;
|
|
620
618
|
totalSteps: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentScope as $, onScopeDispose as W, shallowRef as d, effectScope as Q, computed as g, reactive as U, toValue as r, watchEffect as b, watch as
|
|
1
|
+
import { getCurrentScope as $, onScopeDispose as W, shallowRef as d, effectScope as Q, computed as g, reactive as U, toValue as r, watchEffect as b, watch as D, ref as x, shallowReactive as q, toRaw as Y, isRef as G } from "@reactive-vscode/reactivity";
|
|
2
2
|
export * from "@reactive-vscode/reactivity";
|
|
3
3
|
import { workspace as T, commands as A, window as l, debug as P, extensions as V, comments as J, env as p, EventEmitter as L, tasks as k, Uri as X, languages as Z, ColorThemeKind as M, l10n as F } from "vscode";
|
|
4
4
|
function _(e) {
|
|
@@ -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,24 +40,24 @@ 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) => {
|
|
47
47
|
h.value = v, i.update(o, v);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
return w.update = async (v,
|
|
51
|
-
await i.update(o, v,
|
|
50
|
+
return w.update = async (v, C, S) => {
|
|
51
|
+
await i.update(o, v, C, S), w.value = v;
|
|
52
52
|
}, w.set = (v) => {
|
|
53
53
|
h.value = v;
|
|
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(() => {
|
|
@@ -163,7 +163,7 @@ function re(e, t, n, a = {}) {
|
|
|
163
163
|
}) : null;
|
|
164
164
|
return i.includes("effect") ? b(async () => {
|
|
165
165
|
o == null || o.value, await c();
|
|
166
|
-
}) : o &&
|
|
166
|
+
}) : o && D(o, c), {
|
|
167
167
|
/**
|
|
168
168
|
* Manually trigger the decoration update.
|
|
169
169
|
*/
|
|
@@ -176,42 +176,42 @@ 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;
|
|
205
205
|
const t = d((n = r(e)) == null ? void 0 : n.state);
|
|
206
|
-
return
|
|
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
|
}
|
|
213
213
|
function Re(...e) {
|
|
214
|
-
const t =
|
|
214
|
+
const t = x(null);
|
|
215
215
|
function n() {
|
|
216
216
|
return !!t.value && t.value.exitStatus == null;
|
|
217
217
|
}
|
|
@@ -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),
|
|
@@ -259,14 +259,14 @@ function y(e, t = []) {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
async function Ae(e) {
|
|
262
|
-
const t = R.value.secrets, n =
|
|
262
|
+
const t = R.value.secrets, n = x(await t.get(e));
|
|
263
263
|
return n.set = async (a) => {
|
|
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);
|
|
271
271
|
}), n;
|
|
272
272
|
}
|
|
@@ -280,35 +280,35 @@ 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
|
});
|
|
299
299
|
function h() {
|
|
300
300
|
const v = f.value;
|
|
301
|
-
for (const [
|
|
302
|
-
v.includes(
|
|
303
|
-
for (const
|
|
304
|
-
if (!i.has(
|
|
305
|
-
const
|
|
306
|
-
|
|
301
|
+
for (const [C, S] of i)
|
|
302
|
+
v.includes(C) || (S.dispose(), i.delete(C));
|
|
303
|
+
for (const C of v)
|
|
304
|
+
if (!i.has(C)) {
|
|
305
|
+
const S = T.createFileSystemWatcher(
|
|
306
|
+
C,
|
|
307
307
|
r(t) || !1,
|
|
308
308
|
r(n) || !1,
|
|
309
309
|
r(a) || !1
|
|
310
310
|
);
|
|
311
|
-
|
|
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
|
|
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,17 +372,17 @@ 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
|
});
|
|
379
379
|
function oe(e) {
|
|
380
380
|
var n;
|
|
381
381
|
const t = d(((n = r(e)) == null ? void 0 : n.selections) ?? []);
|
|
382
|
-
return
|
|
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() {
|
|
@@ -409,10 +409,10 @@ function Ne(e) {
|
|
|
409
409
|
function He(e) {
|
|
410
410
|
var n;
|
|
411
411
|
const t = d(((n = r(e)) == null ? void 0 : n.visibleRanges) ?? []);
|
|
412
|
-
return
|
|
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))
|
|
@@ -515,20 +518,20 @@ function Ue(e) {
|
|
|
515
518
|
function de(e, t) {
|
|
516
519
|
var a;
|
|
517
520
|
const n = d(((a = r(e)) == null ? void 0 : a.selections) ?? []);
|
|
518
|
-
return
|
|
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
|
}
|
|
@@ -546,20 +549,20 @@ function qe(e, t) {
|
|
|
546
549
|
function Ye(e) {
|
|
547
550
|
var n;
|
|
548
551
|
const t = d((n = r(e)) == null ? void 0 : n.viewColumn);
|
|
549
|
-
return
|
|
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
|
}
|
|
556
559
|
function Ge(e) {
|
|
557
560
|
var n;
|
|
558
561
|
const t = d(((n = r(e)) == null ? void 0 : n.visibleRanges) ?? []);
|
|
559
|
-
return
|
|
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
|
}
|
|
@@ -578,8 +581,8 @@ function O(e, t) {
|
|
|
578
581
|
const Je = N(
|
|
579
582
|
(e, t, n) => {
|
|
580
583
|
const a = y();
|
|
581
|
-
|
|
582
|
-
const i = /* @__PURE__ */ new WeakMap(),
|
|
584
|
+
D(t, () => a.fire()), n != null && n.watchSource && D(n.watchSource, () => a.fire());
|
|
585
|
+
const i = /* @__PURE__ */ new WeakMap(), s = u(l.createTreeView(e, {
|
|
583
586
|
...n,
|
|
584
587
|
treeDataProvider: {
|
|
585
588
|
...n,
|
|
@@ -596,44 +599,44 @@ 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
|
);
|
|
603
606
|
function Xe(e) {
|
|
604
607
|
var a;
|
|
605
|
-
const t =
|
|
608
|
+
const t = x((a = r(e)) == null ? void 0 : a.visible);
|
|
606
609
|
function n() {
|
|
607
610
|
var i;
|
|
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
|
});
|
|
629
632
|
function et(e, t, n = !0) {
|
|
630
|
-
const a = G(t) ? t : typeof t == "function" ? g(t) :
|
|
633
|
+
const a = G(t) ? t : typeof t == "function" ? g(t) : x(t);
|
|
631
634
|
return b(() => {
|
|
632
635
|
r(n) && A.executeCommand("setContext", e, a.value);
|
|
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,
|
|
@@ -644,31 +647,31 @@ function tt(e, t, n, a, i) {
|
|
|
644
647
|
}
|
|
645
648
|
));
|
|
646
649
|
i != null && i.onDidReceiveMessage && c.webview.onDidReceiveMessage(i.onDidReceiveMessage);
|
|
647
|
-
const o =
|
|
650
|
+
const o = x(0);
|
|
648
651
|
function f() {
|
|
649
652
|
o.value++;
|
|
650
653
|
}
|
|
651
654
|
if (b(() => {
|
|
652
655
|
c.webview.html = `${r(n)}<!--${o.value}-->`;
|
|
653
656
|
}), i != null && i.webviewOptions) {
|
|
654
|
-
const
|
|
657
|
+
const C = i.webviewOptions;
|
|
655
658
|
b(() => {
|
|
656
|
-
c.webview.options = r(
|
|
659
|
+
c.webview.options = r(C);
|
|
657
660
|
});
|
|
658
661
|
}
|
|
659
662
|
O(c, t);
|
|
660
|
-
function h(
|
|
661
|
-
return c.webview.postMessage(
|
|
663
|
+
function h(C) {
|
|
664
|
+
return c.webview.postMessage(C);
|
|
662
665
|
}
|
|
663
|
-
const w =
|
|
664
|
-
return
|
|
666
|
+
const w = x(c.active), v = x(c.visible);
|
|
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.5",
|
|
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.5"
|
|
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",
|