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

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
@@ -46,6 +46,7 @@ import { TreeDataProvider } from 'vscode';
46
46
  import { TreeItem } from 'vscode';
47
47
  import { TreeView } from 'vscode';
48
48
  import { TreeViewOptions } from 'vscode';
49
+ import { UnwrapNestedRefs } from '@reactive-vscode/reactivity';
49
50
  import { Uri } from 'vscode';
50
51
  import { ViewBadge } from 'vscode';
51
52
  import { ViewColumn } from 'vscode';
@@ -61,7 +62,7 @@ export declare interface Commands extends Record<string, (...args: any[]) => any
61
62
  'vscode.open': (uri: Uri) => void;
62
63
  }
63
64
 
64
- export declare type ConfigObject<C extends object> = ShallowReactive<C & {
65
+ export declare type ConfigObject<C extends object> = UnwrapNestedRefs<C> & {
65
66
  /**
66
67
  * Write the configuration value to the workspace.
67
68
  *
@@ -72,7 +73,7 @@ export declare type ConfigObject<C extends object> = ShallowReactive<C & {
72
73
  * Set the value without updating the workspace.
73
74
  */
74
75
  $set: (key: keyof C, value: C[keyof C]) => void;
75
- }>;
76
+ };
76
77
 
77
78
  export declare interface ConfigRef<T> extends WritableComputedRef<T> {
78
79
  /**
@@ -91,7 +92,7 @@ export declare interface ConfigType<T> extends ObjectConstructor {
91
92
  [ConfigTypeSymbol]: T;
92
93
  }
93
94
 
94
- /* Excluded from this release type: ConfigTypeOptions */
95
+ export declare type ConfigTypeOptions = Record<string, ConfigTypeRaw<any>>;
95
96
 
96
97
  declare type ConfigTypeRaw<T> = ConfigTypeSingle<T> | ConfigTypeSingle<T>[];
97
98
 
@@ -122,9 +123,9 @@ export declare function createSingletonComposable<T>(fn: () => T): () => T;
122
123
  *
123
124
  * @category lifecycle
124
125
  */
125
- export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>;
126
+ export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>;
126
127
 
127
- export declare function defineConfigObject<C extends object>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<C>;
128
+ export declare function defineConfigObject<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<C>;
128
129
 
129
130
  /**
130
131
  * Define configurations of an extension. See `vscode::workspace.getConfiguration`.
@@ -133,9 +134,9 @@ export declare function defineConfigObject<C extends object>(section: string, co
133
134
  *
134
135
  * @category lifecycle
135
136
  */
136
- export declare function defineConfigs<const C extends ConfigTypeOptions>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<ParseConfigTypeOptions<C>>;
137
+ export declare function defineConfigs<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<ParseConfigTypeOptions<C>>;
137
138
 
138
- export declare function defineConfigs<C extends object>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<C>;
139
+ export declare function defineConfigs<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<C>;
139
140
 
140
141
  /**
141
142
  * Define a new extension.
@@ -218,7 +219,9 @@ declare type OnDeactivateCb = () => void;
218
219
 
219
220
  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
221
 
221
- /* Excluded from this release type: ParseConfigTypeOptions */
222
+ export declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = {
223
+ -readonly [K in keyof C]: ParseConfigType<C[K]>;
224
+ };
222
225
 
223
226
  export declare type TextEditorCommandCallback = (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void;
224
227
 
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 q, computed as f, reactive as J, toValue as a, watchEffect as m, watch as b, ref as E, shallowReactive as K, toRaw as z, isRef as Y } 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 G, env as T, EventEmitter as F, tasks as D, Uri as Q, languages as X, ColorThemeKind as A, l10n as N } from "vscode";
4
+ function Z(e) {
5
+ return L() ? (W(e), !0) : !1;
6
6
  }
