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