act-plus 1.1.22 → 1.1.24
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/act-plus.js +6 -5
- package/act-plus.umd.cjs +94 -1722
- package/lib/{configBtns-c4e55eb0.js → configBtns-15591aad.js} +51 -50
- package/lib/{configFileds-b79642bc.js → configFileds-a045430e.js} +5 -4
- package/lib/{configTable-21f37060.js → configTable-0285d3f8.js} +32 -31
- package/lib/{dialogAddField-535d4a6c.js → dialogAddField-f474439d.js} +5 -4
- package/lib/{dialogConfigBtn-f4b70a91.js → dialogConfigBtn-c97ccee8.js} +5 -4
- package/lib/{dialogSiteComponentsParams-a99a4d71.js → dialogSiteComponentsParams-e2c5b8dd.js} +1 -1
- package/lib/{index-cb908890.js → index-36c9cd81.js} +15 -14
- package/lib/{index-f2795fa7.js → index-3e20553c.js} +11 -10
- package/lib/{index-79e6c123.js → index-7de949f6.js} +4 -3
- package/lib/{index-742c1da3.js → index-85deefc8.js} +5 -4
- package/lib/index-d0c3be37.js +68438 -0
- package/lib/{index-14906725.js → index-f58e1535.js} +31 -30
- package/package.json +1 -1
- package/style.css +1 -1
- package/assets/css.worker-1af1972f.js +0 -84
- package/assets/editor.worker-df55e1ff.js +0 -8
- package/assets/html.worker-38c267f1.js +0 -456
- package/assets/json.worker-bf861c27.js +0 -39
- package/assets/ts.worker-e151483b.js +0 -33972
- package/lib/abap-1354785f.js +0 -1314
- package/lib/apex-279d4f27.js +0 -315
- package/lib/azcli-ba812c55.js +0 -74
- package/lib/bat-4d77495d.js +0 -95
- package/lib/bicep-7b240724.js +0 -108
- package/lib/cameligo-5d2daeb8.js +0 -168
- package/lib/clojure-b7ea12a3.js +0 -754
- package/lib/coffee-1a8cfbf4.js +0 -228
- package/lib/cpp-642b10c4.js +0 -387
- package/lib/csharp-d987ddad.js +0 -320
- package/lib/csp-96407af0.js +0 -57
- package/lib/css-5dd354ac.js +0 -186
- package/lib/cssMode-049c1acb.js +0 -1448
- package/lib/cypher-11e5a4b6.js +0 -262
- package/lib/dart-5d209f63.js +0 -270
- package/lib/dockerfile-8739cff7.js +0 -132
- package/lib/ecl-a20c5155.js +0 -454
- package/lib/elixir-8b028584.js +0 -467
- package/lib/flow9-0dea2e73.js +0 -141
- package/lib/freemarker2-c93dec09.js +0 -646
- package/lib/fsharp-49a70fad.js +0 -210
- package/lib/go-46e3b371.js +0 -208
- package/lib/graphql-51a577e5.js +0 -141
- package/lib/handlebars-8a7428d8.js +0 -394
- package/lib/hcl-56b85754.js +0 -177
- package/lib/html-2fad443c.js +0 -284
- package/lib/htmlMode-3c13e1c6.js +0 -1458
- package/lib/index-a2634eef.js +0 -162522
- package/lib/ini-1d58d82f.js +0 -68
- package/lib/java-cd017f60.js +0 -221
- package/lib/javascript-2ec13b45.js +0 -78
- package/lib/jsonMode-33ed8d99.js +0 -1869
- package/lib/julia-a0caf483.js +0 -496
- package/lib/kotlin-c6e52a56.js +0 -245
- package/lib/less-718543b4.js +0 -168
- package/lib/lexon-5e6e7a44.js +0 -151
- package/lib/liquid-40ee460a.js +0 -241
- package/lib/lua-f159160b.js +0 -157
- package/lib/m3-aadaf771.js +0 -210
- package/lib/markdown-9b448c46.js +0 -202
- package/lib/mips-161e49ce.js +0 -194
- package/lib/msdax-f65cb1e6.js +0 -377
- package/lib/mysql-24549dd1.js +0 -875
- package/lib/objective-c-e129a5ca.js +0 -188
- package/lib/pascal-4ccdf5ce.js +0 -245
- package/lib/pascaligo-a9603dcd.js +0 -158
- package/lib/perl-ba1fb97a.js +0 -599
- package/lib/pgsql-89978310.js +0 -843
- package/lib/php-987b9d87.js +0 -471
- package/lib/pla-96c2695d.js +0 -131
- package/lib/postiats-7b52ebac.js +0 -544
- package/lib/powerquery-8954ec26.js +0 -890
- package/lib/powershell-f00d0274.js +0 -233
- package/lib/protobuf-3eb85f80.js +0 -422
- package/lib/pug-6fab415a.js +0 -393
- package/lib/python-852dc2c1.js +0 -262
- package/lib/qsharp-4792f872.js +0 -282
- package/lib/r-630f5d6b.js +0 -245
- package/lib/razor-c24d586d.js +0 -515
- package/lib/redis-276b8288.js +0 -298
- package/lib/redshift-520a7359.js +0 -806
- package/lib/restructuredtext-4676a3fc.js +0 -162
- package/lib/ruby-764137cd.js +0 -444
- package/lib/rust-97f8f6e1.js +0 -337
- package/lib/sb-8c22f14c.js +0 -110
- package/lib/scala-c68c650c.js +0 -353
- package/lib/scheme-e6a52cb0.js +0 -114
- package/lib/scss-45104c77.js +0 -244
- package/lib/shell-09452d42.js +0 -224
- package/lib/solidity-d4979008.js +0 -1351
- package/lib/sophia-21995caf.js +0 -190
- package/lib/sparql-5088743c.js +0 -193
- package/lib/sql-63ec8e76.js +0 -818
- package/lib/st-fa9ab362.js +0 -414
- package/lib/swift-abdf1835.js +0 -315
- package/lib/systemverilog-a4f858ed.js +0 -556
- package/lib/tcl-8adf937f.js +0 -232
- package/lib/tsMode-6d6244be.js +0 -792
- package/lib/twig-404eb73e.js +0 -323
- package/lib/typescript-807ce4d9.js +0 -330
- package/lib/vb-e21e8153.js +0 -364
- package/lib/xml-cc91b485.js +0 -98
- package/lib/yaml-f2de88bb.js +0 -187
package/lib/tsMode-6d6244be.js
DELETED
|
@@ -1,792 +0,0 @@
|
|
|
1
|
-
var M = Object.defineProperty;
|
|
2
|
-
var K = (e, t, r) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var _ = (e, t, r) => (K(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
-
import { t as R, m as E } from "./index-a2634eef.js";
|
|
5
|
-
import "vue";
|
|
6
|
-
import "vue-router";
|
|
7
|
-
import "element-plus";
|
|
8
|
-
/*!-----------------------------------------------------------------------------
|
|
9
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
|
11
|
-
* Released under the MIT license
|
|
12
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
13
|
-
*-----------------------------------------------------------------------------*/
|
|
14
|
-
var P = Object.defineProperty, H = Object.getOwnPropertyDescriptor, V = Object.getOwnPropertyNames, W = Object.prototype.hasOwnProperty, j = (e, t, r) => t in e ? P(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, T = (e, t, r, s) => {
|
|
15
|
-
if (t && typeof t == "object" || typeof t == "function")
|
|
16
|
-
for (let a of V(t))
|
|
17
|
-
!W.call(e, a) && a !== r && P(e, a, { get: () => t[a], enumerable: !(s = H(t, a)) || s.enumerable });
|
|
18
|
-
return e;
|
|
19
|
-
}, B = (e, t, r) => (T(e, t, "default"), r && T(r, t, "default")), b = (e, t, r) => (j(e, typeof t != "symbol" ? t + "" : t, r), r), i = {};
|
|
20
|
-
B(i, E);
|
|
21
|
-
var U = class {
|
|
22
|
-
constructor(e, t) {
|
|
23
|
-
_(this, "_configChangeListener");
|
|
24
|
-
_(this, "_updateExtraLibsToken");
|
|
25
|
-
_(this, "_extraLibsChangeListener");
|
|
26
|
-
_(this, "_worker");
|
|
27
|
-
_(this, "_client");
|
|
28
|
-
this._modeId = e, this._defaults = t, this._worker = null, this._client = null, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker()), this._updateExtraLibsToken = 0, this._extraLibsChangeListener = this._defaults.onDidExtraLibsChange(() => this._updateExtraLibs());
|
|
29
|
-
}
|
|
30
|
-
dispose() {
|
|
31
|
-
this._configChangeListener.dispose(), this._extraLibsChangeListener.dispose(), this._stopWorker();
|
|
32
|
-
}
|
|
33
|
-
_stopWorker() {
|
|
34
|
-
this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
|
|
35
|
-
}
|
|
36
|
-
async _updateExtraLibs() {
|
|
37
|
-
if (!this._worker)
|
|
38
|
-
return;
|
|
39
|
-
const e = ++this._updateExtraLibsToken, t = await this._worker.getProxy();
|
|
40
|
-
this._updateExtraLibsToken === e && t.updateExtraLibs(this._defaults.getExtraLibs());
|
|
41
|
-
}
|
|
42
|
-
_getClient() {
|
|
43
|
-
return this._client || (this._client = (async () => (this._worker = i.editor.createWebWorker({
|
|
44
|
-
moduleId: "vs/language/typescript/tsWorker",
|
|
45
|
-
label: this._modeId,
|
|
46
|
-
keepIdleModels: !0,
|
|
47
|
-
createData: {
|
|
48
|
-
compilerOptions: this._defaults.getCompilerOptions(),
|
|
49
|
-
extraLibs: this._defaults.getExtraLibs(),
|
|
50
|
-
customWorkerPath: this._defaults.workerOptions.customWorkerPath,
|
|
51
|
-
inlayHintsOptions: this._defaults.inlayHintsOptions
|
|
52
|
-
}
|
|
53
|
-
}), this._defaults.getEagerModelSync() ? await this._worker.withSyncedResources(i.editor.getModels().filter((e) => e.getLanguageId() === this._modeId).map((e) => e.uri)) : await this._worker.getProxy()))()), this._client;
|
|
54
|
-
}
|
|
55
|
-
async getLanguageServiceWorker(...e) {
|
|
56
|
-
const t = await this._getClient();
|
|
57
|
-
return this._worker && await this._worker.withSyncedResources(e), t;
|
|
58
|
-
}
|
|
59
|
-
}, o = {};
|
|
60
|
-
o["lib.d.ts"] = !0;
|
|
61
|
-
o["lib.dom.d.ts"] = !0;
|
|
62
|
-
o["lib.dom.iterable.d.ts"] = !0;
|
|
63
|
-
o["lib.es2015.collection.d.ts"] = !0;
|
|
64
|
-
o["lib.es2015.core.d.ts"] = !0;
|
|
65
|
-
o["lib.es2015.d.ts"] = !0;
|
|
66
|
-
o["lib.es2015.generator.d.ts"] = !0;
|
|
67
|
-
o["lib.es2015.iterable.d.ts"] = !0;
|
|
68
|
-
o["lib.es2015.promise.d.ts"] = !0;
|
|
69
|
-
o["lib.es2015.proxy.d.ts"] = !0;
|
|
70
|
-
o["lib.es2015.reflect.d.ts"] = !0;
|
|
71
|
-
o["lib.es2015.symbol.d.ts"] = !0;
|
|
72
|
-
o["lib.es2015.symbol.wellknown.d.ts"] = !0;
|
|
73
|
-
o["lib.es2016.array.include.d.ts"] = !0;
|
|
74
|
-
o["lib.es2016.d.ts"] = !0;
|
|
75
|
-
o["lib.es2016.full.d.ts"] = !0;
|
|
76
|
-
o["lib.es2017.d.ts"] = !0;
|
|
77
|
-
o["lib.es2017.full.d.ts"] = !0;
|
|
78
|
-
o["lib.es2017.intl.d.ts"] = !0;
|
|
79
|
-
o["lib.es2017.object.d.ts"] = !0;
|
|
80
|
-
o["lib.es2017.sharedmemory.d.ts"] = !0;
|
|
81
|
-
o["lib.es2017.string.d.ts"] = !0;
|
|
82
|
-
o["lib.es2017.typedarrays.d.ts"] = !0;
|
|
83
|
-
o["lib.es2018.asyncgenerator.d.ts"] = !0;
|
|
84
|
-
o["lib.es2018.asynciterable.d.ts"] = !0;
|
|
85
|
-
o["lib.es2018.d.ts"] = !0;
|
|
86
|
-
o["lib.es2018.full.d.ts"] = !0;
|
|
87
|
-
o["lib.es2018.intl.d.ts"] = !0;
|
|
88
|
-
o["lib.es2018.promise.d.ts"] = !0;
|
|
89
|
-
o["lib.es2018.regexp.d.ts"] = !0;
|
|
90
|
-
o["lib.es2019.array.d.ts"] = !0;
|
|
91
|
-
o["lib.es2019.d.ts"] = !0;
|
|
92
|
-
o["lib.es2019.full.d.ts"] = !0;
|
|
93
|
-
o["lib.es2019.object.d.ts"] = !0;
|
|
94
|
-
o["lib.es2019.string.d.ts"] = !0;
|
|
95
|
-
o["lib.es2019.symbol.d.ts"] = !0;
|
|
96
|
-
o["lib.es2020.bigint.d.ts"] = !0;
|
|
97
|
-
o["lib.es2020.d.ts"] = !0;
|
|
98
|
-
o["lib.es2020.full.d.ts"] = !0;
|
|
99
|
-
o["lib.es2020.intl.d.ts"] = !0;
|
|
100
|
-
o["lib.es2020.promise.d.ts"] = !0;
|
|
101
|
-
o["lib.es2020.sharedmemory.d.ts"] = !0;
|
|
102
|
-
o["lib.es2020.string.d.ts"] = !0;
|
|
103
|
-
o["lib.es2020.symbol.wellknown.d.ts"] = !0;
|
|
104
|
-
o["lib.es2021.d.ts"] = !0;
|
|
105
|
-
o["lib.es2021.full.d.ts"] = !0;
|
|
106
|
-
o["lib.es2021.intl.d.ts"] = !0;
|
|
107
|
-
o["lib.es2021.promise.d.ts"] = !0;
|
|
108
|
-
o["lib.es2021.string.d.ts"] = !0;
|
|
109
|
-
o["lib.es2021.weakref.d.ts"] = !0;
|
|
110
|
-
o["lib.es5.d.ts"] = !0;
|
|
111
|
-
o["lib.es6.d.ts"] = !0;
|
|
112
|
-
o["lib.esnext.d.ts"] = !0;
|
|
113
|
-
o["lib.esnext.full.d.ts"] = !0;
|
|
114
|
-
o["lib.esnext.intl.d.ts"] = !0;
|
|
115
|
-
o["lib.esnext.promise.d.ts"] = !0;
|
|
116
|
-
o["lib.esnext.string.d.ts"] = !0;
|
|
117
|
-
o["lib.esnext.weakref.d.ts"] = !0;
|
|
118
|
-
o["lib.scripthost.d.ts"] = !0;
|
|
119
|
-
o["lib.webworker.d.ts"] = !0;
|
|
120
|
-
o["lib.webworker.importscripts.d.ts"] = !0;
|
|
121
|
-
o["lib.webworker.iterable.d.ts"] = !0;
|
|
122
|
-
function F(e, t, r = 0) {
|
|
123
|
-
if (typeof e == "string")
|
|
124
|
-
return e;
|
|
125
|
-
if (e === void 0)
|
|
126
|
-
return "";
|
|
127
|
-
let s = "";
|
|
128
|
-
if (r) {
|
|
129
|
-
s += t;
|
|
130
|
-
for (let a = 0; a < r; a++)
|
|
131
|
-
s += " ";
|
|
132
|
-
}
|
|
133
|
-
if (s += e.messageText, r++, e.next)
|
|
134
|
-
for (const a of e.next)
|
|
135
|
-
s += F(a, t, r);
|
|
136
|
-
return s;
|
|
137
|
-
}
|
|
138
|
-
function k(e) {
|
|
139
|
-
return e ? e.map((t) => t.text).join("") : "";
|
|
140
|
-
}
|
|
141
|
-
var w = class {
|
|
142
|
-
constructor(e) {
|
|
143
|
-
this._worker = e;
|
|
144
|
-
}
|
|
145
|
-
_textSpanToRange(e, t) {
|
|
146
|
-
let r = e.getPositionAt(t.start), s = e.getPositionAt(t.start + t.length), { lineNumber: a, column: u } = r, { lineNumber: c, column: g } = s;
|
|
147
|
-
return { startLineNumber: a, startColumn: u, endLineNumber: c, endColumn: g };
|
|
148
|
-
}
|
|
149
|
-
}, $ = class {
|
|
150
|
-
constructor(e) {
|
|
151
|
-
_(this, "_libFiles");
|
|
152
|
-
_(this, "_hasFetchedLibFiles");
|
|
153
|
-
_(this, "_fetchLibFilesPromise");
|
|
154
|
-
this._worker = e, this._libFiles = {}, this._hasFetchedLibFiles = !1, this._fetchLibFilesPromise = null;
|
|
155
|
-
}
|
|
156
|
-
isLibFile(e) {
|
|
157
|
-
return e && e.path.indexOf("/lib.") === 0 ? !!o[e.path.slice(1)] : !1;
|
|
158
|
-
}
|
|
159
|
-
getOrCreateModel(e) {
|
|
160
|
-
const t = i.Uri.parse(e), r = i.editor.getModel(t);
|
|
161
|
-
if (r)
|
|
162
|
-
return r;
|
|
163
|
-
if (this.isLibFile(t) && this._hasFetchedLibFiles)
|
|
164
|
-
return i.editor.createModel(this._libFiles[t.path.slice(1)], "typescript", t);
|
|
165
|
-
const s = R.getExtraLibs()[e];
|
|
166
|
-
return s ? i.editor.createModel(s.content, "typescript", t) : null;
|
|
167
|
-
}
|
|
168
|
-
_containsLibFile(e) {
|
|
169
|
-
for (let t of e)
|
|
170
|
-
if (this.isLibFile(t))
|
|
171
|
-
return !0;
|
|
172
|
-
return !1;
|
|
173
|
-
}
|
|
174
|
-
async fetchLibFilesIfNecessary(e) {
|
|
175
|
-
this._containsLibFile(e) && await this._fetchLibFiles();
|
|
176
|
-
}
|
|
177
|
-
_fetchLibFiles() {
|
|
178
|
-
return this._fetchLibFilesPromise || (this._fetchLibFilesPromise = this._worker().then((e) => e.getLibFiles()).then((e) => {
|
|
179
|
-
this._hasFetchedLibFiles = !0, this._libFiles = e;
|
|
180
|
-
})), this._fetchLibFilesPromise;
|
|
181
|
-
}
|
|
182
|
-
}, z = class extends w {
|
|
183
|
-
constructor(t, r, s, a) {
|
|
184
|
-
super(a);
|
|
185
|
-
_(this, "_disposables", []);
|
|
186
|
-
_(this, "_listener", /* @__PURE__ */ Object.create(null));
|
|
187
|
-
this._libFiles = t, this._defaults = r, this._selector = s;
|
|
188
|
-
const u = (n) => {
|
|
189
|
-
if (n.getLanguageId() !== s)
|
|
190
|
-
return;
|
|
191
|
-
const p = () => {
|
|
192
|
-
const { onlyVisible: y } = this._defaults.getDiagnosticsOptions();
|
|
193
|
-
y ? n.isAttachedToEditor() && this._doValidate(n) : this._doValidate(n);
|
|
194
|
-
};
|
|
195
|
-
let d;
|
|
196
|
-
const f = n.onDidChangeContent(() => {
|
|
197
|
-
clearTimeout(d), d = window.setTimeout(p, 500);
|
|
198
|
-
}), h = n.onDidChangeAttached(() => {
|
|
199
|
-
const { onlyVisible: y } = this._defaults.getDiagnosticsOptions();
|
|
200
|
-
y && (n.isAttachedToEditor() ? p() : i.editor.setModelMarkers(n, this._selector, []));
|
|
201
|
-
});
|
|
202
|
-
this._listener[n.uri.toString()] = {
|
|
203
|
-
dispose() {
|
|
204
|
-
f.dispose(), h.dispose(), clearTimeout(d);
|
|
205
|
-
}
|
|
206
|
-
}, p();
|
|
207
|
-
}, c = (n) => {
|
|
208
|
-
i.editor.setModelMarkers(n, this._selector, []);
|
|
209
|
-
const p = n.uri.toString();
|
|
210
|
-
this._listener[p] && (this._listener[p].dispose(), delete this._listener[p]);
|
|
211
|
-
};
|
|
212
|
-
this._disposables.push(i.editor.onDidCreateModel((n) => u(n))), this._disposables.push(i.editor.onWillDisposeModel(c)), this._disposables.push(i.editor.onDidChangeModelLanguage((n) => {
|
|
213
|
-
c(n.model), u(n.model);
|
|
214
|
-
})), this._disposables.push({
|
|
215
|
-
dispose() {
|
|
216
|
-
for (const n of i.editor.getModels())
|
|
217
|
-
c(n);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
const g = () => {
|
|
221
|
-
for (const n of i.editor.getModels())
|
|
222
|
-
c(n), u(n);
|
|
223
|
-
};
|
|
224
|
-
this._disposables.push(this._defaults.onDidChange(g)), this._disposables.push(this._defaults.onDidExtraLibsChange(g)), i.editor.getModels().forEach((n) => u(n));
|
|
225
|
-
}
|
|
226
|
-
dispose() {
|
|
227
|
-
this._disposables.forEach((t) => t && t.dispose()), this._disposables = [];
|
|
228
|
-
}
|
|
229
|
-
async _doValidate(t) {
|
|
230
|
-
const r = await this._worker(t.uri);
|
|
231
|
-
if (t.isDisposed())
|
|
232
|
-
return;
|
|
233
|
-
const s = [], { noSyntaxValidation: a, noSemanticValidation: u, noSuggestionDiagnostics: c } = this._defaults.getDiagnosticsOptions();
|
|
234
|
-
a || s.push(r.getSyntacticDiagnostics(t.uri.toString())), u || s.push(r.getSemanticDiagnostics(t.uri.toString())), c || s.push(r.getSuggestionDiagnostics(t.uri.toString()));
|
|
235
|
-
const g = await Promise.all(s);
|
|
236
|
-
if (!g || t.isDisposed())
|
|
237
|
-
return;
|
|
238
|
-
const n = g.reduce((d, f) => f.concat(d), []).filter((d) => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1), p = n.map((d) => d.relatedInformation || []).reduce((d, f) => f.concat(d), []).map((d) => d.file ? i.Uri.parse(d.file.fileName) : null);
|
|
239
|
-
await this._libFiles.fetchLibFilesIfNecessary(p), !t.isDisposed() && i.editor.setModelMarkers(t, this._selector, n.map((d) => this._convertDiagnostics(t, d)));
|
|
240
|
-
}
|
|
241
|
-
_convertDiagnostics(t, r) {
|
|
242
|
-
const s = r.start || 0, a = r.length || 1, { lineNumber: u, column: c } = t.getPositionAt(s), { lineNumber: g, column: n } = t.getPositionAt(s + a), p = [];
|
|
243
|
-
return r.reportsUnnecessary && p.push(i.MarkerTag.Unnecessary), r.reportsDeprecated && p.push(i.MarkerTag.Deprecated), {
|
|
244
|
-
severity: this._tsDiagnosticCategoryToMarkerSeverity(r.category),
|
|
245
|
-
startLineNumber: u,
|
|
246
|
-
startColumn: c,
|
|
247
|
-
endLineNumber: g,
|
|
248
|
-
endColumn: n,
|
|
249
|
-
message: F(r.messageText, `
|
|
250
|
-
`),
|
|
251
|
-
code: r.code.toString(),
|
|
252
|
-
tags: p,
|
|
253
|
-
relatedInformation: this._convertRelatedInformation(t, r.relatedInformation)
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
_convertRelatedInformation(t, r) {
|
|
257
|
-
if (!r)
|
|
258
|
-
return [];
|
|
259
|
-
const s = [];
|
|
260
|
-
return r.forEach((a) => {
|
|
261
|
-
let u = t;
|
|
262
|
-
if (a.file && (u = this._libFiles.getOrCreateModel(a.file.fileName)), !u)
|
|
263
|
-
return;
|
|
264
|
-
const c = a.start || 0, g = a.length || 1, { lineNumber: n, column: p } = u.getPositionAt(c), { lineNumber: d, column: f } = u.getPositionAt(c + g);
|
|
265
|
-
s.push({
|
|
266
|
-
resource: u.uri,
|
|
267
|
-
startLineNumber: n,
|
|
268
|
-
startColumn: p,
|
|
269
|
-
endLineNumber: d,
|
|
270
|
-
endColumn: f,
|
|
271
|
-
message: F(a.messageText, `
|
|
272
|
-
`)
|
|
273
|
-
});
|
|
274
|
-
}), s;
|
|
275
|
-
}
|
|
276
|
-
_tsDiagnosticCategoryToMarkerSeverity(t) {
|
|
277
|
-
switch (t) {
|
|
278
|
-
case 1:
|
|
279
|
-
return i.MarkerSeverity.Error;
|
|
280
|
-
case 3:
|
|
281
|
-
return i.MarkerSeverity.Info;
|
|
282
|
-
case 0:
|
|
283
|
-
return i.MarkerSeverity.Warning;
|
|
284
|
-
case 2:
|
|
285
|
-
return i.MarkerSeverity.Hint;
|
|
286
|
-
}
|
|
287
|
-
return i.MarkerSeverity.Info;
|
|
288
|
-
}
|
|
289
|
-
}, D = class extends w {
|
|
290
|
-
get triggerCharacters() {
|
|
291
|
-
return ["."];
|
|
292
|
-
}
|
|
293
|
-
async provideCompletionItems(e, t, r, s) {
|
|
294
|
-
const a = e.getWordUntilPosition(t), u = new i.Range(t.lineNumber, a.startColumn, t.lineNumber, a.endColumn), c = e.uri, g = e.getOffsetAt(t), n = await this._worker(c);
|
|
295
|
-
if (e.isDisposed())
|
|
296
|
-
return;
|
|
297
|
-
const p = await n.getCompletionsAtPosition(c.toString(), g);
|
|
298
|
-
return !p || e.isDisposed() ? void 0 : {
|
|
299
|
-
suggestions: p.entries.map((f) => {
|
|
300
|
-
var x;
|
|
301
|
-
let h = u;
|
|
302
|
-
if (f.replacementSpan) {
|
|
303
|
-
const v = e.getPositionAt(f.replacementSpan.start), C = e.getPositionAt(f.replacementSpan.start + f.replacementSpan.length);
|
|
304
|
-
h = new i.Range(v.lineNumber, v.column, C.lineNumber, C.column);
|
|
305
|
-
}
|
|
306
|
-
const y = [];
|
|
307
|
-
return ((x = f.kindModifiers) == null ? void 0 : x.indexOf("deprecated")) !== -1 && y.push(i.languages.CompletionItemTag.Deprecated), {
|
|
308
|
-
uri: c,
|
|
309
|
-
position: t,
|
|
310
|
-
offset: g,
|
|
311
|
-
range: h,
|
|
312
|
-
label: f.name,
|
|
313
|
-
insertText: f.name,
|
|
314
|
-
sortText: f.sortText,
|
|
315
|
-
kind: D.convertKind(f.kind),
|
|
316
|
-
tags: y
|
|
317
|
-
};
|
|
318
|
-
})
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
async resolveCompletionItem(e, t) {
|
|
322
|
-
const r = e, s = r.uri, a = r.position, u = r.offset, g = await (await this._worker(s)).getCompletionEntryDetails(s.toString(), u, r.label);
|
|
323
|
-
return g ? {
|
|
324
|
-
uri: s,
|
|
325
|
-
position: a,
|
|
326
|
-
label: g.name,
|
|
327
|
-
kind: D.convertKind(g.kind),
|
|
328
|
-
detail: k(g.displayParts),
|
|
329
|
-
documentation: {
|
|
330
|
-
value: D.createDocumentationString(g)
|
|
331
|
-
}
|
|
332
|
-
} : r;
|
|
333
|
-
}
|
|
334
|
-
static convertKind(e) {
|
|
335
|
-
switch (e) {
|
|
336
|
-
case l.primitiveType:
|
|
337
|
-
case l.keyword:
|
|
338
|
-
return i.languages.CompletionItemKind.Keyword;
|
|
339
|
-
case l.variable:
|
|
340
|
-
case l.localVariable:
|
|
341
|
-
return i.languages.CompletionItemKind.Variable;
|
|
342
|
-
case l.memberVariable:
|
|
343
|
-
case l.memberGetAccessor:
|
|
344
|
-
case l.memberSetAccessor:
|
|
345
|
-
return i.languages.CompletionItemKind.Field;
|
|
346
|
-
case l.function:
|
|
347
|
-
case l.memberFunction:
|
|
348
|
-
case l.constructSignature:
|
|
349
|
-
case l.callSignature:
|
|
350
|
-
case l.indexSignature:
|
|
351
|
-
return i.languages.CompletionItemKind.Function;
|
|
352
|
-
case l.enum:
|
|
353
|
-
return i.languages.CompletionItemKind.Enum;
|
|
354
|
-
case l.module:
|
|
355
|
-
return i.languages.CompletionItemKind.Module;
|
|
356
|
-
case l.class:
|
|
357
|
-
return i.languages.CompletionItemKind.Class;
|
|
358
|
-
case l.interface:
|
|
359
|
-
return i.languages.CompletionItemKind.Interface;
|
|
360
|
-
case l.warning:
|
|
361
|
-
return i.languages.CompletionItemKind.File;
|
|
362
|
-
}
|
|
363
|
-
return i.languages.CompletionItemKind.Property;
|
|
364
|
-
}
|
|
365
|
-
static createDocumentationString(e) {
|
|
366
|
-
let t = k(e.documentation);
|
|
367
|
-
if (e.tags)
|
|
368
|
-
for (const r of e.tags)
|
|
369
|
-
t += `
|
|
370
|
-
|
|
371
|
-
${O(r)}`;
|
|
372
|
-
return t;
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
function O(e) {
|
|
376
|
-
let t = `*@${e.name}*`;
|
|
377
|
-
if (e.name === "param" && e.text) {
|
|
378
|
-
const [r, ...s] = e.text;
|
|
379
|
-
t += `\`${r.text}\``, s.length > 0 && (t += ` — ${s.map((a) => a.text).join(" ")}`);
|
|
380
|
-
} else
|
|
381
|
-
Array.isArray(e.text) ? t += ` — ${e.text.map((r) => r.text).join(" ")}` : e.text && (t += ` — ${e.text}`);
|
|
382
|
-
return t;
|
|
383
|
-
}
|
|
384
|
-
var I = class extends w {
|
|
385
|
-
constructor() {
|
|
386
|
-
super(...arguments);
|
|
387
|
-
_(this, "signatureHelpTriggerCharacters", ["(", ","]);
|
|
388
|
-
}
|
|
389
|
-
static _toSignatureHelpTriggerReason(t) {
|
|
390
|
-
switch (t.triggerKind) {
|
|
391
|
-
case i.languages.SignatureHelpTriggerKind.TriggerCharacter:
|
|
392
|
-
return t.triggerCharacter ? t.isRetrigger ? { kind: "retrigger", triggerCharacter: t.triggerCharacter } : { kind: "characterTyped", triggerCharacter: t.triggerCharacter } : { kind: "invoked" };
|
|
393
|
-
case i.languages.SignatureHelpTriggerKind.ContentChange:
|
|
394
|
-
return t.isRetrigger ? { kind: "retrigger" } : { kind: "invoked" };
|
|
395
|
-
case i.languages.SignatureHelpTriggerKind.Invoke:
|
|
396
|
-
default:
|
|
397
|
-
return { kind: "invoked" };
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
async provideSignatureHelp(t, r, s, a) {
|
|
401
|
-
const u = t.uri, c = t.getOffsetAt(r), g = await this._worker(u);
|
|
402
|
-
if (t.isDisposed())
|
|
403
|
-
return;
|
|
404
|
-
const n = await g.getSignatureHelpItems(u.toString(), c, {
|
|
405
|
-
triggerReason: I._toSignatureHelpTriggerReason(a)
|
|
406
|
-
});
|
|
407
|
-
if (!n || t.isDisposed())
|
|
408
|
-
return;
|
|
409
|
-
const p = {
|
|
410
|
-
activeSignature: n.selectedItemIndex,
|
|
411
|
-
activeParameter: n.argumentIndex,
|
|
412
|
-
signatures: []
|
|
413
|
-
};
|
|
414
|
-
return n.items.forEach((d) => {
|
|
415
|
-
const f = {
|
|
416
|
-
label: "",
|
|
417
|
-
parameters: []
|
|
418
|
-
};
|
|
419
|
-
f.documentation = {
|
|
420
|
-
value: k(d.documentation)
|
|
421
|
-
}, f.label += k(d.prefixDisplayParts), d.parameters.forEach((h, y, x) => {
|
|
422
|
-
const v = k(h.displayParts), C = {
|
|
423
|
-
label: v,
|
|
424
|
-
documentation: {
|
|
425
|
-
value: k(h.documentation)
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
f.label += v, f.parameters.push(C), y < x.length - 1 && (f.label += k(d.separatorDisplayParts));
|
|
429
|
-
}), f.label += k(d.suffixDisplayParts), p.signatures.push(f);
|
|
430
|
-
}), {
|
|
431
|
-
value: p,
|
|
432
|
-
dispose() {
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
}, G = class extends w {
|
|
437
|
-
async provideHover(e, t, r) {
|
|
438
|
-
const s = e.uri, a = e.getOffsetAt(t), u = await this._worker(s);
|
|
439
|
-
if (e.isDisposed())
|
|
440
|
-
return;
|
|
441
|
-
const c = await u.getQuickInfoAtPosition(s.toString(), a);
|
|
442
|
-
if (!c || e.isDisposed())
|
|
443
|
-
return;
|
|
444
|
-
const g = k(c.documentation), n = c.tags ? c.tags.map((d) => O(d)).join(`
|
|
445
|
-
|
|
446
|
-
`) : "", p = k(c.displayParts);
|
|
447
|
-
return {
|
|
448
|
-
range: this._textSpanToRange(e, c.textSpan),
|
|
449
|
-
contents: [
|
|
450
|
-
{
|
|
451
|
-
value: "```typescript\n" + p + "\n```\n"
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
value: g + (n ? `
|
|
455
|
-
|
|
456
|
-
` + n : "")
|
|
457
|
-
}
|
|
458
|
-
]
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
}, J = class extends w {
|
|
462
|
-
async provideDocumentHighlights(e, t, r) {
|
|
463
|
-
const s = e.uri, a = e.getOffsetAt(t), u = await this._worker(s);
|
|
464
|
-
if (e.isDisposed())
|
|
465
|
-
return;
|
|
466
|
-
const c = await u.getOccurrencesAtPosition(s.toString(), a);
|
|
467
|
-
if (!(!c || e.isDisposed()))
|
|
468
|
-
return c.map((g) => ({
|
|
469
|
-
range: this._textSpanToRange(e, g.textSpan),
|
|
470
|
-
kind: g.isWriteAccess ? i.languages.DocumentHighlightKind.Write : i.languages.DocumentHighlightKind.Text
|
|
471
|
-
}));
|
|
472
|
-
}
|
|
473
|
-
}, Q = class extends w {
|
|
474
|
-
constructor(e, t) {
|
|
475
|
-
super(t), this._libFiles = e;
|
|
476
|
-
}
|
|
477
|
-
async provideDefinition(e, t, r) {
|
|
478
|
-
const s = e.uri, a = e.getOffsetAt(t), u = await this._worker(s);
|
|
479
|
-
if (e.isDisposed())
|
|
480
|
-
return;
|
|
481
|
-
const c = await u.getDefinitionAtPosition(s.toString(), a);
|
|
482
|
-
if (!c || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(c.map((n) => i.Uri.parse(n.fileName))), e.isDisposed()))
|
|
483
|
-
return;
|
|
484
|
-
const g = [];
|
|
485
|
-
for (let n of c) {
|
|
486
|
-
const p = this._libFiles.getOrCreateModel(n.fileName);
|
|
487
|
-
p && g.push({
|
|
488
|
-
uri: p.uri,
|
|
489
|
-
range: this._textSpanToRange(p, n.textSpan)
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
return g;
|
|
493
|
-
}
|
|
494
|
-
}, q = class extends w {
|
|
495
|
-
constructor(e, t) {
|
|
496
|
-
super(t), this._libFiles = e;
|
|
497
|
-
}
|
|
498
|
-
async provideReferences(e, t, r, s) {
|
|
499
|
-
const a = e.uri, u = e.getOffsetAt(t), c = await this._worker(a);
|
|
500
|
-
if (e.isDisposed())
|
|
501
|
-
return;
|
|
502
|
-
const g = await c.getReferencesAtPosition(a.toString(), u);
|
|
503
|
-
if (!g || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(g.map((p) => i.Uri.parse(p.fileName))), e.isDisposed()))
|
|
504
|
-
return;
|
|
505
|
-
const n = [];
|
|
506
|
-
for (let p of g) {
|
|
507
|
-
const d = this._libFiles.getOrCreateModel(p.fileName);
|
|
508
|
-
d && n.push({
|
|
509
|
-
uri: d.uri,
|
|
510
|
-
range: this._textSpanToRange(d, p.textSpan)
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
return n;
|
|
514
|
-
}
|
|
515
|
-
}, X = class extends w {
|
|
516
|
-
async provideDocumentSymbols(e, t) {
|
|
517
|
-
const r = e.uri, s = await this._worker(r);
|
|
518
|
-
if (e.isDisposed())
|
|
519
|
-
return;
|
|
520
|
-
const a = await s.getNavigationBarItems(r.toString());
|
|
521
|
-
if (!a || e.isDisposed())
|
|
522
|
-
return;
|
|
523
|
-
const u = (g, n, p) => {
|
|
524
|
-
let d = {
|
|
525
|
-
name: n.text,
|
|
526
|
-
detail: "",
|
|
527
|
-
kind: m[n.kind] || i.languages.SymbolKind.Variable,
|
|
528
|
-
range: this._textSpanToRange(e, n.spans[0]),
|
|
529
|
-
selectionRange: this._textSpanToRange(e, n.spans[0]),
|
|
530
|
-
tags: []
|
|
531
|
-
};
|
|
532
|
-
if (p && (d.containerName = p), n.childItems && n.childItems.length > 0)
|
|
533
|
-
for (let f of n.childItems)
|
|
534
|
-
u(g, f, d.name);
|
|
535
|
-
g.push(d);
|
|
536
|
-
};
|
|
537
|
-
let c = [];
|
|
538
|
-
return a.forEach((g) => u(c, g)), c;
|
|
539
|
-
}
|
|
540
|
-
}, l = class {
|
|
541
|
-
};
|
|
542
|
-
b(l, "unknown", "");
|
|
543
|
-
b(l, "keyword", "keyword");
|
|
544
|
-
b(l, "script", "script");
|
|
545
|
-
b(l, "module", "module");
|
|
546
|
-
b(l, "class", "class");
|
|
547
|
-
b(l, "interface", "interface");
|
|
548
|
-
b(l, "type", "type");
|
|
549
|
-
b(l, "enum", "enum");
|
|
550
|
-
b(l, "variable", "var");
|
|
551
|
-
b(l, "localVariable", "local var");
|
|
552
|
-
b(l, "function", "function");
|
|
553
|
-
b(l, "localFunction", "local function");
|
|
554
|
-
b(l, "memberFunction", "method");
|
|
555
|
-
b(l, "memberGetAccessor", "getter");
|
|
556
|
-
b(l, "memberSetAccessor", "setter");
|
|
557
|
-
b(l, "memberVariable", "property");
|
|
558
|
-
b(l, "constructorImplementation", "constructor");
|
|
559
|
-
b(l, "callSignature", "call");
|
|
560
|
-
b(l, "indexSignature", "index");
|
|
561
|
-
b(l, "constructSignature", "construct");
|
|
562
|
-
b(l, "parameter", "parameter");
|
|
563
|
-
b(l, "typeParameter", "type parameter");
|
|
564
|
-
b(l, "primitiveType", "primitive type");
|
|
565
|
-
b(l, "label", "label");
|
|
566
|
-
b(l, "alias", "alias");
|
|
567
|
-
b(l, "const", "const");
|
|
568
|
-
b(l, "let", "let");
|
|
569
|
-
b(l, "warning", "warning");
|
|
570
|
-
var m = /* @__PURE__ */ Object.create(null);
|
|
571
|
-
m[l.module] = i.languages.SymbolKind.Module;
|
|
572
|
-
m[l.class] = i.languages.SymbolKind.Class;
|
|
573
|
-
m[l.enum] = i.languages.SymbolKind.Enum;
|
|
574
|
-
m[l.interface] = i.languages.SymbolKind.Interface;
|
|
575
|
-
m[l.memberFunction] = i.languages.SymbolKind.Method;
|
|
576
|
-
m[l.memberVariable] = i.languages.SymbolKind.Property;
|
|
577
|
-
m[l.memberGetAccessor] = i.languages.SymbolKind.Property;
|
|
578
|
-
m[l.memberSetAccessor] = i.languages.SymbolKind.Property;
|
|
579
|
-
m[l.variable] = i.languages.SymbolKind.Variable;
|
|
580
|
-
m[l.const] = i.languages.SymbolKind.Variable;
|
|
581
|
-
m[l.localVariable] = i.languages.SymbolKind.Variable;
|
|
582
|
-
m[l.variable] = i.languages.SymbolKind.Variable;
|
|
583
|
-
m[l.function] = i.languages.SymbolKind.Function;
|
|
584
|
-
m[l.localFunction] = i.languages.SymbolKind.Function;
|
|
585
|
-
var S = class extends w {
|
|
586
|
-
static _convertOptions(e) {
|
|
587
|
-
return {
|
|
588
|
-
ConvertTabsToSpaces: e.insertSpaces,
|
|
589
|
-
TabSize: e.tabSize,
|
|
590
|
-
IndentSize: e.tabSize,
|
|
591
|
-
IndentStyle: 2,
|
|
592
|
-
NewLineCharacter: `
|
|
593
|
-
`,
|
|
594
|
-
InsertSpaceAfterCommaDelimiter: !0,
|
|
595
|
-
InsertSpaceAfterSemicolonInForStatements: !0,
|
|
596
|
-
InsertSpaceBeforeAndAfterBinaryOperators: !0,
|
|
597
|
-
InsertSpaceAfterKeywordsInControlFlowStatements: !0,
|
|
598
|
-
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: !0,
|
|
599
|
-
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: !1,
|
|
600
|
-
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: !1,
|
|
601
|
-
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: !1,
|
|
602
|
-
PlaceOpenBraceOnNewLineForControlBlocks: !1,
|
|
603
|
-
PlaceOpenBraceOnNewLineForFunctions: !1
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
_convertTextChanges(e, t) {
|
|
607
|
-
return {
|
|
608
|
-
text: t.newText,
|
|
609
|
-
range: this._textSpanToRange(e, t.span)
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
}, Y = class extends S {
|
|
613
|
-
async provideDocumentRangeFormattingEdits(e, t, r, s) {
|
|
614
|
-
const a = e.uri, u = e.getOffsetAt({
|
|
615
|
-
lineNumber: t.startLineNumber,
|
|
616
|
-
column: t.startColumn
|
|
617
|
-
}), c = e.getOffsetAt({
|
|
618
|
-
lineNumber: t.endLineNumber,
|
|
619
|
-
column: t.endColumn
|
|
620
|
-
}), g = await this._worker(a);
|
|
621
|
-
if (e.isDisposed())
|
|
622
|
-
return;
|
|
623
|
-
const n = await g.getFormattingEditsForRange(a.toString(), u, c, S._convertOptions(r));
|
|
624
|
-
if (!(!n || e.isDisposed()))
|
|
625
|
-
return n.map((p) => this._convertTextChanges(e, p));
|
|
626
|
-
}
|
|
627
|
-
}, Z = class extends S {
|
|
628
|
-
get autoFormatTriggerCharacters() {
|
|
629
|
-
return [";", "}", `
|
|
630
|
-
`];
|
|
631
|
-
}
|
|
632
|
-
async provideOnTypeFormattingEdits(e, t, r, s, a) {
|
|
633
|
-
const u = e.uri, c = e.getOffsetAt(t), g = await this._worker(u);
|
|
634
|
-
if (e.isDisposed())
|
|
635
|
-
return;
|
|
636
|
-
const n = await g.getFormattingEditsAfterKeystroke(u.toString(), c, r, S._convertOptions(s));
|
|
637
|
-
if (!(!n || e.isDisposed()))
|
|
638
|
-
return n.map((p) => this._convertTextChanges(e, p));
|
|
639
|
-
}
|
|
640
|
-
}, ee = class extends S {
|
|
641
|
-
async provideCodeActions(e, t, r, s) {
|
|
642
|
-
const a = e.uri, u = e.getOffsetAt({
|
|
643
|
-
lineNumber: t.startLineNumber,
|
|
644
|
-
column: t.startColumn
|
|
645
|
-
}), c = e.getOffsetAt({
|
|
646
|
-
lineNumber: t.endLineNumber,
|
|
647
|
-
column: t.endColumn
|
|
648
|
-
}), g = S._convertOptions(e.getOptions()), n = r.markers.filter((h) => h.code).map((h) => h.code).map(Number), p = await this._worker(a);
|
|
649
|
-
if (e.isDisposed())
|
|
650
|
-
return;
|
|
651
|
-
const d = await p.getCodeFixesAtPosition(a.toString(), u, c, n, g);
|
|
652
|
-
return !d || e.isDisposed() ? { actions: [], dispose: () => {
|
|
653
|
-
} } : {
|
|
654
|
-
actions: d.filter((h) => h.changes.filter((y) => y.isNewFile).length === 0).map((h) => this._tsCodeFixActionToMonacoCodeAction(e, r, h)),
|
|
655
|
-
dispose: () => {
|
|
656
|
-
}
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
_tsCodeFixActionToMonacoCodeAction(e, t, r) {
|
|
660
|
-
const s = [];
|
|
661
|
-
for (const u of r.changes)
|
|
662
|
-
for (const c of u.textChanges)
|
|
663
|
-
s.push({
|
|
664
|
-
resource: e.uri,
|
|
665
|
-
versionId: void 0,
|
|
666
|
-
textEdit: {
|
|
667
|
-
range: this._textSpanToRange(e, c.span),
|
|
668
|
-
text: c.newText
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
return {
|
|
672
|
-
title: r.description,
|
|
673
|
-
edit: { edits: s },
|
|
674
|
-
diagnostics: t.markers,
|
|
675
|
-
kind: "quickfix"
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
}, te = class extends w {
|
|
679
|
-
constructor(e, t) {
|
|
680
|
-
super(t), this._libFiles = e;
|
|
681
|
-
}
|
|
682
|
-
async provideRenameEdits(e, t, r, s) {
|
|
683
|
-
const a = e.uri, u = a.toString(), c = e.getOffsetAt(t), g = await this._worker(a);
|
|
684
|
-
if (e.isDisposed())
|
|
685
|
-
return;
|
|
686
|
-
const n = await g.getRenameInfo(u, c, {
|
|
687
|
-
allowRenameOfImportPath: !1
|
|
688
|
-
});
|
|
689
|
-
if (n.canRename === !1)
|
|
690
|
-
return {
|
|
691
|
-
edits: [],
|
|
692
|
-
rejectReason: n.localizedErrorMessage
|
|
693
|
-
};
|
|
694
|
-
if (n.fileToRename !== void 0)
|
|
695
|
-
throw new Error("Renaming files is not supported.");
|
|
696
|
-
const p = await g.findRenameLocations(u, c, !1, !1, !1);
|
|
697
|
-
if (!p || e.isDisposed())
|
|
698
|
-
return;
|
|
699
|
-
const d = [];
|
|
700
|
-
for (const f of p) {
|
|
701
|
-
const h = this._libFiles.getOrCreateModel(f.fileName);
|
|
702
|
-
if (h)
|
|
703
|
-
d.push({
|
|
704
|
-
resource: h.uri,
|
|
705
|
-
versionId: void 0,
|
|
706
|
-
textEdit: {
|
|
707
|
-
range: this._textSpanToRange(h, f.textSpan),
|
|
708
|
-
text: r
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
else
|
|
712
|
-
throw new Error(`Unknown file ${f.fileName}.`);
|
|
713
|
-
}
|
|
714
|
-
return { edits: d };
|
|
715
|
-
}
|
|
716
|
-
}, re = class extends w {
|
|
717
|
-
async provideInlayHints(e, t, r) {
|
|
718
|
-
const s = e.uri, a = s.toString(), u = e.getOffsetAt({
|
|
719
|
-
lineNumber: t.startLineNumber,
|
|
720
|
-
column: t.startColumn
|
|
721
|
-
}), c = e.getOffsetAt({
|
|
722
|
-
lineNumber: t.endLineNumber,
|
|
723
|
-
column: t.endColumn
|
|
724
|
-
}), g = await this._worker(s);
|
|
725
|
-
return e.isDisposed() ? null : { hints: (await g.provideInlayHints(a, u, c)).map((d) => ({
|
|
726
|
-
...d,
|
|
727
|
-
label: d.text,
|
|
728
|
-
position: e.getPositionAt(d.position),
|
|
729
|
-
kind: this._convertHintKind(d.kind)
|
|
730
|
-
})), dispose: () => {
|
|
731
|
-
} };
|
|
732
|
-
}
|
|
733
|
-
_convertHintKind(e) {
|
|
734
|
-
switch (e) {
|
|
735
|
-
case "Parameter":
|
|
736
|
-
return i.languages.InlayHintKind.Parameter;
|
|
737
|
-
case "Type":
|
|
738
|
-
return i.languages.InlayHintKind.Type;
|
|
739
|
-
default:
|
|
740
|
-
return i.languages.InlayHintKind.Type;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
}, A, L;
|
|
744
|
-
function le(e) {
|
|
745
|
-
L = N(e, "typescript");
|
|
746
|
-
}
|
|
747
|
-
function ce(e) {
|
|
748
|
-
A = N(e, "javascript");
|
|
749
|
-
}
|
|
750
|
-
function ue() {
|
|
751
|
-
return new Promise((e, t) => {
|
|
752
|
-
if (!A)
|
|
753
|
-
return t("JavaScript not registered!");
|
|
754
|
-
e(A);
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
function ge() {
|
|
758
|
-
return new Promise((e, t) => {
|
|
759
|
-
if (!L)
|
|
760
|
-
return t("TypeScript not registered!");
|
|
761
|
-
e(L);
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
function N(e, t) {
|
|
765
|
-
const r = new U(t, e), s = (...u) => r.getLanguageServiceWorker(...u), a = new $(s);
|
|
766
|
-
return i.languages.registerCompletionItemProvider(t, new D(s)), i.languages.registerSignatureHelpProvider(t, new I(s)), i.languages.registerHoverProvider(t, new G(s)), i.languages.registerDocumentHighlightProvider(t, new J(s)), i.languages.registerDefinitionProvider(t, new Q(a, s)), i.languages.registerReferenceProvider(t, new q(a, s)), i.languages.registerDocumentSymbolProvider(t, new X(s)), i.languages.registerDocumentRangeFormattingEditProvider(t, new Y(s)), i.languages.registerOnTypeFormattingEditProvider(t, new Z(s)), i.languages.registerCodeActionProvider(t, new ee(s)), i.languages.registerRenameProvider(t, new te(a, s)), i.languages.registerInlayHintsProvider(t, new re(s)), new z(a, e, t, s), s;
|
|
767
|
-
}
|
|
768
|
-
export {
|
|
769
|
-
w as Adapter,
|
|
770
|
-
ee as CodeActionAdaptor,
|
|
771
|
-
Q as DefinitionAdapter,
|
|
772
|
-
z as DiagnosticsAdapter,
|
|
773
|
-
Y as FormatAdapter,
|
|
774
|
-
S as FormatHelper,
|
|
775
|
-
Z as FormatOnTypeAdapter,
|
|
776
|
-
re as InlayHintsAdapter,
|
|
777
|
-
l as Kind,
|
|
778
|
-
$ as LibFiles,
|
|
779
|
-
J as OccurrencesAdapter,
|
|
780
|
-
X as OutlineAdapter,
|
|
781
|
-
G as QuickInfoAdapter,
|
|
782
|
-
q as ReferenceAdapter,
|
|
783
|
-
te as RenameAdapter,
|
|
784
|
-
I as SignatureHelpAdapter,
|
|
785
|
-
D as SuggestAdapter,
|
|
786
|
-
U as WorkerManager,
|
|
787
|
-
F as flattenDiagnosticMessageText,
|
|
788
|
-
ue as getJavaScriptWorker,
|
|
789
|
-
ge as getTypeScriptWorker,
|
|
790
|
-
ce as setupJavaScript,
|
|
791
|
-
le as setupTypeScript
|
|
792
|
-
};
|