reactive-vscode 0.2.0-beta.5 → 0.2.0-beta.6

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