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