reactive-vscode 0.2.0-beta.5 → 0.2.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -8
- package/dist/index.js +297 -291
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { TreeDataProvider } from 'vscode';
|
|
|
46
46
|
import { TreeItem } from 'vscode';
|
|
47
47
|
import { TreeView } from 'vscode';
|
|
48
48
|
import { TreeViewOptions } from 'vscode';
|
|
49
|
+
import { UnwrapNestedRefs } from '@reactive-vscode/reactivity';
|
|
49
50
|
import { Uri } from 'vscode';
|
|
50
51
|
import { ViewBadge } from 'vscode';
|
|
51
52
|
import { ViewColumn } from 'vscode';
|
|
@@ -61,7 +62,7 @@ export declare interface Commands extends Record<string, (...args: any[]) => any
|
|
|
61
62
|
'vscode.open': (uri: Uri) => void;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
export declare type ConfigObject<C extends object> =
|
|
65
|
+
export declare type ConfigObject<C extends object> = UnwrapNestedRefs<C> & {
|
|
65
66
|
/**
|
|
66
67
|
* Write the configuration value to the workspace.
|
|
67
68
|
*
|
|
@@ -72,7 +73,7 @@ export declare type ConfigObject<C extends object> = ShallowReactive<C & {
|
|
|
72
73
|
* Set the value without updating the workspace.
|
|
73
74
|
*/
|
|
74
75
|
$set: (key: keyof C, value: C[keyof C]) => void;
|
|
75
|
-
}
|
|
76
|
+
};
|
|
76
77
|
|
|
77
78
|
export declare interface ConfigRef<T> extends WritableComputedRef<T> {
|
|
78
79
|
/**
|
|
@@ -91,7 +92,7 @@ export declare interface ConfigType<T> extends ObjectConstructor {
|
|
|
91
92
|
[ConfigTypeSymbol]: T;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
export declare type ConfigTypeOptions = Record<string, ConfigTypeRaw<any>>;
|
|
95
96
|
|
|
96
97
|
declare type ConfigTypeRaw<T> = ConfigTypeSingle<T> | ConfigTypeSingle<T>[];
|
|
97
98
|
|
|
@@ -122,9 +123,9 @@ export declare function createSingletonComposable<T>(fn: () => T): () => T;
|
|
|
122
123
|
*
|
|
123
124
|
* @category lifecycle
|
|
124
125
|
*/
|
|
125
|
-
export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: string
|
|
126
|
+
export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>;
|
|
126
127
|
|
|
127
|
-
export declare function defineConfigObject<C extends object>(section: string
|
|
128
|
+
export declare function defineConfigObject<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<C>;
|
|
128
129
|
|
|
129
130
|
/**
|
|
130
131
|
* Define configurations of an extension. See `vscode::workspace.getConfiguration`.
|
|
@@ -133,9 +134,9 @@ export declare function defineConfigObject<C extends object>(section: string, co
|
|
|
133
134
|
*
|
|
134
135
|
* @category lifecycle
|
|
135
136
|
*/
|
|
136
|
-
export declare function defineConfigs<const C extends ConfigTypeOptions>(section: string
|
|
137
|
+
export declare function defineConfigs<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<ParseConfigTypeOptions<C>>;
|
|
137
138
|
|
|
138
|
-
export declare function defineConfigs<C extends object>(section: string
|
|
139
|
+
export declare function defineConfigs<C extends object>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ToConfigRefs<C>;
|
|
139
140
|
|
|
140
141
|
/**
|
|
141
142
|
* Define a new extension.
|
|
@@ -218,7 +219,9 @@ declare type OnDeactivateCb = () => void;
|
|
|
218
219
|
|
|
219
220
|
declare type ParseConfigType<C extends ConfigTypeRaw<any>> = C extends (infer C1)[] ? (C1 extends ConfigTypeSingle<any> ? ParseConfigType<C1> : never) : C extends ConfigType<infer T> ? T : (C extends typeof String ? string : C extends typeof Number ? number : C extends typeof Boolean ? boolean : C extends typeof Array ? any[] : C extends typeof Object ? Record<string | number, any> : C extends null ? null : never);
|
|
220
221
|
|
|
221
|
-
|
|
222
|
+
export declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = {
|
|
223
|
+
-readonly [K in keyof C]: ParseConfigType<C[K]>;
|
|
224
|
+
};
|
|
222
225
|
|
|
223
226
|
export declare type TextEditorCommandCallback = (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void;
|
|
224
227
|
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
1
|
+
import { getCurrentScope as L, onScopeDispose as W, shallowRef as l, effectScope as q, computed as f, reactive as J, toValue as a, watchEffect as m, watch as b, ref as E, shallowReactive as K, toRaw as z, isRef as Y } from "@reactive-vscode/reactivity";
|
|
2
2
|
export * from "@reactive-vscode/reactivity";
|
|
3
|
-
import { workspace as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
3
|
+
import { workspace as C, commands as k, window as c, debug as V, extensions as R, comments as G, env as T, EventEmitter as F, tasks as D, Uri as Q, languages as X, ColorThemeKind as A, l10n as N } from "vscode";
|
|
4
|
+
function Z(e) {
|
|
5
|
+
return L() ? (W(e), !0) : !1;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function O(e, t) {
|
|
8
8
|
const n = /* @__PURE__ */ new Map();
|
|
9
9
|
return (...r) => {
|
|
10
10
|
const i = t(...r);
|
|
@@ -12,81 +12,87 @@ function W(e, t) {
|
|
|
12
12
|
return o ? o.refCount++ : (o = {
|
|
13
13
|
data: e(...r),
|
|
14
14
|
refCount: 1
|
|
15
|
-
}, n.set(i, o)),
|
|
15
|
+
}, n.set(i, o)), Z(() => {
|
|
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 $ = [];
|
|
25
|
-
function
|
|
25
|
+
function ge(e) {
|
|
26
26
|
$.push(e);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
function
|
|
28
|
+
const x = l(null), y = q();
|
|
29
|
+
function he(e) {
|
|
30
30
|
return {
|
|
31
|
-
activate: (t) => (
|
|
31
|
+
activate: (t) => (x.value = t, y.run(() => (I.map((n) => n(t)), e()))),
|
|
32
32
|
deactivate: () => {
|
|
33
|
-
$.map((t) => t()),
|
|
33
|
+
$.map((t) => t()), y.stop();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
const I = [];
|
|
38
38
|
function P(e) {
|
|
39
|
-
|
|
39
|
+
x.value ? e(x.value) : I.push(e);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const r =
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
get: () =>
|
|
41
|
+
function _(e, t, n) {
|
|
42
|
+
const r = !e, i = C.getConfiguration(r ? void 0 : e, n);
|
|
43
|
+
function o(d, v) {
|
|
44
|
+
const g = l(v), S = f({
|
|
45
|
+
get: () => g.value,
|
|
46
46
|
set: (w) => {
|
|
47
|
-
|
|
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, H, U) => {
|
|
51
|
+
await i.update(d, w, H, U), S.value = w;
|
|
52
|
+
}, S.set = (w) => {
|
|
53
|
+
g.value = w;
|
|
54
|
+
}, S;
|
|
55
55
|
}
|
|
56
|
-
const
|
|
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
59
|
return P(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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 me(e, t, n) {
|
|
76
|
+
const r = _(e, t, n);
|
|
77
|
+
return J({
|
|
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) => (...
|
|
87
|
+
function Ce(e, t) {
|
|
88
|
+
const n = l(null), r = [], i = (o) => (...s) => n.value ? n.value[o](...s) : (r.push([o, s]), null);
|
|
83
89
|
return P(() => {
|
|
84
|
-
n.value =
|
|
85
|
-
for (const [o,
|
|
86
|
-
n.value[o](...
|
|
90
|
+
n.value = se(e, t);
|
|
91
|
+
for (const [o, s] of r)
|
|
92
|
+
n.value[o](...s);
|
|
87
93
|
}), {
|
|
88
94
|
logger: n,
|
|
89
|
-
outputChannel:
|
|
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 be(e, ...t) {
|
|
111
|
+
return k.executeCommand(e, ...t);
|
|
106
112
|
}
|
|
107
|
-
function
|
|
108
|
-
const n =
|
|
113
|
+
function ee(e, t = !1) {
|
|
114
|
+
const n = x.value;
|
|
109
115
|
if (!n && !t)
|
|
110
116
|
throw new Error("Cannot get absolute path because the extension is not activated yet");
|
|
111
117
|
return n == null ? void 0 : n.asAbsolutePath(e);
|
|
112
118
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
119
|
+
function we(e, t = !1) {
|
|
120
|
+
return f(() => ee(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 te = 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
|
+
}), Te = 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
|
+
}), ne = 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 re(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 De(e, t) {
|
|
149
|
+
const n = ne();
|
|
150
|
+
re(n, e, t);
|
|
145
151
|
}
|
|
146
|
-
const
|
|
152
|
+
const Se = 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
|
+
}), pe = 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
|
+
}), xe = h(() => {
|
|
163
|
+
const e = l(R.all);
|
|
164
|
+
return u(R.onDidChange(() => {
|
|
165
|
+
e.value = R.all;
|
|
166
|
+
})), f(() => e.value);
|
|
161
167
|
});
|
|
162
|
-
function
|
|
163
|
-
|
|
168
|
+
function ie(e, t) {
|
|
169
|
+
u(k.registerCommand(e, t));
|
|
164
170
|
}
|
|
165
|
-
function
|
|
171
|
+
function Ee(e) {
|
|
166
172
|
for (const [t, n] of Object.entries(e))
|
|
167
|
-
n &&
|
|
173
|
+
n && ie(t, n);
|
|
168
174
|
}
|
|
169
|
-
function
|
|
170
|
-
return
|
|
175
|
+
function ke(e, t) {
|
|
176
|
+
return u(G.createCommentController(e, t));
|
|
171
177
|
}
|
|
172
178
|
function M(e) {
|
|
173
179
|
var n;
|
|
174
180
|
const t = l((n = a(e)) == null ? void 0 : n.state);
|
|
175
|
-
return
|
|
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 Re(...e) {
|
|
189
|
+
const t = E(null);
|
|
184
190
|
function n() {
|
|
185
191
|
return !!t.value && t.value.exitStatus == null;
|
|
186
192
|
}
|
|
187
193
|
function r() {
|
|
188
194
|
return n() ? t.value : t.value = c.createTerminal(...e);
|
|
189
195
|
}
|
|
190
|
-
function i(
|
|
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:
|
|
210
|
+
close: s,
|
|
205
211
|
state: M(t)
|
|
206
212
|
};
|
|
207
213
|
}
|
|
208
|
-
const
|
|
214
|
+
const ye = 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 Ve(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 ae(e, t = []) {
|
|
237
|
+
const n = Array.isArray(e) ? e : t ?? [], r = u(Array.isArray(e) || e == null ? new F() : e), i = p(r.event, n);
|
|
232
238
|
for (const o of n)
|
|
233
239
|
i(o);
|
|
234
240
|
return {
|
|
@@ -237,11 +243,11 @@ function re(e, t = []) {
|
|
|
237
243
|
addListener: i
|
|
238
244
|
};
|
|
239
245
|
}
|
|
240
|
-
function
|
|
241
|
-
return
|
|
246
|
+
function Ae(e) {
|
|
247
|
+
return f(() => D.fetchTasks(a(e)));
|
|
242
248
|
}
|
|
243
|
-
function
|
|
244
|
-
return
|
|
249
|
+
function oe(e) {
|
|
250
|
+
return K({
|
|
245
251
|
get scheme() {
|
|
246
252
|
return a(e).scheme;
|
|
247
253
|
},
|
|
@@ -271,62 +277,62 @@ function ie(e) {
|
|
|
271
277
|
}
|
|
272
278
|
});
|
|
273
279
|
}
|
|
274
|
-
function
|
|
275
|
-
return
|
|
280
|
+
function Ne(e) {
|
|
281
|
+
return oe(() => Q.file(a(e)));
|
|
276
282
|
}
|
|
277
|
-
function
|
|
278
|
-
const n = new
|
|
279
|
-
|
|
283
|
+
function Le(e, t) {
|
|
284
|
+
const n = new F(), r = l();
|
|
285
|
+
m(() => {
|
|
280
286
|
r.value && n.fire(), r.value = a(t);
|
|
281
|
-
}),
|
|
287
|
+
}), u(X.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 We(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 Fe =
|
|
302
|
-
const e =
|
|
303
|
-
return
|
|
304
|
-
}),
|
|
307
|
+
const Fe = h(() => {
|
|
308
|
+
const e = te();
|
|
309
|
+
return f(() => e.value.kind === A.Dark || e.value.kind === A.HighContrast);
|
|
310
|
+
}), Oe = h(() => {
|
|
305
311
|
const e = l(T.isTelemetryEnabled);
|
|
306
|
-
return
|
|
312
|
+
return u(T.onDidChangeTelemetryEnabled((t) => {
|
|
307
313
|
e.value = t;
|
|
308
|
-
})),
|
|
314
|
+
})), f(() => e.value);
|
|
309
315
|
});
|
|
310
|
-
function
|
|
311
|
-
return
|
|
316
|
+
function $e(e, ...t) {
|
|
317
|
+
return f(() => typeof t[0] == "object" ? N.t(a(e), z(t[0])) : N.t(a(e), ...t.map(a)));
|
|
312
318
|
}
|
|
313
|
-
const
|
|
319
|
+
const Ie = 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 ue(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 Pe(e) {
|
|
329
|
+
const t = /* @__PURE__ */ new Date(), n = String(t.getFullYear()).padStart(4, "0"), r = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), o = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), d = String(t.getSeconds()).padStart(2, "0"), v = String(t.getMilliseconds()).padStart(3, "0");
|
|
330
|
+
return `${n}-${r}-${i} ${o}:${s}:${d}.${v} [${e}] `;
|
|
325
331
|
}
|
|
326
|
-
function
|
|
327
|
-
const n = t.outputChannel ??
|
|
328
|
-
var
|
|
329
|
-
n.appendLine((((
|
|
332
|
+
function se(e, t = {}) {
|
|
333
|
+
const n = t.outputChannel ?? ue(e), r = (i) => (...o) => {
|
|
334
|
+
var s;
|
|
335
|
+
n.appendLine((((s = t.getPrefix) == null ? void 0 : s.call(t, i)) ?? "") + o.join(" "));
|
|
330
336
|
};
|
|
331
337
|
return {
|
|
332
338
|
outputChannel: n,
|
|
@@ -342,15 +348,15 @@ function oe(e, t = {}) {
|
|
|
342
348
|
hide: n.hide.bind(n)
|
|
343
349
|
};
|
|
344
350
|
}
|
|
345
|
-
function
|
|
351
|
+
function ce(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 Me(e) {
|
|
371
|
+
const t = ce(e);
|
|
372
|
+
return f({
|
|
367
373
|
get() {
|
|
368
374
|
return t.value[0];
|
|
369
375
|
},
|
|
@@ -372,28 +378,28 @@ function Ie(e) {
|
|
|
372
378
|
}
|
|
373
379
|
});
|
|
374
380
|
}
|
|
375
|
-
function
|
|
381
|
+
function je(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 Be = 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 He(e) {
|
|
399
|
+
const t = u(e.id ? c.createStatusBarItem(e.id, e.alignment, e.priority) : c.createStatusBarItem(e.alignment, e.priority));
|
|
394
400
|
function n(r) {
|
|
395
401
|
const i = e[r];
|
|
396
|
-
i != null &&
|
|
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 Ue = 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 qe(...e) {
|
|
422
|
+
const t = u(c.createTerminal(...e));
|
|
417
423
|
return {
|
|
418
424
|
terminal: t,
|
|
419
425
|
get name() {
|
|
@@ -434,23 +440,23 @@ function He(...e) {
|
|
|
434
440
|
state: M(t)
|
|
435
441
|
};
|
|
436
442
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
443
|
+
function le(e, t) {
|
|
444
|
+
u(k.registerTextEditorCommand(e, t));
|
|
439
445
|
}
|
|
440
|
-
function
|
|
446
|
+
function Je(e) {
|
|
441
447
|
for (const [t, n] of Object.entries(e))
|
|
442
|
-
|
|
448
|
+
le(t, n);
|
|
443
449
|
}
|
|
444
|
-
function
|
|
450
|
+
function de(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 Ke(e, t) {
|
|
471
|
+
const n = de(e, t);
|
|
472
|
+
return f({
|
|
467
473
|
get() {
|
|
468
474
|
return n.value[0];
|
|
469
475
|
},
|
|
@@ -472,56 +478,56 @@ function qe(e, t) {
|
|
|
472
478
|
}
|
|
473
479
|
});
|
|
474
480
|
}
|
|
475
|
-
function
|
|
481
|
+
function ze(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 Ye(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
501
|
function j(e, t) {
|
|
496
|
-
|
|
502
|
+
m(() => {
|
|
497
503
|
const n = a(e);
|
|
498
504
|
n && (n.badge = a(t));
|
|
499
505
|
});
|
|
500
506
|
}
|
|
501
507
|
function B(e, t) {
|
|
502
|
-
|
|
508
|
+
m(() => {
|
|
503
509
|
const n = a(e);
|
|
504
510
|
n && (n.title = a(t));
|
|
505
511
|
});
|
|
506
512
|
}
|
|
507
|
-
const
|
|
513
|
+
const Ge = O(
|
|
508
514
|
(e, t, n) => {
|
|
509
|
-
const r =
|
|
510
|
-
|
|
511
|
-
const i = /* @__PURE__ */ new WeakMap(), o =
|
|
515
|
+
const r = ae();
|
|
516
|
+
b(t, () => r.fire()), n != null && n.watchSource && b(n.watchSource, () => r.fire());
|
|
517
|
+
const i = /* @__PURE__ */ new WeakMap(), o = u(c.createTreeView(e, {
|
|
512
518
|
...n,
|
|
513
519
|
treeDataProvider: {
|
|
514
520
|
...n,
|
|
515
521
|
onDidChangeTreeData: r.event,
|
|
516
|
-
getTreeItem(
|
|
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
|
}));
|
|
@@ -529,46 +535,46 @@ const ze = W(
|
|
|
529
535
|
},
|
|
530
536
|
(e) => e
|
|
531
537
|
);
|
|
532
|
-
function
|
|
538
|
+
function Qe(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 Xe = 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
|
+
}), Ze = 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 _e(e, t, n = !0) {
|
|
565
|
+
const r = Y(t) ? t : typeof t == "function" ? f(t) : E(t);
|
|
566
|
+
return m(() => {
|
|
567
|
+
a(n) && k.executeCommand("setContext", e, r.value);
|
|
562
568
|
}), r;
|
|
563
569
|
}
|
|
564
|
-
const
|
|
570
|
+
const et = O(
|
|
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
598
|
n != null && n.title && B(r, n.title), n != null && n.badge && j(r, n.badge);
|
|
593
|
-
function v
|
|
594
|
-
var
|
|
595
|
-
return (
|
|
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
|
+
), tt = 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
|
+
}), nt = h(() => {
|
|
615
|
+
const e = l(C.workspaceFolders);
|
|
616
|
+
return u(C.onDidChangeWorkspaceFolders(() => {
|
|
617
|
+
e.value = C.workspaceFolders;
|
|
618
|
+
})), f(() => e.value);
|
|
613
619
|
});
|
|
614
620
|
export {
|
|
615
621
|
I as activateCbs,
|
|
616
|
-
|
|
617
|
-
|
|
622
|
+
O as createKeyedComposable,
|
|
623
|
+
h as createSingletonComposable,
|
|
618
624
|
$ as deactivateCbs,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
625
|
+
me as defineConfigObject,
|
|
626
|
+
_ as defineConfigs,
|
|
627
|
+
he as defineExtension,
|
|
628
|
+
Ce as defineLogger,
|
|
629
|
+
be as executeCommand,
|
|
630
|
+
x as extensionContext,
|
|
631
|
+
y as extensionScope,
|
|
632
|
+
Pe as getDefaultLoggerPrefix,
|
|
627
633
|
P as onActivate,
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
634
|
+
ge as onDeactivate,
|
|
635
|
+
Z as tryOnScopeDispose,
|
|
636
|
+
we as useAbsolutePath,
|
|
637
|
+
te as useActiveColorTheme,
|
|
638
|
+
Te as useActiveDebugSession,
|
|
639
|
+
De as useActiveEditorDecorations,
|
|
640
|
+
Se as useActiveNotebookEditor,
|
|
641
|
+
pe as useActiveTerminal,
|
|
642
|
+
ne as useActiveTextEditor,
|
|
643
|
+
xe as useAllExtensions,
|
|
644
|
+
ie as useCommand,
|
|
645
|
+
Ee as useCommands,
|
|
646
|
+
ke as useCommentController,
|
|
647
|
+
Re as useControlledTerminal,
|
|
648
|
+
ye as useDefaultShell,
|
|
649
|
+
u as useDisposable,
|
|
650
|
+
Ve as useDocumentText,
|
|
651
|
+
re as useEditorDecorations,
|
|
652
|
+
p as useEvent,
|
|
653
|
+
ae as useEventEmitter,
|
|
654
|
+
Ae as useFetchTasks,
|
|
655
|
+
Ne as useFileUri,
|
|
656
|
+
Le as useFoldingRangeProvider,
|
|
657
|
+
We as useFsWatcher,
|
|
652
658
|
Fe as useIsDarkTheme,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
659
|
+
Oe as useIsTelemetryEnabled,
|
|
660
|
+
$e as useL10nText,
|
|
661
|
+
Ie as useLogLevel,
|
|
662
|
+
se as useLogger,
|
|
663
|
+
Me as useNotebookEditorSelection,
|
|
664
|
+
ce as useNotebookEditorSelections,
|
|
665
|
+
je as useNotebookEditorVisibleRanges,
|
|
666
|
+
Be as useOpenedTerminals,
|
|
667
|
+
ue as useOutputChannel,
|
|
668
|
+
He as useStatusBarItem,
|
|
669
|
+
Ue as useTaskExecutions,
|
|
670
|
+
qe as useTerminal,
|
|
665
671
|
M as useTerminalState,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
672
|
+
le as useTextEditorCommand,
|
|
673
|
+
Je as useTextEditorCommands,
|
|
674
|
+
Ke as useTextEditorSelection,
|
|
675
|
+
de as useTextEditorSelections,
|
|
676
|
+
ze as useTextEditorViewColumn,
|
|
677
|
+
Ye as useTextEditorVisibleRanges,
|
|
678
|
+
Ge as useTreeView,
|
|
679
|
+
oe as useUri,
|
|
674
680
|
j as useViewBadge,
|
|
675
681
|
B as useViewTitle,
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
682
|
+
Qe as useViewVisibility,
|
|
683
|
+
Xe as useVisibleNotebookEditors,
|
|
684
|
+
Ze as useVisibleTextEditors,
|
|
685
|
+
_e as useVscodeContext,
|
|
686
|
+
et as useWebviewView,
|
|
687
|
+
tt as useWindowState,
|
|
688
|
+
nt as useWorkspaceFolders
|
|
683
689
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactive-vscode",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.0-beta.
|
|
4
|
+
"version": "0.2.0-beta.7",
|
|
5
5
|
"description": "Develop VSCode extension with Vue Reactivity API",
|
|
6
6
|
"author": "_Kerman <kermanx@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/vscode": "^1.89.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@reactive-vscode/reactivity": "0.2.0-beta.
|
|
40
|
+
"@reactive-vscode/reactivity": "0.2.0-beta.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.14.2",
|