7
- function W(e, t) {
7
+ function O(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)), Z(() => {
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
24
  const $ = [];
25
- function fe(e) {
25
+ function ge(e) {
26
26
  $.push(e);
27
27
  }
28
- const p = l(null), R = q();
29
- function ve(e) {
28
+ const x = l(null), y = q();
29
+ function he(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(() => (I.map((n) => n(t)), e()))),
32
32
  deactivate: () => {
33
- $.map((t) => t()), R.stop();
33
+ $.map((t) => t()), y.stop();
34
34
  }
35
35
  };
36
36
  }
37
37
  const I = [];
38
38
  function P(e) {
39
- p.value ? e(p.value) : I.push(e);
39
+ x.value ? e(x.value) : I.push(e);
40
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,
41
+ function _(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, H, U) => {
51
+ await i.update(d, w, H, U), 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
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;
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 me(e, t, n) {
76
+ const r = _(e, t, n);
77
+ return J({
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);
87
+ function Ce(e, t) {
88
+ const n = l(null), r = [], i = (o) => (...s) => n.value ? n.value[o](...s) : (r.push([o, s]), null);
83
89
  return P(() => {
84
- n.value = oe(e, t);
85
- for (const [o, u] of r)
86
- n.value[o](...u);
90
+ n.value = se(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 be(e, ...t) {
111
+ return k.executeCommand(e, ...t);
106
112
  }
107
- function Z(e, t = !1) {
108
- const n = p.value;
113
+ function ee(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
- function be(e, t = !1) {
114
- return d(() => Z(a(e), t));
119
+ function we(e, t = !1) {
120
+ return f(() => ee(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 te = 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
+ }), Te = 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
+ }), ne = 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 re(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 De(e, t) {
149
+ const n = ne();
150
+ re(n, e, t);
145
151
  }
146
- const Te = g(() => {
152
+ const Se = 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
+ }), pe = 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
+ }), xe = 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 ie(e, t) {
169
+ u(k.registerCommand(e, t));
164
170
  }
165
- function pe(e) {
171
+ function Ee(e) {
166
172
  for (const [t, n] of Object.entries(e))
167
- n && ne(t, n);
173
+ n && ie(t, n);
168
174
  }
169
- function xe(e, t) {
170
- return s(z.createCommentController(e, t));
175
+ function ke(e, t) {
176
+ return u(G.createCommentController(e, t));
171
177
  }
172
178
  function M(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 Re(...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,
210
+ close: s,
205
211
  state: M(t)
206
212
  };
207
213
  }
208
- const ke = g(() => {
214
+ const ye = 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 Ve(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 ae(e, t = []) {
237
+ const n = Array.isArray(e) ? e : t ?? [], r = u(Array.isArray(e) || e == null ? new F() : 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 Ae(e) {
247
+ return f(() => D.fetchTasks(a(e)));
242
248
  }
243
- function ie(e) {
244
- return L({
249
+ function oe(e) {
250
+ return K({
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 Ne(e) {
281
+ return oe(() => Q.file(a(e)));
276
282
  }
277
- function Ae(e, t) {
278
- const n = new O(), r = l();
279
- h(() => {
283
+ function Le(e, t) {
284
+ const n = new F(), r = l();
285
+ m(() => {
280
286
  r.value && n.fire(), r.value = a(t);
281
- }), s(G.registerFoldingRangeProvider(
287
+ }), u(X.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 We(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 Fe = h(() => {
308
+ const e = te();
309
+ return f(() => e.value.kind === A.Dark || e.value.kind === A.HighContrast);
310
+ }), Oe = 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
- 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)));
316
+ function $e(e, ...t) {
317
+ return f(() => typeof t[0] == "object" ? N.t(a(e), z(t[0])) : N.t(a(e), ...t.map(a)));
312
318
  }
313
- const We = g(() => {
319
+ const Ie = 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 ue(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 Pe(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 se(e, t = {}) {
333
+ const n = t.outputChannel ?? ue(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 ce(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 Me(e) {
371
+ const t = ce(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 je(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 Be = 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 He(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 Ue = 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 qe(...e) {
422
+ const t = u(c.createTerminal(...e));
417
423
  return {
418
424
  terminal: t,
419
425
  get name() {
@@ -434,23 +440,23 @@ function He(...e) {
434
440
  state: M(t)
435
441
  };
436
442
  }
437
- function se(e, t) {
438
- s(E.registerTextEditorCommand(e, t));
443
+ function le(e, t) {
444
+ u(k.registerTextEditorCommand(e, t));
439
445
  }
440
- function Ue(e) {
446
+ function Je(e) {
441
447
  for (const [t, n] of Object.entries(e))
442
- se(t, n);
448
+ le(t, n);
443
449
  }
444
- function ce(e, t) {
450
+ function de(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 Ke(e, t) {
471
+ const n = de(e, t);
472
+ return f({
467
473
  get() {
468
474
  return n.value[0];
469
475
  },
@@ -472,56 +478,56 @@ function qe(e, t) {
472
478
  }
473
479
  });
474
480
  }
475
- function Je(e) {
481
+ function ze(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 Ye(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
501
  function j(e, t) {
496
- h(() => {
502
+ m(() => {
497
503
  const n = a(e);
498
504
  n && (n.badge = a(t));
499
505
  });
500
506
  }
501
507
  function B(e, t) {
502
- h(() => {
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 Ge = O(
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 = ae();
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
  }));
@@ -529,46 +535,46 @@ const ze = W(
529
535
  },
530
536
  (e) => e
531
537
  );
532
- function Ye(e) {
538
+ function Qe(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 Xe = 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
+ }), Ze = 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 _e(e, t, n = !0) {
565
+ const r = Y(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 et = O(
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
598
  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);
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
+ ), tt = 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
+ }), nt = 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
621
  I as activateCbs,
616
- W as createKeyedComposable,
617
- g as createSingletonComposable,
622
+ O as createKeyedComposable,
623
+ h as createSingletonComposable,
618
624
  $ 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,
625
+ me as defineConfigObject,
626
+ _ as defineConfigs,
627
+ he as defineExtension,
628
+ Ce as defineLogger,
629
+ be as executeCommand,
630
+ x as extensionContext,
631
+ y as extensionScope,
632
+ Pe as getDefaultLoggerPrefix,
627
633
  P as onActivate,
628
- fe as onDeactivate,
629
- Q as tryOnScopeDispose,
630
- 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,
634
+ ge as onDeactivate,
635
+ Z as tryOnScopeDispose,
636
+ we as useAbsolutePath,
637
+ te as useActiveColorTheme,
638
+ Te as useActiveDebugSession,
639
+ De as useActiveEditorDecorations,
640
+ Se as useActiveNotebookEditor,
641
+ pe as useActiveTerminal,
642
+ ne as useActiveTextEditor,
643
+ xe as useAllExtensions,
644
+ ie as useCommand,
645
+ Ee as useCommands,
646
+ ke as useCommentController,
647
+ Re as useControlledTerminal,
648
+ ye as useDefaultShell,
649
+ u as useDisposable,
650
+ Ve as useDocumentText,
651
+ re as useEditorDecorations,
652
+ p as useEvent,
653
+ ae as useEventEmitter,
654
+ Ae as useFetchTasks,
655
+ Ne as useFileUri,
656
+ Le as useFoldingRangeProvider,
657
+ We as useFsWatcher,
652
658
  Fe as useIsDarkTheme,
653
- Le as useIsTelemetryEnabled,
654
- 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,
659
+ Oe as useIsTelemetryEnabled,
660
+ $e as useL10nText,
661
+ Ie as useLogLevel,
662
+ se as useLogger,
663
+ Me as useNotebookEditorSelection,
664
+ ce as useNotebookEditorSelections,
665
+ je as useNotebookEditorVisibleRanges,
666
+ Be as useOpenedTerminals,
667
+ ue as useOutputChannel,
668
+ He as useStatusBarItem,
669
+ Ue as useTaskExecutions,
670
+ qe as useTerminal,
665
671
  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,
672
+ le as useTextEditorCommand,
673
+ Je as useTextEditorCommands,
674
+ Ke as useTextEditorSelection,
675
+ de as useTextEditorSelections,
676
+ ze as useTextEditorViewColumn,
677
+ Ye as useTextEditorVisibleRanges,
678
+ Ge as useTreeView,
679
+ oe as useUri,
674
680
  j as useViewBadge,
675
681
  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
682
+ Qe as useViewVisibility,
683
+ Xe as useVisibleNotebookEditors,
684
+ Ze as useVisibleTextEditors,
685
+ _e as useVscodeContext,
686
+ et as useWebviewView,
687
+ tt as useWindowState,
688
+ nt 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.7",
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.7"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^20.14.2",