reactive-vscode 0.2.0-beta.9 → 0.2.0

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