sun-form-v3 1.0.70 → 1.0.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/abap-DfvySaIJ.js +1404 -0
- package/dist/apex-B__0irD3.js +332 -0
- package/dist/assets/css.worker-OK053IOu.js +84 -0
- package/dist/assets/editor.worker-D9iUZyMP.js +11 -0
- package/dist/assets/html.worker-CL40hqKM.js +458 -0
- package/dist/assets/json.worker-6f9bhSHY.js +42 -0
- package/dist/assets/ts.worker-B6g3wjaE.js +37021 -0
- package/dist/azcli-CDMGhRmx.js +74 -0
- package/dist/bat-0Mk8aqzx.js +106 -0
- package/dist/bicep-BBi_I06Z.js +108 -0
- package/dist/cameligo-D0G_Zm6X.js +180 -0
- package/dist/clojure-o2ZKLeMp.js +767 -0
- package/dist/coffee-DOQff5VC.js +238 -0
- package/dist/cpp-CQGJnWhD.js +395 -0
- package/dist/csharp-C1jLsHl8.js +332 -0
- package/dist/csp-C_ttMQaW.js +59 -0
- package/dist/css-BC202kVV.js +193 -0
- package/dist/cssMode-D3INtz5D.js +1541 -0
- package/dist/cypher-DwtEH7Fi.js +269 -0
- package/dist/dart-D9XknsP2.js +287 -0
- package/dist/dockerfile-DgsNjqqa.js +136 -0
- package/dist/ecl-BAMCHBl6.js +462 -0
- package/dist/elixir-CegIttP8.js +575 -0
- package/dist/favicon.ico +0 -0
- package/dist/flow9-9608t7UV.js +148 -0
- package/dist/freemarker2-hasIzj0A.js +995 -0
- package/dist/fsharp-CCtt9-1_.js +223 -0
- package/dist/go-CGUIPbct.js +224 -0
- package/dist/graphql-BNRIFFIn.js +157 -0
- package/dist/handlebars-Cqza9dif.js +425 -0
- package/dist/hcl-C__KLIXe.js +189 -0
- package/dist/html-QpDlLWtS.js +314 -0
- package/dist/htmlMode-3p93KT8l.js +1551 -0
- package/dist/index2-jkDcibEo.js +120443 -0
- package/dist/ini-CeKYn_zA.js +77 -0
- package/dist/java-Dm24deQl.js +238 -0
- package/dist/javascript-CSPB5Brm.js +76 -0
- package/dist/jsonMode-qA6pURD0.js +1957 -0
- package/dist/julia-BImNW7VE.js +517 -0
- package/dist/kotlin-BfE79GEb.js +259 -0
- package/dist/less-DglNOcaC.js +168 -0
- package/dist/lexon-BA0dRz9Q.js +163 -0
- package/dist/liquid-BWuASSim.js +246 -0
- package/dist/lua-DMkWzJcm.js +168 -0
- package/dist/m3-sA-5shO8.js +216 -0
- package/dist/markdown-OYRB1igA.js +235 -0
- package/dist/mdx-CnHJXO9F.js +171 -0
- package/dist/mips-rRzkJ_7G.js +204 -0
- package/dist/msdax-DoVJdUhd.js +381 -0
- package/dist/mysql-Ty44IHXo.js +884 -0
- package/dist/objective-c-VUfyhYrA.js +189 -0
- package/dist/pascal-DkASiYyw.js +257 -0
- package/dist/pascaligo-p-ELPlVO.js +170 -0
- package/dist/perl-Cjl1FxLZ.js +632 -0
- package/dist/pgsql-DjVenF7s.js +857 -0
- package/dist/php-CwvGzZOO.js +506 -0
- package/dist/pla-Br1iaBIV.js +143 -0
- package/dist/postiats-BaeP8zZY.js +913 -0
- package/dist/powerquery-CLCshuo8.js +896 -0
- package/dist/powershell-CZV50w5N.js +245 -0
- package/dist/protobuf-MV3XTewJ.js +426 -0
- package/dist/pug-DkDg4c4l.js +408 -0
- package/dist/python-CRYsEVap.js +282 -0
- package/dist/qsharp-BAtiKA97.js +291 -0
- package/dist/r-8ocrd-h-.js +249 -0
- package/dist/razor-DyEtGntt.js +556 -0
- package/dist/redis-9sZiddxc.js +308 -0
- package/dist/redshift-DQfTOGC0.js +815 -0
- package/dist/restructuredtext-DXU-vkgr.js +180 -0
- package/dist/ruby-DotfqwMf.js +517 -0
- package/dist/rust-BIauJ5KN.js +349 -0
- package/dist/sb-CmWMvDEV.js +121 -0
- package/dist/scala-C81brEbk.js +376 -0
- package/dist/scheme-D0pcFz2x.js +114 -0
- package/dist/scss-BOdN2fGG.js +268 -0
- package/dist/shell-6E09eAkU.js +227 -0
- package/dist/solidity-CWStzA1K.js +1373 -0
- package/dist/sophia-76Sb6CWe.js +205 -0
- package/dist/sparql-BmZTkOWT.js +207 -0
- package/dist/sql-Cs9TBAW5.js +859 -0
- package/dist/st-B-rqE1Bu.js +422 -0
- package/dist/style.css +1 -0
- package/dist/sun-form-v3.es.js +4 -0
- package/dist/sun-form-v3.umd.js +1902 -0
- package/dist/swift-Btsj6YxQ.js +318 -0
- package/dist/systemverilog-B3RHBRa2.js +582 -0
- package/dist/tcl-Dpj776pn.js +238 -0
- package/dist/tsMode-BrlIPEQw.js +885 -0
- package/dist/twig-Bb9JmBsE.js +398 -0
- package/dist/typescript-CYTudnTM.js +349 -0
- package/dist/typespec-CDWeg3SU.js +123 -0
- package/dist/vb-DEXnYwEI.js +378 -0
- package/dist/wgsl-D602c1lx.js +445 -0
- package/dist/xml-B-x5164u.js +101 -0
- package/dist/yaml-Buq2hM65.js +212 -0
- package/package.json +5 -8
- package/src/App.vue +0 -9
- package/src/assets/font/YouSheBiaoTiHei-2.ttf +0 -0
- package/src/assets/font/demo.css +0 -539
- package/src/assets/font/demo_index.html +0 -1200
- package/src/assets/font/iconfont.css +0 -191
- package/src/assets/font/iconfont.js +0 -1
- package/src/assets/font/iconfont.json +0 -317
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/font/iconfont.woff2 +0 -0
- package/src/assets/img/bg_footer.png +0 -0
- package/src/assets/img/bg_title.png +0 -0
- package/src/assets/img/file.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logo2.png +0 -0
- package/src/assets/img/logo22.png +0 -0
- package/src/assets/img/logo23.png +0 -0
- package/src/assets/img/logo3.png +0 -0
- package/src/assets/img//347/237/251/345/275/242@2x.png +0 -0
- package/src/assets/logo.svg +0 -1
- package/src/assets/styles/element/index.scss +0 -15
- package/src/assets/styles/index.css +0 -3
- package/src/components/a.js +0 -14
- package/src/components/aDesigner/config.vue +0 -127
- package/src/components/aDesigner/design.vue +0 -20
- package/src/components/aDesigner/designer.js +0 -342
- package/src/components/aDesigner/http.js +0 -292
- package/src/components/aDesigner/index.vue +0 -144
- package/src/components/aDesigner/panel.vue +0 -144
- package/src/components/aDesigner/show.vue +0 -24
- package/src/components/widgetCommonComps/commonApiConfig/index.vue +0 -194
- package/src/components/widgetCommonComps/commonCard/index.vue +0 -36
- package/src/components/widgetCommonComps/commonCodeEditor/editor.vue +0 -219
- package/src/components/widgetCommonComps/commonCodeEditor/modalEditor.vue +0 -68
- package/src/components/widgetCommonComps/commonCollapseCard/index.vue +0 -10
- package/src/components/widgetCommonComps/commonContainer/index.vue +0 -95
- package/src/components/widgetCommonComps/commonJsonInput/index.vue +0 -59
- package/src/components/widgetCommonComps/commonLabelContainer/index.vue +0 -39
- package/src/components/widgetCommonComps/commonSidetree/index.vue +0 -61
- package/src/components/widgetCommonComps/commonTypeInput/index.vue +0 -75
- package/src/components/widgetCommonComps/commonWidgetLabelContainer/index.vue +0 -55
- package/src/components/widgetCommonComps/index copy.js +0 -17
- package/src/components/widgetCommonComps/index.js +0 -17
- package/src/components/widgetConfigComps/config-input/index.vue +0 -60
- package/src/components/widgetConfigComps/index copy.js +0 -13
- package/src/components/widgetConfigComps/index.js +0 -17
- package/src/components/widgetShowComps/index.js +0 -29
- package/src/components/widgetShowComps/widget-form/index.vue +0 -43
- package/src/components/widgetShowComps/widget-homepage/index.vue +0 -41
- package/src/components/widgetShowComps/widget-input/index.vue +0 -85
- package/src/components/widgetShowComps/widget-select/index.vue +0 -31
- package/src/designer.js +0 -342
- package/src/http.js +0 -293
- package/src/index.js +0 -24
- package/src/index2.js +0 -23
- package/src/main.js +0 -19
- package/src/remark.js +0 -708
- package/src/testBtn.vue +0 -11
- package/src/testInput.vue +0 -12
- package/src/util/jsformat.js +0 -568
- package/src/widgetConfig.js +0 -1112
@@ -0,0 +1,885 @@
|
|
1
|
+
import { t as O, m as I } from "./index2-jkDcibEo.js";
|
2
|
+
/*!-----------------------------------------------------------------------------
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
4
|
+
* Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
|
5
|
+
* Released under the MIT license
|
6
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
7
|
+
*-----------------------------------------------------------------------------*/
|
8
|
+
var N = Object.defineProperty, M = Object.getOwnPropertyDescriptor, R = Object.getOwnPropertyNames, K = Object.prototype.hasOwnProperty, E = (e, t, r, o) => {
|
9
|
+
if (t && typeof t == "object" || typeof t == "function")
|
10
|
+
for (let i of R(t))
|
11
|
+
!K.call(e, i) && i !== r && N(e, i, { get: () => t[i], enumerable: !(o = M(t, i)) || o.enumerable });
|
12
|
+
return e;
|
13
|
+
}, H = (e, t, r) => (E(e, t, "default"), r), a = {};
|
14
|
+
H(a, I);
|
15
|
+
var V = class {
|
16
|
+
constructor(e, t) {
|
17
|
+
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(
|
18
|
+
() => this._updateExtraLibs()
|
19
|
+
);
|
20
|
+
}
|
21
|
+
dispose() {
|
22
|
+
this._configChangeListener.dispose(), this._extraLibsChangeListener.dispose(), this._stopWorker();
|
23
|
+
}
|
24
|
+
_stopWorker() {
|
25
|
+
this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
|
26
|
+
}
|
27
|
+
async _updateExtraLibs() {
|
28
|
+
if (!this._worker)
|
29
|
+
return;
|
30
|
+
const e = ++this._updateExtraLibsToken, t = await this._worker.getProxy();
|
31
|
+
this._updateExtraLibsToken === e && t.updateExtraLibs(this._defaults.getExtraLibs());
|
32
|
+
}
|
33
|
+
_getClient() {
|
34
|
+
return this._client || (this._client = (async () => (this._worker = a.editor.createWebWorker({
|
35
|
+
// module that exports the create() method and returns a `TypeScriptWorker` instance
|
36
|
+
moduleId: "vs/language/typescript/tsWorker",
|
37
|
+
label: this._modeId,
|
38
|
+
keepIdleModels: !0,
|
39
|
+
// passed in to the create() method
|
40
|
+
createData: {
|
41
|
+
compilerOptions: this._defaults.getCompilerOptions(),
|
42
|
+
extraLibs: this._defaults.getExtraLibs(),
|
43
|
+
customWorkerPath: this._defaults.workerOptions.customWorkerPath,
|
44
|
+
inlayHintsOptions: this._defaults.inlayHintsOptions
|
45
|
+
}
|
46
|
+
}), this._defaults.getEagerModelSync() ? await this._worker.withSyncedResources(
|
47
|
+
a.editor.getModels().filter((e) => e.getLanguageId() === this._modeId).map((e) => e.uri)
|
48
|
+
) : await this._worker.getProxy()))()), this._client;
|
49
|
+
}
|
50
|
+
async getLanguageServiceWorker(...e) {
|
51
|
+
const t = await this._getClient();
|
52
|
+
return this._worker && await this._worker.withSyncedResources(e), t;
|
53
|
+
}
|
54
|
+
}, n = {};
|
55
|
+
n["lib.d.ts"] = !0;
|
56
|
+
n["lib.decorators.d.ts"] = !0;
|
57
|
+
n["lib.decorators.legacy.d.ts"] = !0;
|
58
|
+
n["lib.dom.d.ts"] = !0;
|
59
|
+
n["lib.dom.iterable.d.ts"] = !0;
|
60
|
+
n["lib.es2015.collection.d.ts"] = !0;
|
61
|
+
n["lib.es2015.core.d.ts"] = !0;
|
62
|
+
n["lib.es2015.d.ts"] = !0;
|
63
|
+
n["lib.es2015.generator.d.ts"] = !0;
|
64
|
+
n["lib.es2015.iterable.d.ts"] = !0;
|
65
|
+
n["lib.es2015.promise.d.ts"] = !0;
|
66
|
+
n["lib.es2015.proxy.d.ts"] = !0;
|
67
|
+
n["lib.es2015.reflect.d.ts"] = !0;
|
68
|
+
n["lib.es2015.symbol.d.ts"] = !0;
|
69
|
+
n["lib.es2015.symbol.wellknown.d.ts"] = !0;
|
70
|
+
n["lib.es2016.array.include.d.ts"] = !0;
|
71
|
+
n["lib.es2016.d.ts"] = !0;
|
72
|
+
n["lib.es2016.full.d.ts"] = !0;
|
73
|
+
n["lib.es2017.d.ts"] = !0;
|
74
|
+
n["lib.es2017.full.d.ts"] = !0;
|
75
|
+
n["lib.es2017.intl.d.ts"] = !0;
|
76
|
+
n["lib.es2017.object.d.ts"] = !0;
|
77
|
+
n["lib.es2017.sharedmemory.d.ts"] = !0;
|
78
|
+
n["lib.es2017.string.d.ts"] = !0;
|
79
|
+
n["lib.es2017.typedarrays.d.ts"] = !0;
|
80
|
+
n["lib.es2018.asyncgenerator.d.ts"] = !0;
|
81
|
+
n["lib.es2018.asynciterable.d.ts"] = !0;
|
82
|
+
n["lib.es2018.d.ts"] = !0;
|
83
|
+
n["lib.es2018.full.d.ts"] = !0;
|
84
|
+
n["lib.es2018.intl.d.ts"] = !0;
|
85
|
+
n["lib.es2018.promise.d.ts"] = !0;
|
86
|
+
n["lib.es2018.regexp.d.ts"] = !0;
|
87
|
+
n["lib.es2019.array.d.ts"] = !0;
|
88
|
+
n["lib.es2019.d.ts"] = !0;
|
89
|
+
n["lib.es2019.full.d.ts"] = !0;
|
90
|
+
n["lib.es2019.intl.d.ts"] = !0;
|
91
|
+
n["lib.es2019.object.d.ts"] = !0;
|
92
|
+
n["lib.es2019.string.d.ts"] = !0;
|
93
|
+
n["lib.es2019.symbol.d.ts"] = !0;
|
94
|
+
n["lib.es2020.bigint.d.ts"] = !0;
|
95
|
+
n["lib.es2020.d.ts"] = !0;
|
96
|
+
n["lib.es2020.date.d.ts"] = !0;
|
97
|
+
n["lib.es2020.full.d.ts"] = !0;
|
98
|
+
n["lib.es2020.intl.d.ts"] = !0;
|
99
|
+
n["lib.es2020.number.d.ts"] = !0;
|
100
|
+
n["lib.es2020.promise.d.ts"] = !0;
|
101
|
+
n["lib.es2020.sharedmemory.d.ts"] = !0;
|
102
|
+
n["lib.es2020.string.d.ts"] = !0;
|
103
|
+
n["lib.es2020.symbol.wellknown.d.ts"] = !0;
|
104
|
+
n["lib.es2021.d.ts"] = !0;
|
105
|
+
n["lib.es2021.full.d.ts"] = !0;
|
106
|
+
n["lib.es2021.intl.d.ts"] = !0;
|
107
|
+
n["lib.es2021.promise.d.ts"] = !0;
|
108
|
+
n["lib.es2021.string.d.ts"] = !0;
|
109
|
+
n["lib.es2021.weakref.d.ts"] = !0;
|
110
|
+
n["lib.es2022.array.d.ts"] = !0;
|
111
|
+
n["lib.es2022.d.ts"] = !0;
|
112
|
+
n["lib.es2022.error.d.ts"] = !0;
|
113
|
+
n["lib.es2022.full.d.ts"] = !0;
|
114
|
+
n["lib.es2022.intl.d.ts"] = !0;
|
115
|
+
n["lib.es2022.object.d.ts"] = !0;
|
116
|
+
n["lib.es2022.regexp.d.ts"] = !0;
|
117
|
+
n["lib.es2022.sharedmemory.d.ts"] = !0;
|
118
|
+
n["lib.es2022.string.d.ts"] = !0;
|
119
|
+
n["lib.es2023.array.d.ts"] = !0;
|
120
|
+
n["lib.es2023.d.ts"] = !0;
|
121
|
+
n["lib.es2023.full.d.ts"] = !0;
|
122
|
+
n["lib.es5.d.ts"] = !0;
|
123
|
+
n["lib.es6.d.ts"] = !0;
|
124
|
+
n["lib.esnext.d.ts"] = !0;
|
125
|
+
n["lib.esnext.full.d.ts"] = !0;
|
126
|
+
n["lib.esnext.intl.d.ts"] = !0;
|
127
|
+
n["lib.scripthost.d.ts"] = !0;
|
128
|
+
n["lib.webworker.d.ts"] = !0;
|
129
|
+
n["lib.webworker.importscripts.d.ts"] = !0;
|
130
|
+
n["lib.webworker.iterable.d.ts"] = !0;
|
131
|
+
function D(e, t, r = 0) {
|
132
|
+
if (typeof e == "string")
|
133
|
+
return e;
|
134
|
+
if (e === void 0)
|
135
|
+
return "";
|
136
|
+
let o = "";
|
137
|
+
if (r) {
|
138
|
+
o += t;
|
139
|
+
for (let i = 0; i < r; i++)
|
140
|
+
o += " ";
|
141
|
+
}
|
142
|
+
if (o += e.messageText, r++, e.next)
|
143
|
+
for (const i of e.next)
|
144
|
+
o += D(i, t, r);
|
145
|
+
return o;
|
146
|
+
}
|
147
|
+
function w(e) {
|
148
|
+
return e ? e.map((t) => t.text).join("") : "";
|
149
|
+
}
|
150
|
+
var _ = class {
|
151
|
+
constructor(e) {
|
152
|
+
this._worker = e;
|
153
|
+
}
|
154
|
+
// protected _positionToOffset(model: editor.ITextModel, position: monaco.IPosition): number {
|
155
|
+
// return model.getOffsetAt(position);
|
156
|
+
// }
|
157
|
+
// protected _offsetToPosition(model: editor.ITextModel, offset: number): monaco.IPosition {
|
158
|
+
// return model.getPositionAt(offset);
|
159
|
+
// }
|
160
|
+
_textSpanToRange(e, t) {
|
161
|
+
let r = e.getPositionAt(t.start), o = e.getPositionAt(t.start + t.length), { lineNumber: i, column: l } = r, { lineNumber: u, column: s } = o;
|
162
|
+
return { startLineNumber: i, startColumn: l, endLineNumber: u, endColumn: s };
|
163
|
+
}
|
164
|
+
}, W = class {
|
165
|
+
constructor(e) {
|
166
|
+
this._worker = e, this._libFiles = {}, this._hasFetchedLibFiles = !1, this._fetchLibFilesPromise = null;
|
167
|
+
}
|
168
|
+
isLibFile(e) {
|
169
|
+
return e && e.path.indexOf("/lib.") === 0 ? !!n[e.path.slice(1)] : !1;
|
170
|
+
}
|
171
|
+
getOrCreateModel(e) {
|
172
|
+
const t = a.Uri.parse(e), r = a.editor.getModel(t);
|
173
|
+
if (r)
|
174
|
+
return r;
|
175
|
+
if (this.isLibFile(t) && this._hasFetchedLibFiles)
|
176
|
+
return a.editor.createModel(this._libFiles[t.path.slice(1)], "typescript", t);
|
177
|
+
const o = O.getExtraLibs()[e];
|
178
|
+
return o ? a.editor.createModel(o.content, "typescript", t) : null;
|
179
|
+
}
|
180
|
+
_containsLibFile(e) {
|
181
|
+
for (let t of e)
|
182
|
+
if (this.isLibFile(t))
|
183
|
+
return !0;
|
184
|
+
return !1;
|
185
|
+
}
|
186
|
+
async fetchLibFilesIfNecessary(e) {
|
187
|
+
this._containsLibFile(e) && await this._fetchLibFiles();
|
188
|
+
}
|
189
|
+
_fetchLibFiles() {
|
190
|
+
return this._fetchLibFilesPromise || (this._fetchLibFilesPromise = this._worker().then((e) => e.getLibFiles()).then((e) => {
|
191
|
+
this._hasFetchedLibFiles = !0, this._libFiles = e;
|
192
|
+
})), this._fetchLibFilesPromise;
|
193
|
+
}
|
194
|
+
}, j = class extends _ {
|
195
|
+
constructor(e, t, r, o) {
|
196
|
+
super(o), this._libFiles = e, this._defaults = t, this._selector = r, this._disposables = [], this._listener = /* @__PURE__ */ Object.create(null);
|
197
|
+
const i = (s) => {
|
198
|
+
if (s.getLanguageId() !== r)
|
199
|
+
return;
|
200
|
+
const c = () => {
|
201
|
+
const { onlyVisible: h } = this._defaults.getDiagnosticsOptions();
|
202
|
+
h ? s.isAttachedToEditor() && this._doValidate(s) : this._doValidate(s);
|
203
|
+
};
|
204
|
+
let g;
|
205
|
+
const d = s.onDidChangeContent(() => {
|
206
|
+
clearTimeout(g), g = window.setTimeout(c, 500);
|
207
|
+
}), b = s.onDidChangeAttached(() => {
|
208
|
+
const { onlyVisible: h } = this._defaults.getDiagnosticsOptions();
|
209
|
+
h && (s.isAttachedToEditor() ? c() : a.editor.setModelMarkers(s, this._selector, []));
|
210
|
+
});
|
211
|
+
this._listener[s.uri.toString()] = {
|
212
|
+
dispose() {
|
213
|
+
d.dispose(), b.dispose(), clearTimeout(g);
|
214
|
+
}
|
215
|
+
}, c();
|
216
|
+
}, l = (s) => {
|
217
|
+
a.editor.setModelMarkers(s, this._selector, []);
|
218
|
+
const c = s.uri.toString();
|
219
|
+
this._listener[c] && (this._listener[c].dispose(), delete this._listener[c]);
|
220
|
+
};
|
221
|
+
this._disposables.push(
|
222
|
+
a.editor.onDidCreateModel((s) => i(s))
|
223
|
+
), this._disposables.push(a.editor.onWillDisposeModel(l)), this._disposables.push(
|
224
|
+
a.editor.onDidChangeModelLanguage((s) => {
|
225
|
+
l(s.model), i(s.model);
|
226
|
+
})
|
227
|
+
), this._disposables.push({
|
228
|
+
dispose() {
|
229
|
+
for (const s of a.editor.getModels())
|
230
|
+
l(s);
|
231
|
+
}
|
232
|
+
});
|
233
|
+
const u = () => {
|
234
|
+
for (const s of a.editor.getModels())
|
235
|
+
l(s), i(s);
|
236
|
+
};
|
237
|
+
this._disposables.push(this._defaults.onDidChange(u)), this._disposables.push(this._defaults.onDidExtraLibsChange(u)), a.editor.getModels().forEach((s) => i(s));
|
238
|
+
}
|
239
|
+
dispose() {
|
240
|
+
this._disposables.forEach((e) => e && e.dispose()), this._disposables = [];
|
241
|
+
}
|
242
|
+
async _doValidate(e) {
|
243
|
+
const t = await this._worker(e.uri);
|
244
|
+
if (e.isDisposed())
|
245
|
+
return;
|
246
|
+
const r = [], { noSyntaxValidation: o, noSemanticValidation: i, noSuggestionDiagnostics: l } = this._defaults.getDiagnosticsOptions();
|
247
|
+
o || r.push(t.getSyntacticDiagnostics(e.uri.toString())), i || r.push(t.getSemanticDiagnostics(e.uri.toString())), l || r.push(t.getSuggestionDiagnostics(e.uri.toString()));
|
248
|
+
const u = await Promise.all(r);
|
249
|
+
if (!u || e.isDisposed())
|
250
|
+
return;
|
251
|
+
const s = u.reduce((g, d) => d.concat(g), []).filter(
|
252
|
+
(g) => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(g.code) === -1
|
253
|
+
), c = s.map((g) => g.relatedInformation || []).reduce((g, d) => d.concat(g), []).map(
|
254
|
+
(g) => g.file ? a.Uri.parse(g.file.fileName) : null
|
255
|
+
);
|
256
|
+
await this._libFiles.fetchLibFilesIfNecessary(c), !e.isDisposed() && a.editor.setModelMarkers(
|
257
|
+
e,
|
258
|
+
this._selector,
|
259
|
+
s.map((g) => this._convertDiagnostics(e, g))
|
260
|
+
);
|
261
|
+
}
|
262
|
+
_convertDiagnostics(e, t) {
|
263
|
+
const r = t.start || 0, o = t.length || 1, { lineNumber: i, column: l } = e.getPositionAt(r), { lineNumber: u, column: s } = e.getPositionAt(
|
264
|
+
r + o
|
265
|
+
), c = [];
|
266
|
+
return t.reportsUnnecessary && c.push(a.MarkerTag.Unnecessary), t.reportsDeprecated && c.push(a.MarkerTag.Deprecated), {
|
267
|
+
severity: this._tsDiagnosticCategoryToMarkerSeverity(t.category),
|
268
|
+
startLineNumber: i,
|
269
|
+
startColumn: l,
|
270
|
+
endLineNumber: u,
|
271
|
+
endColumn: s,
|
272
|
+
message: D(t.messageText, `
|
273
|
+
`),
|
274
|
+
code: t.code.toString(),
|
275
|
+
tags: c,
|
276
|
+
relatedInformation: this._convertRelatedInformation(e, t.relatedInformation)
|
277
|
+
};
|
278
|
+
}
|
279
|
+
_convertRelatedInformation(e, t) {
|
280
|
+
if (!t)
|
281
|
+
return [];
|
282
|
+
const r = [];
|
283
|
+
return t.forEach((o) => {
|
284
|
+
let i = e;
|
285
|
+
if (o.file && (i = this._libFiles.getOrCreateModel(o.file.fileName)), !i)
|
286
|
+
return;
|
287
|
+
const l = o.start || 0, u = o.length || 1, { lineNumber: s, column: c } = i.getPositionAt(l), { lineNumber: g, column: d } = i.getPositionAt(
|
288
|
+
l + u
|
289
|
+
);
|
290
|
+
r.push({
|
291
|
+
resource: i.uri,
|
292
|
+
startLineNumber: s,
|
293
|
+
startColumn: c,
|
294
|
+
endLineNumber: g,
|
295
|
+
endColumn: d,
|
296
|
+
message: D(o.messageText, `
|
297
|
+
`)
|
298
|
+
});
|
299
|
+
}), r;
|
300
|
+
}
|
301
|
+
_tsDiagnosticCategoryToMarkerSeverity(e) {
|
302
|
+
switch (e) {
|
303
|
+
case 1:
|
304
|
+
return a.MarkerSeverity.Error;
|
305
|
+
case 3:
|
306
|
+
return a.MarkerSeverity.Info;
|
307
|
+
case 0:
|
308
|
+
return a.MarkerSeverity.Warning;
|
309
|
+
case 2:
|
310
|
+
return a.MarkerSeverity.Hint;
|
311
|
+
}
|
312
|
+
return a.MarkerSeverity.Info;
|
313
|
+
}
|
314
|
+
}, B = class C extends _ {
|
315
|
+
get triggerCharacters() {
|
316
|
+
return ["."];
|
317
|
+
}
|
318
|
+
async provideCompletionItems(t, r, o, i) {
|
319
|
+
const l = t.getWordUntilPosition(r), u = new a.Range(
|
320
|
+
r.lineNumber,
|
321
|
+
l.startColumn,
|
322
|
+
r.lineNumber,
|
323
|
+
l.endColumn
|
324
|
+
), s = t.uri, c = t.getOffsetAt(r), g = await this._worker(s);
|
325
|
+
if (t.isDisposed())
|
326
|
+
return;
|
327
|
+
const d = await g.getCompletionsAtPosition(s.toString(), c);
|
328
|
+
return !d || t.isDisposed() ? void 0 : {
|
329
|
+
suggestions: d.entries.map((h) => {
|
330
|
+
let y = u;
|
331
|
+
if (h.replacementSpan) {
|
332
|
+
const S = t.getPositionAt(h.replacementSpan.start), x = t.getPositionAt(h.replacementSpan.start + h.replacementSpan.length);
|
333
|
+
y = new a.Range(S.lineNumber, S.column, x.lineNumber, x.column);
|
334
|
+
}
|
335
|
+
const v = [];
|
336
|
+
return h.kindModifiers !== void 0 && h.kindModifiers.indexOf("deprecated") !== -1 && v.push(a.languages.CompletionItemTag.Deprecated), {
|
337
|
+
uri: s,
|
338
|
+
position: r,
|
339
|
+
offset: c,
|
340
|
+
range: y,
|
341
|
+
label: h.name,
|
342
|
+
insertText: h.name,
|
343
|
+
sortText: h.sortText,
|
344
|
+
kind: C.convertKind(h.kind),
|
345
|
+
tags: v
|
346
|
+
};
|
347
|
+
})
|
348
|
+
};
|
349
|
+
}
|
350
|
+
async resolveCompletionItem(t, r) {
|
351
|
+
const o = t, i = o.uri, l = o.position, u = o.offset, c = await (await this._worker(i)).getCompletionEntryDetails(
|
352
|
+
i.toString(),
|
353
|
+
u,
|
354
|
+
o.label
|
355
|
+
);
|
356
|
+
return c ? {
|
357
|
+
uri: i,
|
358
|
+
position: l,
|
359
|
+
label: c.name,
|
360
|
+
kind: C.convertKind(c.kind),
|
361
|
+
detail: w(c.displayParts),
|
362
|
+
documentation: {
|
363
|
+
value: C.createDocumentationString(c)
|
364
|
+
}
|
365
|
+
} : o;
|
366
|
+
}
|
367
|
+
static convertKind(t) {
|
368
|
+
switch (t) {
|
369
|
+
case f.primitiveType:
|
370
|
+
case f.keyword:
|
371
|
+
return a.languages.CompletionItemKind.Keyword;
|
372
|
+
case f.variable:
|
373
|
+
case f.localVariable:
|
374
|
+
return a.languages.CompletionItemKind.Variable;
|
375
|
+
case f.memberVariable:
|
376
|
+
case f.memberGetAccessor:
|
377
|
+
case f.memberSetAccessor:
|
378
|
+
return a.languages.CompletionItemKind.Field;
|
379
|
+
case f.function:
|
380
|
+
case f.memberFunction:
|
381
|
+
case f.constructSignature:
|
382
|
+
case f.callSignature:
|
383
|
+
case f.indexSignature:
|
384
|
+
return a.languages.CompletionItemKind.Function;
|
385
|
+
case f.enum:
|
386
|
+
return a.languages.CompletionItemKind.Enum;
|
387
|
+
case f.module:
|
388
|
+
return a.languages.CompletionItemKind.Module;
|
389
|
+
case f.class:
|
390
|
+
return a.languages.CompletionItemKind.Class;
|
391
|
+
case f.interface:
|
392
|
+
return a.languages.CompletionItemKind.Interface;
|
393
|
+
case f.warning:
|
394
|
+
return a.languages.CompletionItemKind.File;
|
395
|
+
}
|
396
|
+
return a.languages.CompletionItemKind.Property;
|
397
|
+
}
|
398
|
+
static createDocumentationString(t) {
|
399
|
+
let r = w(t.documentation);
|
400
|
+
if (t.tags)
|
401
|
+
for (const o of t.tags)
|
402
|
+
r += `
|
403
|
+
|
404
|
+
${T(o)}`;
|
405
|
+
return r;
|
406
|
+
}
|
407
|
+
};
|
408
|
+
function T(e) {
|
409
|
+
let t = `*@${e.name}*`;
|
410
|
+
if (e.name === "param" && e.text) {
|
411
|
+
const [r, ...o] = e.text;
|
412
|
+
t += `\`${r.text}\``, o.length > 0 && (t += ` — ${o.map((i) => i.text).join(" ")}`);
|
413
|
+
} else Array.isArray(e.text) ? t += ` — ${e.text.map((r) => r.text).join(" ")}` : e.text && (t += ` — ${e.text}`);
|
414
|
+
return t;
|
415
|
+
}
|
416
|
+
var U = class P extends _ {
|
417
|
+
constructor() {
|
418
|
+
super(...arguments), this.signatureHelpTriggerCharacters = ["(", ","];
|
419
|
+
}
|
420
|
+
static _toSignatureHelpTriggerReason(t) {
|
421
|
+
switch (t.triggerKind) {
|
422
|
+
case a.languages.SignatureHelpTriggerKind.TriggerCharacter:
|
423
|
+
return t.triggerCharacter ? t.isRetrigger ? { kind: "retrigger", triggerCharacter: t.triggerCharacter } : { kind: "characterTyped", triggerCharacter: t.triggerCharacter } : { kind: "invoked" };
|
424
|
+
case a.languages.SignatureHelpTriggerKind.ContentChange:
|
425
|
+
return t.isRetrigger ? { kind: "retrigger" } : { kind: "invoked" };
|
426
|
+
case a.languages.SignatureHelpTriggerKind.Invoke:
|
427
|
+
default:
|
428
|
+
return { kind: "invoked" };
|
429
|
+
}
|
430
|
+
}
|
431
|
+
async provideSignatureHelp(t, r, o, i) {
|
432
|
+
const l = t.uri, u = t.getOffsetAt(r), s = await this._worker(l);
|
433
|
+
if (t.isDisposed())
|
434
|
+
return;
|
435
|
+
const c = await s.getSignatureHelpItems(l.toString(), u, {
|
436
|
+
triggerReason: P._toSignatureHelpTriggerReason(i)
|
437
|
+
});
|
438
|
+
if (!c || t.isDisposed())
|
439
|
+
return;
|
440
|
+
const g = {
|
441
|
+
activeSignature: c.selectedItemIndex,
|
442
|
+
activeParameter: c.argumentIndex,
|
443
|
+
signatures: []
|
444
|
+
};
|
445
|
+
return c.items.forEach((d) => {
|
446
|
+
const b = {
|
447
|
+
label: "",
|
448
|
+
parameters: []
|
449
|
+
};
|
450
|
+
b.documentation = {
|
451
|
+
value: w(d.documentation)
|
452
|
+
}, b.label += w(d.prefixDisplayParts), d.parameters.forEach((h, y, v) => {
|
453
|
+
const S = w(h.displayParts), x = {
|
454
|
+
label: S,
|
455
|
+
documentation: {
|
456
|
+
value: w(h.documentation)
|
457
|
+
}
|
458
|
+
};
|
459
|
+
b.label += S, b.parameters.push(x), y < v.length - 1 && (b.label += w(d.separatorDisplayParts));
|
460
|
+
}), b.label += w(d.suffixDisplayParts), g.signatures.push(b);
|
461
|
+
}), {
|
462
|
+
value: g,
|
463
|
+
dispose() {
|
464
|
+
}
|
465
|
+
};
|
466
|
+
}
|
467
|
+
}, $ = class extends _ {
|
468
|
+
async provideHover(e, t, r) {
|
469
|
+
const o = e.uri, i = e.getOffsetAt(t), l = await this._worker(o);
|
470
|
+
if (e.isDisposed())
|
471
|
+
return;
|
472
|
+
const u = await l.getQuickInfoAtPosition(o.toString(), i);
|
473
|
+
if (!u || e.isDisposed())
|
474
|
+
return;
|
475
|
+
const s = w(u.documentation), c = u.tags ? u.tags.map((d) => T(d)).join(`
|
476
|
+
|
477
|
+
`) : "", g = w(u.displayParts);
|
478
|
+
return {
|
479
|
+
range: this._textSpanToRange(e, u.textSpan),
|
480
|
+
contents: [
|
481
|
+
{
|
482
|
+
value: "```typescript\n" + g + "\n```\n"
|
483
|
+
},
|
484
|
+
{
|
485
|
+
value: s + (c ? `
|
486
|
+
|
487
|
+
` + c : "")
|
488
|
+
}
|
489
|
+
]
|
490
|
+
};
|
491
|
+
}
|
492
|
+
}, z = class extends _ {
|
493
|
+
async provideDocumentHighlights(e, t, r) {
|
494
|
+
const o = e.uri, i = e.getOffsetAt(t), l = await this._worker(o);
|
495
|
+
if (e.isDisposed())
|
496
|
+
return;
|
497
|
+
const u = await l.getDocumentHighlights(o.toString(), i, [
|
498
|
+
o.toString()
|
499
|
+
]);
|
500
|
+
if (!(!u || e.isDisposed()))
|
501
|
+
return u.flatMap((s) => s.highlightSpans.map((c) => ({
|
502
|
+
range: this._textSpanToRange(e, c.textSpan),
|
503
|
+
kind: c.kind === "writtenReference" ? a.languages.DocumentHighlightKind.Write : a.languages.DocumentHighlightKind.Text
|
504
|
+
})));
|
505
|
+
}
|
506
|
+
}, G = class extends _ {
|
507
|
+
constructor(e, t) {
|
508
|
+
super(t), this._libFiles = e;
|
509
|
+
}
|
510
|
+
async provideDefinition(e, t, r) {
|
511
|
+
const o = e.uri, i = e.getOffsetAt(t), l = await this._worker(o);
|
512
|
+
if (e.isDisposed())
|
513
|
+
return;
|
514
|
+
const u = await l.getDefinitionAtPosition(o.toString(), i);
|
515
|
+
if (!u || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(
|
516
|
+
u.map((c) => a.Uri.parse(c.fileName))
|
517
|
+
), e.isDisposed()))
|
518
|
+
return;
|
519
|
+
const s = [];
|
520
|
+
for (let c of u) {
|
521
|
+
const g = this._libFiles.getOrCreateModel(c.fileName);
|
522
|
+
g && s.push({
|
523
|
+
uri: g.uri,
|
524
|
+
range: this._textSpanToRange(g, c.textSpan)
|
525
|
+
});
|
526
|
+
}
|
527
|
+
return s;
|
528
|
+
}
|
529
|
+
}, J = class extends _ {
|
530
|
+
constructor(e, t) {
|
531
|
+
super(t), this._libFiles = e;
|
532
|
+
}
|
533
|
+
async provideReferences(e, t, r, o) {
|
534
|
+
const i = e.uri, l = e.getOffsetAt(t), u = await this._worker(i);
|
535
|
+
if (e.isDisposed())
|
536
|
+
return;
|
537
|
+
const s = await u.getReferencesAtPosition(i.toString(), l);
|
538
|
+
if (!s || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(
|
539
|
+
s.map((g) => a.Uri.parse(g.fileName))
|
540
|
+
), e.isDisposed()))
|
541
|
+
return;
|
542
|
+
const c = [];
|
543
|
+
for (let g of s) {
|
544
|
+
const d = this._libFiles.getOrCreateModel(g.fileName);
|
545
|
+
d && c.push({
|
546
|
+
uri: d.uri,
|
547
|
+
range: this._textSpanToRange(d, g.textSpan)
|
548
|
+
});
|
549
|
+
}
|
550
|
+
return c;
|
551
|
+
}
|
552
|
+
}, Q = class extends _ {
|
553
|
+
async provideDocumentSymbols(e, t) {
|
554
|
+
const r = e.uri, o = await this._worker(r);
|
555
|
+
if (e.isDisposed())
|
556
|
+
return;
|
557
|
+
const i = await o.getNavigationTree(r.toString());
|
558
|
+
if (!i || e.isDisposed())
|
559
|
+
return;
|
560
|
+
const l = (s, c) => {
|
561
|
+
var d;
|
562
|
+
return {
|
563
|
+
name: s.text,
|
564
|
+
detail: "",
|
565
|
+
kind: m[s.kind] || a.languages.SymbolKind.Variable,
|
566
|
+
range: this._textSpanToRange(e, s.spans[0]),
|
567
|
+
selectionRange: this._textSpanToRange(e, s.spans[0]),
|
568
|
+
tags: [],
|
569
|
+
children: (d = s.childItems) == null ? void 0 : d.map((b) => l(b, s.text)),
|
570
|
+
containerName: c
|
571
|
+
};
|
572
|
+
};
|
573
|
+
return i.childItems ? i.childItems.map((s) => l(s)) : [];
|
574
|
+
}
|
575
|
+
}, p, f = (p = class {
|
576
|
+
}, p.unknown = "", p.keyword = "keyword", p.script = "script", p.module = "module", p.class = "class", p.interface = "interface", p.type = "type", p.enum = "enum", p.variable = "var", p.localVariable = "local var", p.function = "function", p.localFunction = "local function", p.memberFunction = "method", p.memberGetAccessor = "getter", p.memberSetAccessor = "setter", p.memberVariable = "property", p.constructorImplementation = "constructor", p.callSignature = "call", p.indexSignature = "index", p.constructSignature = "construct", p.parameter = "parameter", p.typeParameter = "type parameter", p.primitiveType = "primitive type", p.label = "label", p.alias = "alias", p.const = "const", p.let = "let", p.warning = "warning", p), m = /* @__PURE__ */ Object.create(null);
|
577
|
+
m[f.module] = a.languages.SymbolKind.Module;
|
578
|
+
m[f.class] = a.languages.SymbolKind.Class;
|
579
|
+
m[f.enum] = a.languages.SymbolKind.Enum;
|
580
|
+
m[f.interface] = a.languages.SymbolKind.Interface;
|
581
|
+
m[f.memberFunction] = a.languages.SymbolKind.Method;
|
582
|
+
m[f.memberVariable] = a.languages.SymbolKind.Property;
|
583
|
+
m[f.memberGetAccessor] = a.languages.SymbolKind.Property;
|
584
|
+
m[f.memberSetAccessor] = a.languages.SymbolKind.Property;
|
585
|
+
m[f.variable] = a.languages.SymbolKind.Variable;
|
586
|
+
m[f.const] = a.languages.SymbolKind.Variable;
|
587
|
+
m[f.localVariable] = a.languages.SymbolKind.Variable;
|
588
|
+
m[f.variable] = a.languages.SymbolKind.Variable;
|
589
|
+
m[f.function] = a.languages.SymbolKind.Function;
|
590
|
+
m[f.localFunction] = a.languages.SymbolKind.Function;
|
591
|
+
var k = class extends _ {
|
592
|
+
static _convertOptions(e) {
|
593
|
+
return {
|
594
|
+
ConvertTabsToSpaces: e.insertSpaces,
|
595
|
+
TabSize: e.tabSize,
|
596
|
+
IndentSize: e.tabSize,
|
597
|
+
IndentStyle: 2,
|
598
|
+
NewLineCharacter: `
|
599
|
+
`,
|
600
|
+
InsertSpaceAfterCommaDelimiter: !0,
|
601
|
+
InsertSpaceAfterSemicolonInForStatements: !0,
|
602
|
+
InsertSpaceBeforeAndAfterBinaryOperators: !0,
|
603
|
+
InsertSpaceAfterKeywordsInControlFlowStatements: !0,
|
604
|
+
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: !0,
|
605
|
+
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: !1,
|
606
|
+
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: !1,
|
607
|
+
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: !1,
|
608
|
+
PlaceOpenBraceOnNewLineForControlBlocks: !1,
|
609
|
+
PlaceOpenBraceOnNewLineForFunctions: !1
|
610
|
+
};
|
611
|
+
}
|
612
|
+
_convertTextChanges(e, t) {
|
613
|
+
return {
|
614
|
+
text: t.newText,
|
615
|
+
range: this._textSpanToRange(e, t.span)
|
616
|
+
};
|
617
|
+
}
|
618
|
+
}, q = class extends k {
|
619
|
+
constructor() {
|
620
|
+
super(...arguments), this.canFormatMultipleRanges = !1;
|
621
|
+
}
|
622
|
+
async provideDocumentRangeFormattingEdits(e, t, r, o) {
|
623
|
+
const i = e.uri, l = e.getOffsetAt({
|
624
|
+
lineNumber: t.startLineNumber,
|
625
|
+
column: t.startColumn
|
626
|
+
}), u = e.getOffsetAt({
|
627
|
+
lineNumber: t.endLineNumber,
|
628
|
+
column: t.endColumn
|
629
|
+
}), s = await this._worker(i);
|
630
|
+
if (e.isDisposed())
|
631
|
+
return;
|
632
|
+
const c = await s.getFormattingEditsForRange(
|
633
|
+
i.toString(),
|
634
|
+
l,
|
635
|
+
u,
|
636
|
+
k._convertOptions(r)
|
637
|
+
);
|
638
|
+
if (!(!c || e.isDisposed()))
|
639
|
+
return c.map((g) => this._convertTextChanges(e, g));
|
640
|
+
}
|
641
|
+
}, X = class extends k {
|
642
|
+
get autoFormatTriggerCharacters() {
|
643
|
+
return [";", "}", `
|
644
|
+
`];
|
645
|
+
}
|
646
|
+
async provideOnTypeFormattingEdits(e, t, r, o, i) {
|
647
|
+
const l = e.uri, u = e.getOffsetAt(t), s = await this._worker(l);
|
648
|
+
if (e.isDisposed())
|
649
|
+
return;
|
650
|
+
const c = await s.getFormattingEditsAfterKeystroke(
|
651
|
+
l.toString(),
|
652
|
+
u,
|
653
|
+
r,
|
654
|
+
k._convertOptions(o)
|
655
|
+
);
|
656
|
+
if (!(!c || e.isDisposed()))
|
657
|
+
return c.map((g) => this._convertTextChanges(e, g));
|
658
|
+
}
|
659
|
+
}, Y = class extends k {
|
660
|
+
async provideCodeActions(e, t, r, o) {
|
661
|
+
const i = e.uri, l = e.getOffsetAt({
|
662
|
+
lineNumber: t.startLineNumber,
|
663
|
+
column: t.startColumn
|
664
|
+
}), u = e.getOffsetAt({
|
665
|
+
lineNumber: t.endLineNumber,
|
666
|
+
column: t.endColumn
|
667
|
+
}), s = k._convertOptions(e.getOptions()), c = r.markers.filter((h) => h.code).map((h) => h.code).map(Number), g = await this._worker(i);
|
668
|
+
if (e.isDisposed())
|
669
|
+
return;
|
670
|
+
const d = await g.getCodeFixesAtPosition(
|
671
|
+
i.toString(),
|
672
|
+
l,
|
673
|
+
u,
|
674
|
+
c,
|
675
|
+
s
|
676
|
+
);
|
677
|
+
return !d || e.isDisposed() ? { actions: [], dispose: () => {
|
678
|
+
} } : {
|
679
|
+
actions: d.filter((h) => h.changes.filter((y) => y.isNewFile).length === 0).map((h) => this._tsCodeFixActionToMonacoCodeAction(e, r, h)),
|
680
|
+
dispose: () => {
|
681
|
+
}
|
682
|
+
};
|
683
|
+
}
|
684
|
+
_tsCodeFixActionToMonacoCodeAction(e, t, r) {
|
685
|
+
const o = [];
|
686
|
+
for (const l of r.changes)
|
687
|
+
for (const u of l.textChanges)
|
688
|
+
o.push({
|
689
|
+
resource: e.uri,
|
690
|
+
versionId: void 0,
|
691
|
+
textEdit: {
|
692
|
+
range: this._textSpanToRange(e, u.span),
|
693
|
+
text: u.newText
|
694
|
+
}
|
695
|
+
});
|
696
|
+
return {
|
697
|
+
title: r.description,
|
698
|
+
edit: { edits: o },
|
699
|
+
diagnostics: t.markers,
|
700
|
+
kind: "quickfix"
|
701
|
+
};
|
702
|
+
}
|
703
|
+
}, Z = class extends _ {
|
704
|
+
constructor(e, t) {
|
705
|
+
super(t), this._libFiles = e;
|
706
|
+
}
|
707
|
+
async provideRenameEdits(e, t, r, o) {
|
708
|
+
const i = e.uri, l = i.toString(), u = e.getOffsetAt(t), s = await this._worker(i);
|
709
|
+
if (e.isDisposed())
|
710
|
+
return;
|
711
|
+
const c = await s.getRenameInfo(l, u, {
|
712
|
+
allowRenameOfImportPath: !1
|
713
|
+
});
|
714
|
+
if (c.canRename === !1)
|
715
|
+
return {
|
716
|
+
edits: [],
|
717
|
+
rejectReason: c.localizedErrorMessage
|
718
|
+
};
|
719
|
+
if (c.fileToRename !== void 0)
|
720
|
+
throw new Error("Renaming files is not supported.");
|
721
|
+
const g = await s.findRenameLocations(
|
722
|
+
l,
|
723
|
+
u,
|
724
|
+
/*strings*/
|
725
|
+
!1,
|
726
|
+
/*comments*/
|
727
|
+
!1,
|
728
|
+
/*prefixAndSuffix*/
|
729
|
+
!1
|
730
|
+
);
|
731
|
+
if (!g || e.isDisposed())
|
732
|
+
return;
|
733
|
+
const d = [];
|
734
|
+
for (const b of g) {
|
735
|
+
const h = this._libFiles.getOrCreateModel(b.fileName);
|
736
|
+
if (h)
|
737
|
+
d.push({
|
738
|
+
resource: h.uri,
|
739
|
+
versionId: void 0,
|
740
|
+
textEdit: {
|
741
|
+
range: this._textSpanToRange(h, b.textSpan),
|
742
|
+
text: r
|
743
|
+
}
|
744
|
+
});
|
745
|
+
else
|
746
|
+
throw new Error(`Unknown file ${b.fileName}.`);
|
747
|
+
}
|
748
|
+
return { edits: d };
|
749
|
+
}
|
750
|
+
}, ee = class extends _ {
|
751
|
+
async provideInlayHints(e, t, r) {
|
752
|
+
const o = e.uri, i = o.toString(), l = e.getOffsetAt({
|
753
|
+
lineNumber: t.startLineNumber,
|
754
|
+
column: t.startColumn
|
755
|
+
}), u = e.getOffsetAt({
|
756
|
+
lineNumber: t.endLineNumber,
|
757
|
+
column: t.endColumn
|
758
|
+
}), s = await this._worker(o);
|
759
|
+
return e.isDisposed() ? null : { hints: (await s.provideInlayHints(i, l, u)).map((d) => ({
|
760
|
+
...d,
|
761
|
+
label: d.text,
|
762
|
+
position: e.getPositionAt(d.position),
|
763
|
+
kind: this._convertHintKind(d.kind)
|
764
|
+
})), dispose: () => {
|
765
|
+
} };
|
766
|
+
}
|
767
|
+
_convertHintKind(e) {
|
768
|
+
switch (e) {
|
769
|
+
case "Parameter":
|
770
|
+
return a.languages.InlayHintKind.Parameter;
|
771
|
+
case "Type":
|
772
|
+
return a.languages.InlayHintKind.Type;
|
773
|
+
default:
|
774
|
+
return a.languages.InlayHintKind.Type;
|
775
|
+
}
|
776
|
+
}
|
777
|
+
}, A, F;
|
778
|
+
function re(e) {
|
779
|
+
F = L(e, "typescript");
|
780
|
+
}
|
781
|
+
function ie(e) {
|
782
|
+
A = L(e, "javascript");
|
783
|
+
}
|
784
|
+
function ne() {
|
785
|
+
return new Promise((e, t) => {
|
786
|
+
if (!A)
|
787
|
+
return t("JavaScript not registered!");
|
788
|
+
e(A);
|
789
|
+
});
|
790
|
+
}
|
791
|
+
function ae() {
|
792
|
+
return new Promise((e, t) => {
|
793
|
+
if (!F)
|
794
|
+
return t("TypeScript not registered!");
|
795
|
+
e(F);
|
796
|
+
});
|
797
|
+
}
|
798
|
+
function L(e, t) {
|
799
|
+
const r = [], o = new V(t, e), i = (...s) => o.getLanguageServiceWorker(...s), l = new W(i);
|
800
|
+
function u() {
|
801
|
+
const { modeConfiguration: s } = e;
|
802
|
+
te(r), s.completionItems && r.push(
|
803
|
+
a.languages.registerCompletionItemProvider(
|
804
|
+
t,
|
805
|
+
new B(i)
|
806
|
+
)
|
807
|
+
), s.signatureHelp && r.push(
|
808
|
+
a.languages.registerSignatureHelpProvider(
|
809
|
+
t,
|
810
|
+
new U(i)
|
811
|
+
)
|
812
|
+
), s.hovers && r.push(
|
813
|
+
a.languages.registerHoverProvider(t, new $(i))
|
814
|
+
), s.documentHighlights && r.push(
|
815
|
+
a.languages.registerDocumentHighlightProvider(
|
816
|
+
t,
|
817
|
+
new z(i)
|
818
|
+
)
|
819
|
+
), s.definitions && r.push(
|
820
|
+
a.languages.registerDefinitionProvider(
|
821
|
+
t,
|
822
|
+
new G(l, i)
|
823
|
+
)
|
824
|
+
), s.references && r.push(
|
825
|
+
a.languages.registerReferenceProvider(
|
826
|
+
t,
|
827
|
+
new J(l, i)
|
828
|
+
)
|
829
|
+
), s.documentSymbols && r.push(
|
830
|
+
a.languages.registerDocumentSymbolProvider(
|
831
|
+
t,
|
832
|
+
new Q(i)
|
833
|
+
)
|
834
|
+
), s.rename && r.push(
|
835
|
+
a.languages.registerRenameProvider(
|
836
|
+
t,
|
837
|
+
new Z(l, i)
|
838
|
+
)
|
839
|
+
), s.documentRangeFormattingEdits && r.push(
|
840
|
+
a.languages.registerDocumentRangeFormattingEditProvider(
|
841
|
+
t,
|
842
|
+
new q(i)
|
843
|
+
)
|
844
|
+
), s.onTypeFormattingEdits && r.push(
|
845
|
+
a.languages.registerOnTypeFormattingEditProvider(
|
846
|
+
t,
|
847
|
+
new X(i)
|
848
|
+
)
|
849
|
+
), s.codeActions && r.push(
|
850
|
+
a.languages.registerCodeActionProvider(t, new Y(i))
|
851
|
+
), s.inlayHints && r.push(
|
852
|
+
a.languages.registerInlayHintsProvider(t, new ee(i))
|
853
|
+
), s.diagnostics && r.push(new j(l, e, t, i));
|
854
|
+
}
|
855
|
+
return u(), i;
|
856
|
+
}
|
857
|
+
function te(e) {
|
858
|
+
for (; e.length; )
|
859
|
+
e.pop().dispose();
|
860
|
+
}
|
861
|
+
export {
|
862
|
+
_ as Adapter,
|
863
|
+
Y as CodeActionAdaptor,
|
864
|
+
G as DefinitionAdapter,
|
865
|
+
j as DiagnosticsAdapter,
|
866
|
+
z as DocumentHighlightAdapter,
|
867
|
+
q as FormatAdapter,
|
868
|
+
k as FormatHelper,
|
869
|
+
X as FormatOnTypeAdapter,
|
870
|
+
ee as InlayHintsAdapter,
|
871
|
+
f as Kind,
|
872
|
+
W as LibFiles,
|
873
|
+
Q as OutlineAdapter,
|
874
|
+
$ as QuickInfoAdapter,
|
875
|
+
J as ReferenceAdapter,
|
876
|
+
Z as RenameAdapter,
|
877
|
+
U as SignatureHelpAdapter,
|
878
|
+
B as SuggestAdapter,
|
879
|
+
V as WorkerManager,
|
880
|
+
D as flattenDiagnosticMessageText,
|
881
|
+
ne as getJavaScriptWorker,
|
882
|
+
ae as getTypeScriptWorker,
|
883
|
+
ie as setupJavaScript,
|
884
|
+
re as setupTypeScript
|
885
|
+
};
|