act-plus 1.1.23 → 1.1.25

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.
Files changed (106) hide show
  1. package/act-plus.js +6 -5
  2. package/act-plus.umd.cjs +87 -1733
  3. package/lib/configBtns-63d416ef.js +152 -0
  4. package/lib/{configFileds-4633be91.js → configFileds-105ca288.js} +13 -11
  5. package/lib/{configTable-160a99e8.js → configTable-5bf09aac.js} +33 -31
  6. package/lib/{dialogAddField-a8db1c57.js → dialogAddField-bb493c88.js} +6 -4
  7. package/lib/{dialogConfigBtn-e5c41ad9.js → dialogConfigBtn-1fcd1496.js} +57 -55
  8. package/lib/{dialogSiteComponentsParams-05a400cc.js → dialogSiteComponentsParams-708737d2.js} +1 -1
  9. package/lib/{index-28cfa770.js → index-6b7ddc83.js} +74 -65
  10. package/lib/{index-44e2732a.js → index-740fe217.js} +10 -8
  11. package/lib/{index-7a1700c3.js → index-9071c381.js} +12 -10
  12. package/lib/{index-421ea84f.js → index-9bd009b2.js} +32 -30
  13. package/lib/index-ba8fa827.js +61597 -0
  14. package/lib/{index-cceb15dd.js → index-f8e81c41.js} +126 -148
  15. package/package.json +2 -6
  16. package/style.css +1 -1
  17. package/assets/css.worker-1af1972f.js +0 -84
  18. package/assets/editor.worker-df55e1ff.js +0 -8
  19. package/assets/html.worker-38c267f1.js +0 -456
  20. package/assets/json.worker-bf861c27.js +0 -39
  21. package/assets/ts.worker-e151483b.js +0 -33972
  22. package/lib/abap-1354785f.js +0 -1314
  23. package/lib/apex-279d4f27.js +0 -315
  24. package/lib/azcli-ba812c55.js +0 -74
  25. package/lib/bat-4d77495d.js +0 -95
  26. package/lib/bicep-7b240724.js +0 -108
  27. package/lib/cameligo-5d2daeb8.js +0 -168
  28. package/lib/clojure-b7ea12a3.js +0 -754
  29. package/lib/coffee-1a8cfbf4.js +0 -228
  30. package/lib/configBtns-c51c642b.js +0 -150
  31. package/lib/cpp-642b10c4.js +0 -387
  32. package/lib/csharp-d987ddad.js +0 -320
  33. package/lib/csp-96407af0.js +0 -57
  34. package/lib/css-5dd354ac.js +0 -186
  35. package/lib/cssMode-55e3e2b9.js +0 -1448
  36. package/lib/cypher-11e5a4b6.js +0 -262
  37. package/lib/dart-5d209f63.js +0 -270
  38. package/lib/dockerfile-8739cff7.js +0 -132
  39. package/lib/ecl-a20c5155.js +0 -454
  40. package/lib/elixir-8b028584.js +0 -467
  41. package/lib/flow9-0dea2e73.js +0 -141
  42. package/lib/freemarker2-86429a9d.js +0 -646
  43. package/lib/fsharp-49a70fad.js +0 -210
  44. package/lib/go-46e3b371.js +0 -208
  45. package/lib/graphql-51a577e5.js +0 -141
  46. package/lib/handlebars-dcad112f.js +0 -394
  47. package/lib/hcl-56b85754.js +0 -177
  48. package/lib/html-95cf87e3.js +0 -284
  49. package/lib/htmlMode-93d4ea14.js +0 -1458
  50. package/lib/index-22ab90dc.js +0 -162522
  51. package/lib/index-e2f2023d.js +0 -35
  52. package/lib/ini-1d58d82f.js +0 -68
  53. package/lib/java-cd017f60.js +0 -221
  54. package/lib/javascript-55252557.js +0 -78
  55. package/lib/jsonMode-b73c28d1.js +0 -1869
  56. package/lib/julia-a0caf483.js +0 -496
  57. package/lib/kotlin-c6e52a56.js +0 -245
  58. package/lib/less-718543b4.js +0 -168
  59. package/lib/lexon-5e6e7a44.js +0 -151
  60. package/lib/liquid-c923578c.js +0 -241
  61. package/lib/lua-f159160b.js +0 -157
  62. package/lib/m3-aadaf771.js +0 -210
  63. package/lib/markdown-9b448c46.js +0 -202
  64. package/lib/mips-161e49ce.js +0 -194
  65. package/lib/msdax-f65cb1e6.js +0 -377
  66. package/lib/mysql-24549dd1.js +0 -875
  67. package/lib/objective-c-e129a5ca.js +0 -188
  68. package/lib/pascal-4ccdf5ce.js +0 -245
  69. package/lib/pascaligo-a9603dcd.js +0 -158
  70. package/lib/perl-ba1fb97a.js +0 -599
  71. package/lib/pgsql-89978310.js +0 -843
  72. package/lib/php-987b9d87.js +0 -471
  73. package/lib/pla-96c2695d.js +0 -131
  74. package/lib/postiats-7b52ebac.js +0 -544
  75. package/lib/powerquery-8954ec26.js +0 -890
  76. package/lib/powershell-f00d0274.js +0 -233
  77. package/lib/protobuf-3eb85f80.js +0 -422
  78. package/lib/pug-6fab415a.js +0 -393
  79. package/lib/python-319c4cbb.js +0 -262
  80. package/lib/qsharp-4792f872.js +0 -282
  81. package/lib/r-630f5d6b.js +0 -245
  82. package/lib/razor-9a8bae51.js +0 -515
  83. package/lib/redis-276b8288.js +0 -298
  84. package/lib/redshift-520a7359.js +0 -806
  85. package/lib/restructuredtext-4676a3fc.js +0 -162
  86. package/lib/ruby-764137cd.js +0 -444
  87. package/lib/rust-97f8f6e1.js +0 -337
  88. package/lib/sb-8c22f14c.js +0 -110
  89. package/lib/scala-c68c650c.js +0 -353
  90. package/lib/scheme-e6a52cb0.js +0 -114
  91. package/lib/scss-45104c77.js +0 -244
  92. package/lib/shell-09452d42.js +0 -224
  93. package/lib/solidity-d4979008.js +0 -1351
  94. package/lib/sophia-21995caf.js +0 -190
  95. package/lib/sparql-5088743c.js +0 -193
  96. package/lib/sql-63ec8e76.js +0 -818
  97. package/lib/st-fa9ab362.js +0 -414
  98. package/lib/swift-abdf1835.js +0 -315
  99. package/lib/systemverilog-a4f858ed.js +0 -556
  100. package/lib/tcl-8adf937f.js +0 -232
  101. package/lib/tsMode-7111578e.js +0 -792
  102. package/lib/twig-404eb73e.js +0 -323
  103. package/lib/typescript-0c5e909b.js +0 -330
  104. package/lib/vb-e21e8153.js +0 -364
  105. package/lib/xml-acd745c7.js +0 -98
  106. package/lib/yaml-c114fa81.js +0 -187
