reactive-vscode
Advanced tools
Comparing version
@@ -94,3 +94,3 @@ /// <reference types="vscode" /> | ||
/* Excluded from this release type: ConfigTypeOptions */ | ||
export declare type ConfigTypeOptions = Record<string, ConfigTypeRaw<any>>; | ||
@@ -126,5 +126,5 @@ declare type ConfigTypeRaw<T> = ConfigTypeSingle<T> | ConfigTypeSingle<T>[]; | ||
*/ | ||
export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>; | ||
export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>; | ||
export declare function defineConfigObject<C extends object>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<C>; | ||
export declare function defineConfigObject<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<C>; | ||
@@ -138,5 +138,5 @@ /** | ||
*/ | ||
export declare function defineConfigs<const C extends ConfigTypeOptions>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<ParseConfigTypeOptions<C>>; | ||
export declare function defineConfigs<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<ParseConfigTypeOptions<C>>; | ||
export declare function defineConfigs<C extends object>(section: string, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<C>; | ||
export declare function defineConfigs<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<C>; | ||
@@ -224,3 +224,5 @@ /** | ||
/* Excluded from this release type: ParseConfigTypeOptions */ | ||
export declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = { | ||
-readonly [K in keyof C]: ParseConfigType<C[K]>; | ||
}; | ||
@@ -227,0 +229,0 @@ export declare type TextEditorCommandCallback = (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void; |
@@ -1,8 +0,8 @@ | ||
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"; | ||
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"; | ||
export * from "@reactive-vscode/reactivity"; | ||
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"; | ||
function Q(e) { | ||
return N() ? (F(e), !0) : !1; | ||
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"; | ||
function X(e) { | ||
return L() ? (W(e), !0) : !1; | ||
} | ||
function W(e, t) { | ||
function $(e, t) { | ||
const n = /* @__PURE__ */ new Map(); | ||
@@ -15,3 +15,3 @@ return (...r) => { | ||
refCount: 1 | ||
}, n.set(i, o)), Q(() => { | ||
}, n.set(i, o)), X(() => { | ||
--o.refCount === 0 && n.delete(i); | ||
@@ -21,57 +21,63 @@ }), o.data; | ||
} | ||
function g(e) { | ||
function h(e) { | ||
let t; | ||
return () => t ?? (t = e()); | ||
} | ||
const $ = []; | ||
function fe(e) { | ||
$.push(e); | ||
const I = []; | ||
function ve(e) { | ||
I.push(e); | ||
} | ||
const p = l(null), R = q(); | ||
function ve(e) { | ||
const x = l(null), y = J(); | ||
function ge(e) { | ||
return { | ||
activate: (t) => (p.value = t, R.run(() => (I.map((n) => n(t)), e()))), | ||
activate: (t) => (x.value = t, y.run(() => (P.map((n) => n(t)), e()))), | ||
deactivate: () => { | ||
$.map((t) => t()), R.stop(); | ||
I.map((t) => t()), y.stop(); | ||
} | ||
}; | ||
} | ||
const I = []; | ||
function P(e) { | ||
p.value ? e(p.value) : I.push(e); | ||
const P = []; | ||
function M(e) { | ||
x.value ? e(x.value) : P.push(e); | ||
} | ||
function X(e, t, n) { | ||
const r = b.getConfiguration(e, n); | ||
function i(u, v) { | ||
const f = l(v), m = d({ | ||
get: () => f.value, | ||
function Z(e, t, n) { | ||
const r = !e, i = C.getConfiguration(r ? void 0 : e, n); | ||
function o(d, v) { | ||
const g = l(v), S = f({ | ||
get: () => g.value, | ||
set: (w) => { | ||
f.value = w, r.update(u, w); | ||
g.value = w, i.update(d, w); | ||
} | ||
}); | ||
return m.update = async (w, H, U) => { | ||
await r.update(u, w, H, U), m.value = w; | ||
}, m.set = (w) => { | ||
f.value = w; | ||
}, m; | ||
return S.update = async (w, U, q) => { | ||
await i.update(d, w, U, q), S.value = w; | ||
}, S.set = (w) => { | ||
g.value = w; | ||
}, S; | ||
} | ||
const o = Object.fromEntries( | ||
Object.keys(t).map((u) => [u, i(u, r.get(u))]) | ||
const s = Object.fromEntries( | ||
Object.keys(t).map((d) => [d, o(d, i.get(d))]) | ||
); | ||
return P(() => { | ||
s(b.onDidChangeConfiguration((u) => { | ||
if (!u.affectsConfiguration(e)) | ||
return; | ||
const v = b.getConfiguration(e); | ||
for (const f in t) | ||
u.affectsConfiguration(`${e}.${f}`) && o[f].set(v.get(f)); | ||
})); | ||
}), o; | ||
return M(() => { | ||
u(C.onDidChangeConfiguration( | ||
r ? (d) => { | ||
const v = C.getConfiguration(); | ||
for (const g in t) | ||
d.affectsConfiguration(g) && s[g].set(v.get(g)); | ||
} : (d) => { | ||
if (!d.affectsConfiguration(e)) | ||
return; | ||
const v = C.getConfiguration(e); | ||
for (const g in t) | ||
d.affectsConfiguration(`${e}.${g}`) && s[g].set(v.get(g)); | ||
} | ||
)); | ||
}), s; | ||
} | ||
function ge(e, t, n) { | ||
const r = X(e, t, n); | ||
return L({ | ||
function he(e, t, n) { | ||
const r = Z(e, t, n); | ||
return F({ | ||
...r, | ||
$update(i, o, u, v) { | ||
return r[i].update(o, u, v); | ||
$update(i, o, s, d) { | ||
return r[i].update(o, s, d); | ||
}, | ||
@@ -83,11 +89,11 @@ $set(i, o) { | ||
} | ||
function he(e, t) { | ||
const n = l(null), r = [], i = (o) => (...u) => n.value ? n.value[o](...u) : (r.push([o, u]), null); | ||
return P(() => { | ||
n.value = oe(e, t); | ||
for (const [o, u] of r) | ||
n.value[o](...u); | ||
function me(e, t) { | ||
const n = l(null), r = [], i = (o) => (...s) => n.value ? n.value[o](...s) : (r.push([o, s]), null); | ||
return M(() => { | ||
n.value = ue(e, t); | ||
for (const [o, s] of r) | ||
n.value[o](...s); | ||
}), { | ||
logger: n, | ||
outputChannel: d(() => { | ||
outputChannel: f(() => { | ||
var o; | ||
@@ -107,7 +113,7 @@ return (o = n.value) == null ? void 0 : o.outputChannel; | ||
} | ||
function me(e, ...t) { | ||
return E.executeCommand(e, ...t); | ||
function Ce(e, ...t) { | ||
return k.executeCommand(e, ...t); | ||
} | ||
function Z(e, t = !1) { | ||
const n = p.value; | ||
function _(e, t = !1) { | ||
const n = x.value; | ||
if (!n && !t) | ||
@@ -118,26 +124,26 @@ throw new Error("Cannot get absolute path because the extension is not activated yet"); | ||
function be(e, t = !1) { | ||
return d(() => Z(a(e), t)); | ||
return f(() => _(a(e), t)); | ||
} | ||
function s(e) { | ||
return (N() ?? R).cleanups.push(e.dispose.bind(e)), e; | ||
function u(e) { | ||
return (L() ?? y).cleanups.push(e.dispose.bind(e)), e; | ||
} | ||
const _ = g(() => { | ||
const ee = h(() => { | ||
const e = l(c.activeColorTheme); | ||
return s(c.onDidChangeActiveColorTheme((t) => { | ||
return u(c.onDidChangeActiveColorTheme((t) => { | ||
e.value = t; | ||
})), e; | ||
}), Ce = g(() => { | ||
const e = l(y.activeDebugSession); | ||
return s(y.onDidChangeActiveDebugSession((t) => { | ||
}), we = h(() => { | ||
const e = l(V.activeDebugSession); | ||
return u(V.onDidChangeActiveDebugSession((t) => { | ||
e.value = t; | ||
})), d(() => e.value); | ||
}), ee = g(() => { | ||
})), f(() => e.value); | ||
}), te = h(() => { | ||
const e = l(c.activeTextEditor); | ||
return s(c.onDidChangeActiveTextEditor((t) => { | ||
return u(c.onDidChangeActiveTextEditor((t) => { | ||
e.value = t; | ||
})), e; | ||
}); | ||
function te(e, t, n) { | ||
function ne(e, t, n) { | ||
const r = "key" in t ? t : c.createTextEditorDecorationType(t); | ||
h(() => { | ||
m(() => { | ||
var i; | ||
@@ -147,44 +153,44 @@ (i = a(e)) == null || i.setDecorations(r, a(n)); | ||
} | ||
function we(e, t) { | ||
const n = ee(); | ||
te(n, e, t); | ||
function Te(e, t) { | ||
const n = te(); | ||
ne(n, e, t); | ||
} | ||
const Te = g(() => { | ||
const De = h(() => { | ||
const e = l(c.activeNotebookEditor); | ||
return s(c.onDidChangeActiveNotebookEditor((t) => { | ||
return u(c.onDidChangeActiveNotebookEditor((t) => { | ||
e.value = t; | ||
})), e; | ||
}), De = g(() => { | ||
}), Se = h(() => { | ||
const e = l(c.activeTerminal); | ||
return s(c.onDidChangeActiveTerminal((t) => { | ||
return u(c.onDidChangeActiveTerminal((t) => { | ||
e.value = t; | ||
})), e; | ||
}), Se = g(() => { | ||
const e = l(k.all); | ||
return s(k.onDidChange(() => { | ||
e.value = k.all; | ||
})), d(() => e.value); | ||
}), pe = h(() => { | ||
const e = l(R.all); | ||
return u(R.onDidChange(() => { | ||
e.value = R.all; | ||
})), f(() => e.value); | ||
}); | ||
function ne(e, t) { | ||
s(E.registerCommand(e, t)); | ||
function re(e, t) { | ||
u(k.registerCommand(e, t)); | ||
} | ||
function pe(e) { | ||
function xe(e) { | ||
for (const [t, n] of Object.entries(e)) | ||
n && ne(t, n); | ||
n && re(t, n); | ||
} | ||
function xe(e, t) { | ||
return s(z.createCommentController(e, t)); | ||
function Ee(e, t) { | ||
return u(Y.createCommentController(e, t)); | ||
} | ||
function M(e) { | ||
function j(e) { | ||
var n; | ||
const t = l((n = a(e)) == null ? void 0 : n.state); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var r; | ||
t.value = (r = a(e)) == null ? void 0 : r.state; | ||
}), s(c.onDidChangeTerminalState((r) => { | ||
}), u(c.onDidChangeTerminalState((r) => { | ||
r === a(e) && (t.value = r.state); | ||
})), d(() => t.value); | ||
})), f(() => t.value); | ||
} | ||
function Ee(...e) { | ||
const t = x(null); | ||
function ke(...e) { | ||
const t = E(null); | ||
function n() { | ||
@@ -196,4 +202,4 @@ return !!t.value && t.value.exitStatus == null; | ||
} | ||
function i(v) { | ||
r().sendText(v); | ||
function i(d) { | ||
r().sendText(d); | ||
} | ||
@@ -203,6 +209,6 @@ function o() { | ||
} | ||
function u() { | ||
function s() { | ||
n() && (t.value.sendText(""), t.value.dispose(), t.value = null); | ||
} | ||
return F(u), { | ||
return W(s), { | ||
terminal: t, | ||
@@ -212,24 +218,24 @@ getIsActive: n, | ||
sendText: i, | ||
close: u, | ||
state: M(t) | ||
close: s, | ||
state: j(t) | ||
}; | ||
} | ||
const ke = g(() => { | ||
const Re = h(() => { | ||
const e = l(T.shell); | ||
return s(T.onDidChangeShell((t) => { | ||
return u(T.onDidChangeShell((t) => { | ||
e.value = t; | ||
})), d(() => e.value); | ||
})), f(() => e.value); | ||
}); | ||
function Re(e) { | ||
function ye(e) { | ||
var n; | ||
const t = l((n = a(e)) == null ? void 0 : n.getText()); | ||
return h(() => { | ||
return m(() => { | ||
var r; | ||
t.value = (r = a(e)) == null ? void 0 : r.getText(); | ||
}), s(b.onDidChangeTextDocument((r) => { | ||
}), u(C.onDidChangeTextDocument((r) => { | ||
r.document === a(e) && (t.value = r.document.getText()); | ||
})), t; | ||
} | ||
function S(e, t = []) { | ||
const n = (r, i, o) => s(e(r, i, o)); | ||
function p(e, t = []) { | ||
const n = (r, i, o) => u(e(r, i, o)); | ||
for (const r of t) | ||
@@ -239,4 +245,4 @@ n(r); | ||
} | ||
function re(e, t = []) { | ||
const n = Array.isArray(e) ? e : t ?? [], r = s(Array.isArray(e) || e == null ? new O() : e), i = S(r.event, n); | ||
function ie(e, t = []) { | ||
const n = Array.isArray(e) ? e : t ?? [], r = u(Array.isArray(e) || e == null ? new O() : e), i = p(r.event, n); | ||
for (const o of n) | ||
@@ -250,7 +256,7 @@ i(o); | ||
} | ||
function ye(e) { | ||
return d(() => D.fetchTasks(a(e))); | ||
function Ve(e) { | ||
return f(() => D.fetchTasks(a(e))); | ||
} | ||
function ie(e) { | ||
return L({ | ||
function ae(e) { | ||
return F({ | ||
get scheme() { | ||
@@ -285,16 +291,16 @@ return a(e).scheme; | ||
} | ||
function Ve(e) { | ||
return ie(() => Y.file(a(e))); | ||
function Ae(e) { | ||
return ae(() => G.file(a(e))); | ||
} | ||
function Ae(e, t) { | ||
function Ne(e, t) { | ||
const n = new O(), r = l(); | ||
h(() => { | ||
m(() => { | ||
r.value && n.fire(), r.value = a(t); | ||
}), s(G.registerFoldingRangeProvider( | ||
}), u(Q.registerFoldingRangeProvider( | ||
e, | ||
{ | ||
onDidChangeFoldingRanges: n.event, | ||
provideFoldingRanges(i, o, u) { | ||
var v; | ||
return (v = r.value) == null ? void 0 : v.call(r, i, o, u); | ||
provideFoldingRanges(i, o, s) { | ||
var d; | ||
return (d = r.value) == null ? void 0 : d.call(r, i, o, s); | ||
} | ||
@@ -304,40 +310,40 @@ } | ||
} | ||
function Ne(e, t, n, r) { | ||
const i = s(b.createFileSystemWatcher(e, t, n, r)); | ||
function Le(e, t, n, r) { | ||
const i = u(C.createFileSystemWatcher(e, t, n, r)); | ||
return { | ||
...i, | ||
onDidCreate: S(i.onDidCreate), | ||
onDidChange: S(i.onDidChange), | ||
onDidDelete: S(i.onDidDelete) | ||
onDidCreate: p(i.onDidCreate), | ||
onDidChange: p(i.onDidChange), | ||
onDidDelete: p(i.onDidDelete) | ||
}; | ||
} | ||
const Fe = g(() => { | ||
const e = _(); | ||
return d(() => e.value.kind === V.Dark || e.value.kind === V.HighContrast); | ||
}), Le = g(() => { | ||
const We = h(() => { | ||
const e = ee(); | ||
return f(() => e.value.kind === A.Dark || e.value.kind === A.HighContrast); | ||
}), Fe = h(() => { | ||
const e = l(T.isTelemetryEnabled); | ||
return s(T.onDidChangeTelemetryEnabled((t) => { | ||
return u(T.onDidChangeTelemetryEnabled((t) => { | ||
e.value = t; | ||
})), d(() => e.value); | ||
})), f(() => e.value); | ||
}); | ||
function Oe(e, ...t) { | ||
return d(() => typeof t[0] == "object" ? A.t(a(e), J(t[0])) : A.t(a(e), ...t.map(a))); | ||
return f(() => typeof t[0] == "object" ? N.t(a(e), K(t[0])) : N.t(a(e), ...t.map(a))); | ||
} | ||
const We = g(() => { | ||
const $e = h(() => { | ||
const e = l(T.logLevel); | ||
return s(T.onDidChangeLogLevel((t) => { | ||
return u(T.onDidChangeLogLevel((t) => { | ||
e.value = t; | ||
})), d(() => e.value); | ||
})), f(() => e.value); | ||
}); | ||
function ae(e, t) { | ||
return s(c.createOutputChannel(e, t)); | ||
function oe(e, t) { | ||
return u(c.createOutputChannel(e, t)); | ||
} | ||
function $e(e) { | ||
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"); | ||
return `${n}-${r}-${i} ${o}:${u}:${v}.${f} [${e}] `; | ||
function Ie(e) { | ||
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"); | ||
return `${n}-${r}-${i} ${o}:${s}:${d}.${v} [${e}] `; | ||
} | ||
function oe(e, t = {}) { | ||
const n = t.outputChannel ?? ae(e), r = (i) => (...o) => { | ||
var u; | ||
n.appendLine((((u = t.getPrefix) == null ? void 0 : u.call(t, i)) ?? "") + o.join(" ")); | ||
function ue(e, t = {}) { | ||
const n = t.outputChannel ?? oe(e), r = (i) => (...o) => { | ||
var s; | ||
n.appendLine((((s = t.getPrefix) == null ? void 0 : s.call(t, i)) ?? "") + o.join(" ")); | ||
}; | ||
@@ -358,11 +364,11 @@ return { | ||
} | ||
function ue(e) { | ||
function se(e) { | ||
var n; | ||
const t = l(((n = a(e)) == null ? void 0 : n.selections) ?? []); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var r; | ||
t.value = ((r = a(e)) == null ? void 0 : r.selections) ?? []; | ||
}), s(c.onDidChangeNotebookEditorSelection((r) => { | ||
}), u(c.onDidChangeNotebookEditorSelection((r) => { | ||
r.notebookEditor === a(e) && (t.value = r.selections); | ||
})), d({ | ||
})), f({ | ||
get() { | ||
@@ -378,5 +384,5 @@ return t.value; | ||
} | ||
function Ie(e) { | ||
const t = ue(e); | ||
return d({ | ||
function Pe(e) { | ||
const t = se(e); | ||
return f({ | ||
get() { | ||
@@ -390,13 +396,13 @@ return t.value[0]; | ||
} | ||
function Pe(e) { | ||
function Me(e) { | ||
var n; | ||
const t = l(((n = a(e)) == null ? void 0 : n.visibleRanges) ?? []); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var r; | ||
t.value = ((r = a(e)) == null ? void 0 : r.visibleRanges) ?? []; | ||
}), s(c.onDidChangeNotebookEditorVisibleRanges((r) => { | ||
}), u(c.onDidChangeNotebookEditorVisibleRanges((r) => { | ||
r.notebookEditor === a(e) && (t.value = r.visibleRanges); | ||
})), d(() => t.value); | ||
})), f(() => t.value); | ||
} | ||
const Me = g(() => { | ||
const je = h(() => { | ||
const e = l(c.terminals); | ||
@@ -406,9 +412,9 @@ function t() { | ||
} | ||
return s(c.onDidOpenTerminal(t)), s(c.onDidCloseTerminal(t)), e; | ||
return u(c.onDidOpenTerminal(t)), u(c.onDidCloseTerminal(t)), e; | ||
}); | ||
function je(e) { | ||
const t = s(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority)); | ||
function Be(e) { | ||
const t = u(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority)); | ||
function n(r) { | ||
const i = e[r]; | ||
i != null && h(() => t[r] = a(i)); | ||
i != null && m(() => t[r] = a(i)); | ||
} | ||
@@ -425,3 +431,3 @@ return [ | ||
} | ||
const Be = g(() => { | ||
const He = h(() => { | ||
const e = l(D.taskExecutions); | ||
@@ -431,6 +437,6 @@ function t() { | ||
} | ||
return s(D.onDidStartTask(t)), s(D.onDidEndTask(t)), d(() => e.value); | ||
return u(D.onDidStartTask(t)), u(D.onDidEndTask(t)), f(() => e.value); | ||
}); | ||
function He(...e) { | ||
const t = s(c.createTerminal(...e)); | ||
function Ue(...e) { | ||
const t = u(c.createTerminal(...e)); | ||
return { | ||
@@ -453,22 +459,22 @@ terminal: t, | ||
hide: t.hide.bind(t), | ||
state: M(t) | ||
state: j(t) | ||
}; | ||
} | ||
function se(e, t) { | ||
s(E.registerTextEditorCommand(e, t)); | ||
function ce(e, t) { | ||
u(k.registerTextEditorCommand(e, t)); | ||
} | ||
function Ue(e) { | ||
function qe(e) { | ||
for (const [t, n] of Object.entries(e)) | ||
se(t, n); | ||
ce(t, n); | ||
} | ||
function ce(e, t) { | ||
function le(e, t) { | ||
var r; | ||
const n = l(((r = a(e)) == null ? void 0 : r.selections) ?? []); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var i; | ||
n.value = ((i = a(e)) == null ? void 0 : i.selections) ?? []; | ||
}), s(c.onDidChangeTextEditorSelection((i) => { | ||
const o = a(e), u = a(t); | ||
i.textEditor === o && (!u || u.includes(i.kind)) && (n.value = i.selections); | ||
})), d({ | ||
}), u(c.onDidChangeTextEditorSelection((i) => { | ||
const o = a(e), s = a(t); | ||
i.textEditor === o && (!s || s.includes(i.kind)) && (n.value = i.selections); | ||
})), f({ | ||
get() { | ||
@@ -484,5 +490,5 @@ return n.value; | ||
} | ||
function qe(e, t) { | ||
const n = ce(e, t); | ||
return d({ | ||
function Je(e, t) { | ||
const n = le(e, t); | ||
return f({ | ||
get() { | ||
@@ -496,24 +502,24 @@ return n.value[0]; | ||
} | ||
function Je(e) { | ||
function Ke(e) { | ||
var n; | ||
const t = l((n = a(e)) == null ? void 0 : n.viewColumn); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var r; | ||
t.value = (r = a(e)) == null ? void 0 : r.viewColumn; | ||
}), s(c.onDidChangeTextEditorViewColumn((r) => { | ||
}), u(c.onDidChangeTextEditorViewColumn((r) => { | ||
r.textEditor === a(e) && (t.value = r.viewColumn); | ||
})), d(() => t.value); | ||
})), f(() => t.value); | ||
} | ||
function Ke(e) { | ||
function ze(e) { | ||
var n; | ||
const t = l(((n = a(e)) == null ? void 0 : n.visibleRanges) ?? []); | ||
return C(e, () => { | ||
return b(e, () => { | ||
var r; | ||
t.value = ((r = a(e)) == null ? void 0 : r.visibleRanges) ?? []; | ||
}), s(c.onDidChangeTextEditorVisibleRanges((r) => { | ||
}), u(c.onDidChangeTextEditorVisibleRanges((r) => { | ||
r.textEditor === a(e) && (t.value = r.visibleRanges); | ||
})), d(() => t.value); | ||
})), f(() => t.value); | ||
} | ||
function j(e, t) { | ||
h(() => { | ||
function B(e, t) { | ||
m(() => { | ||
const n = a(e); | ||
@@ -523,4 +529,4 @@ n && (n.badge = a(t)); | ||
} | ||
function B(e, t) { | ||
h(() => { | ||
function H(e, t) { | ||
m(() => { | ||
const n = a(e); | ||
@@ -530,7 +536,7 @@ n && (n.title = a(t)); | ||
} | ||
const ze = W( | ||
const Ye = $( | ||
(e, t, n) => { | ||
const r = re(); | ||
C(t, () => r.fire()), n != null && n.watchSource && C(n.watchSource, () => r.fire()); | ||
const i = /* @__PURE__ */ new WeakMap(), o = s(c.createTreeView(e, { | ||
const r = ie(); | ||
b(t, () => r.fire()), n != null && n.watchSource && b(n.watchSource, () => r.fire()); | ||
const i = /* @__PURE__ */ new WeakMap(), o = u(c.createTreeView(e, { | ||
...n, | ||
@@ -540,21 +546,21 @@ treeDataProvider: { | ||
onDidChangeTreeData: r.event, | ||
getTreeItem(u) { | ||
return u.treeItem; | ||
getTreeItem(s) { | ||
return s.treeItem; | ||
}, | ||
getChildren(u) { | ||
var v; | ||
return u ? ((v = u.children) == null || v.forEach((f) => i.set(f, u)), u.children) : a(t); | ||
getChildren(s) { | ||
var d; | ||
return s ? ((d = s.children) == null || d.forEach((v) => i.set(v, s)), s.children) : a(t); | ||
}, | ||
getParent(u) { | ||
return i.get(u); | ||
getParent(s) { | ||
return i.get(s); | ||
} | ||
} | ||
})); | ||
return n != null && n.title && B(o, n.title), n != null && n.badge && j(o, n.badge), o; | ||
return n != null && n.title && H(o, n.title), n != null && n.badge && B(o, n.badge), o; | ||
}, | ||
(e) => e | ||
); | ||
function Ye(e) { | ||
function Ge(e) { | ||
var r; | ||
const t = x((r = a(e)) == null ? void 0 : r.visible); | ||
const t = E((r = a(e)) == null ? void 0 : r.visible); | ||
function n() { | ||
@@ -564,35 +570,35 @@ var i; | ||
} | ||
return h((i) => { | ||
return m((i) => { | ||
const o = a(e); | ||
if (o) { | ||
const u = o.onDidChangeVisibility(n); | ||
i(() => u.dispose()); | ||
const s = o.onDidChangeVisibility(n); | ||
i(() => s.dispose()); | ||
} | ||
}), h(n), d(() => !!t.value); | ||
}), m(n), f(() => !!t.value); | ||
} | ||
const Ge = g(() => { | ||
const Qe = h(() => { | ||
const e = l(c.visibleNotebookEditors); | ||
return s(c.onDidChangeVisibleNotebookEditors((t) => { | ||
return u(c.onDidChangeVisibleNotebookEditors((t) => { | ||
e.value = t; | ||
})), e; | ||
}), Qe = g(() => { | ||
}), Xe = h(() => { | ||
const e = l(c.visibleTextEditors); | ||
return s(c.onDidChangeVisibleTextEditors((t) => { | ||
return u(c.onDidChangeVisibleTextEditors((t) => { | ||
e.value = t; | ||
})), e; | ||
}); | ||
function Xe(e, t, n = !0) { | ||
const r = K(t) ? t : typeof t == "function" ? d(t) : x(t); | ||
return h(() => { | ||
a(n) && E.executeCommand("setContext", e, r.value); | ||
function Ze(e, t, n = !0) { | ||
const r = z(t) ? t : typeof t == "function" ? f(t) : E(t); | ||
return m(() => { | ||
a(n) && k.executeCommand("setContext", e, r.value); | ||
}), r; | ||
} | ||
const Ze = W( | ||
const _e = $( | ||
(e, t, n) => { | ||
const r = l(), i = l(); | ||
s(c.registerWebviewViewProvider( | ||
u(c.registerWebviewViewProvider( | ||
e, | ||
{ | ||
resolveWebviewView(f, m) { | ||
r.value = f, i.value = m, n != null && n.onDidReceiveMessage && f.webview.onDidReceiveMessage(n.onDidReceiveMessage); | ||
resolveWebviewView(v, g) { | ||
r.value = v, i.value = g, n != null && n.onDidReceiveMessage && v.webview.onDidReceiveMessage(n.onDidReceiveMessage); | ||
} | ||
@@ -606,105 +612,105 @@ }, | ||
)); | ||
const o = x(0); | ||
function u() { | ||
const o = E(0); | ||
function s() { | ||
o.value++; | ||
} | ||
if (h(() => { | ||
if (m(() => { | ||
r.value && (r.value.webview.html = `${a(t)}<!--${o.value}-->`); | ||
}), n != null && n.webviewOptions) { | ||
const f = n.webviewOptions; | ||
h(() => { | ||
r.value && (r.value.webview.options = a(f)); | ||
const v = n.webviewOptions; | ||
m(() => { | ||
r.value && (r.value.webview.options = a(v)); | ||
}); | ||
} | ||
n != null && n.title && B(r, n.title), n != null && n.badge && j(r, n.badge); | ||
function v(f) { | ||
var m; | ||
return (m = r.value) == null ? void 0 : m.webview.postMessage(f); | ||
n != null && n.title && H(r, n.title), n != null && n.badge && B(r, n.badge); | ||
function d(v) { | ||
var g; | ||
return (g = r.value) == null ? void 0 : g.webview.postMessage(v); | ||
} | ||
return { view: r, context: i, postMessage: v, forceRefresh: u }; | ||
return { view: r, context: i, postMessage: d, forceRefresh: s }; | ||
}, | ||
(e) => e | ||
), _e = g(() => { | ||
), et = h(() => { | ||
const e = l(c.state); | ||
return s(c.onDidChangeWindowState((t) => { | ||
return u(c.onDidChangeWindowState((t) => { | ||
e.value = t; | ||
})), { | ||
focused: d(() => e.value.focused), | ||
active: d(() => e.value.active) | ||
focused: f(() => e.value.focused), | ||
active: f(() => e.value.active) | ||
}; | ||
}), et = g(() => { | ||
const e = l(b.workspaceFolders); | ||
return s(b.onDidChangeWorkspaceFolders(() => { | ||
e.value = b.workspaceFolders; | ||
})), d(() => e.value); | ||
}), tt = h(() => { | ||
const e = l(C.workspaceFolders); | ||
return u(C.onDidChangeWorkspaceFolders(() => { | ||
e.value = C.workspaceFolders; | ||
})), f(() => e.value); | ||
}); | ||
export { | ||
I as activateCbs, | ||
W as createKeyedComposable, | ||
g as createSingletonComposable, | ||
$ as deactivateCbs, | ||
ge as defineConfigObject, | ||
X as defineConfigs, | ||
ve as defineExtension, | ||
he as defineLogger, | ||
me as executeCommand, | ||
p as extensionContext, | ||
R as extensionScope, | ||
$e as getDefaultLoggerPrefix, | ||
P as onActivate, | ||
fe as onDeactivate, | ||
Q as tryOnScopeDispose, | ||
P as activateCbs, | ||
$ as createKeyedComposable, | ||
h as createSingletonComposable, | ||
I as deactivateCbs, | ||
he as defineConfigObject, | ||
Z as defineConfigs, | ||
ge as defineExtension, | ||
me as defineLogger, | ||
Ce as executeCommand, | ||
x as extensionContext, | ||
y as extensionScope, | ||
Ie as getDefaultLoggerPrefix, | ||
M as onActivate, | ||
ve as onDeactivate, | ||
X as tryOnScopeDispose, | ||
be as useAbsolutePath, | ||
_ as useActiveColorTheme, | ||
Ce as useActiveDebugSession, | ||
we as useActiveEditorDecorations, | ||
Te as useActiveNotebookEditor, | ||
De as useActiveTerminal, | ||
ee as useActiveTextEditor, | ||
Se as useAllExtensions, | ||
ne as useCommand, | ||
pe as useCommands, | ||
xe as useCommentController, | ||
Ee as useControlledTerminal, | ||
ke as useDefaultShell, | ||
s as useDisposable, | ||
Re as useDocumentText, | ||
te as useEditorDecorations, | ||
S as useEvent, | ||
re as useEventEmitter, | ||
ye as useFetchTasks, | ||
Ve as useFileUri, | ||
Ae as useFoldingRangeProvider, | ||
Ne as useFsWatcher, | ||
Fe as useIsDarkTheme, | ||
Le as useIsTelemetryEnabled, | ||
ee as useActiveColorTheme, | ||
we as useActiveDebugSession, | ||
Te as useActiveEditorDecorations, | ||
De as useActiveNotebookEditor, | ||
Se as useActiveTerminal, | ||
te as useActiveTextEditor, | ||
pe as useAllExtensions, | ||
re as useCommand, | ||
xe as useCommands, | ||
Ee as useCommentController, | ||
ke as useControlledTerminal, | ||
Re as useDefaultShell, | ||
u as useDisposable, | ||
ye as useDocumentText, | ||
ne as useEditorDecorations, | ||
p as useEvent, | ||
ie as useEventEmitter, | ||
Ve as useFetchTasks, | ||
Ae as useFileUri, | ||
Ne as useFoldingRangeProvider, | ||
Le as useFsWatcher, | ||
We as useIsDarkTheme, | ||
Fe as useIsTelemetryEnabled, | ||
Oe as useL10nText, | ||
We as useLogLevel, | ||
oe as useLogger, | ||
Ie as useNotebookEditorSelection, | ||
ue as useNotebookEditorSelections, | ||
Pe as useNotebookEditorVisibleRanges, | ||
Me as useOpenedTerminals, | ||
ae as useOutputChannel, | ||
je as useStatusBarItem, | ||
Be as useTaskExecutions, | ||
He as useTerminal, | ||
M as useTerminalState, | ||
se as useTextEditorCommand, | ||
Ue as useTextEditorCommands, | ||
qe as useTextEditorSelection, | ||
ce as useTextEditorSelections, | ||
Je as useTextEditorViewColumn, | ||
Ke as useTextEditorVisibleRanges, | ||
ze as useTreeView, | ||
ie as useUri, | ||
j as useViewBadge, | ||
B as useViewTitle, | ||
Ye as useViewVisibility, | ||
Ge as useVisibleNotebookEditors, | ||
Qe as useVisibleTextEditors, | ||
Xe as useVscodeContext, | ||
Ze as useWebviewView, | ||
_e as useWindowState, | ||
et as useWorkspaceFolders | ||
$e as useLogLevel, | ||
ue as useLogger, | ||
Pe as useNotebookEditorSelection, | ||
se as useNotebookEditorSelections, | ||
Me as useNotebookEditorVisibleRanges, | ||
je as useOpenedTerminals, | ||
oe as useOutputChannel, | ||
Be as useStatusBarItem, | ||
He as useTaskExecutions, | ||
Ue as useTerminal, | ||
j as useTerminalState, | ||
ce as useTextEditorCommand, | ||
qe as useTextEditorCommands, | ||
Je as useTextEditorSelection, | ||
le as useTextEditorSelections, | ||
Ke as useTextEditorViewColumn, | ||
ze as useTextEditorVisibleRanges, | ||
Ye as useTreeView, | ||
ae as useUri, | ||
B as useViewBadge, | ||
H as useViewTitle, | ||
Ge as useViewVisibility, | ||
Qe as useVisibleNotebookEditors, | ||
Xe as useVisibleTextEditors, | ||
Ze as useVscodeContext, | ||
_e as useWebviewView, | ||
et as useWindowState, | ||
tt as useWorkspaceFolders | ||
}; |
{ | ||
"name": "reactive-vscode", | ||
"type": "module", | ||
"version": "0.2.0-beta.5", | ||
"version": "0.2.0-beta.6", | ||
"description": "Develop VSCode extension with Vue Reactivity API", | ||
@@ -40,3 +40,3 @@ "author": "_Kerman <kermanx@qq.com>", | ||
"dependencies": { | ||
"@reactive-vscode/reactivity": "0.2.0-beta.5" | ||
"@reactive-vscode/reactivity": "0.2.0-beta.6" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
48168
0.69%1282
0.63%+ Added
- Removed