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