@@ -1,1458 +0,0 @@
1
- var $e = Object.defineProperty;
2
- var qe = (e, n, i) => n in e ? $e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
- var E = (e, n, i) => (qe(e, typeof n != "symbol" ? n + "" : n, i), i);
4
- import { m as Qe } from "./index-22ab90dc.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 Ge = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, Ye = Object.getOwnPropertyNames, Ze = Object.prototype.hasOwnProperty, Y = (e, n, i, r) => {
15
- if (n && typeof n == "object" || typeof n == "function")
16
- for (let t of Ye(n))
17
- !Ze.call(e, t) && t !== i && Ge(e, t, { get: () => n[t], enumerable: !(r = Je(n, t)) || r.enumerable });
18
- return e;
19
- }, Ke = (e, n, i) => (Y(e, n, "default"), i && Y(i, n, "default")), c = {};
20
- Ke(c, Qe);
21
- var et = 2 * 60 * 1e3, Me = class {
22
- constructor(e) {
23
- E(this, "_defaults");
24
- E(this, "_idleCheckInterval");
25
- E(this, "_lastUsedTime");
26
- E(this, "_configChangeListener");
27
- E(this, "_worker");
28
- E(this, "_client");
29
- this._defaults = e, this._worker = null, this._client = null, this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3), this._lastUsedTime = 0, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
30
- }
31
- _stopWorker() {
32
- this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
33
- }
34
- dispose() {
35
- clearInterval(this._idleCheckInterval), this._configChangeListener.dispose(), this._stopWorker();
36
- }
37
- _checkIfIdle() {
38
- if (!this._worker)
39
- return;
40
- Date.now() - this._lastUsedTime > et && this._stopWorker();
41
- }
42
- _getClient() {
43
- return this._lastUsedTime = Date.now(), this._client || (this._worker = c.editor.createWebWorker({
44
- moduleId: "vs/language/html/htmlWorker",
45
- createData: {
46
- languageSettings: this._defaults.options,
47
- languageId: this._defaults.languageId
48
- },
49
- label: this._defaults.languageId
50
- }), this._client = this._worker.getProxy()), this._client;
51
- }
52
- getLanguageServiceWorker(...e) {
53
- let n;
54
- return this._getClient().then((i) => {
55
- n = i;
56
- }).then((i) => {
57
- if (this._worker)
58
- return this._worker.withSyncedResources(e);
59
- }).then((i) => n);
60
- }
61
- }, Z;
62
- (function(e) {
63
- e.MIN_VALUE = -2147483648, e.MAX_VALUE = 2147483647;
64
- })(Z || (Z = {}));
65
- var H;
66
- (function(e) {
67
- e.MIN_VALUE = 0, e.MAX_VALUE = 2147483647;
68
- })(H || (H = {}));
69
- var k;
70
- (function(e) {
71
- function n(r, t) {
72
- return r === Number.MAX_VALUE && (r = H.MAX_VALUE), t === Number.MAX_VALUE && (t = H.MAX_VALUE), { line: r, character: t };
73
- }
74
- e.create = n;
75
- function i(r) {
76
- var t = r;
77
- return s.objectLiteral(t) && s.uinteger(t.line) && s.uinteger(t.character);
78
- }
79
- e.is = i;
80
- })(k || (k = {}));
81
- var p;
82
- (function(e) {
83
- function n(r, t, a, o) {
84
- if (s.uinteger(r) && s.uinteger(t) && s.uinteger(a) && s.uinteger(o))
85
- return { start: k.create(r, t), end: k.create(a, o) };
86
- if (k.is(r) && k.is(t))
87
- return { start: r, end: t };
88
- throw new Error("Range#create called with invalid arguments[" + r + ", " + t + ", " + a + ", " + o + "]");
89
- }
90
- e.create = n;
91
- function i(r) {
92
- var t = r;
93
- return s.objectLiteral(t) && k.is(t.start) && k.is(t.end);
94
- }
95
- e.is = i;
96
- })(p || (p = {}));
97
- var X;
98
- (function(e) {
99
- function n(r, t) {
100
- return { uri: r, range: t };
101
- }
102
- e.create = n;
103
- function i(r) {
104
- var t = r;
105
- return s.defined(t) && p.is(t.range) && (s.string(t.uri) || s.undefined(t.uri));
106
- }
107
- e.is = i;
108
- })(X || (X = {}));
109
- var K;
110
- (function(e) {
111
- function n(r, t, a, o) {
112
- return { targetUri: r, targetRange: t, targetSelectionRange: a, originSelectionRange: o };
113
- }
114
- e.create = n;
115
- function i(r) {
116
- var t = r;
117
- return s.defined(t) && p.is(t.targetRange) && s.string(t.targetUri) && (p.is(t.targetSelectionRange) || s.undefined(t.targetSelectionRange)) && (p.is(t.originSelectionRange) || s.undefined(t.originSelectionRange));
118
- }
119
- e.is = i;
120
- })(K || (K = {}));
121
- var B;
122
- (function(e) {
123
- function n(r, t, a, o) {
124
- return {
125
- red: r,
126
- green: t,
127
- blue: a,
128
- alpha: o
129
- };
130
- }
131
- e.create = n;
132
- function i(r) {
133
- var t = r;
134
- return s.numberRange(t.red, 0, 1) && s.numberRange(t.green, 0, 1) && s.numberRange(t.blue, 0, 1) && s.numberRange(t.alpha, 0, 1);
135
- }
136
- e.is = i;
137
- })(B || (B = {}));
138
- var ee;
139
- (function(e) {
140
- function n(r, t) {
141
- return {
142
- range: r,
143
- color: t
144
- };
145
- }
146
- e.create = n;
147
- function i(r) {
148
- var t = r;
149
- return p.is(t.range) && B.is(t.color);
150
- }
151
- e.is = i;
152
- })(ee || (ee = {}));
153
- var te;
154
- (function(e) {
155
- function n(r, t, a) {
156
- return {
157
- label: r,
158
- textEdit: t,
159
- additionalTextEdits: a
160
- };
161
- }
162
- e.create = n;
163
- function i(r) {
164
- var t = r;
165
- return s.string(t.label) && (s.undefined(t.textEdit) || C.is(t)) && (s.undefined(t.additionalTextEdits) || s.typedArray(t.additionalTextEdits, C.is));
166
- }
167
- e.is = i;
168
- })(te || (te = {}));
169
- var R;
170
- (function(e) {
171
- e.Comment = "comment", e.Imports = "imports", e.Region = "region";
172
- })(R || (R = {}));
173
- var re;
174
- (function(e) {
175
- function n(r, t, a, o, u) {
176
- var f = {
177
- startLine: r,
178
- endLine: t
179
- };
180
- return s.defined(a) && (f.startCharacter = a), s.defined(o) && (f.endCharacter = o), s.defined(u) && (f.kind = u), f;
181
- }
182
- e.create = n;
183
- function i(r) {
184
- var t = r;
185
- return s.uinteger(t.startLine) && s.uinteger(t.startLine) && (s.undefined(t.startCharacter) || s.uinteger(t.startCharacter)) && (s.undefined(t.endCharacter) || s.uinteger(t.endCharacter)) && (s.undefined(t.kind) || s.string(t.kind));
186
- }
187
- e.is = i;
188
- })(re || (re = {}));
189
- var $;
190
- (function(e) {
191
- function n(r, t) {
192
- return {
193
- location: r,
194
- message: t
195
- };
196
- }
197
- e.create = n;
198
- function i(r) {
199
- var t = r;
200
- return s.defined(t) && X.is(t.location) && s.string(t.message);
201
- }
202
- e.is = i;
203
- })($ || ($ = {}));
204
- var I;
205
- (function(e) {
206
- e.Error = 1, e.Warning = 2, e.Information = 3, e.Hint = 4;
207
- })(I || (I = {}));
208
- var ne;
209
- (function(e) {
210
- e.Unnecessary = 1, e.Deprecated = 2;
211
- })(ne || (ne = {}));
212
- var ie;
213
- (function(e) {
214
- function n(i) {
215
- var r = i;
216
- return r != null && s.string(r.href);
217
- }
218
- e.is = n;
219
- })(ie || (ie = {}));
220
- var U;
221
- (function(e) {
222
- function n(r, t, a, o, u, f) {
223
- var d = { range: r, message: t };
224
- return s.defined(a) && (d.severity = a), s.defined(o) && (d.code = o), s.defined(u) && (d.source = u), s.defined(f) && (d.relatedInformation = f), d;
225
- }
226
- e.create = n;
227
- function i(r) {
228
- var t, a = r;
229
- return s.defined(a) && p.is(a.range) && s.string(a.message) && (s.number(a.severity) || s.undefined(a.severity)) && (s.integer(a.code) || s.string(a.code) || s.undefined(a.code)) && (s.undefined(a.codeDescription) || s.string((t = a.codeDescription) === null || t === void 0 ? void 0 : t.href)) && (s.string(a.source) || s.undefined(a.source)) && (s.undefined(a.relatedInformation) || s.typedArray(a.relatedInformation, $.is));
230
- }
231
- e.is = i;
232
- })(U || (U = {}));
233
- var M;
234
- (function(e) {
235
- function n(r, t) {
236
- for (var a = [], o = 2; o < arguments.length; o++)
237
- a[o - 2] = arguments[o];
238
- var u = { title: r, command: t };
239
- return s.defined(a) && a.length > 0 && (u.arguments = a), u;
240
- }
241
- e.create = n;
242
- function i(r) {
243
- var t = r;
244
- return s.defined(t) && s.string(t.title) && s.string(t.command);
245
- }
246
- e.is = i;
247
- })(M || (M = {}));
248
- var C;
249
- (function(e) {
250
- function n(a, o) {
251
- return { range: a, newText: o };
252
- }
253
- e.replace = n;
254
- function i(a, o) {
255
- return { range: { start: a, end: a }, newText: o };
256
- }
257
- e.insert = i;
258
- function r(a) {
259
- return { range: a, newText: "" };
260
- }
261
- e.del = r;
262
- function t(a) {
263
- var o = a;
264
- return s.objectLiteral(o) && s.string(o.newText) && p.is(o.range);
265
- }
266
- e.is = t;
267
- })(C || (C = {}));
268
- var P;
269
- (function(e) {
270
- function n(r, t, a) {
271
- var o = { label: r };
272
- return t !== void 0 && (o.needsConfirmation = t), a !== void 0 && (o.description = a), o;
273
- }
274
- e.create = n;
275
- function i(r) {
276
- var t = r;
277
- return t !== void 0 && s.objectLiteral(t) && s.string(t.label) && (s.boolean(t.needsConfirmation) || t.needsConfirmation === void 0) && (s.string(t.description) || t.description === void 0);
278
- }
279
- e.is = i;
280
- })(P || (P = {}));
281
- var m;
282
- (function(e) {
283
- function n(i) {
284
- var r = i;
285
- return typeof r == "string";
286
- }
287
- e.is = n;
288
- })(m || (m = {}));
289
- var x;
290
- (function(e) {
291
- function n(a, o, u) {
292
- return { range: a, newText: o, annotationId: u };
293
- }
294
- e.replace = n;
295
- function i(a, o, u) {
296
- return { range: { start: a, end: a }, newText: o, annotationId: u };
297
- }
298
- e.insert = i;
299
- function r(a, o) {
300
- return { range: a, newText: "", annotationId: o };
301
- }
302
- e.del = r;
303
- function t(a) {
304
- var o = a;
305
- return C.is(o) && (P.is(o.annotationId) || m.is(o.annotationId));
306
- }
307
- e.is = t;
308
- })(x || (x = {}));
309
- var O;
310
- (function(e) {
311
- function n(r, t) {
312
- return { textDocument: r, edits: t };
313
- }
314
- e.create = n;
315
- function i(r) {
316
- var t = r;
317
- return s.defined(t) && V.is(t.textDocument) && Array.isArray(t.edits);
318
- }
319
- e.is = i;
320
- })(O || (O = {}));
321
- var S;
322
- (function(e) {
323
- function n(r, t, a) {
324
- var o = {
325
- kind: "create",
326
- uri: r
327
- };
328
- return t !== void 0 && (t.overwrite !== void 0 || t.ignoreIfExists !== void 0) && (o.options = t), a !== void 0 && (o.annotationId = a), o;
329
- }
330
- e.create = n;
331
- function i(r) {
332
- var t = r;
333
- return t && t.kind === "create" && s.string(t.uri) && (t.options === void 0 || (t.options.overwrite === void 0 || s.boolean(t.options.overwrite)) && (t.options.ignoreIfExists === void 0 || s.boolean(t.options.ignoreIfExists))) && (t.annotationId === void 0 || m.is(t.annotationId));
334
- }
335
- e.is = i;
336
- })(S || (S = {}));
337
- var T;
338
- (function(e) {
339
- function n(r, t, a, o) {
340
- var u = {
341
- kind: "rename",
342
- oldUri: r,
343
- newUri: t
344
- };
345
- return a !== void 0 && (a.overwrite !== void 0 || a.ignoreIfExists !== void 0) && (u.options = a), o !== void 0 && (u.annotationId = o), u;
346
- }
347
- e.create = n;
348
- function i(r) {
349
- var t = r;
350
- return t && t.kind === "rename" && s.string(t.oldUri) && s.string(t.newUri) && (t.options === void 0 || (t.options.overwrite === void 0 || s.boolean(t.options.overwrite)) && (t.options.ignoreIfExists === void 0 || s.boolean(t.options.ignoreIfExists))) && (t.annotationId === void 0 || m.is(t.annotationId));
351
- }
352
- e.is = i;
353
- })(T || (T = {}));
354
- var F;
355
- (function(e) {
356
- function n(r, t, a) {
357
- var o = {
358
- kind: "delete",
359
- uri: r
360
- };
361
- return t !== void 0 && (t.recursive !== void 0 || t.ignoreIfNotExists !== void 0) && (o.options = t), a !== void 0 && (o.annotationId = a), o;
362
- }
363
- e.create = n;
364
- function i(r) {
365
- var t = r;
366
- return t && t.kind === "delete" && s.string(t.uri) && (t.options === void 0 || (t.options.recursive === void 0 || s.boolean(t.options.recursive)) && (t.options.ignoreIfNotExists === void 0 || s.boolean(t.options.ignoreIfNotExists))) && (t.annotationId === void 0 || m.is(t.annotationId));
367
- }
368
- e.is = i;
369
- })(F || (F = {}));
370
- var q;
371
- (function(e) {
372
- function n(i) {
373
- var r = i;
374
- return r && (r.changes !== void 0 || r.documentChanges !== void 0) && (r.documentChanges === void 0 || r.documentChanges.every(function(t) {
375
- return s.string(t.kind) ? S.is(t) || T.is(t) || F.is(t) : O.is(t);
376
- }));
377
- }
378
- e.is = n;
379
- })(q || (q = {}));
380
- var W = function() {
381
- function e(n, i) {
382
- this.edits = n, this.changeAnnotations = i;
383
- }
384
- return e.prototype.insert = function(n, i, r) {
385
- var t, a;
386
- if (r === void 0 ? t = C.insert(n, i) : m.is(r) ? (a = r, t = x.insert(n, i, r)) : (this.assertChangeAnnotations(this.changeAnnotations), a = this.changeAnnotations.manage(r), t = x.insert(n, i, a)), this.edits.push(t), a !== void 0)
387
- return a;
388
- }, e.prototype.replace = function(n, i, r) {
389
- var t, a;
390
- if (r === void 0 ? t = C.replace(n, i) : m.is(r) ? (a = r, t = x.replace(n, i, r)) : (this.assertChangeAnnotations(this.changeAnnotations), a = this.changeAnnotations.manage(r), t = x.replace(n, i, a)), this.edits.push(t), a !== void 0)
391
- return a;
392
- }, e.prototype.delete = function(n, i) {
393
- var r, t;
394
- if (i === void 0 ? r = C.del(n) : m.is(i) ? (t = i, r = x.del(n, i)) : (this.assertChangeAnnotations(this.changeAnnotations), t = this.changeAnnotations.manage(i), r = x.del(n, t)), this.edits.push(r), t !== void 0)
395
- return t;
396
- }, e.prototype.add = function(n) {
397
- this.edits.push(n);
398
- }, e.prototype.all = function() {
399
- return this.edits;
400
- }, e.prototype.clear = function() {
401
- this.edits.splice(0, this.edits.length);
402
- }, e.prototype.assertChangeAnnotations = function(n) {
403
- if (n === void 0)
404
- throw new Error("Text edit change is not configured to manage change annotations.");
405
- }, e;
406
- }(), ae = function() {
407
- function e(n) {
408
- this._annotations = n === void 0 ? /* @__PURE__ */ Object.create(null) : n, this._counter = 0, this._size = 0;
409
- }
410
- return e.prototype.all = function() {
411
- return this._annotations;
412
- }, Object.defineProperty(e.prototype, "size", {
413
- get: function() {
414
- return this._size;
415
- },
416
- enumerable: !1,
417
- configurable: !0
418
- }), e.prototype.manage = function(n, i) {
419
- var r;
420
- if (m.is(n) ? r = n : (r = this.nextId(), i = n), this._annotations[r] !== void 0)
421
- throw new Error("Id " + r + " is already in use.");
422
- if (i === void 0)
423
- throw new Error("No annotation provided for id " + r);
424
- return this._annotations[r] = i, this._size++, r;
425
- }, e.prototype.nextId = function() {
426
- return this._counter++, this._counter.toString();
427
- }, e;
428
- }();
429
- (function() {
430
- function e(n) {
431
- var i = this;
432
- this._textEditChanges = /* @__PURE__ */ Object.create(null), n !== void 0 ? (this._workspaceEdit = n, n.documentChanges ? (this._changeAnnotations = new ae(n.changeAnnotations), n.changeAnnotations = this._changeAnnotations.all(), n.documentChanges.forEach(function(r) {
433
- if (O.is(r)) {
434
- var t = new W(r.edits, i._changeAnnotations);
435
- i._textEditChanges[r.textDocument.uri] = t;
436
- }
437
- })) : n.changes && Object.keys(n.changes).forEach(function(r) {
438
- var t = new W(n.changes[r]);
439
- i._textEditChanges[r] = t;
440
- })) : this._workspaceEdit = {};
441
- }
442
- return Object.defineProperty(e.prototype, "edit", {
443
- get: function() {
444
- return this.initDocumentChanges(), this._changeAnnotations !== void 0 && (this._changeAnnotations.size === 0 ? this._workspaceEdit.changeAnnotations = void 0 : this._workspaceEdit.changeAnnotations = this._changeAnnotations.all()), this._workspaceEdit;
445
- },
446
- enumerable: !1,
447
- configurable: !0
448
- }), e.prototype.getTextEditChange = function(n) {
449
- if (V.is(n)) {
450
- if (this.initDocumentChanges(), this._workspaceEdit.documentChanges === void 0)
451
- throw new Error("Workspace edit is not configured for document changes.");
452
- var i = { uri: n.uri, version: n.version }, r = this._textEditChanges[i.uri];
453
- if (!r) {
454
- var t = [], a = {
455
- textDocument: i,
456
- edits: t
457
- };
458
- this._workspaceEdit.documentChanges.push(a), r = new W(t, this._changeAnnotations), this._textEditChanges[i.uri] = r;
459
- }
460
- return r;
461
- } else {
462
- if (this.initChanges(), this._workspaceEdit.changes === void 0)
463
- throw new Error("Workspace edit is not configured for normal text edit changes.");
464
- var r = this._textEditChanges[n];
465
- if (!r) {
466
- var t = [];
467
- this._workspaceEdit.changes[n] = t, r = new W(t), this._textEditChanges[n] = r;
468
- }
469
- return r;
470
- }
471
- }, e.prototype.initDocumentChanges = function() {
472
- this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0 && (this._changeAnnotations = new ae(), this._workspaceEdit.documentChanges = [], this._workspaceEdit.changeAnnotations = this._changeAnnotations.all());
473
- }, e.prototype.initChanges = function() {
474
- this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0 && (this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null));
475
- }, e.prototype.createFile = function(n, i, r) {
476
- if (this.initDocumentChanges(), this._workspaceEdit.documentChanges === void 0)
477
- throw new Error("Workspace edit is not configured for document changes.");
478
- var t;
479
- P.is(i) || m.is(i) ? t = i : r = i;
480
- var a, o;
481
- if (t === void 0 ? a = S.create(n, r) : (o = m.is(t) ? t : this._changeAnnotations.manage(t), a = S.create(n, r, o)), this._workspaceEdit.documentChanges.push(a), o !== void 0)
482
- return o;
483
- }, e.prototype.renameFile = function(n, i, r, t) {
484
- if (this.initDocumentChanges(), this._workspaceEdit.documentChanges === void 0)
485
- throw new Error("Workspace edit is not configured for document changes.");
486
- var a;
487
- P.is(r) || m.is(r) ? a = r : t = r;
488
- var o, u;
489
- if (a === void 0 ? o = T.create(n, i, t) : (u = m.is(a) ? a : this._changeAnnotations.manage(a), o = T.create(n, i, t, u)), this._workspaceEdit.documentChanges.push(o), u !== void 0)
490
- return u;
491
- }, e.prototype.deleteFile = function(n, i, r) {
492
- if (this.initDocumentChanges(), this._workspaceEdit.documentChanges === void 0)
493
- throw new Error("Workspace edit is not configured for document changes.");
494
- var t;
495
- P.is(i) || m.is(i) ? t = i : r = i;
496
- var a, o;
497
- if (t === void 0 ? a = F.create(n, r) : (o = m.is(t) ? t : this._changeAnnotations.manage(t), a = F.create(n, r, o)), this._workspaceEdit.documentChanges.push(a), o !== void 0)
498
- return o;
499
- }, e;
500
- })();
501
- var oe;
502
- (function(e) {
503
- function n(r) {
504
- return { uri: r };
505
- }
506
- e.create = n;
507
- function i(r) {
508
- var t = r;
509
- return s.defined(t) && s.string(t.uri);
510
- }
511
- e.is = i;
512
- })(oe || (oe = {}));
513
- var se;
514
- (function(e) {
515
- function n(r, t) {
516
- return { uri: r, version: t };
517
- }
518
- e.create = n;
519
- function i(r) {
520
- var t = r;
521
- return s.defined(t) && s.string(t.uri) && s.integer(t.version);
522
- }
523
- e.is = i;
524
- })(se || (se = {}));
525
- var V;
526
- (function(e) {
527
- function n(r, t) {
528
- return { uri: r, version: t };
529
- }
530
- e.create = n;
531
- function i(r) {
532
- var t = r;
533
- return s.defined(t) && s.string(t.uri) && (t.version === null || s.integer(t.version));
534
- }
535
- e.is = i;
536
- })(V || (V = {}));
537
- var ue;
538
- (function(e) {
539
- function n(r, t, a, o) {
540
- return { uri: r, languageId: t, version: a, text: o };
541
- }
542
- e.create = n;
543
- function i(r) {
544
- var t = r;
545
- return s.defined(t) && s.string(t.uri) && s.string(t.languageId) && s.integer(t.version) && s.string(t.text);
546
- }
547
- e.is = i;
548
- })(ue || (ue = {}));
549
- var L;
550
- (function(e) {
551
- e.PlainText = "plaintext", e.Markdown = "markdown";
552
- })(L || (L = {}));
553
- (function(e) {
554
- function n(i) {
555
- var r = i;
556
- return r === e.PlainText || r === e.Markdown;
557
- }
558
- e.is = n;
559
- })(L || (L = {}));
560
- var Q;
561
- (function(e) {
562
- function n(i) {
563
- var r = i;
564
- return s.objectLiteral(i) && L.is(r.kind) && s.string(r.value);
565
- }
566
- e.is = n;
567
- })(Q || (Q = {}));
568
- var l;
569
- (function(e) {
570
- e.Text = 1, e.Method = 2, e.Function = 3, e.Constructor = 4, e.Field = 5, e.Variable = 6, e.Class = 7, e.Interface = 8, e.Module = 9, e.Property = 10, e.Unit = 11, e.Value = 12, e.Enum = 13, e.Keyword = 14, e.Snippet = 15, e.Color = 16, e.File = 17, e.Reference = 18, e.Folder = 19, e.EnumMember = 20, e.Constant = 21, e.Struct = 22, e.Event = 23, e.Operator = 24, e.TypeParameter = 25;
571
- })(l || (l = {}));
572
- var G;
573
- (function(e) {
574
- e.PlainText = 1, e.Snippet = 2;
575
- })(G || (G = {}));
576
- var ce;
577
- (function(e) {
578
- e.Deprecated = 1;
579
- })(ce || (ce = {}));
580
- var de;
581
- (function(e) {
582
- function n(r, t, a) {
583
- return { newText: r, insert: t, replace: a };
584
- }
585
- e.create = n;
586
- function i(r) {
587
- var t = r;
588
- return t && s.string(t.newText) && p.is(t.insert) && p.is(t.replace);
589
- }
590
- e.is = i;
591
- })(de || (de = {}));
592
- var ge;
593
- (function(e) {
594
- e.asIs = 1, e.adjustIndentation = 2;
595
- })(ge || (ge = {}));
596
- var fe;
597
- (function(e) {
598
- function n(i) {
599
- return { label: i };
600
- }
601
- e.create = n;
602
- })(fe || (fe = {}));
603
- var le;
604
- (function(e) {
605
- function n(i, r) {
606
- return { items: i || [], isIncomplete: !!r };
607
- }
608
- e.create = n;
609
- })(le || (le = {}));
610
- var z;
611
- (function(e) {
612
- function n(r) {
613
- return r.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
614
- }
615
- e.fromPlainText = n;
616
- function i(r) {
617
- var t = r;
618
- return s.string(t) || s.objectLiteral(t) && s.string(t.language) && s.string(t.value);
619
- }
620
- e.is = i;
621
- })(z || (z = {}));
622
- var he;
623
- (function(e) {
624
- function n(i) {
625
- var r = i;
626
- return !!r && s.objectLiteral(r) && (Q.is(r.contents) || z.is(r.contents) || s.typedArray(r.contents, z.is)) && (i.range === void 0 || p.is(i.range));
627
- }
628
- e.is = n;
629
- })(he || (he = {}));
630
- var ve;
631
- (function(e) {
632
- function n(i, r) {
633
- return r ? { label: i, documentation: r } : { label: i };
634
- }
635
- e.create = n;
636
- })(ve || (ve = {}));
637
- var pe;
638
- (function(e) {
639
- function n(i, r) {
640
- for (var t = [], a = 2; a < arguments.length; a++)
641
- t[a - 2] = arguments[a];
642
- var o = { label: i };
643
- return s.defined(r) && (o.documentation = r), s.defined(t) ? o.parameters = t : o.parameters = [], o;
644
- }
645
- e.create = n;
646
- })(pe || (pe = {}));
647
- var D;
648
- (function(e) {
649
- e.Text = 1, e.Read = 2, e.Write = 3;
650
- })(D || (D = {}));
651
- var me;
652
- (function(e) {
653
- function n(i, r) {
654
- var t = { range: i };
655
- return s.number(r) && (t.kind = r), t;
656
- }
657
- e.create = n;
658
- })(me || (me = {}));
659
- var h;
660
- (function(e) {
661
- e.File = 1, e.Module = 2, e.Namespace = 3, e.Package = 4, e.Class = 5, e.Method = 6, e.Property = 7, e.Field = 8, e.Constructor = 9, e.Enum = 10, e.Interface = 11, e.Function = 12, e.Variable = 13, e.Constant = 14, e.String = 15, e.Number = 16, e.Boolean = 17, e.Array = 18, e.Object = 19, e.Key = 20, e.Null = 21, e.EnumMember = 22, e.Struct = 23, e.Event = 24, e.Operator = 25, e.TypeParameter = 26;
662
- })(h || (h = {}));
663
- var _e;
664
- (function(e) {
665
- e.Deprecated = 1;
666
- })(_e || (_e = {}));
667
- var we;
668
- (function(e) {
669
- function n(i, r, t, a, o) {
670
- var u = {
671
- name: i,
672
- kind: r,
673
- location: { uri: a, range: t }
674
- };
675
- return o && (u.containerName = o), u;
676
- }
677
- e.create = n;
678
- })(we || (we = {}));
679
- var ke;
680
- (function(e) {
681
- function n(r, t, a, o, u, f) {
682
- var d = {
683
- name: r,
684
- detail: t,
685
- kind: a,
686
- range: o,
687
- selectionRange: u
688
- };
689
- return f !== void 0 && (d.children = f), d;
690
- }
691
- e.create = n;
692
- function i(r) {
693
- var t = r;
694
- return t && s.string(t.name) && s.number(t.kind) && p.is(t.range) && p.is(t.selectionRange) && (t.detail === void 0 || s.string(t.detail)) && (t.deprecated === void 0 || s.boolean(t.deprecated)) && (t.children === void 0 || Array.isArray(t.children)) && (t.tags === void 0 || Array.isArray(t.tags));
695
- }
696
- e.is = i;
697
- })(ke || (ke = {}));
698
- var be;
699
- (function(e) {
700
- e.Empty = "", e.QuickFix = "quickfix", e.Refactor = "refactor", e.RefactorExtract = "refactor.extract", e.RefactorInline = "refactor.inline", e.RefactorRewrite = "refactor.rewrite", e.Source = "source", e.SourceOrganizeImports = "source.organizeImports", e.SourceFixAll = "source.fixAll";
701
- })(be || (be = {}));
702
- var Ee;
703
- (function(e) {
704
- function n(r, t) {
705
- var a = { diagnostics: r };
706
- return t != null && (a.only = t), a;
707
- }
708
- e.create = n;
709
- function i(r) {
710
- var t = r;
711
- return s.defined(t) && s.typedArray(t.diagnostics, U.is) && (t.only === void 0 || s.typedArray(t.only, s.string));
712
- }
713
- e.is = i;
714
- })(Ee || (Ee = {}));
715
- var xe;
716
- (function(e) {
717
- function n(r, t, a) {
718
- var o = { title: r }, u = !0;
719
- return typeof t == "string" ? (u = !1, o.kind = t) : M.is(t) ? o.command = t : o.edit = t, u && a !== void 0 && (o.kind = a), o;
720
- }
721
- e.create = n;
722
- function i(r) {
723
- var t = r;
724
- return t && s.string(t.title) && (t.diagnostics === void 0 || s.typedArray(t.diagnostics, U.is)) && (t.kind === void 0 || s.string(t.kind)) && (t.edit !== void 0 || t.command !== void 0) && (t.command === void 0 || M.is(t.command)) && (t.isPreferred === void 0 || s.boolean(t.isPreferred)) && (t.edit === void 0 || q.is(t.edit));
725
- }
726
- e.is = i;
727
- })(xe || (xe = {}));
728
- var Ce;
729
- (function(e) {
730
- function n(r, t) {
731
- var a = { range: r };
732
- return s.defined(t) && (a.data = t), a;
733
- }
734
- e.create = n;
735
- function i(r) {
736
- var t = r;
737
- return s.defined(t) && p.is(t.range) && (s.undefined(t.command) || M.is(t.command));
738
- }
739
- e.is = i;
740
- })(Ce || (Ce = {}));
741
- var Ae;
742
- (function(e) {
743
- function n(r, t) {
744
- return { tabSize: r, insertSpaces: t };
745
- }
746
- e.create = n;
747
- function i(r) {
748
- var t = r;
749
- return s.defined(t) && s.uinteger(t.tabSize) && s.boolean(t.insertSpaces);
750
- }
751
- e.is = i;
752
- })(Ae || (Ae = {}));
753
- var ye;
754
- (function(e) {
755
- function n(r, t, a) {
756
- return { range: r, target: t, data: a };
757
- }
758
- e.create = n;
759
- function i(r) {
760
- var t = r;
761
- return s.defined(t) && p.is(t.range) && (s.undefined(t.target) || s.string(t.target));
762
- }
763
- e.is = i;
764
- })(ye || (ye = {}));
765
- var Ie;
766
- (function(e) {
767
- function n(r, t) {
768
- return { range: r, parent: t };
769
- }
770
- e.create = n;
771
- function i(r) {
772
- var t = r;
773
- return t !== void 0 && p.is(t.range) && (t.parent === void 0 || e.is(t.parent));
774
- }
775
- e.is = i;
776
- })(Ie || (Ie = {}));
777
- var Pe;
778
- (function(e) {
779
- function n(a, o, u, f) {
780
- return new tt(a, o, u, f);
781
- }
782
- e.create = n;
783
- function i(a) {
784
- var o = a;
785
- return !!(s.defined(o) && s.string(o.uri) && (s.undefined(o.languageId) || s.string(o.languageId)) && s.uinteger(o.lineCount) && s.func(o.getText) && s.func(o.positionAt) && s.func(o.offsetAt));
786
- }
787
- e.is = i;
788
- function r(a, o) {
789
- for (var u = a.getText(), f = t(o, function(y, N) {
790
- var J = y.range.start.line - N.range.start.line;
791
- return J === 0 ? y.range.start.character - N.range.start.character : J;
792
- }), d = u.length, v = f.length - 1; v >= 0; v--) {
793
- var w = f[v], b = a.offsetAt(w.range.start), g = a.offsetAt(w.range.end);
794
- if (g <= d)
795
- u = u.substring(0, b) + w.newText + u.substring(g, u.length);
796
- else
797
- throw new Error("Overlapping edit");
798
- d = b;
799
- }
800
- return u;
801
- }
802
- e.applyEdits = r;
803
- function t(a, o) {
804
- if (a.length <= 1)
805
- return a;
806
- var u = a.length / 2 | 0, f = a.slice(0, u), d = a.slice(u);
807
- t(f, o), t(d, o);
808
- for (var v = 0, w = 0, b = 0; v < f.length && w < d.length; ) {
809
- var g = o(f[v], d[w]);
810
- g <= 0 ? a[b++] = f[v++] : a[b++] = d[w++];
811
- }
812
- for (; v < f.length; )
813
- a[b++] = f[v++];
814
- for (; w < d.length; )
815
- a[b++] = d[w++];
816
- return a;
817
- }
818
- })(Pe || (Pe = {}));
819
- var tt = function() {
820
- function e(n, i, r, t) {
821
- this._uri = n, this._languageId = i, this._version = r, this._content = t, this._lineOffsets = void 0;
822
- }
823
- return Object.defineProperty(e.prototype, "uri", {
824
- get: function() {
825
- return this._uri;
826
- },
827
- enumerable: !1,
828
- configurable: !0
829
- }), Object.defineProperty(e.prototype, "languageId", {
830
- get: function() {
831
- return this._languageId;
832
- },
833
- enumerable: !1,
834
- configurable: !0
835
- }), Object.defineProperty(e.prototype, "version", {
836
- get: function() {
837
- return this._version;
838
- },
839
- enumerable: !1,
840
- configurable: !0
841
- }), e.prototype.getText = function(n) {
842
- if (n) {
843
- var i = this.offsetAt(n.start), r = this.offsetAt(n.end);
844
- return this._content.substring(i, r);
845
- }
846
- return this._content;
847
- }, e.prototype.update = function(n, i) {
848
- this._content = n.text, this._version = i, this._lineOffsets = void 0;
849
- }, e.prototype.getLineOffsets = function() {
850
- if (this._lineOffsets === void 0) {
851
- for (var n = [], i = this._content, r = !0, t = 0; t < i.length; t++) {
852
- r && (n.push(t), r = !1);
853
- var a = i.charAt(t);
854
- r = a === "\r" || a === `
855
- `, a === "\r" && t + 1 < i.length && i.charAt(t + 1) === `
856
- ` && t++;
857
- }
858
- r && i.length > 0 && n.push(i.length), this._lineOffsets = n;
859
- }
860
- return this._lineOffsets;
861
- }, e.prototype.positionAt = function(n) {
862
- n = Math.max(Math.min(n, this._content.length), 0);
863
- var i = this.getLineOffsets(), r = 0, t = i.length;
864
- if (t === 0)
865
- return k.create(0, n);
866
- for (; r < t; ) {
867
- var a = Math.floor((r + t) / 2);
868
- i[a] > n ? t = a : r = a + 1;
869
- }
870
- var o = r - 1;
871
- return k.create(o, n - i[o]);
872
- }, e.prototype.offsetAt = function(n) {
873
- var i = this.getLineOffsets();
874
- if (n.line >= i.length)
875
- return this._content.length;
876
- if (n.line < 0)
877
- return 0;
878
- var r = i[n.line], t = n.line + 1 < i.length ? i[n.line + 1] : this._content.length;
879
- return Math.max(Math.min(r + n.character, t), r);
880
- }, Object.defineProperty(e.prototype, "lineCount", {
881
- get: function() {
882
- return this.getLineOffsets().length;
883
- },
884
- enumerable: !1,
885
- configurable: !0
886
- }), e;
887
- }(), s;
888
- (function(e) {
889
- var n = Object.prototype.toString;
890
- function i(g) {
891
- return typeof g < "u";
892
- }
893
- e.defined = i;
894
- function r(g) {
895
- return typeof g > "u";
896
- }
897
- e.undefined = r;
898
- function t(g) {
899
- return g === !0 || g === !1;
900
- }
901
- e.boolean = t;
902
- function a(g) {
903
- return n.call(g) === "[object String]";
904
- }
905
- e.string = a;
906
- function o(g) {
907
- return n.call(g) === "[object Number]";
908
- }
909
- e.number = o;
910
- function u(g, y, N) {
911
- return n.call(g) === "[object Number]" && y <= g && g <= N;
912
- }
913
- e.numberRange = u;
914
- function f(g) {
915
- return n.call(g) === "[object Number]" && -2147483648 <= g && g <= 2147483647;
916
- }
917
- e.integer = f;
918
- function d(g) {
919
- return n.call(g) === "[object Number]" && 0 <= g && g <= 2147483647;
920
- }
921
- e.uinteger = d;
922
- function v(g) {
923
- return n.call(g) === "[object Function]";
924
- }
925
- e.func = v;
926
- function w(g) {
927
- return g !== null && typeof g == "object";
928
- }
929
- e.objectLiteral = w;
930
- function b(g, y) {
931
- return Array.isArray(g) && g.every(y);
932
- }
933
- e.typedArray = b;
934
- })(s || (s = {}));
935
- var wt = class {
936
- constructor(e, n, i) {
937
- E(this, "_disposables", []);
938
- E(this, "_listener", /* @__PURE__ */ Object.create(null));
939
- this._languageId = e, this._worker = n;
940
- const r = (a) => {
941
- let o = a.getLanguageId();
942
- if (o !== this._languageId)
943
- return;
944
- let u;
945
- this._listener[a.uri.toString()] = a.onDidChangeContent(() => {
946
- window.clearTimeout(u), u = window.setTimeout(() => this._doValidate(a.uri, o), 500);
947
- }), this._doValidate(a.uri, o);
948
- }, t = (a) => {
949
- c.editor.setModelMarkers(a, this._languageId, []);
950
- let o = a.uri.toString(), u = this._listener[o];
951
- u && (u.dispose(), delete this._listener[o]);
952
- };
953
- this._disposables.push(c.editor.onDidCreateModel(r)), this._disposables.push(c.editor.onWillDisposeModel(t)), this._disposables.push(c.editor.onDidChangeModelLanguage((a) => {
954
- t(a.model), r(a.model);
955
- })), this._disposables.push(i((a) => {
956
- c.editor.getModels().forEach((o) => {
957
- o.getLanguageId() === this._languageId && (t(o), r(o));
958
- });
959
- })), this._disposables.push({
960
- dispose: () => {
961
- c.editor.getModels().forEach(t);
962
- for (let a in this._listener)
963
- this._listener[a].dispose();
964
- }
965
- }), c.editor.getModels().forEach(r);
966
- }
967
- dispose() {
968
- this._disposables.forEach((e) => e && e.dispose()), this._disposables.length = 0;
969
- }
970
- _doValidate(e, n) {
971
- this._worker(e).then((i) => i.doValidation(e.toString())).then((i) => {
972
- const r = i.map((a) => nt(e, a));
973
- let t = c.editor.getModel(e);
974
- t && t.getLanguageId() === n && c.editor.setModelMarkers(t, n, r);
975
- }).then(void 0, (i) => {
976
- console.error(i);
977
- });
978
- }
979
- };
980
- function rt(e) {
981
- switch (e) {
982
- case I.Error:
983
- return c.MarkerSeverity.Error;
984
- case I.Warning:
985
- return c.MarkerSeverity.Warning;
986
- case I.Information:
987
- return c.MarkerSeverity.Info;
988
- case I.Hint:
989
- return c.MarkerSeverity.Hint;
990
- default:
991
- return c.MarkerSeverity.Info;
992
- }
993
- }
994
- function nt(e, n) {
995
- let i = typeof n.code == "number" ? String(n.code) : n.code;
996
- return {
997
- severity: rt(n.severity),
998
- startLineNumber: n.range.start.line + 1,
999
- startColumn: n.range.start.character + 1,
1000
- endLineNumber: n.range.end.line + 1,
1001
- endColumn: n.range.end.character + 1,
1002
- message: n.message,
1003
- code: i,
1004
- source: n.source
1005
- };
1006
- }
1007
- var it = class {
1008
- constructor(e, n) {
1009
- this._worker = e, this._triggerCharacters = n;
1010
- }
1011
- get triggerCharacters() {
1012
- return this._triggerCharacters;
1013
- }
1014
- provideCompletionItems(e, n, i, r) {
1015
- const t = e.uri;
1016
- return this._worker(t).then((a) => a.doComplete(t.toString(), A(n))).then((a) => {
1017
- if (!a)
1018
- return;
1019
- const o = e.getWordUntilPosition(n), u = new c.Range(n.lineNumber, o.startColumn, n.lineNumber, o.endColumn), f = a.items.map((d) => {
1020
- const v = {
1021
- label: d.label,
1022
- insertText: d.insertText || d.label,
1023
- sortText: d.sortText,
1024
- filterText: d.filterText,
1025
- documentation: d.documentation,
1026
- detail: d.detail,
1027
- command: st(d.command),
1028
- range: u,
1029
- kind: ot(d.kind)
1030
- };
1031
- return d.textEdit && (at(d.textEdit) ? v.range = {
1032
- insert: _(d.textEdit.insert),
1033
- replace: _(d.textEdit.replace)
1034
- } : v.range = _(d.textEdit.range), v.insertText = d.textEdit.newText), d.additionalTextEdits && (v.additionalTextEdits = d.additionalTextEdits.map(j)), d.insertTextFormat === G.Snippet && (v.insertTextRules = c.languages.CompletionItemInsertTextRule.InsertAsSnippet), v;
1035
- });
1036
- return {
1037
- isIncomplete: a.isIncomplete,
1038
- suggestions: f
1039
- };
1040
- });
1041
- }
1042
- };
1043
- function A(e) {
1044
- if (e)
1045
- return { character: e.column - 1, line: e.lineNumber - 1 };
1046
- }
1047
- function Se(e) {
1048
- if (e)
1049
- return {
1050
- start: {
1051
- line: e.startLineNumber - 1,
1052
- character: e.startColumn - 1
1053
- },
1054
- end: { line: e.endLineNumber - 1, character: e.endColumn - 1 }
1055
- };
1056
- }
1057
- function _(e) {
1058
- if (e)
1059
- return new c.Range(e.start.line + 1, e.start.character + 1, e.end.line + 1, e.end.character + 1);
1060
- }
1061
- function at(e) {
1062
- return typeof e.insert < "u" && typeof e.replace < "u";
1063
- }
1064
- function ot(e) {
1065
- const n = c.languages.CompletionItemKind;
1066
- switch (e) {
1067
- case l.Text:
1068
- return n.Text;
1069
- case l.Method:
1070
- return n.Method;
1071
- case l.Function:
1072
- return n.Function;
1073
- case l.Constructor:
1074
- return n.Constructor;
1075
- case l.Field:
1076
- return n.Field;
1077
- case l.Variable:
1078
- return n.Variable;
1079
- case l.Class:
1080
- return n.Class;
1081
- case l.Interface:
1082
- return n.Interface;
1083
- case l.Module:
1084
- return n.Module;
1085
- case l.Property:
1086
- return n.Property;
1087
- case l.Unit:
1088
- return n.Unit;
1089
- case l.Value:
1090
- return n.Value;
1091
- case l.Enum:
1092
- return n.Enum;
1093
- case l.Keyword:
1094
- return n.Keyword;
1095
- case l.Snippet:
1096
- return n.Snippet;
1097
- case l.Color:
1098
- return n.Color;
1099
- case l.File:
1100
- return n.File;
1101
- case l.Reference:
1102
- return n.Reference;
1103
- }
1104
- return n.Property;
1105
- }
1106
- function j(e) {
1107
- if (e)
1108
- return {
1109
- range: _(e.range),
1110
- text: e.newText
1111
- };
1112
- }
1113
- function st(e) {
1114
- return e && e.command === "editor.action.triggerSuggest" ? { id: e.command, title: e.title, arguments: e.arguments } : void 0;
1115
- }
1116
- var Te = class {
1117
- constructor(e) {
1118
- this._worker = e;
1119
- }
1120
- provideHover(e, n, i) {
1121
- let r = e.uri;
1122
- return this._worker(r).then((t) => t.doHover(r.toString(), A(n))).then((t) => {
1123
- if (t)
1124
- return {
1125
- range: _(t.range),
1126
- contents: ct(t.contents)
1127
- };
1128
- });
1129
- }
1130
- };
1131
- function ut(e) {
1132
- return e && typeof e == "object" && typeof e.kind == "string";
1133
- }
1134
- function Re(e) {
1135
- return typeof e == "string" ? {
1136
- value: e
1137
- } : ut(e) ? e.kind === "plaintext" ? {
1138
- value: e.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1139
- } : {
1140
- value: e.value
1141
- } : { value: "```" + e.language + `
1142
- ` + e.value + "\n```\n" };
1143
- }
1144
- function ct(e) {
1145
- if (e)
1146
- return Array.isArray(e) ? e.map(Re) : [Re(e)];
1147
- }
1148
- var Fe = class {
1149
- constructor(e) {
1150
- this._worker = e;
1151
- }
1152
- provideDocumentHighlights(e, n, i) {
1153
- const r = e.uri;
1154
- return this._worker(r).then((t) => t.findDocumentHighlights(r.toString(), A(n))).then((t) => {
1155
- if (t)
1156
- return t.map((a) => ({
1157
- range: _(a.range),
1158
- kind: dt(a.kind)
1159
- }));
1160
- });
1161
- }
1162
- };
1163
- function dt(e) {
1164
- switch (e) {
1165
- case D.Read:
1166
- return c.languages.DocumentHighlightKind.Read;
1167
- case D.Write:
1168
- return c.languages.DocumentHighlightKind.Write;
1169
- case D.Text:
1170
- return c.languages.DocumentHighlightKind.Text;
1171
- }
1172
- return c.languages.DocumentHighlightKind.Text;
1173
- }
1174
- var kt = class {
1175
- constructor(e) {
1176
- this._worker = e;
1177
- }
1178
- provideDefinition(e, n, i) {
1179
- const r = e.uri;
1180
- return this._worker(r).then((t) => t.findDefinition(r.toString(), A(n))).then((t) => {
1181
- if (t)
1182
- return [Le(t)];
1183
- });
1184
- }
1185
- };
1186
- function Le(e) {
1187
- return {
1188
- uri: c.Uri.parse(e.uri),
1189
- range: _(e.range)
1190
- };
1191
- }
1192
- var bt = class {
1193
- constructor(e) {
1194
- this._worker = e;
1195
- }
1196
- provideReferences(e, n, i, r) {
1197
- const t = e.uri;
1198
- return this._worker(t).then((a) => a.findReferences(t.toString(), A(n))).then((a) => {
1199
- if (a)
1200
- return a.map(Le);
1201
- });
1202
- }
1203
- }, je = class {
1204
- constructor(e) {
1205
- this._worker = e;
1206
- }
1207
- provideRenameEdits(e, n, i, r) {
1208
- const t = e.uri;
1209
- return this._worker(t).then((a) => a.doRename(t.toString(), A(n), i)).then((a) => gt(a));
1210
- }
1211
- };
1212
- function gt(e) {
1213
- if (!e || !e.changes)
1214
- return;
1215
- let n = [];
1216
- for (let i in e.changes) {
1217
- const r = c.Uri.parse(i);
1218
- for (let t of e.changes[i])
1219
- n.push({
1220
- resource: r,
1221
- versionId: void 0,
1222
- textEdit: {
1223
- range: _(t.range),
1224
- text: t.newText
1225
- }
1226
- });
1227
- }
1228
- return {
1229
- edits: n
1230
- };
1231
- }
1232
- var Ne = class {
1233
- constructor(e) {
1234
- this._worker = e;
1235
- }
1236
- provideDocumentSymbols(e, n) {
1237
- const i = e.uri;
1238
- return this._worker(i).then((r) => r.findDocumentSymbols(i.toString())).then((r) => {
1239
- if (r)
1240
- return r.map((t) => ({
1241
- name: t.name,
1242
- detail: "",
1243
- containerName: t.containerName,
1244
- kind: ft(t.kind),
1245
- range: _(t.location.range),
1246
- selectionRange: _(t.location.range),
1247
- tags: []
1248
- }));
1249
- });
1250
- }
1251
- };
1252
- function ft(e) {
1253
- let n = c.languages.SymbolKind;
1254
- switch (e) {
1255
- case h.File:
1256
- return n.Array;
1257
- case h.Module:
1258
- return n.Module;
1259
- case h.Namespace:
1260
- return n.Namespace;
1261
- case h.Package:
1262
- return n.Package;
1263
- case h.Class:
1264
- return n.Class;
1265
- case h.Method:
1266
- return n.Method;
1267
- case h.Property:
1268
- return n.Property;
1269
- case h.Field:
1270
- return n.Field;
1271
- case h.Constructor:
1272
- return n.Constructor;
1273
- case h.Enum:
1274
- return n.Enum;
1275
- case h.Interface:
1276
- return n.Interface;
1277
- case h.Function:
1278
- return n.Function;
1279
- case h.Variable:
1280
- return n.Variable;
1281
- case h.Constant:
1282
- return n.Constant;
1283
- case h.String:
1284
- return n.String;
1285
- case h.Number:
1286
- return n.Number;
1287
- case h.Boolean:
1288
- return n.Boolean;
1289
- case h.Array:
1290
- return n.Array;
1291
- }
1292
- return n.Function;
1293
- }
1294
- var We = class {
1295
- constructor(e) {
1296
- this._worker = e;
1297
- }
1298
- provideLinks(e, n) {
1299
- const i = e.uri;
1300
- return this._worker(i).then((r) => r.findDocumentLinks(i.toString())).then((r) => {
1301
- if (r)
1302
- return {
1303
- links: r.map((t) => ({
1304
- range: _(t.range),
1305
- url: t.target
1306
- }))
1307
- };
1308
- });
1309
- }
1310
- }, He = class {
1311
- constructor(e) {
1312
- this._worker = e;
1313
- }
1314
- provideDocumentFormattingEdits(e, n, i) {
1315
- const r = e.uri;
1316
- return this._worker(r).then((t) => t.format(r.toString(), null, Oe(n)).then((a) => {
1317
- if (!(!a || a.length === 0))
1318
- return a.map(j);
1319
- }));
1320
- }
1321
- }, Ue = class {
1322
- constructor(e) {
1323
- this._worker = e;
1324
- }
1325
- provideDocumentRangeFormattingEdits(e, n, i, r) {
1326
- const t = e.uri;
1327
- return this._worker(t).then((a) => a.format(t.toString(), Se(n), Oe(i)).then((o) => {
1328
- if (!(!o || o.length === 0))
1329
- return o.map(j);
1330
- }));
1331
- }
1332
- };
1333
- function Oe(e) {
1334
- return {
1335
- tabSize: e.tabSize,
1336
- insertSpaces: e.insertSpaces
1337
- };
1338
- }
1339
- var Et = class {
1340
- constructor(e) {
1341
- this._worker = e;
1342
- }
1343
- provideDocumentColors(e, n) {
1344
- const i = e.uri;
1345
- return this._worker(i).then((r) => r.findDocumentColors(i.toString())).then((r) => {
1346
- if (r)
1347
- return r.map((t) => ({
1348
- color: t.color,
1349
- range: _(t.range)
1350
- }));
1351
- });
1352
- }
1353
- provideColorPresentations(e, n, i) {
1354
- const r = e.uri;
1355
- return this._worker(r).then((t) => t.getColorPresentations(r.toString(), n.color, Se(n.range))).then((t) => {
1356
- if (t)
1357
- return t.map((a) => {
1358
- let o = {
1359
- label: a.label
1360
- };
1361
- return a.textEdit && (o.textEdit = j(a.textEdit)), a.additionalTextEdits && (o.additionalTextEdits = a.additionalTextEdits.map(j)), o;
1362
- });
1363
- });
1364
- }
1365
- }, Ve = class {
1366
- constructor(e) {
1367
- this._worker = e;
1368
- }
1369
- provideFoldingRanges(e, n, i) {
1370
- const r = e.uri;
1371
- return this._worker(r).then((t) => t.getFoldingRanges(r.toString(), n)).then((t) => {
1372
- if (t)
1373
- return t.map((a) => {
1374
- const o = {
1375
- start: a.startLine + 1,
1376
- end: a.endLine + 1
1377
- };
1378
- return typeof a.kind < "u" && (o.kind = lt(a.kind)), o;
1379
- });
1380
- });
1381
- }
1382
- };
1383
- function lt(e) {
1384
- switch (e) {
1385
- case R.Comment:
1386
- return c.languages.FoldingRangeKind.Comment;
1387
- case R.Imports:
1388
- return c.languages.FoldingRangeKind.Imports;
1389
- case R.Region:
1390
- return c.languages.FoldingRangeKind.Region;
1391
- }
1392
- }
1393
- var ze = class {
1394
- constructor(e) {
1395
- this._worker = e;
1396
- }
1397
- provideSelectionRanges(e, n, i) {
1398
- const r = e.uri;
1399
- return this._worker(r).then((t) => t.getSelectionRanges(r.toString(), n.map(A))).then((t) => {
1400
- if (t)
1401
- return t.map((a) => {
1402
- const o = [];
1403
- for (; a; )
1404
- o.push({ range: _(a.range) }), a = a.parent;
1405
- return o;
1406
- });
1407
- });
1408
- }
1409
- }, Xe = class extends it {
1410
- constructor(e) {
1411
- super(e, [".", ":", "<", '"', "=", "/"]);
1412
- }
1413
- };
1414
- function xt(e) {
1415
- const n = new Me(e), i = (...t) => n.getLanguageServiceWorker(...t);
1416
- let r = e.languageId;
1417
- c.languages.registerCompletionItemProvider(r, new Xe(i)), c.languages.registerHoverProvider(r, new Te(i)), c.languages.registerDocumentHighlightProvider(r, new Fe(i)), c.languages.registerLinkProvider(r, new We(i)), c.languages.registerFoldingRangeProvider(r, new Ve(i)), c.languages.registerDocumentSymbolProvider(r, new Ne(i)), c.languages.registerSelectionRangeProvider(r, new ze(i)), c.languages.registerRenameProvider(r, new je(i)), r === "html" && (c.languages.registerDocumentFormattingEditProvider(r, new He(i)), c.languages.registerDocumentRangeFormattingEditProvider(r, new Ue(i)));
1418
- }
1419
- function Ct(e) {
1420
- const n = [], i = [], r = new Me(e);
1421
- n.push(r);
1422
- const t = (...o) => r.getLanguageServiceWorker(...o);
1423
- function a() {
1424
- const { languageId: o, modeConfiguration: u } = e;
1425
- Be(i), u.completionItems && i.push(c.languages.registerCompletionItemProvider(o, new Xe(t))), u.hovers && i.push(c.languages.registerHoverProvider(o, new Te(t))), u.documentHighlights && i.push(c.languages.registerDocumentHighlightProvider(o, new Fe(t))), u.links && i.push(c.languages.registerLinkProvider(o, new We(t))), u.documentSymbols && i.push(c.languages.registerDocumentSymbolProvider(o, new Ne(t))), u.rename && i.push(c.languages.registerRenameProvider(o, new je(t))), u.foldingRanges && i.push(c.languages.registerFoldingRangeProvider(o, new Ve(t))), u.selectionRanges && i.push(c.languages.registerSelectionRangeProvider(o, new ze(t))), u.documentFormattingEdits && i.push(c.languages.registerDocumentFormattingEditProvider(o, new He(t))), u.documentRangeFormattingEdits && i.push(c.languages.registerDocumentRangeFormattingEditProvider(o, new Ue(t)));
1426
- }
1427
- return a(), n.push(De(i)), De(n);
1428
- }
1429
- function De(e) {
1430
- return { dispose: () => Be(e) };
1431
- }
1432
- function Be(e) {
1433
- for (; e.length; )
1434
- e.pop().dispose();
1435
- }
1436
- export {
1437
- it as CompletionAdapter,
1438
- kt as DefinitionAdapter,
1439
- wt as DiagnosticsAdapter,
1440
- Et as DocumentColorAdapter,
1441
- He as DocumentFormattingEditProvider,
1442
- Fe as DocumentHighlightAdapter,
1443
- We as DocumentLinkAdapter,
1444
- Ue as DocumentRangeFormattingEditProvider,
1445
- Ne as DocumentSymbolAdapter,
1446
- Ve as FoldingRangeAdapter,
1447
- Te as HoverAdapter,
1448
- bt as ReferenceAdapter,
1449
- je as RenameAdapter,
1450
- ze as SelectionRangeAdapter,
1451
- Me as WorkerManager,
1452
- A as fromPosition,
1453
- Se as fromRange,
1454
- Ct as setupMode,
1455
- xt as setupMode1,
1456
- _ as toRange,
1457
- j as toTextEdit
1458
- };