reactive-vscode 0.4.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,504 +1,465 @@
1
- import { getCurrentScope as U, onScopeDispose as L, effectScope as Y, shallowRef as g, computed as h, shallowReactive as $, toValue as a, watchEffect as w, watch as C, unref as I, ref as S, toRaw as oe, isRef as ie } from "@reactive-vscode/reactivity";
1
+ import { shallowRef as r, effectScope as Q, computed as d, toValue as v, getCurrentScope as z, isRef as C, watchEffect as w, unref as M, watch as D, onScopeDispose as L, shallowReactive as G, readonly as J, toRaw as X, ref as F } from "@reactive-vscode/reactivity";
2
2
  export * from "@reactive-vscode/reactivity";
3
- import { workspace as T, commands as V, window as v, debug as q, extensions as W, chat as ae, comments as se, env as E, EventEmitter as G, tasks as y, Uri as re, languages as ce, ColorThemeKind as z, l10n as Q, lm as F } from "vscode";
4
- function ue(e) {
5
- return U() ? (L(e), !0) : !1;
6
- }
7
- function N(e, t) {
8
- const n = /* @__PURE__ */ new Map();
9
- return (...o) => {
10
- const i = t(...o);
11
- let r = n.get(i);
12
- return r ? r.refCount++ : (r = {
13
- data: e(...o),
14
- refCount: 1
15
- }, n.set(i, r)), ue(() => {
16
- --r.refCount === 0 && n.delete(i);
17
- }), r.data;
3
+ import { workspace as T, env as x, window as f, Uri as Y, debug as W, extensions as A, chat as Z, commands as S, EventEmitter as q, ColorThemeKind as O, l10n as N, lm as V, tasks as R } from "vscode";
4
+ const B = [];
5
+ function _(e) {
6
+ E.value ? e(E.value) : B.push(e);
7
+ }
8
+ const $ = [];
9
+ function ve(e) {
10
+ $.push(e);
11
+ }
12
+ const E = r(null), k = Q();
13
+ function de(e) {
14
+ return {
15
+ activate: (t) => (E.value = t, k.run(() => (B.forEach((n) => n(t)), e(t)))),
16
+ deactivate: async () => {
17
+ await Promise.allSettled($.map((t) => t())), k.stop();
18
+ }
18
19
  };
19
20
  }
20
- const J = [];
21
- function le(e) {
22
- J.push(e);
21
+ function fe(e, t) {
22
+ const n = !e, o = r(null);
23
+ function s() {
24
+ return o.value = T.getConfiguration(e ?? void 0, t);
25
+ }
26
+ function i() {
27
+ if (!E.value)
28
+ throw new Error("Cannot access config before extension is activated.");
29
+ return o.value ? o.value : s();
30
+ }
31
+ function u(c) {
32
+ return new Proxy({}, {
33
+ get(p, l) {
34
+ const g = i();
35
+ if (typeof l != "string")
36
+ throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
37
+ if (c === "" && ["get", "has", "inspect", "update"].includes(l))
38
+ return Reflect.get(g, l).bind(g);
39
+ const m = g.get(c + l);
40
+ if (m === void 0)
41
+ throw new Error(`Configuration key "${e ? `${e}.` : ""}${c + l}" is not defined.`);
42
+ return typeof m != "object" || m === null || Array.isArray(m) ? m : u(`${c}${l}.`);
43
+ },
44
+ set(p, l, g) {
45
+ const m = i();
46
+ if (typeof l != "string")
47
+ throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
48
+ return m.update(c + l, g), !0;
49
+ },
50
+ apply: P,
51
+ construct: P,
52
+ defineProperty(p, l, g) {
53
+ const m = i();
54
+ return Reflect.defineProperty(m, l, g);
55
+ },
56
+ deleteProperty(p, l) {
57
+ const g = i();
58
+ return Reflect.deleteProperty(g, l);
59
+ },
60
+ getOwnPropertyDescriptor(p, l) {
61
+ const g = i();
62
+ return Reflect.getOwnPropertyDescriptor(g, l);
63
+ },
64
+ getPrototypeOf(p) {
65
+ const l = i();
66
+ return Reflect.getPrototypeOf(l);
67
+ },
68
+ has(p, l) {
69
+ const g = i();
70
+ return Reflect.has(g, l);
71
+ },
72
+ isExtensible(p) {
73
+ const l = i();
74
+ return Reflect.isExtensible(l);
75
+ },
76
+ ownKeys(p) {
77
+ const l = i();
78
+ return Reflect.ownKeys(l);
79
+ },
80
+ preventExtensions: P,
81
+ setPrototypeOf: P
82
+ });
83
+ }
84
+ return _(() => {
85
+ a(T.onDidChangeConfiguration((c) => {
86
+ (n || c.affectsConfiguration(e, t ?? void 0)) && s();
87
+ }));
88
+ }), u("");
89
+ }
90
+ function P() {
91
+ throw new Error("Not supported");
92
+ }
93
+ const ee = [
94
+ "append",
95
+ "appendLine",
96
+ "replace",
97
+ "clear",
98
+ "show",
99
+ "hide",
100
+ "trace",
101
+ "debug",
102
+ "info",
103
+ "warn",
104
+ "error"
105
+ ];
106
+ function ge(e) {
107
+ const t = r(null), n = r(x.logLevel), o = [];
108
+ _(() => {
109
+ const i = t.value = a(f.createOutputChannel(e, { log: !0 }));
110
+ n.value = i.logLevel, a(i.onDidChangeLogLevel((u) => {
111
+ n.value = u;
112
+ })), o.forEach((u) => u());
113
+ });
114
+ const s = {};
115
+ for (const i of ee)
116
+ s[i] = (...u) => {
117
+ t.value ? t.value[i](...u) : o.push(() => t.value[i](...u));
118
+ };
119
+ return {
120
+ logger: d(() => t.value),
121
+ ...s
122
+ };
23
123
  }
24
- function b(e) {
124
+ function h(e) {
25
125
  let t = !1, n = !1, o;
26
126
  return () => {
27
127
  if (!n) {
28
128
  if (t)
29
129
  throw new Error("Cannot call a singleton composable recursively.");
30
130
  try {
31
- t = !0;
32
- const i = Y(!0);
33
- le(() => i.stop()), o = i.run(e), n = !0;
131
+ t = !0, o = k.run(e);
34
132
  } finally {
35
- t = !1;
133
+ t = !1, n = !0;
36
134
  }
37
135
  }
38
136
  return o;
39
137
  };
40
138
  }
41
- const k = g(null), M = Y();
42
- function Ee(e) {
43
- return {
44
- activate: (t) => (k.value = t, M.run(() => (X.map((n) => n(t)), e(t)))),
45
- deactivate: () => {
46
- J.map((t) => t()), M.stop();
47
- }
48
- };
49
- }
50
- const X = [];
51
- function Z(e) {
52
- k.value ? e(k.value) : X.push(e);
53
- }
54
- function de(e, t, n) {
55
- const o = !e, i = T.getConfiguration(o ? void 0 : e, n);
56
- function r(u, d) {
57
- const l = g(d), m = h({
58
- get: () => l.value,
59
- set: (f) => {
60
- l.value = f, i.update(u, f);
61
- }
62
- });
63
- return m.update = async (f, p, D) => {
64
- await i.update(u, f, p, D), l.value = f;
65
- }, m.set = (f) => {
66
- l.value = f;
67
- }, m;
68
- }
69
- const s = Object.fromEntries(
70
- Object.keys(t).map((u) => [u, r(u, i.get(u))])
71
- );
72
- return Z(() => {
73
- c(T.onDidChangeConfiguration(
74
- o ? (u) => {
75
- const d = T.getConfiguration();
76
- for (const l in t)
77
- u.affectsConfiguration(l) && s[l].set(d.get(l));
78
- } : (u) => {
79
- if (!u.affectsConfiguration(e))
80
- return;
81
- const d = T.getConfiguration(e);
82
- for (const l in t)
83
- u.affectsConfiguration(`${e}.${l}`) && s[l].set(d.get(l));
84
- }
85
- ));
86
- }), s;
87
- }
88
- function ye(e, t, n) {
89
- const o = de(e, t, n), i = {}, r = $({
90
- $update(s, u, d, l) {
91
- return o[s].update(u, d, l);
92
- },
93
- $set(s, u) {
94
- return o[s].set(u);
95
- }
96
- });
97
- for (const s in t) {
98
- const u = s.split(".");
99
- let d = "", l = i, m = r;
100
- for (const p of u.slice(0, -1)) {
101
- d = d ? `${d}.${p}` : p;
102
- const D = l = l[p] ||= {};
103
- if (m[p])
104
- m = m[p];
105
- else {
106
- const H = $({});
107
- Object.defineProperty(m, p, {
108
- enumerable: !0,
109
- get() {
110
- return H;
111
- },
112
- set(ne) {
113
- function B(A, O, K) {
114
- if (A)
115
- for (const R in A)
116
- B(A[R], O ? `${O}.${R}` : R, K?.[R]);
117
- else
118
- o[O].value = K;
119
- }
120
- B(D, d, ne);
121
- }
122
- }), m = H;
123
- }
124
- }
125
- const f = u[u.length - 1];
126
- l[f] = null, Object.defineProperty(m, f, {
127
- enumerable: !0,
128
- get() {
129
- return o[s].value;
130
- },
131
- set(p) {
132
- o[s].value = p;
133
- }
134
- });
135
- }
136
- return r;
137
- }
138
- function ke(e, t) {
139
- const n = g(null), o = [], i = (r) => (...s) => n.value ? n.value[r](...s) : (o.push([r, s]), null);
140
- return Z(() => {
141
- n.value = we(e, t);
142
- for (const [r, s] of o)
143
- n.value[r](...s);
144
- }), {
145
- logger: n,
146
- outputChannel: h(() => n.value?.outputChannel),
147
- info: i("info"),
148
- warn: i("warn"),
149
- error: i("error"),
150
- append: i("append"),
151
- appendLine: i("appendLine"),
152
- replace: i("replace"),
153
- clear: i("clear"),
154
- show: i("show"),
155
- hide: i("hide")
156
- };
157
- }
158
- const Re = b;
159
- function Pe(e, ...t) {
160
- return V.executeCommand(e, ...t);
139
+ function pe(e) {
140
+ return d(() => Y.joinPath(E.value.extensionUri, v(e)));
161
141
  }
162
- function fe(e, t = !1) {
163
- const n = k.value;
164
- if (!n && !t)
165
- throw new Error("Cannot get absolute path because the extension is not activated yet");
166
- return n?.asAbsolutePath(e);
142
+ function a(e) {
143
+ return (z() ?? k).cleanups.push(e.dispose.bind(e)), e;
167
144
  }
168
- function Ve(e, t = !1) {
169
- return h(() => fe(a(e), t));
170
- }
171
- function c(e) {
172
- return (U() ?? M).cleanups.push(e.dispose.bind(e)), e;
173
- }
174
- const ve = b(() => {
175
- const e = g(v.activeColorTheme);
176
- return c(v.onDidChangeActiveColorTheme((t) => {
145
+ const te = h(() => {
146
+ const e = r(f.activeColorTheme);
147
+ return a(f.onDidChangeActiveColorTheme((t) => {
177
148
  e.value = t;
178
149
  })), e;
179
- }), Ae = b(() => {
180
- const e = g(q.activeDebugSession);
181
- return c(q.onDidChangeActiveDebugSession((t) => {
150
+ }), he = h(() => {
151
+ const e = r(W.activeDebugSession);
152
+ return a(W.onDidChangeActiveDebugSession((t) => {
182
153
  e.value = t;
183
- })), h(() => e.value);
184
- }), ge = b(() => {
185
- const e = g(v.activeTextEditor);
186
- return c(v.onDidChangeActiveTextEditor((t) => {
154
+ })), d(() => e.value);
155
+ }), me = h(() => {
156
+ const e = r(f.activeNotebookEditor);
157
+ return a(f.onDidChangeActiveNotebookEditor((t) => {
187
158
  e.value = t;
188
159
  })), e;
189
- });
190
- function he(e) {
191
- const t = g(a(e)?.getText());
192
- return w(() => {
193
- t.value = a(e)?.getText();
194
- }), c(T.onDidChangeTextDocument((n) => {
195
- n.document === a(e) && (t.value = n.document.getText());
196
- })), t;
197
- }
198
- function me(e, t, n, o = {}) {
199
- const {
200
- updateOn: i = ["effect", "documentChanged"]
201
- } = o;
202
- let r;
203
- const s = h(
204
- () => {
205
- r?.dispose(), r = void 0;
206
- const l = a(t);
207
- if ("key" in l)
208
- return l;
209
- const m = v.createTextEditorDecorationType(l);
210
- return r = c(m), m;
211
- }
212
- ), u = async () => {
213
- const l = a(e);
214
- l && l.setDecorations(
215
- s.value,
216
- typeof n == "function" ? await n(l) : a(n)
217
- );
218
- }, d = i.includes("documentChanged") ? he(() => a(e)?.document) : null;
219
- return i.includes("effect") ? w(async () => {
220
- d?.value, await u();
221
- }) : d && C(d, u), {
222
- /**
223
- * Manually trigger the decoration update.
224
- */
225
- update: u
226
- };
227
- }
228
- function Oe(e, t, n = {}) {
229
- const o = ge();
230
- return me(o, e, t, n);
231
- }
232
- const Ie = b(() => {
233
- const e = g(v.activeNotebookEditor);
234
- return c(v.onDidChangeActiveNotebookEditor((t) => {
160
+ }), Ce = h(() => {
161
+ const e = r(f.activeTerminal);
162
+ return a(f.onDidChangeActiveTerminal((t) => {
235
163
  e.value = t;
236
164
  })), e;
237
- }), We = b(() => {
238
- const e = g(v.activeTerminal);
239
- return c(v.onDidChangeActiveTerminal((t) => {
165
+ }), we = h(() => {
166
+ const e = r(f.activeTextEditor);
167
+ return a(f.onDidChangeActiveTextEditor((t) => {
240
168
  e.value = t;
241
- })), e;
242
- }), Fe = b(() => {
243
- const e = g(W.all);
244
- return c(W.onDidChange(() => {
245
- e.value = W.all;
246
- })), h(() => e.value);
169
+ })), d(() => e.value);
170
+ }), De = h(() => {
171
+ const e = r(A.all);
172
+ return a(A.onDidChange(() => {
173
+ e.value = A.all;
174
+ })), d(() => e.value);
247
175
  });
248
- function x(e, t) {
249
- const n = (o, i, r) => {
250
- c(e(o, i, r));
251
- };
252
- return t?.forEach((o) => n(o)), n;
176
+ function b(e, t, n) {
177
+ if (C(e) || typeof e == "function") {
178
+ w(() => {
179
+ const o = v(e);
180
+ o != null && b(o, t, n);
181
+ });
182
+ return;
183
+ }
184
+ for (const o of n) {
185
+ const s = t[o];
186
+ s != null && e[o](s);
187
+ }
253
188
  }
254
- function _(e, t, n) {
189
+ function y(e, t, n) {
255
190
  for (const o of n) {
256
- const i = t[o];
257
- i !== void 0 && w(() => {
258
- e[o] = a(i);
191
+ const s = t[o];
192
+ s !== void 0 && w(() => {
193
+ const i = v(e);
194
+ i != null && (i[o] = v(s));
259
195
  });
260
196
  }
261
197
  }
262
- const $e = N((e, t, n = {}) => {
263
- const o = c(ae.createChatParticipant(e, I(t)));
264
- return _(o, n, [
265
- "iconPath"
266
- ]), n.followupProvider !== void 0 && w(() => {
267
- o.followupProvider = I(n.followupProvider);
268
- }), w(() => {
269
- o.requestHandler = I(t);
270
- }), {
271
- onDidReceiveFeedback: x(o.onDidReceiveFeedback)
272
- };
273
- }, (e) => e);
274
- function pe(e, t) {
275
- c(V.registerCommand(e, t));
198
+ function be(e, t, n = {}) {
199
+ const o = a(Z.createChatParticipant(e, M(t)));
200
+ return y(o, n, [
201
+ "iconPath",
202
+ "followupProvider"
203
+ ]), b(o, n, [
204
+ "onDidReceiveFeedback"
205
+ ]), C(t) && D(t, (s) => {
206
+ o.requestHandler = s;
207
+ }), o;
276
208
  }
277
- function Me(e) {
209
+ function ne(e, t) {
210
+ C(t) ? w((n) => {
211
+ if (t.value) {
212
+ const o = S.registerCommand(e, t.value);
213
+ n(() => o.dispose());
214
+ }
215
+ }) : t && a(S.registerCommand(e, t));
216
+ }
217
+ function ye(e) {
278
218
  for (const [t, n] of Object.entries(e))
279
- n && pe(t, n);
280
- }
281
- function Le(e, t) {
282
- return c(se.createCommentController(e, t));
283
- }
284
- function ee(e) {
285
- const t = g(a(e)?.state);
286
- return C(e, () => {
287
- t.value = a(e)?.state;
288
- }), c(v.onDidChangeTerminalState((n) => {
289
- n === a(e) && (t.value = n.state);
290
- })), h(() => t.value);
291
- }
292
- function Ne(...e) {
293
- const t = S(null);
294
- function n() {
295
- return !!t.value && t.value.exitStatus == null;
296
- }
297
- function o() {
298
- return n() ? t.value : t.value = v.createTerminal(...e);
299
- }
300
- function i(u) {
301
- o().sendText(u);
302
- }
303
- function r() {
304
- o().show();
305
- }
306
- function s() {
307
- n() && (t.value.sendText(""), t.value.dispose(), t.value = null);
308
- }
309
- return L(s), {
310
- terminal: t,
311
- getIsActive: n,
312
- show: r,
313
- sendText: i,
314
- close: s,
315
- state: ee(t)
219
+ ne(t, n);
220
+ }
221
+ function Te(e) {
222
+ const t = r(v(e)?.getText());
223
+ return (C(e) || typeof e == "function") && D(e, (n) => {
224
+ t.value = n?.getText();
225
+ }), a(T.onDidChangeTextDocument((n) => {
226
+ n.document === v(e) && (t.value = n.document.getText());
227
+ })), t;
228
+ }
229
+ function Ee(e, t, n, o = {}) {
230
+ let s;
231
+ const i = d(() => {
232
+ s?.dispose(), s = void 0;
233
+ const c = v(t);
234
+ if ("key" in c)
235
+ return c;
236
+ const p = f.createTextEditorDecorationType(c);
237
+ return s = p, p;
238
+ });
239
+ L(() => s?.dispose());
240
+ const u = async () => {
241
+ const c = v(e);
242
+ c && c.setDecorations(
243
+ i.value,
244
+ typeof n == "function" ? await n(c) : M(n)
245
+ );
246
+ };
247
+ return (o.watchDocumentChange ?? !0) && a(T.onDidChangeTextDocument(async (c) => {
248
+ v(e)?.document === c.document && await u();
249
+ })), (o.immediate ?? !0) && u(), {
250
+ /**
251
+ * Manually trigger the decoration update.
252
+ */
253
+ update: u
316
254
  };
317
255
  }
318
- const je = b(() => {
319
- const e = g(E.shell);
320
- return c(E.onDidChangeShell((t) => {
256
+ const xe = h(() => {
257
+ const e = r(x.shell);
258
+ return a(x.onDidChangeShell((t) => {
321
259
  e.value = t;
322
- })), h(() => e.value);
260
+ })), d(() => e.value);
323
261
  });
324
- function P(e, t = []) {
325
- const n = Array.isArray(e) ? e : t ?? [], o = c(Array.isArray(e) || e == null ? new G() : e), i = x(o.event, n);
326
- for (const r of n)
327
- i(r);
262
+ function oe(e, t) {
263
+ const n = (o, s, i) => a(e(o, s, i));
264
+ return t?.forEach((o) => n(o)), n;
265
+ }
266
+ function I(e, t = []) {
267
+ const n = Array.isArray(e) ? e : t ?? [], o = a(Array.isArray(e) || e == null ? new q() : e), s = oe(o.event, n);
328
268
  return {
329
- event: o.event,
330
- fire: o.fire.bind(o),
331
- addListener: i
269
+ emitter: o,
270
+ event: s,
271
+ fire: o.fire.bind(o)
332
272
  };
333
273
  }
334
- async function He(e) {
335
- const t = k.value.secrets, n = S(await t.get(e));
336
- return n.set = async (o) => {
337
- n.value = o, await t.store(e, o);
338
- }, n.remove = async () => {
274
+ function Se(e) {
275
+ const t = E.value.secrets, n = r(null);
276
+ t.get(e).then((u) => {
277
+ n.value = u;
278
+ }), a(t.onDidChange(async (u) => {
279
+ u.key === e && (n.value = await t.get(e));
280
+ }));
281
+ const o = async (u) => {
282
+ n.value = u, await t.store(e, u);
283
+ }, s = async () => {
339
284
  n.value = void 0, await t.delete(e);
340
- }, c(t.onDidChange(async (o) => {
341
- o.key === e && (n.value = await t.get(e));
342
- })), C(n, (o) => {
343
- o === void 0 ? t.delete(e) : t.store(e, o);
344
- }), n;
345
- }
346
- function Be(e) {
347
- return h(() => y.fetchTasks(a(e)));
348
- }
349
- function Ke(e) {
350
- return h(() => re.file(a(e)));
351
- }
352
- function qe(e, t) {
353
- const n = new G(), o = g();
354
- w(() => {
355
- o.value && n.fire(), o.value = a(t);
356
- }), c(ce.registerFoldingRangeProvider(
357
- e,
358
- {
359
- onDidChangeFoldingRanges: n.event,
360
- provideFoldingRanges(i, r, s) {
361
- return o.value?.(i, r, s);
362
- }
285
+ }, i = d({
286
+ get() {
287
+ return n.value;
288
+ },
289
+ set(u) {
290
+ u === void 0 ? s() : o(u);
363
291
  }
364
- ));
292
+ });
293
+ return i.set = o, i.remove = s, i;
365
294
  }
366
- function ze(e, t, n, o) {
367
- const i = $(/* @__PURE__ */ new Map()), r = P(), s = P(), u = P(), d = h(() => {
368
- const f = a(e);
369
- return Array.isArray(f) ? f : f instanceof Set ? Array.from(f) : [f];
295
+ function Re(e, t = {}) {
296
+ const n = G(/* @__PURE__ */ new Map()), o = I(), s = I(), i = I(), u = d(() => {
297
+ const l = v(e);
298
+ return l instanceof Set ? l : new Set(
299
+ Array.isArray(l) ? l : [l]
300
+ );
370
301
  });
371
- function l() {
372
- const f = d.value;
373
- for (const [p, D] of i)
374
- f.includes(p) || (D.dispose(), i.delete(p));
375
- for (const p of f)
376
- if (!i.has(p)) {
377
- const D = T.createFileSystemWatcher(
378
- p,
379
- a(t) || !1,
380
- a(n) || !1,
381
- a(o) || !1
302
+ function c() {
303
+ const l = u.value;
304
+ for (const [g, m] of n)
305
+ l.has(g) || (m.dispose(), n.delete(g));
306
+ for (const g of l)
307
+ if (!n.has(g)) {
308
+ const m = T.createFileSystemWatcher(
309
+ g,
310
+ t.onDidCreate === !1,
311
+ t.onDidChange === !1,
312
+ t.onDidDelete === !1
382
313
  );
383
- D.onDidCreate(r.fire), D.onDidChange(s.fire), D.onDidDelete(u.fire), i.set(p, D);
314
+ m.onDidCreate(o.fire), m.onDidChange(s.fire), m.onDidDelete(i.fire), n.set(g, m);
384
315
  }
385
316
  }
386
- function m() {
387
- for (const f of i.values())
388
- f.dispose();
389
- i.clear();
317
+ function p() {
318
+ for (const l of n.values())
319
+ l.dispose();
320
+ n.clear();
390
321
  }
391
- return l(), C(d, l), C(
392
- () => [
393
- a(t),
394
- a(n),
395
- a(o)
396
- ],
397
- () => {
398
- m(), l();
399
- }
400
- ), L(m), {
401
- watchers: i,
402
- onDidCreate: r.event,
322
+ return c(), D(u, c), L(p), typeof t.onDidCreate == "function" && o.event(t.onDidCreate), typeof t.onDidChange == "function" && s.event(t.onDidChange), typeof t.onDidDelete == "function" && i.event(t.onDidDelete), {
323
+ watchers: J(n),
324
+ /**
325
+ * @see {@link FileSystemWatcher.onDidCreate}
326
+ */
327
+ onDidCreate: o.event,
328
+ /**
329
+ * @see {@link FileSystemWatcher.onDidChange}
330
+ */
403
331
  onDidChange: s.event,
404
- onDidDelete: u.event
332
+ /**
333
+ * @see {@link FileSystemWatcher.onDidDelete}
334
+ */
335
+ onDidDelete: i.event
405
336
  };
406
337
  }
407
- const Qe = b(() => {
408
- const e = ve();
409
- return h(() => e.value.kind === z.Dark || e.value.kind === z.HighContrast);
410
- }), Ue = b(() => {
411
- const e = g(E.isTelemetryEnabled);
412
- return c(E.onDidChangeTelemetryEnabled((t) => {
413
- e.value = t;
414
- })), h(() => e.value);
415
- });
416
- function Ye(e, ...t) {
417
- return h(() => typeof t[0] == "object" ? Q.t(a(e), oe(t[0])) : Q.t(a(e), ...t.map(a)));
418
- }
419
- const Ge = b(() => {
420
- const e = g(F.tools);
421
- return c(F.onDidChangeChatModels(() => {
422
- e.value = F.tools;
423
- })), h(() => e.value);
424
- });
425
- function be(e, t) {
426
- return c(v.createOutputChannel(e, t));
338
+ function U(e, t, n) {
339
+ const o = r(e.get(t, n)), s = d({
340
+ get() {
341
+ return o.value;
342
+ },
343
+ set(i) {
344
+ s.update(i);
345
+ }
346
+ });
347
+ return s.update = async (i) => {
348
+ o.value = i === void 0 ? n : i, await e.update(t, i);
349
+ }, s;
427
350
  }
428
- function Je(e) {
429
- const t = /* @__PURE__ */ new Date(), n = String(t.getFullYear()).padStart(4, "0"), o = 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"), u = String(t.getSeconds()).padStart(2, "0"), d = String(t.getMilliseconds()).padStart(3, "0");
430
- return `${n}-${o}-${i} ${r}:${s}:${u}.${d} [${e}] `;
351
+ function Pe(e, t) {
352
+ return U(E.value.globalState, e, t);
431
353
  }
432
- function we(e, t = {}) {
433
- const n = t.outputChannel ?? be(e, { log: !0 }), o = t.toConsole ?? ["error", "warn"], i = (r) => (...s) => {
434
- n.appendLine((t.getPrefix?.(r) ?? "") + s.join(" ")), o.includes(r) && console[r](...s);
435
- };
436
- return {
437
- outputChannel: n,
438
- createLoggerFunc: i,
439
- info: i("info"),
440
- warn: i("warn"),
441
- error: i("error"),
442
- append: n.append.bind(n),
443
- appendLine: n.appendLine.bind(n),
444
- replace: n.replace.bind(n),
445
- clear: n.clear.bind(n),
446
- show: n.show.bind(n),
447
- hide: n.hide.bind(n)
354
+ function j(e, t) {
355
+ y(e, t, [
356
+ "title",
357
+ "step",
358
+ "totalSteps",
359
+ "enabled",
360
+ "busy",
361
+ "ignoreFocusOut"
362
+ ]), b(e, t, [
363
+ "onDidHide"
364
+ ]), t.visible != null && w(() => {
365
+ v(t.visible) ? e.show() : e.hide();
366
+ });
367
+ }
368
+ function Ie(e = {}) {
369
+ const t = a(f.createInputBox());
370
+ j(t, e), y(t, e, [
371
+ "valueSelection",
372
+ "placeholder",
373
+ "password",
374
+ "buttons",
375
+ "prompt",
376
+ "validationMessage"
377
+ ]), b(t, e, [
378
+ "onDidChangeValue",
379
+ "onDidAccept",
380
+ "onDidTriggerButton"
381
+ ]);
382
+ const n = r(e.value ?? t.value);
383
+ return t.onDidChangeValue((o) => n.value = o), w(() => t.value = n.value), {
384
+ ...t,
385
+ /**
386
+ * @see {@linkcode InputBox.value}
387
+ */
388
+ value: n
448
389
  };
449
390
  }
450
- const Xe = b(() => {
451
- const e = g(E.logLevel);
452
- return c(E.onDidChangeLogLevel((t) => {
391
+ const ke = h(() => {
392
+ const e = te();
393
+ return d(() => e.value.kind === O.Dark || e.value.kind === O.HighContrast);
394
+ }), Ae = h(() => {
395
+ const e = r(x.isTelemetryEnabled);
396
+ return a(x.onDidChangeTelemetryEnabled((t) => {
397
+ e.value = t;
398
+ })), d(() => e.value);
399
+ });
400
+ function Ve(e, ...t) {
401
+ return d(() => {
402
+ const n = v(t[0]);
403
+ return typeof n == "object" ? N.t(v(e), X(n)) : N.t(v(e), ...t.map(v));
404
+ });
405
+ }
406
+ const We = h(() => {
407
+ const e = r(V.tools);
408
+ return a(V.onDidChangeChatModels(() => {
409
+ e.value = V.tools;
410
+ })), d(() => e.value);
411
+ }), Oe = h(() => {
412
+ const e = r(x.logLevel);
413
+ return a(x.onDidChangeLogLevel((t) => {
453
414
  e.value = t;
454
- })), h(() => e.value);
415
+ })), d(() => e.value);
455
416
  });
456
- function Ce(e) {
457
- const t = g(a(e)?.selections ?? []);
458
- return C(e, () => {
459
- t.value = a(e)?.selections ?? [];
460
- }), c(v.onDidChangeNotebookEditorSelection((n) => {
461
- n.notebookEditor === a(e) && (t.value = n.selections);
462
- })), h({
417
+ function ie(e) {
418
+ const t = r(v(e)?.selections ?? []);
419
+ return (C(e) || typeof e == "function") && D(e, (n) => {
420
+ t.value = n?.selections ?? [];
421
+ }), a(f.onDidChangeNotebookEditorSelection((n) => {
422
+ n.notebookEditor === v(e) && (t.value = n.selections);
423
+ })), d({
463
424
  get() {
464
425
  return t.value;
465
426
  },
466
427
  set(n) {
467
428
  t.value = n;
468
- const o = a(e);
429
+ const o = v(e);
469
430
  o && (o.selections = n);
470
431
  }
471
432
  });
472
433
  }
473
- function Ze(e) {
474
- const t = Ce(e);
475
- return h({
434
+ function Ne(e) {
435
+ const t = ie(e);
436
+ return d({
476
437
  get() {
477
438
  return t.value[0];
478
439
  },
479
440
  set(n) {
480
- t.value = t.value.toSpliced(0, 1, n);
441
+ t.value = n ? [n] : [];
481
442
  }
482
443
  });
483
444
  }
484
- function _e(e) {
485
- const t = g(a(e)?.visibleRanges ?? []);
486
- return C(e, () => {
487
- t.value = a(e)?.visibleRanges ?? [];
488
- }), c(v.onDidChangeNotebookEditorVisibleRanges((n) => {
489
- n.notebookEditor === a(e) && (t.value = n.visibleRanges);
490
- })), h(() => t.value);
491
- }
492
- const et = b(() => {
493
- const e = g(v.terminals);
445
+ function Me(e) {
446
+ const t = r(v(e)?.visibleRanges ?? []);
447
+ return (C(e) || typeof e == "function") && D(e, (n) => {
448
+ t.value = n?.visibleRanges ?? [];
449
+ }), a(f.onDidChangeNotebookEditorVisibleRanges((n) => {
450
+ n.notebookEditor === v(e) && (t.value = n.visibleRanges);
451
+ })), d(() => t.value);
452
+ }
453
+ const Le = h(() => {
454
+ const e = r(f.terminals);
494
455
  function t() {
495
- e.value = v.terminals;
456
+ e.value = f.terminals;
496
457
  }
497
- return c(v.onDidOpenTerminal(t)), c(v.onDidCloseTerminal(t)), e;
458
+ return a(f.onDidOpenTerminal(t)), a(f.onDidCloseTerminal(t)), e;
498
459
  });
499
- function tt(e = {}) {
500
- const t = c(v.createQuickPick()), n = x(t.onDidChangeActive), o = x(t.onDidChangeSelection), i = x(t.onDidAccept), r = x(t.onDidHide), s = x(t.onDidTriggerButton), u = x(t.onDidChangeValue);
501
- [
460
+ function Fe(e = {}) {
461
+ const t = a(f.createQuickPick());
462
+ j(t, e), y(t, e, [
502
463
  "items",
503
464
  "buttons",
504
465
  "title",
@@ -512,30 +473,38 @@ function tt(e = {}) {
512
473
  "matchOnDescription",
513
474
  "matchOnDetail",
514
475
  "keepScrollPosition"
515
- ].forEach((f) => {
516
- e[f] && w(() => t[f] = a(e[f]));
517
- }), e.value && (t.value = e.value);
518
- const d = g(t.value);
519
- u((f) => d.value = f), e.activeItems && (t.activeItems = e.activeItems);
520
- const l = g(t.activeItems);
521
- n((f) => l.value = f), e.selectedItems && (t.selectedItems = e.selectedItems);
522
- const m = g(t.selectedItems);
523
- return o((f) => m.value = f), {
476
+ ]), b(t, e, [
477
+ "onDidChangeValue",
478
+ "onDidAccept",
479
+ "onDidTriggerButton",
480
+ "onDidTriggerItemButton",
481
+ "onDidChangeActive",
482
+ "onDidChangeSelection"
483
+ ]);
484
+ const n = r(e.value ?? t.value);
485
+ t.onDidChangeValue((i) => n.value = i), w(() => t.value = n.value);
486
+ const o = r(e.activeItems ?? t.activeItems);
487
+ t.onDidChangeActive((i) => o.value = i), w(() => t.activeItems = o.value);
488
+ const s = r(e.selectedItems ?? t.selectedItems);
489
+ return t.onDidChangeSelection((i) => s.value = i), w(() => t.selectedItems = s.value), {
524
490
  ...t,
525
- onDidChangeActive: n,
526
- onDidChangeSelection: o,
527
- onDidAccept: i,
528
- onDidHide: r,
529
- onDidTriggerButton: s,
530
- onDidChangeValue: u,
531
- value: d,
532
- activeItems: l,
533
- selectedItems: m
491
+ /**
492
+ * @see {@linkcode QuickPick.value}
493
+ */
494
+ value: n,
495
+ /**
496
+ * @see {@linkcode QuickPick.activeItems}
497
+ */
498
+ activeItems: o,
499
+ /**
500
+ * @see {@linkcode QuickPick.selectedItems}
501
+ */
502
+ selectedItems: s
534
503
  };
535
504
  }
536
- function nt(e) {
537
- const t = c(e.id ? v.createStatusBarItem(e.id, e.alignment, e.priority) : v.createStatusBarItem(e.alignment, e.priority));
538
- return _(t, e, [
505
+ function Be(e) {
506
+ const t = a(e.id ? f.createStatusBarItem(e.id, e.alignment, e.priority) : f.createStatusBarItem(e.alignment, e.priority));
507
+ return y(t, e, [
539
508
  "name",
540
509
  "text",
541
510
  "tooltip",
@@ -543,319 +512,391 @@ function nt(e) {
543
512
  "backgroundColor",
544
513
  "command",
545
514
  "accessibilityInformation"
546
- ]), e.visible != null ? w(() => {
547
- a(e.visible) ? t.show() : t.hide();
548
- }) : t.show(), t;
515
+ ]), e.visible != null && w(() => {
516
+ v(e.visible) ? t.show() : t.hide();
517
+ }), t;
549
518
  }
550
- const ot = b(() => {
551
- const e = g(y.taskExecutions);
519
+ const _e = h(() => {
520
+ const e = r(R.taskExecutions);
552
521
  function t() {
553
- e.value = y.taskExecutions;
522
+ e.value = R.taskExecutions;
554
523
  }
555
- return c(y.onDidStartTask(t)), c(y.onDidEndTask(t)), h(() => e.value);
524
+ return a(R.onDidStartTask(t)), a(R.onDidEndTask(t)), d(() => e.value);
556
525
  });
557
- function it(...e) {
558
- const t = c(v.createTerminal(...e));
526
+ function se(e) {
527
+ const t = r(v(e)?.shellIntegration);
528
+ return (C(e) || typeof e == "function") && D(e, (n) => {
529
+ t.value = n?.shellIntegration;
530
+ }), a(f.onDidChangeTerminalShellIntegration((n) => {
531
+ n.terminal === v(e) && (t.value = n.shellIntegration);
532
+ })), d(() => t.value);
533
+ }
534
+ function ae(e) {
535
+ const t = r(v(e)?.state);
536
+ return (C(e) || typeof e == "function") && D(e, (n) => {
537
+ t.value = n?.state;
538
+ }), a(f.onDidChangeTerminalState((n) => {
539
+ n === v(e) && (t.value = n.state);
540
+ })), d(() => t.value);
541
+ }
542
+ function $e(...e) {
543
+ const t = a(f.createTerminal(...e));
559
544
  return {
560
545
  terminal: t,
561
- get name() {
562
- return t.name;
563
- },
564
- get processId() {
565
- return t.processId;
566
- },
567
- get creationOptions() {
568
- return t.creationOptions;
569
- },
570
- get exitStatus() {
571
- return t.exitStatus;
572
- },
573
- get shellIntegration() {
574
- return t.shellIntegration;
575
- },
546
+ state: ae(t),
547
+ shellIntegration: se(t),
576
548
  sendText: t.sendText.bind(t),
577
549
  show: t.show.bind(t),
578
550
  hide: t.hide.bind(t),
579
- state: ee(t)
551
+ dispose: t.dispose.bind(t)
580
552
  };
581
553
  }
582
- function De(e, t) {
583
- c(V.registerTextEditorCommand(e, t));
554
+ function re(e, t) {
555
+ C(t) ? w((n) => {
556
+ if (t.value) {
557
+ const o = S.registerTextEditorCommand(e, t.value);
558
+ n(() => o.dispose());
559
+ }
560
+ }) : t && a(S.registerTextEditorCommand(e, t));
584
561
  }
585
- function at(e) {
562
+ function Ue(e) {
586
563
  for (const [t, n] of Object.entries(e))
587
- De(t, n);
588
- }
589
- function Te(e, t) {
590
- const n = g(a(e)?.selections ?? []);
591
- return C(e, () => {
592
- n.value = a(e)?.selections ?? [];
593
- }), c(v.onDidChangeTextEditorSelection((o) => {
594
- const i = a(e), r = a(t);
595
- o.textEditor === i && (!r || r.includes(o.kind)) && (n.value = o.selections);
596
- })), h({
564
+ re(t, n);
565
+ }
566
+ function ue(e, t) {
567
+ const n = r(v(e)?.selections ?? []);
568
+ return (C(e) || typeof e == "function") && D(e, (o) => {
569
+ n.value = o?.selections ?? [];
570
+ }), a(f.onDidChangeTextEditorSelection((o) => {
571
+ if (o.textEditor === v(e)) {
572
+ const s = v(t);
573
+ (!s || s.includes(o.kind)) && (n.value = o.selections);
574
+ }
575
+ })), d({
597
576
  get() {
598
577
  return n.value;
599
578
  },
600
579
  set(o) {
601
580
  n.value = o;
602
- const i = a(e);
603
- i && (i.selections = o);
581
+ const s = v(e);
582
+ s && (s.selections = o);
604
583
  }
605
584
  });
606
585
  }
607
- function st(e, t) {
608
- const n = Te(e, t);
609
- return h({
586
+ function je(e, t) {
587
+ const n = ue(e, t);
588
+ return d({
610
589
  get() {
611
590
  return n.value[0];
612
591
  },
613
592
  set(o) {
614
- n.value = n.value.toSpliced(0, 1, o);
593
+ n.value = o ? [o] : [];
615
594
  }
616
595
  });
617
596
  }
618
- function rt(e) {
619
- const t = g(a(e)?.viewColumn);
620
- return C(e, () => {
621
- t.value = a(e)?.viewColumn;
622
- }), c(v.onDidChangeTextEditorViewColumn((n) => {
623
- n.textEditor === a(e) && (t.value = n.viewColumn);
624
- })), h(() => t.value);
625
- }
626
- function ct(e) {
627
- const t = g(a(e)?.visibleRanges ?? []);
628
- return C(e, () => {
629
- t.value = a(e)?.visibleRanges ?? [];
630
- }), c(v.onDidChangeTextEditorVisibleRanges((n) => {
631
- n.textEditor === a(e) && (t.value = n.visibleRanges);
632
- })), h(() => t.value);
633
- }
634
- function te(e, t) {
635
- w(() => {
636
- const n = a(e);
637
- n && (n.badge = a(t));
638
- });
597
+ function He(e) {
598
+ const t = r(v(e)?.viewColumn);
599
+ return (C(e) || typeof e == "function") && D(e, (n) => {
600
+ t.value = n?.viewColumn;
601
+ }), a(f.onDidChangeTextEditorViewColumn((n) => {
602
+ n.textEditor === v(e) && (t.value = n.viewColumn);
603
+ })), d(() => t.value);
639
604
  }
640
- function j(e, t) {
641
- w(() => {
642
- const n = a(e);
643
- n && (n.title = a(t));
644
- });
645
- }
646
- const ut = N(
647
- (e, t, n) => {
648
- const o = P();
649
- C(t, () => o.fire()), n?.watchSource && C(n.watchSource, () => o.fire());
650
- const i = /* @__PURE__ */ new WeakMap(), r = c(v.createTreeView(e, {
651
- ...n,
652
- treeDataProvider: {
653
- ...n,
654
- onDidChangeTreeData: o.event,
655
- getTreeItem(s) {
656
- return s.treeItem;
657
- },
658
- async getChildren(s) {
659
- if (s) {
660
- const u = await s.children;
661
- return u?.forEach((d) => i.set(d, s)), u;
662
- }
663
- return a(t);
664
- },
665
- getParent(s) {
666
- return i.get(s);
605
+ function Ke(e) {
606
+ const t = r(v(e)?.visibleRanges ?? []);
607
+ return (C(e) || typeof e == "function") && D(e, (n) => {
608
+ t.value = n?.visibleRanges ?? [];
609
+ }), a(f.onDidChangeTextEditorVisibleRanges((n) => {
610
+ n.textEditor === v(e) && (t.value = n.visibleRanges);
611
+ })), d(() => t.value);
612
+ }
613
+ function H(e) {
614
+ const t = F(v(e)?.visible);
615
+ return (C(e) || typeof e == "function") && D(e, (n) => {
616
+ t.value = n?.visible;
617
+ }), w((n) => {
618
+ const o = v(e);
619
+ if (o) {
620
+ const s = o.onDidChangeVisibility(() => {
621
+ t.value = o.visible;
622
+ });
623
+ n(() => s.dispose());
624
+ }
625
+ }), d(() => !!t.value);
626
+ }
627
+ function Qe(e, t, n = {}) {
628
+ const o = I(), s = /* @__PURE__ */ new WeakMap(), i = a(f.createTreeView(e, {
629
+ ...n,
630
+ treeDataProvider: {
631
+ onDidChangeTreeData: o.event,
632
+ getTreeItem(c) {
633
+ return c.treeItem;
634
+ },
635
+ async getChildren(c) {
636
+ if (c) {
637
+ const p = await c.children;
638
+ return p?.forEach((l) => s.set(l, c)), p;
667
639
  }
668
- }
669
- }));
670
- return n?.title && j(r, n.title), n?.badge && te(r, n.badge), r;
671
- },
672
- (e) => e
673
- );
674
- function lt(e) {
675
- const t = S(a(e)?.visible);
676
- function n() {
677
- t.value = a(e)?.visible;
678
- }
679
- return w((o) => {
680
- const i = a(e);
681
- if (i) {
682
- const r = i.onDidChangeVisibility(n);
683
- o(() => r.dispose());
640
+ return v(t);
641
+ },
642
+ getParent(c) {
643
+ return s.get(c);
644
+ },
645
+ resolveTreeItem: n.resolveTreeItem
684
646
  }
685
- }), w(n), h(() => !!t.value);
647
+ }));
648
+ D(t, () => o.fire()), y(i, n, [
649
+ "message",
650
+ "title",
651
+ "description",
652
+ "badge"
653
+ ]), b(i, n, [
654
+ "onDidExpandElement",
655
+ "onDidCollapseElement",
656
+ "onDidChangeSelection",
657
+ "onDidChangeVisibility",
658
+ "onDidChangeCheckboxState"
659
+ ]);
660
+ const u = r(i.selection);
661
+ return a(i.onDidChangeSelection((c) => {
662
+ u.value = c.selection;
663
+ })), {
664
+ view: i,
665
+ /**
666
+ * @see {@linkcode TreeView.selection}
667
+ */
668
+ selection: u,
669
+ /**
670
+ * @see {@linkcode TreeView.visible}
671
+ */
672
+ visible: H(i),
673
+ /**
674
+ * @see {@linkcode TreeView.reveal}
675
+ */
676
+ reveal: i.reveal.bind(i)
677
+ };
686
678
  }
687
- const dt = b(() => {
688
- const e = g(v.visibleNotebookEditors);
689
- return c(v.onDidChangeVisibleNotebookEditors((t) => {
679
+ const ze = h(() => {
680
+ const e = r(f.visibleNotebookEditors);
681
+ return a(f.onDidChangeVisibleNotebookEditors((t) => {
690
682
  e.value = t;
691
- })), e;
692
- }), ft = b(() => {
693
- const e = g(v.visibleTextEditors);
694
- return c(v.onDidChangeVisibleTextEditors((t) => {
683
+ })), d(() => e.value);
684
+ }), Ge = h(() => {
685
+ const e = r(f.visibleTextEditors);
686
+ return a(f.onDidChangeVisibleTextEditors((t) => {
695
687
  e.value = t;
696
- })), e;
688
+ })), d(() => e.value);
697
689
  });
698
- function vt(e, t, n = !0) {
699
- const o = ie(t) ? t : typeof t == "function" ? h(t) : S(t);
700
- return w(() => {
701
- a(n) && V.executeCommand("setContext", e, o.value);
702
- }), o;
703
- }
704
- function gt(e, t, n, o, i) {
705
- const r = g(), s = c(v.createWebviewPanel(
690
+ function Je(e, t) {
691
+ const n = C(t) ? t : typeof t == "function" ? d(t) : F(t);
692
+ return D(n, (o) => {
693
+ S.executeCommand("setContext", e, o);
694
+ }, { immediate: !0 }), n;
695
+ }
696
+ function Xe(e, t, n, o, s = {}) {
697
+ const i = a(f.createWebviewPanel(
706
698
  e,
707
- a(t),
699
+ v(t),
708
700
  o,
709
- {
710
- enableFindWidget: i?.enableFindWidget,
711
- retainContextWhenHidden: i?.retainContextWhenHidden,
712
- ...a(i?.webviewOptions)
701
+ s
702
+ )), u = i.webview;
703
+ y(i, s, [
704
+ "title",
705
+ "iconPath"
706
+ ]), b(i, s, [
707
+ "onDidChangeViewState",
708
+ "onDidDispose"
709
+ ]);
710
+ const c = r(0);
711
+ w(() => {
712
+ u.html = `${v(n)}<!--${c.value}-->`;
713
+ }), y(u, { options: s.webviewOptions }, [
714
+ "options"
715
+ ]), b(u, s, [
716
+ "onDidReceiveMessage"
717
+ ]);
718
+ const p = r(i.viewColumn), l = r(i.active), g = r(i.visible);
719
+ return a(i.onDidChangeViewState((m) => {
720
+ i === m.webviewPanel && (p.value = i.viewColumn, l.value = i.active, g.value = i.visible);
721
+ })), {
722
+ panel: i,
723
+ webview: u,
724
+ /**
725
+ * @see {@linkcode WebviewPanel.viewColumn}
726
+ */
727
+ viewColumn: d(() => p.value),
728
+ /**
729
+ * @see {@linkcode WebviewPanel.active}
730
+ */
731
+ active: d(() => l.value),
732
+ /**
733
+ * @see {@linkcode WebviewPanel.visible}
734
+ */
735
+ visible: d(() => g.value),
736
+ /**
737
+ * @see {@linkcode WebviewPanel.reveal}
738
+ */
739
+ reveal: i.reveal.bind(i),
740
+ /**
741
+ * @see {@linkcode Webview.postMessage}
742
+ */
743
+ postMessage: u.postMessage.bind(u),
744
+ /**
745
+ * @see {@linkcode Webview.asWebviewUri}
746
+ */
747
+ asWebviewUri: u.asWebviewUri.bind(u),
748
+ /**
749
+ * Force reload the webview content.
750
+ */
751
+ forceReload: () => {
752
+ c.value++;
713
753
  }
714
- ));
715
- i?.onDidReceiveMessage && s.webview.onDidReceiveMessage(i.onDidReceiveMessage);
716
- const u = S(0);
717
- function d() {
718
- u.value++;
719
- }
720
- if (w(() => {
721
- s.webview.html = `${a(n)}<!--${u.value}-->`;
722
- }), i?.webviewOptions) {
723
- const p = i.webviewOptions;
724
- w(() => {
725
- s.webview.options = a(p);
726
- });
727
- }
728
- j(s, t);
729
- function l(p) {
730
- return s.webview.postMessage(p);
731
- }
732
- const m = S(s.active), f = S(s.visible);
733
- return c(s.onDidChangeViewState(() => {
734
- m.value = s.active, f.value = s.visible;
735
- })), { panel: s, context: r, active: m, visible: f, postMessage: l, forceRefresh: d };
736
- }
737
- const ht = N(
738
- (e, t, n) => {
739
- const o = g(), i = g();
740
- c(v.registerWebviewViewProvider(
741
- e,
742
- {
743
- resolveWebviewView(d, l) {
744
- o.value = d, i.value = l, n?.onDidReceiveMessage && d.webview.onDidReceiveMessage(n.onDidReceiveMessage);
745
- }
746
- },
747
- {
748
- webviewOptions: {
749
- retainContextWhenHidden: n?.retainContextWhenHidden
750
- }
754
+ };
755
+ }
756
+ function Ye(e, t, n = {}) {
757
+ const o = r(), s = d(() => o.value?.webview), i = r();
758
+ a(f.registerWebviewViewProvider(
759
+ e,
760
+ {
761
+ resolveWebviewView(c, p) {
762
+ o.value = c, i.value = p;
763
+ }
764
+ },
765
+ {
766
+ webviewOptions: {
767
+ retainContextWhenHidden: n.retainContextWhenHidden
751
768
  }
752
- ));
753
- const r = S(0);
754
- function s() {
755
- r.value++;
756
- }
757
- if (w(() => {
758
- o.value && (o.value.webview.html = `${a(t)}<!--${r.value}-->`);
759
- }), n?.webviewOptions) {
760
- const d = n.webviewOptions;
761
- w(() => {
762
- o.value && (o.value.webview.options = a(d));
763
- });
764
769
  }
765
- n?.title && j(o, n.title), n?.badge && te(o, n.badge);
766
- function u(d) {
767
- return o.value?.webview.postMessage(d);
770
+ ));
771
+ const u = r(0);
772
+ return w(() => {
773
+ o.value && (o.value.webview.html = `${v(t)}<!--${u.value}-->`);
774
+ }), y(o, n, [
775
+ "title",
776
+ "description",
777
+ "badge"
778
+ ]), b(o, n, [
779
+ "onDidDispose"
780
+ ]), y(s, { options: n.webviewOptions }, [
781
+ "options"
782
+ ]), b(s, n, [
783
+ "onDidReceiveMessage"
784
+ ]), {
785
+ view: d(() => o.value),
786
+ /**
787
+ * @see {@linkcode WebviewView.webview}
788
+ */
789
+ webview: s,
790
+ /**
791
+ * Additional metadata about the view being resolved.
792
+ */
793
+ context: d(() => i.value),
794
+ /**
795
+ * @see {@linkcode WebviewView.visible}
796
+ */
797
+ visible: H(o),
798
+ /**
799
+ * @see {@linkcode WebviewView.show}
800
+ */
801
+ show: (c) => o.value?.show(c),
802
+ /**
803
+ * @see {@linkcode Webview.postMessage}
804
+ */
805
+ postMessage: (c) => o.value?.webview.postMessage(c),
806
+ /**
807
+ * @see {@linkcode Webview.asWebviewUri}
808
+ */
809
+ asWebviewUri: (c) => s.value?.asWebviewUri(c),
810
+ /**
811
+ * Force reload the webview content.
812
+ */
813
+ forceReload: () => {
814
+ u.value++;
768
815
  }
769
- return { view: o, context: i, postMessage: u, forceRefresh: s };
770
- },
771
- (e) => e
772
- ), mt = b(() => {
773
- const e = g(v.state);
774
- return c(v.onDidChangeWindowState((t) => {
816
+ };
817
+ }
818
+ const K = h(() => {
819
+ const e = r(f.state);
820
+ return a(f.onDidChangeWindowState((t) => {
775
821
  e.value = t;
776
822
  })), {
777
- focused: h(() => e.value.focused),
778
- active: h(() => e.value.active)
823
+ focused: d(() => e.value.focused),
824
+ active: d(() => e.value.active)
779
825
  };
780
- }), pt = b(() => {
781
- const e = g(T.workspaceFolders);
782
- return c(T.onDidChangeWorkspaceFolders(() => {
826
+ }), Ze = h(() => K().active), qe = h(() => K().focused), et = h(() => {
827
+ const e = r(T.workspaceFolders);
828
+ return a(T.onDidChangeWorkspaceFolders(() => {
783
829
  e.value = T.workspaceFolders;
784
- })), h(() => e.value);
830
+ })), d(() => e.value);
785
831
  });
832
+ function tt(e, t) {
833
+ return U(E.value.workspaceState, e, t);
834
+ }
786
835
  export {
787
- X as activateCbs,
788
- N as createKeyedComposable,
789
- b as createSingletonComposable,
790
- J as deactivateCbs,
791
- ye as defineConfigObject,
792
- de as defineConfigs,
793
- Ee as defineExtension,
794
- ke as defineLogger,
795
- Re as defineService,
796
- Pe as executeCommand,
797
- k as extensionContext,
798
- M as extensionScope,
799
- Je as getDefaultLoggerPrefix,
800
- Z as onActivate,
801
- le as onDeactivate,
802
- ue as tryOnScopeDispose,
803
- Ve as useAbsolutePath,
804
- ve as useActiveColorTheme,
805
- Ae as useActiveDebugSession,
806
- Oe as useActiveEditorDecorations,
807
- Ie as useActiveNotebookEditor,
808
- We as useActiveTerminal,
809
- ge as useActiveTextEditor,
810
- Fe as useAllExtensions,
811
- $e as useChatParticipant,
812
- pe as useCommand,
813
- Me as useCommands,
814
- Le as useCommentController,
815
- Ne as useControlledTerminal,
816
- je as useDefaultShell,
817
- c as useDisposable,
818
- he as useDocumentText,
819
- me as useEditorDecorations,
820
- x as useEvent,
821
- P as useEventEmitter,
822
- He as useExtensionSecret,
823
- Be as useFetchTasks,
824
- Ke as useFileUri,
825
- qe as useFoldingRangeProvider,
826
- ze as useFsWatcher,
827
- Qe as useIsDarkTheme,
828
- Ue as useIsTelemetryEnabled,
829
- Ye as useL10nText,
830
- Ge as useLmTools,
831
- Xe as useLogLevel,
832
- we as useLogger,
833
- Ze as useNotebookEditorSelection,
834
- Ce as useNotebookEditorSelections,
835
- _e as useNotebookEditorVisibleRanges,
836
- et as useOpenedTerminals,
837
- be as useOutputChannel,
838
- tt as useQuickPick,
839
- _ as useReactiveOptions,
840
- nt as useStatusBarItem,
841
- ot as useTaskExecutions,
842
- it as useTerminal,
843
- ee as useTerminalState,
844
- De as useTextEditorCommand,
845
- at as useTextEditorCommands,
846
- st as useTextEditorSelection,
847
- Te as useTextEditorSelections,
848
- rt as useTextEditorViewColumn,
849
- ct as useTextEditorVisibleRanges,
850
- ut as useTreeView,
851
- te as useViewBadge,
852
- j as useViewTitle,
853
- lt as useViewVisibility,
854
- dt as useVisibleNotebookEditors,
855
- ft as useVisibleTextEditors,
856
- vt as useVscodeContext,
857
- gt as useWebviewPanel,
858
- ht as useWebviewView,
859
- mt as useWindowState,
860
- pt as useWorkspaceFolders
836
+ B as activateCbs,
837
+ $ as deactivateCbs,
838
+ fe as defineConfig,
839
+ de as defineExtension,
840
+ ge as defineLogger,
841
+ h as defineService,
842
+ E as extensionContext,
843
+ k as extensionScope,
844
+ _ as onActivate,
845
+ ve as onDeactivate,
846
+ pe as useAbsoluteUri,
847
+ te as useActiveColorTheme,
848
+ he as useActiveDebugSession,
849
+ me as useActiveNotebookEditor,
850
+ Ce as useActiveTerminal,
851
+ we as useActiveTextEditor,
852
+ De as useAllExtensions,
853
+ be as useChatParticipant,
854
+ ne as useCommand,
855
+ ye as useCommands,
856
+ a as useDisposable,
857
+ Te as useDocumentText,
858
+ Ee as useEditorDecorations,
859
+ xe as useEnvShell,
860
+ oe as useEvent,
861
+ I as useEventEmitter,
862
+ Se as useExtensionSecret,
863
+ Re as useFileSystemWatcher,
864
+ Pe as useGlobalState,
865
+ Ie as useInputBox,
866
+ ke as useIsDarkTheme,
867
+ Ae as useIsTelemetryEnabled,
868
+ Ve as useL10nText,
869
+ We as useLmTools,
870
+ Oe as useLogLevel,
871
+ U as useMementoItem,
872
+ Ne as useNotebookEditorSelection,
873
+ ie as useNotebookEditorSelections,
874
+ Me as useNotebookEditorVisibleRanges,
875
+ Le as useOpenedTerminals,
876
+ Fe as useQuickPick,
877
+ y as useReactiveOptions,
878
+ Be as useStatusBarItem,
879
+ _e as useTaskExecutions,
880
+ $e as useTerminal,
881
+ se as useTerminalShellIntegration,
882
+ ae as useTerminalState,
883
+ re as useTextEditorCommand,
884
+ Ue as useTextEditorCommands,
885
+ je as useTextEditorSelection,
886
+ ue as useTextEditorSelections,
887
+ He as useTextEditorViewColumn,
888
+ Ke as useTextEditorVisibleRanges,
889
+ Qe as useTreeView,
890
+ H as useViewVisibility,
891
+ ze as useVisibleNotebookEditors,
892
+ Ge as useVisibleTextEditors,
893
+ Je as useVscodeContext,
894
+ Xe as useWebviewPanel,
895
+ Ye as useWebviewView,
896
+ Ze as useWindowActive,
897
+ qe as useWindowFocused,
898
+ K as useWindowState,
899
+ et as useWorkspaceFolders,
900
+ tt as useWorkspaceState
861
901
  };
902
+ //# sourceMappingURL=index.js.map