sun-form-v3 1.0.65 → 1.0.66

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