@univerjs/uniscript 0.4.0-alpha.0 → 0.4.0-nightly.202410121605

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. package/lib/abap-BZS-1p12.js +6 -0
  2. package/lib/abap-D8H3nII2.mjs +1404 -0
  3. package/lib/apex-B2xdRF0k.js +6 -0
  4. package/lib/apex-BVHYDV51.mjs +334 -0
  5. package/lib/azcli-BwJ4gbR1.mjs +74 -0
  6. package/lib/azcli-CKk2q0zF.js +6 -0
  7. package/lib/bat-BDmMqWXx.mjs +106 -0
  8. package/lib/bat-Ehz5Z_mk.js +6 -0
  9. package/lib/bicep-B5L2IbSj.mjs +110 -0
  10. package/lib/bicep-WbLMPUMj.js +7 -0
  11. package/lib/cameligo-B_ldnAvM.js +6 -0
  12. package/lib/cameligo-CmyOPZUd.mjs +180 -0
  13. package/lib/cjs/index.js +1 -9
  14. package/lib/clojure-Dg-qgg-1.js +6 -0
  15. package/lib/clojure-iSXHsTlR.mjs +767 -0
  16. package/lib/coffee-BCg0pb49.js +6 -0
  17. package/lib/coffee-BUCk2FHC.mjs +238 -0
  18. package/lib/cpp-CJWZ7Zo7.js +6 -0
  19. package/lib/cpp-MUyeqRt5.mjs +395 -0
  20. package/lib/csharp-B9vyMfVU.mjs +332 -0
  21. package/lib/csharp-BZypj8XG.js +6 -0
  22. package/lib/csp-BfXxGnNN.js +6 -0
  23. package/lib/csp-CbylPXe5.mjs +59 -0
  24. package/lib/css-BPDnvT2s.js +8 -0
  25. package/lib/css-BQSMT8k7.mjs +193 -0
  26. package/lib/cssMode-B_of5tVd.js +9 -0
  27. package/lib/cssMode-BuX-eUHc.mjs +1604 -0
  28. package/lib/cypher-3bNWMNCJ.js +6 -0
  29. package/lib/cypher-D7IWy_82.mjs +269 -0
  30. package/lib/dart-BCVbUKaH.mjs +287 -0
  31. package/lib/dart-C9Glm5m-.js +6 -0
  32. package/lib/dockerfile-CjnlcV5o.js +6 -0
  33. package/lib/dockerfile-D2-hSnDX.mjs +136 -0
  34. package/lib/ecl-DRJlPmOb.mjs +462 -0
  35. package/lib/ecl-UyoSfv7F.js +6 -0
  36. package/lib/elixir-Bol0p0Ia.js +6 -0
  37. package/lib/elixir-D8NBXKCb.mjs +575 -0
  38. package/lib/es/index.js +5 -262
  39. package/lib/flow9-Be1OUdJl.js +6 -0
  40. package/lib/flow9-Dp7h8rKW.mjs +148 -0
  41. package/lib/freemarker2-D8-fH4uC.mjs +1001 -0
  42. package/lib/freemarker2-S5ay_GEf.js +8 -0
  43. package/lib/fsharp-CJxdVP7r.mjs +223 -0
  44. package/lib/fsharp-CKIYWNYJ.js +6 -0
  45. package/lib/go-DWj6zslQ.js +6 -0
  46. package/lib/go-IPaMO3Uz.mjs +224 -0
  47. package/lib/graphql-BzJpwfxN.js +6 -0
  48. package/lib/graphql-CMoDK5uf.mjs +157 -0
  49. package/lib/handlebars-CEMNnGaU.mjs +427 -0
  50. package/lib/handlebars-CM3PRDRO.js +6 -0
  51. package/lib/hcl-BCY6T0iq.js +6 -0
  52. package/lib/hcl-BTAYK4pT.mjs +189 -0
  53. package/lib/html-BSUn7oJR.mjs +316 -0
  54. package/lib/html-Df-Osxjs.js +6 -0
  55. package/lib/htmlMode-Bj4CfAzA.js +9 -0
  56. package/lib/htmlMode-xJPwX0cD.mjs +1615 -0
  57. package/lib/index-D6nY5NdF.mjs +116821 -0
  58. package/lib/index-rYV4VmC2.js +1163 -0
  59. package/lib/index.css +1 -1
  60. package/lib/ini-CC3_THb4.js +6 -0
  61. package/lib/ini-CiaphB6F.mjs +77 -0
  62. package/lib/java-CwRV8Dsg.js +6 -0
  63. package/lib/java-DxksziCw.mjs +238 -0
  64. package/lib/javascript-D1eKEotE.js +6 -0
  65. package/lib/javascript-c8D1_K05.mjs +76 -0
  66. package/lib/jsonMode-8-L3-E9k.mjs +2042 -0
  67. package/lib/jsonMode-BdBVsN9_.js +15 -0
  68. package/lib/julia-7Z1jwT4W.js +6 -0
  69. package/lib/julia-TTty8och.mjs +517 -0
  70. package/lib/kotlin-BAXgl2QX.js +6 -0
  71. package/lib/kotlin-Dzand-bM.mjs +259 -0
  72. package/lib/less-CSG9Zdoy.js +7 -0
  73. package/lib/less-CWDFQI_i.mjs +168 -0
  74. package/lib/lexon-BiTtMD9F.js +6 -0
  75. package/lib/lexon-bZpjZioh.mjs +163 -0
  76. package/lib/liquid-BmlJOXgY.js +6 -0
  77. package/lib/liquid-Bs7DM5cg.mjs +248 -0
  78. package/lib/lua-CoWYKXUu.mjs +168 -0
  79. package/lib/lua-o7UTFJ05.js +6 -0
  80. package/lib/m3-DIJY3uEe.mjs +216 -0
  81. package/lib/m3-DOYTRLxi.js +6 -0
  82. package/lib/markdown-CDlkMTMZ.mjs +235 -0
  83. package/lib/markdown-Di5faXtP.js +6 -0
  84. package/lib/mdx-BEI71kqO.mjs +173 -0
  85. package/lib/mdx-DJV2KJ98.js +6 -0
  86. package/lib/mips-CIiuS33B.mjs +204 -0
  87. package/lib/mips-CjGjcf9D.js +6 -0
  88. package/lib/msdax-4_jBeazN.mjs +381 -0
  89. package/lib/msdax-DZFpIwAH.js +6 -0
  90. package/lib/mysql-6Y0DL_eO.js +6 -0
  91. package/lib/mysql-D_KZRjSR.mjs +884 -0
  92. package/lib/objective-c-7nsY1fc1.mjs +189 -0
  93. package/lib/objective-c-BtrzMwBz.js +6 -0
  94. package/lib/pascal-BF06Dt9I.js +6 -0
  95. package/lib/pascal-BHpF9PW1.mjs +257 -0
  96. package/lib/pascaligo-BDrxVOcH.js +6 -0
  97. package/lib/pascaligo-C3mRbxmU.mjs +170 -0
  98. package/lib/perl-BMlqAyyD.js +6 -0
  99. package/lib/perl-F3tWDMLI.mjs +632 -0
  100. package/lib/pgsql-D62t1RD_.mjs +857 -0
  101. package/lib/pgsql-DXYBcnYD.js +6 -0
  102. package/lib/php-C8GGPjjI.mjs +506 -0
  103. package/lib/php-DmDmMNs3.js +6 -0
  104. package/lib/pla-2A6q3K8_.js +6 -0
  105. package/lib/pla-C_W_x2fV.mjs +143 -0
  106. package/lib/postiats-CMS8WwLg.mjs +913 -0
  107. package/lib/postiats-DQ-6iLGI.js +6 -0
  108. package/lib/powerquery-CuZPk7NC.js +6 -0
  109. package/lib/powerquery-Dcs0XplE.mjs +896 -0
  110. package/lib/powershell-Brx1N_3T.mjs +245 -0
  111. package/lib/powershell-D7BqJxnS.js +6 -0
  112. package/lib/protobuf-CkqkhuUG.js +7 -0
  113. package/lib/protobuf-UEJDuX6l.mjs +426 -0
  114. package/lib/pug-65DF18O8.js +6 -0
  115. package/lib/pug-LDwDmrMc.mjs +408 -0
  116. package/lib/python-BOeTitp9.mjs +309 -0
  117. package/lib/python-DRyE-VQQ.js +6 -0
  118. package/lib/qsharp-Cb7hPwnM.mjs +307 -0
  119. package/lib/qsharp-Dw07PXbd.js +6 -0
  120. package/lib/r-BHuY0po5.js +6 -0
  121. package/lib/r-BiFgSgcs.mjs +249 -0
  122. package/lib/razor-D0RPXCAO.mjs +558 -0
  123. package/lib/razor-DtDOotKq.js +6 -0
  124. package/lib/redis-BdzqoKC2.mjs +308 -0
  125. package/lib/redis-_Q4kv9ug.js +6 -0
  126. package/lib/redshift-DNNCHCLR.js +6 -0
  127. package/lib/redshift-Df6PoiEL.mjs +815 -0
  128. package/lib/restructuredtext-C9FM3r80.js +6 -0
  129. package/lib/restructuredtext-CW0ZtQ2l.mjs +180 -0
  130. package/lib/ruby-DyIFepcy.mjs +517 -0
  131. package/lib/ruby-DyJmXCYh.js +6 -0
  132. package/lib/rust-BiRHKB0S.mjs +349 -0
  133. package/lib/rust-DVvzZ_uH.js +6 -0
  134. package/lib/sb-CFwmZh3c.js +6 -0
  135. package/lib/sb-CahkGwPC.mjs +121 -0
  136. package/lib/scala-Cg9Wfw6B.mjs +376 -0
  137. package/lib/scala-DjaRe0PR.js +6 -0
  138. package/lib/scheme-Bqb0wlMX.mjs +114 -0
  139. package/lib/scheme-ZdeLzG0d.js +6 -0
  140. package/lib/scss-3qd2syug.mjs +268 -0
  141. package/lib/scss-Dqv1RljX.js +8 -0
  142. package/lib/shell-B5iW6U-v.mjs +227 -0
  143. package/lib/shell-BJ5zD_-e.js +6 -0
  144. package/lib/solidity-8Ys0iSgd.mjs +1373 -0
  145. package/lib/solidity-CagYWQAe.js +6 -0
  146. package/lib/sophia-PnZfErC3.mjs +205 -0
  147. package/lib/sophia-szuux90p.js +6 -0
  148. package/lib/sparql-CXz1-gkd.js +6 -0
  149. package/lib/sparql-CgWX-KRM.mjs +207 -0
  150. package/lib/sql-CN3Vg4Sm.mjs +859 -0
  151. package/lib/sql-CWZ5x4mg.js +6 -0
  152. package/lib/st-CcWMPoh3.js +6 -0
  153. package/lib/st-DKDuarOh.mjs +422 -0
  154. package/lib/swift-DUBoAkDR.js +8 -0
  155. package/lib/swift-DnXH6Con.mjs +318 -0
  156. package/lib/systemverilog-5hQzl-99.js +6 -0
  157. package/lib/systemverilog-pJOgZU46.mjs +582 -0
  158. package/lib/tcl-Bls9iNXn.mjs +238 -0
  159. package/lib/tcl-CiK0GhJi.js +6 -0
  160. package/lib/tsMode-BB2mDc5d.mjs +906 -0
  161. package/lib/tsMode-N-LS5RKx.js +16 -0
  162. package/lib/twig-B14HEeE0.mjs +398 -0
  163. package/lib/twig-Cbq-Ua-E.js +6 -0
  164. package/lib/typescript-CZplv8KD.js +6 -0
  165. package/lib/typescript-f9PHTVoW.mjs +351 -0
  166. package/lib/typespec-Br_LC070.js +6 -0
  167. package/lib/typespec-dAaIdBal.mjs +125 -0
  168. package/lib/umd/index.js +1914 -2
  169. package/lib/vb-B1HzwoGL.js +6 -0
  170. package/lib/vb-CPBujGrP.mjs +378 -0
  171. package/lib/wgsl-BNAUPMiJ.js +303 -0
  172. package/lib/wgsl-CqCqdnZC.mjs +448 -0
  173. package/lib/xml-BSe-ETnG.js +6 -0
  174. package/lib/xml-Dv0cmUxw.mjs +103 -0
  175. package/lib/yaml-O_DoXtBP.js +6 -0
  176. package/lib/yaml-eXS7QSgG.mjs +214 -0
  177. package/package.json +9 -16
  178. package/LICENSE +0 -176
@@ -0,0 +1,2042 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ import { m as monaco_editor_core_star } from "./index-D6nY5NdF.mjs";
4
+ /*!-----------------------------------------------------------------------------
5
+ * Copyright (c) Microsoft Corporation. All rights reserved.
6
+ * Version: 0.52.0(f6dc0eb8fce67e57f6036f4769d92c1666cdf546)
7
+ * Released under the MIT license
8
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
9
+ *-----------------------------------------------------------------------------*/
10
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __copyProps = /* @__PURE__ */ __name((to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function")
12
+ for (let key of __getOwnPropNames(from))
13
+ !__hasOwnProp.call(to, key) && key !== except && __defProp2(to, key, { get: /* @__PURE__ */ __name(() => from[key], "get"), enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ return to;
15
+ }, "__copyProps"), __reExport = /* @__PURE__ */ __name((target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget), "__reExport"), monaco_editor_core_exports = {};
16
+ __reExport(monaco_editor_core_exports, monaco_editor_core_star);
17
+ var STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3, _a, WorkerManager = (_a = class {
18
+ constructor(defaults) {
19
+ this._defaults = defaults, this._worker = null, this._client = null, this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3), this._lastUsedTime = 0, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
20
+ }
21
+ _stopWorker() {
22
+ this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
23
+ }
24
+ dispose() {
25
+ clearInterval(this._idleCheckInterval), this._configChangeListener.dispose(), this._stopWorker();
26
+ }
27
+ _checkIfIdle() {
28
+ if (!this._worker)
29
+ return;
30
+ Date.now() - this._lastUsedTime > STOP_WHEN_IDLE_FOR && this._stopWorker();
31
+ }
32
+ _getClient() {
33
+ return this._lastUsedTime = Date.now(), this._client || (this._worker = monaco_editor_core_exports.editor.createWebWorker({
34
+ // module that exports the create() method and returns a `JSONWorker` instance
35
+ moduleId: "vs/language/json/jsonWorker",
36
+ label: this._defaults.languageId,
37
+ // passed in to the create() method
38
+ createData: {
39
+ languageSettings: this._defaults.diagnosticsOptions,
40
+ languageId: this._defaults.languageId,
41
+ enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest
42
+ }
43
+ }), this._client = this._worker.getProxy()), this._client;
44
+ }
45
+ getLanguageServiceWorker(...resources) {
46
+ let _client;
47
+ return this._getClient().then((client) => {
48
+ _client = client;
49
+ }).then((_) => {
50
+ if (this._worker)
51
+ return this._worker.withSyncedResources(resources);
52
+ }).then((_) => _client);
53
+ }
54
+ }, __name(_a, "WorkerManager"), _a), DocumentUri;
55
+ (function(DocumentUri2) {
56
+ function is(value) {
57
+ return typeof value == "string";
58
+ }
59
+ __name(is, "is"), DocumentUri2.is = is;
60
+ })(DocumentUri || (DocumentUri = {}));
61
+ var URI;
62
+ (function(URI2) {
63
+ function is(value) {
64
+ return typeof value == "string";
65
+ }
66
+ __name(is, "is"), URI2.is = is;
67
+ })(URI || (URI = {}));
68
+ var integer;
69
+ (function(integer2) {
70
+ integer2.MIN_VALUE = -2147483648, integer2.MAX_VALUE = 2147483647;
71
+ function is(value) {
72
+ return typeof value == "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE;
73
+ }
74
+ __name(is, "is"), integer2.is = is;
75
+ })(integer || (integer = {}));
76
+ var uinteger;
77
+ (function(uinteger2) {
78
+ uinteger2.MIN_VALUE = 0, uinteger2.MAX_VALUE = 2147483647;
79
+ function is(value) {
80
+ return typeof value == "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE;
81
+ }
82
+ __name(is, "is"), uinteger2.is = is;
83
+ })(uinteger || (uinteger = {}));
84
+ var Position;
85
+ (function(Position3) {
86
+ function create(line, character) {
87
+ return line === Number.MAX_VALUE && (line = uinteger.MAX_VALUE), character === Number.MAX_VALUE && (character = uinteger.MAX_VALUE), { line, character };
88
+ }
89
+ __name(create, "create"), Position3.create = create;
90
+ function is(value) {
91
+ let candidate = value;
92
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
93
+ }
94
+ __name(is, "is"), Position3.is = is;
95
+ })(Position || (Position = {}));
96
+ var Range;
97
+ (function(Range3) {
98
+ function create(one, two, three, four) {
99
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four))
100
+ return { start: Position.create(one, two), end: Position.create(three, four) };
101
+ if (Position.is(one) && Position.is(two))
102
+ return { start: one, end: two };
103
+ throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
104
+ }
105
+ __name(create, "create"), Range3.create = create;
106
+ function is(value) {
107
+ let candidate = value;
108
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
109
+ }
110
+ __name(is, "is"), Range3.is = is;
111
+ })(Range || (Range = {}));
112
+ var Location;
113
+ (function(Location2) {
114
+ function create(uri, range) {
115
+ return { uri, range };
116
+ }
117
+ __name(create, "create"), Location2.create = create;
118
+ function is(value) {
119
+ let candidate = value;
120
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
121
+ }
122
+ __name(is, "is"), Location2.is = is;
123
+ })(Location || (Location = {}));
124
+ var LocationLink;
125
+ (function(LocationLink2) {
126
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
127
+ return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
128
+ }
129
+ __name(create, "create"), LocationLink2.create = create;
130
+ function is(value) {
131
+ let candidate = value;
132
+ return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
133
+ }
134
+ __name(is, "is"), LocationLink2.is = is;
135
+ })(LocationLink || (LocationLink = {}));
136
+ var Color;
137
+ (function(Color2) {
138
+ function create(red, green, blue, alpha) {
139
+ return {
140
+ red,
141
+ green,
142
+ blue,
143
+ alpha
144
+ };
145
+ }
146
+ __name(create, "create"), Color2.create = create;
147
+ function is(value) {
148
+ const candidate = value;
149
+ return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
150
+ }
151
+ __name(is, "is"), Color2.is = is;
152
+ })(Color || (Color = {}));
153
+ var ColorInformation;
154
+ (function(ColorInformation2) {
155
+ function create(range, color) {
156
+ return {
157
+ range,
158
+ color
159
+ };
160
+ }
161
+ __name(create, "create"), ColorInformation2.create = create;
162
+ function is(value) {
163
+ const candidate = value;
164
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
165
+ }
166
+ __name(is, "is"), ColorInformation2.is = is;
167
+ })(ColorInformation || (ColorInformation = {}));
168
+ var ColorPresentation;
169
+ (function(ColorPresentation2) {
170
+ function create(label, textEdit, additionalTextEdits) {
171
+ return {
172
+ label,
173
+ textEdit,
174
+ additionalTextEdits
175
+ };
176
+ }
177
+ __name(create, "create"), ColorPresentation2.create = create;
178
+ function is(value) {
179
+ const candidate = value;
180
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
181
+ }
182
+ __name(is, "is"), ColorPresentation2.is = is;
183
+ })(ColorPresentation || (ColorPresentation = {}));
184
+ var FoldingRangeKind;
185
+ (function(FoldingRangeKind2) {
186
+ FoldingRangeKind2.Comment = "comment", FoldingRangeKind2.Imports = "imports", FoldingRangeKind2.Region = "region";
187
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
188
+ var FoldingRange;
189
+ (function(FoldingRange2) {
190
+ function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
191
+ const result = {
192
+ startLine,
193
+ endLine
194
+ };
195
+ return Is.defined(startCharacter) && (result.startCharacter = startCharacter), Is.defined(endCharacter) && (result.endCharacter = endCharacter), Is.defined(kind) && (result.kind = kind), Is.defined(collapsedText) && (result.collapsedText = collapsedText), result;
196
+ }
197
+ __name(create, "create"), FoldingRange2.create = create;
198
+ function is(value) {
199
+ const candidate = value;
200
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
201
+ }
202
+ __name(is, "is"), FoldingRange2.is = is;
203
+ })(FoldingRange || (FoldingRange = {}));
204
+ var DiagnosticRelatedInformation;
205
+ (function(DiagnosticRelatedInformation2) {
206
+ function create(location, message) {
207
+ return {
208
+ location,
209
+ message
210
+ };
211
+ }
212
+ __name(create, "create"), DiagnosticRelatedInformation2.create = create;
213
+ function is(value) {
214
+ let candidate = value;
215
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
216
+ }
217
+ __name(is, "is"), DiagnosticRelatedInformation2.is = is;
218
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
219
+ var DiagnosticSeverity;
220
+ (function(DiagnosticSeverity2) {
221
+ DiagnosticSeverity2.Error = 1, DiagnosticSeverity2.Warning = 2, DiagnosticSeverity2.Information = 3, DiagnosticSeverity2.Hint = 4;
222
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
223
+ var DiagnosticTag;
224
+ (function(DiagnosticTag2) {
225
+ DiagnosticTag2.Unnecessary = 1, DiagnosticTag2.Deprecated = 2;
226
+ })(DiagnosticTag || (DiagnosticTag = {}));
227
+ var CodeDescription;
228
+ (function(CodeDescription2) {
229
+ function is(value) {
230
+ const candidate = value;
231
+ return Is.objectLiteral(candidate) && Is.string(candidate.href);
232
+ }
233
+ __name(is, "is"), CodeDescription2.is = is;
234
+ })(CodeDescription || (CodeDescription = {}));
235
+ var Diagnostic;
236
+ (function(Diagnostic2) {
237
+ function create(range, message, severity, code, source, relatedInformation) {
238
+ let result = { range, message };
239
+ return Is.defined(severity) && (result.severity = severity), Is.defined(code) && (result.code = code), Is.defined(source) && (result.source = source), Is.defined(relatedInformation) && (result.relatedInformation = relatedInformation), result;
240
+ }
241
+ __name(create, "create"), Diagnostic2.create = create;
242
+ function is(value) {
243
+ var _a20;
244
+ let candidate = value;
245
+ return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a20 = candidate.codeDescription) === null || _a20 === void 0 ? void 0 : _a20.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
246
+ }
247
+ __name(is, "is"), Diagnostic2.is = is;
248
+ })(Diagnostic || (Diagnostic = {}));
249
+ var Command;
250
+ (function(Command2) {
251
+ function create(title, command, ...args) {
252
+ let result = { title, command };
253
+ return Is.defined(args) && args.length > 0 && (result.arguments = args), result;
254
+ }
255
+ __name(create, "create"), Command2.create = create;
256
+ function is(value) {
257
+ let candidate = value;
258
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
259
+ }
260
+ __name(is, "is"), Command2.is = is;
261
+ })(Command || (Command = {}));
262
+ var TextEdit;
263
+ (function(TextEdit2) {
264
+ function replace(range, newText) {
265
+ return { range, newText };
266
+ }
267
+ __name(replace, "replace"), TextEdit2.replace = replace;
268
+ function insert(position, newText) {
269
+ return { range: { start: position, end: position }, newText };
270
+ }
271
+ __name(insert, "insert"), TextEdit2.insert = insert;
272
+ function del(range) {
273
+ return { range, newText: "" };
274
+ }
275
+ __name(del, "del"), TextEdit2.del = del;
276
+ function is(value) {
277
+ const candidate = value;
278
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
279
+ }
280
+ __name(is, "is"), TextEdit2.is = is;
281
+ })(TextEdit || (TextEdit = {}));
282
+ var ChangeAnnotation;
283
+ (function(ChangeAnnotation2) {
284
+ function create(label, needsConfirmation, description) {
285
+ const result = { label };
286
+ return needsConfirmation !== void 0 && (result.needsConfirmation = needsConfirmation), description !== void 0 && (result.description = description), result;
287
+ }
288
+ __name(create, "create"), ChangeAnnotation2.create = create;
289
+ function is(value) {
290
+ const candidate = value;
291
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
292
+ }
293
+ __name(is, "is"), ChangeAnnotation2.is = is;
294
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
295
+ var ChangeAnnotationIdentifier;
296
+ (function(ChangeAnnotationIdentifier2) {
297
+ function is(value) {
298
+ const candidate = value;
299
+ return Is.string(candidate);
300
+ }
301
+ __name(is, "is"), ChangeAnnotationIdentifier2.is = is;
302
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
303
+ var AnnotatedTextEdit;
304
+ (function(AnnotatedTextEdit2) {
305
+ function replace(range, newText, annotation) {
306
+ return { range, newText, annotationId: annotation };
307
+ }
308
+ __name(replace, "replace"), AnnotatedTextEdit2.replace = replace;
309
+ function insert(position, newText, annotation) {
310
+ return { range: { start: position, end: position }, newText, annotationId: annotation };
311
+ }
312
+ __name(insert, "insert"), AnnotatedTextEdit2.insert = insert;
313
+ function del(range, annotation) {
314
+ return { range, newText: "", annotationId: annotation };
315
+ }
316
+ __name(del, "del"), AnnotatedTextEdit2.del = del;
317
+ function is(value) {
318
+ const candidate = value;
319
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
320
+ }
321
+ __name(is, "is"), AnnotatedTextEdit2.is = is;
322
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
323
+ var TextDocumentEdit;
324
+ (function(TextDocumentEdit2) {
325
+ function create(textDocument, edits) {
326
+ return { textDocument, edits };
327
+ }
328
+ __name(create, "create"), TextDocumentEdit2.create = create;
329
+ function is(value) {
330
+ let candidate = value;
331
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
332
+ }
333
+ __name(is, "is"), TextDocumentEdit2.is = is;
334
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
335
+ var CreateFile;
336
+ (function(CreateFile2) {
337
+ function create(uri, options, annotation) {
338
+ let result = {
339
+ kind: "create",
340
+ uri
341
+ };
342
+ return options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
343
+ }
344
+ __name(create, "create"), CreateFile2.create = create;
345
+ function is(value) {
346
+ let candidate = value;
347
+ return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
348
+ }
349
+ __name(is, "is"), CreateFile2.is = is;
350
+ })(CreateFile || (CreateFile = {}));
351
+ var RenameFile;
352
+ (function(RenameFile2) {
353
+ function create(oldUri, newUri, options, annotation) {
354
+ let result = {
355
+ kind: "rename",
356
+ oldUri,
357
+ newUri
358
+ };
359
+ return options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
360
+ }
361
+ __name(create, "create"), RenameFile2.create = create;
362
+ function is(value) {
363
+ let candidate = value;
364
+ return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
365
+ }
366
+ __name(is, "is"), RenameFile2.is = is;
367
+ })(RenameFile || (RenameFile = {}));
368
+ var DeleteFile;
369
+ (function(DeleteFile2) {
370
+ function create(uri, options, annotation) {
371
+ let result = {
372
+ kind: "delete",
373
+ uri
374
+ };
375
+ return options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
376
+ }
377
+ __name(create, "create"), DeleteFile2.create = create;
378
+ function is(value) {
379
+ let candidate = value;
380
+ return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
381
+ }
382
+ __name(is, "is"), DeleteFile2.is = is;
383
+ })(DeleteFile || (DeleteFile = {}));
384
+ var WorkspaceEdit;
385
+ (function(WorkspaceEdit2) {
386
+ function is(value) {
387
+ let candidate = value;
388
+ return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => Is.string(change.kind) ? CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change) : TextDocumentEdit.is(change)));
389
+ }
390
+ __name(is, "is"), WorkspaceEdit2.is = is;
391
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
392
+ var TextDocumentIdentifier;
393
+ (function(TextDocumentIdentifier2) {
394
+ function create(uri) {
395
+ return { uri };
396
+ }
397
+ __name(create, "create"), TextDocumentIdentifier2.create = create;
398
+ function is(value) {
399
+ let candidate = value;
400
+ return Is.defined(candidate) && Is.string(candidate.uri);
401
+ }
402
+ __name(is, "is"), TextDocumentIdentifier2.is = is;
403
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
404
+ var VersionedTextDocumentIdentifier;
405
+ (function(VersionedTextDocumentIdentifier2) {
406
+ function create(uri, version) {
407
+ return { uri, version };
408
+ }
409
+ __name(create, "create"), VersionedTextDocumentIdentifier2.create = create;
410
+ function is(value) {
411
+ let candidate = value;
412
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
413
+ }
414
+ __name(is, "is"), VersionedTextDocumentIdentifier2.is = is;
415
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
416
+ var OptionalVersionedTextDocumentIdentifier;
417
+ (function(OptionalVersionedTextDocumentIdentifier2) {
418
+ function create(uri, version) {
419
+ return { uri, version };
420
+ }
421
+ __name(create, "create"), OptionalVersionedTextDocumentIdentifier2.create = create;
422
+ function is(value) {
423
+ let candidate = value;
424
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
425
+ }
426
+ __name(is, "is"), OptionalVersionedTextDocumentIdentifier2.is = is;
427
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
428
+ var TextDocumentItem;
429
+ (function(TextDocumentItem2) {
430
+ function create(uri, languageId, version, text) {
431
+ return { uri, languageId, version, text };
432
+ }
433
+ __name(create, "create"), TextDocumentItem2.create = create;
434
+ function is(value) {
435
+ let candidate = value;
436
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
437
+ }
438
+ __name(is, "is"), TextDocumentItem2.is = is;
439
+ })(TextDocumentItem || (TextDocumentItem = {}));
440
+ var MarkupKind;
441
+ (function(MarkupKind2) {
442
+ MarkupKind2.PlainText = "plaintext", MarkupKind2.Markdown = "markdown";
443
+ function is(value) {
444
+ const candidate = value;
445
+ return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
446
+ }
447
+ __name(is, "is"), MarkupKind2.is = is;
448
+ })(MarkupKind || (MarkupKind = {}));
449
+ var MarkupContent;
450
+ (function(MarkupContent2) {
451
+ function is(value) {
452
+ const candidate = value;
453
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
454
+ }
455
+ __name(is, "is"), MarkupContent2.is = is;
456
+ })(MarkupContent || (MarkupContent = {}));
457
+ var CompletionItemKind;
458
+ (function(CompletionItemKind2) {
459
+ CompletionItemKind2.Text = 1, CompletionItemKind2.Method = 2, CompletionItemKind2.Function = 3, CompletionItemKind2.Constructor = 4, CompletionItemKind2.Field = 5, CompletionItemKind2.Variable = 6, CompletionItemKind2.Class = 7, CompletionItemKind2.Interface = 8, CompletionItemKind2.Module = 9, CompletionItemKind2.Property = 10, CompletionItemKind2.Unit = 11, CompletionItemKind2.Value = 12, CompletionItemKind2.Enum = 13, CompletionItemKind2.Keyword = 14, CompletionItemKind2.Snippet = 15, CompletionItemKind2.Color = 16, CompletionItemKind2.File = 17, CompletionItemKind2.Reference = 18, CompletionItemKind2.Folder = 19, CompletionItemKind2.EnumMember = 20, CompletionItemKind2.Constant = 21, CompletionItemKind2.Struct = 22, CompletionItemKind2.Event = 23, CompletionItemKind2.Operator = 24, CompletionItemKind2.TypeParameter = 25;
460
+ })(CompletionItemKind || (CompletionItemKind = {}));
461
+ var InsertTextFormat;
462
+ (function(InsertTextFormat2) {
463
+ InsertTextFormat2.PlainText = 1, InsertTextFormat2.Snippet = 2;
464
+ })(InsertTextFormat || (InsertTextFormat = {}));
465
+ var CompletionItemTag;
466
+ (function(CompletionItemTag2) {
467
+ CompletionItemTag2.Deprecated = 1;
468
+ })(CompletionItemTag || (CompletionItemTag = {}));
469
+ var InsertReplaceEdit;
470
+ (function(InsertReplaceEdit2) {
471
+ function create(newText, insert, replace) {
472
+ return { newText, insert, replace };
473
+ }
474
+ __name(create, "create"), InsertReplaceEdit2.create = create;
475
+ function is(value) {
476
+ const candidate = value;
477
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
478
+ }
479
+ __name(is, "is"), InsertReplaceEdit2.is = is;
480
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
481
+ var InsertTextMode;
482
+ (function(InsertTextMode2) {
483
+ InsertTextMode2.asIs = 1, InsertTextMode2.adjustIndentation = 2;
484
+ })(InsertTextMode || (InsertTextMode = {}));
485
+ var CompletionItemLabelDetails;
486
+ (function(CompletionItemLabelDetails2) {
487
+ function is(value) {
488
+ const candidate = value;
489
+ return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
490
+ }
491
+ __name(is, "is"), CompletionItemLabelDetails2.is = is;
492
+ })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
493
+ var CompletionItem;
494
+ (function(CompletionItem2) {
495
+ function create(label) {
496
+ return { label };
497
+ }
498
+ __name(create, "create"), CompletionItem2.create = create;
499
+ })(CompletionItem || (CompletionItem = {}));
500
+ var CompletionList;
501
+ (function(CompletionList2) {
502
+ function create(items, isIncomplete) {
503
+ return { items: items || [], isIncomplete: !!isIncomplete };
504
+ }
505
+ __name(create, "create"), CompletionList2.create = create;
506
+ })(CompletionList || (CompletionList = {}));
507
+ var MarkedString;
508
+ (function(MarkedString2) {
509
+ function fromPlainText(plainText) {
510
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
511
+ }
512
+ __name(fromPlainText, "fromPlainText"), MarkedString2.fromPlainText = fromPlainText;
513
+ function is(value) {
514
+ const candidate = value;
515
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
516
+ }
517
+ __name(is, "is"), MarkedString2.is = is;
518
+ })(MarkedString || (MarkedString = {}));
519
+ var Hover;
520
+ (function(Hover2) {
521
+ function is(value) {
522
+ let candidate = value;
523
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
524
+ }
525
+ __name(is, "is"), Hover2.is = is;
526
+ })(Hover || (Hover = {}));
527
+ var ParameterInformation;
528
+ (function(ParameterInformation2) {
529
+ function create(label, documentation) {
530
+ return documentation ? { label, documentation } : { label };
531
+ }
532
+ __name(create, "create"), ParameterInformation2.create = create;
533
+ })(ParameterInformation || (ParameterInformation = {}));
534
+ var SignatureInformation;
535
+ (function(SignatureInformation2) {
536
+ function create(label, documentation, ...parameters) {
537
+ let result = { label };
538
+ return Is.defined(documentation) && (result.documentation = documentation), Is.defined(parameters) ? result.parameters = parameters : result.parameters = [], result;
539
+ }
540
+ __name(create, "create"), SignatureInformation2.create = create;
541
+ })(SignatureInformation || (SignatureInformation = {}));
542
+ var DocumentHighlightKind;
543
+ (function(DocumentHighlightKind2) {
544
+ DocumentHighlightKind2.Text = 1, DocumentHighlightKind2.Read = 2, DocumentHighlightKind2.Write = 3;
545
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
546
+ var DocumentHighlight;
547
+ (function(DocumentHighlight2) {
548
+ function create(range, kind) {
549
+ let result = { range };
550
+ return Is.number(kind) && (result.kind = kind), result;
551
+ }
552
+ __name(create, "create"), DocumentHighlight2.create = create;
553
+ })(DocumentHighlight || (DocumentHighlight = {}));
554
+ var SymbolKind;
555
+ (function(SymbolKind2) {
556
+ SymbolKind2.File = 1, SymbolKind2.Module = 2, SymbolKind2.Namespace = 3, SymbolKind2.Package = 4, SymbolKind2.Class = 5, SymbolKind2.Method = 6, SymbolKind2.Property = 7, SymbolKind2.Field = 8, SymbolKind2.Constructor = 9, SymbolKind2.Enum = 10, SymbolKind2.Interface = 11, SymbolKind2.Function = 12, SymbolKind2.Variable = 13, SymbolKind2.Constant = 14, SymbolKind2.String = 15, SymbolKind2.Number = 16, SymbolKind2.Boolean = 17, SymbolKind2.Array = 18, SymbolKind2.Object = 19, SymbolKind2.Key = 20, SymbolKind2.Null = 21, SymbolKind2.EnumMember = 22, SymbolKind2.Struct = 23, SymbolKind2.Event = 24, SymbolKind2.Operator = 25, SymbolKind2.TypeParameter = 26;
557
+ })(SymbolKind || (SymbolKind = {}));
558
+ var SymbolTag;
559
+ (function(SymbolTag2) {
560
+ SymbolTag2.Deprecated = 1;
561
+ })(SymbolTag || (SymbolTag = {}));
562
+ var SymbolInformation;
563
+ (function(SymbolInformation2) {
564
+ function create(name, kind, range, uri, containerName) {
565
+ let result = {
566
+ name,
567
+ kind,
568
+ location: { uri, range }
569
+ };
570
+ return containerName && (result.containerName = containerName), result;
571
+ }
572
+ __name(create, "create"), SymbolInformation2.create = create;
573
+ })(SymbolInformation || (SymbolInformation = {}));
574
+ var WorkspaceSymbol;
575
+ (function(WorkspaceSymbol2) {
576
+ function create(name, kind, uri, range) {
577
+ return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } };
578
+ }
579
+ __name(create, "create"), WorkspaceSymbol2.create = create;
580
+ })(WorkspaceSymbol || (WorkspaceSymbol = {}));
581
+ var DocumentSymbol;
582
+ (function(DocumentSymbol2) {
583
+ function create(name, detail, kind, range, selectionRange, children) {
584
+ let result = {
585
+ name,
586
+ detail,
587
+ kind,
588
+ range,
589
+ selectionRange
590
+ };
591
+ return children !== void 0 && (result.children = children), result;
592
+ }
593
+ __name(create, "create"), DocumentSymbol2.create = create;
594
+ function is(value) {
595
+ let candidate = value;
596
+ return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
597
+ }
598
+ __name(is, "is"), DocumentSymbol2.is = is;
599
+ })(DocumentSymbol || (DocumentSymbol = {}));
600
+ var CodeActionKind;
601
+ (function(CodeActionKind2) {
602
+ CodeActionKind2.Empty = "", CodeActionKind2.QuickFix = "quickfix", CodeActionKind2.Refactor = "refactor", CodeActionKind2.RefactorExtract = "refactor.extract", CodeActionKind2.RefactorInline = "refactor.inline", CodeActionKind2.RefactorRewrite = "refactor.rewrite", CodeActionKind2.Source = "source", CodeActionKind2.SourceOrganizeImports = "source.organizeImports", CodeActionKind2.SourceFixAll = "source.fixAll";
603
+ })(CodeActionKind || (CodeActionKind = {}));
604
+ var CodeActionTriggerKind;
605
+ (function(CodeActionTriggerKind2) {
606
+ CodeActionTriggerKind2.Invoked = 1, CodeActionTriggerKind2.Automatic = 2;
607
+ })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
608
+ var CodeActionContext;
609
+ (function(CodeActionContext2) {
610
+ function create(diagnostics, only, triggerKind) {
611
+ let result = { diagnostics };
612
+ return only != null && (result.only = only), triggerKind != null && (result.triggerKind = triggerKind), result;
613
+ }
614
+ __name(create, "create"), CodeActionContext2.create = create;
615
+ function is(value) {
616
+ let candidate = value;
617
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
618
+ }
619
+ __name(is, "is"), CodeActionContext2.is = is;
620
+ })(CodeActionContext || (CodeActionContext = {}));
621
+ var CodeAction;
622
+ (function(CodeAction2) {
623
+ function create(title, kindOrCommandOrEdit, kind) {
624
+ let result = { title }, checkKind = !0;
625
+ return typeof kindOrCommandOrEdit == "string" ? (checkKind = !1, result.kind = kindOrCommandOrEdit) : Command.is(kindOrCommandOrEdit) ? result.command = kindOrCommandOrEdit : result.edit = kindOrCommandOrEdit, checkKind && kind !== void 0 && (result.kind = kind), result;
626
+ }
627
+ __name(create, "create"), CodeAction2.create = create;
628
+ function is(value) {
629
+ let candidate = value;
630
+ return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
631
+ }
632
+ __name(is, "is"), CodeAction2.is = is;
633
+ })(CodeAction || (CodeAction = {}));
634
+ var CodeLens;
635
+ (function(CodeLens2) {
636
+ function create(range, data) {
637
+ let result = { range };
638
+ return Is.defined(data) && (result.data = data), result;
639
+ }
640
+ __name(create, "create"), CodeLens2.create = create;
641
+ function is(value) {
642
+ let candidate = value;
643
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
644
+ }
645
+ __name(is, "is"), CodeLens2.is = is;
646
+ })(CodeLens || (CodeLens = {}));
647
+ var FormattingOptions;
648
+ (function(FormattingOptions2) {
649
+ function create(tabSize, insertSpaces) {
650
+ return { tabSize, insertSpaces };
651
+ }
652
+ __name(create, "create"), FormattingOptions2.create = create;
653
+ function is(value) {
654
+ let candidate = value;
655
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
656
+ }
657
+ __name(is, "is"), FormattingOptions2.is = is;
658
+ })(FormattingOptions || (FormattingOptions = {}));
659
+ var DocumentLink;
660
+ (function(DocumentLink2) {
661
+ function create(range, target, data) {
662
+ return { range, target, data };
663
+ }
664
+ __name(create, "create"), DocumentLink2.create = create;
665
+ function is(value) {
666
+ let candidate = value;
667
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
668
+ }
669
+ __name(is, "is"), DocumentLink2.is = is;
670
+ })(DocumentLink || (DocumentLink = {}));
671
+ var SelectionRange;
672
+ (function(SelectionRange2) {
673
+ function create(range, parent) {
674
+ return { range, parent };
675
+ }
676
+ __name(create, "create"), SelectionRange2.create = create;
677
+ function is(value) {
678
+ let candidate = value;
679
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
680
+ }
681
+ __name(is, "is"), SelectionRange2.is = is;
682
+ })(SelectionRange || (SelectionRange = {}));
683
+ var SemanticTokenTypes;
684
+ (function(SemanticTokenTypes2) {
685
+ SemanticTokenTypes2.namespace = "namespace", SemanticTokenTypes2.type = "type", SemanticTokenTypes2.class = "class", SemanticTokenTypes2.enum = "enum", SemanticTokenTypes2.interface = "interface", SemanticTokenTypes2.struct = "struct", SemanticTokenTypes2.typeParameter = "typeParameter", SemanticTokenTypes2.parameter = "parameter", SemanticTokenTypes2.variable = "variable", SemanticTokenTypes2.property = "property", SemanticTokenTypes2.enumMember = "enumMember", SemanticTokenTypes2.event = "event", SemanticTokenTypes2.function = "function", SemanticTokenTypes2.method = "method", SemanticTokenTypes2.macro = "macro", SemanticTokenTypes2.keyword = "keyword", SemanticTokenTypes2.modifier = "modifier", SemanticTokenTypes2.comment = "comment", SemanticTokenTypes2.string = "string", SemanticTokenTypes2.number = "number", SemanticTokenTypes2.regexp = "regexp", SemanticTokenTypes2.operator = "operator", SemanticTokenTypes2.decorator = "decorator";
686
+ })(SemanticTokenTypes || (SemanticTokenTypes = {}));
687
+ var SemanticTokenModifiers;
688
+ (function(SemanticTokenModifiers2) {
689
+ SemanticTokenModifiers2.declaration = "declaration", SemanticTokenModifiers2.definition = "definition", SemanticTokenModifiers2.readonly = "readonly", SemanticTokenModifiers2.static = "static", SemanticTokenModifiers2.deprecated = "deprecated", SemanticTokenModifiers2.abstract = "abstract", SemanticTokenModifiers2.async = "async", SemanticTokenModifiers2.modification = "modification", SemanticTokenModifiers2.documentation = "documentation", SemanticTokenModifiers2.defaultLibrary = "defaultLibrary";
690
+ })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
691
+ var SemanticTokens;
692
+ (function(SemanticTokens2) {
693
+ function is(value) {
694
+ const candidate = value;
695
+ return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId == "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] == "number");
696
+ }
697
+ __name(is, "is"), SemanticTokens2.is = is;
698
+ })(SemanticTokens || (SemanticTokens = {}));
699
+ var InlineValueText;
700
+ (function(InlineValueText2) {
701
+ function create(range, text) {
702
+ return { range, text };
703
+ }
704
+ __name(create, "create"), InlineValueText2.create = create;
705
+ function is(value) {
706
+ const candidate = value;
707
+ return candidate != null && Range.is(candidate.range) && Is.string(candidate.text);
708
+ }
709
+ __name(is, "is"), InlineValueText2.is = is;
710
+ })(InlineValueText || (InlineValueText = {}));
711
+ var InlineValueVariableLookup;
712
+ (function(InlineValueVariableLookup2) {
713
+ function create(range, variableName, caseSensitiveLookup) {
714
+ return { range, variableName, caseSensitiveLookup };
715
+ }
716
+ __name(create, "create"), InlineValueVariableLookup2.create = create;
717
+ function is(value) {
718
+ const candidate = value;
719
+ return candidate != null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
720
+ }
721
+ __name(is, "is"), InlineValueVariableLookup2.is = is;
722
+ })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
723
+ var InlineValueEvaluatableExpression;
724
+ (function(InlineValueEvaluatableExpression2) {
725
+ function create(range, expression) {
726
+ return { range, expression };
727
+ }
728
+ __name(create, "create"), InlineValueEvaluatableExpression2.create = create;
729
+ function is(value) {
730
+ const candidate = value;
731
+ return candidate != null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
732
+ }
733
+ __name(is, "is"), InlineValueEvaluatableExpression2.is = is;
734
+ })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
735
+ var InlineValueContext;
736
+ (function(InlineValueContext2) {
737
+ function create(frameId, stoppedLocation) {
738
+ return { frameId, stoppedLocation };
739
+ }
740
+ __name(create, "create"), InlineValueContext2.create = create;
741
+ function is(value) {
742
+ const candidate = value;
743
+ return Is.defined(candidate) && Range.is(value.stoppedLocation);
744
+ }
745
+ __name(is, "is"), InlineValueContext2.is = is;
746
+ })(InlineValueContext || (InlineValueContext = {}));
747
+ var InlayHintKind;
748
+ (function(InlayHintKind2) {
749
+ InlayHintKind2.Type = 1, InlayHintKind2.Parameter = 2;
750
+ function is(value) {
751
+ return value === 1 || value === 2;
752
+ }
753
+ __name(is, "is"), InlayHintKind2.is = is;
754
+ })(InlayHintKind || (InlayHintKind = {}));
755
+ var InlayHintLabelPart;
756
+ (function(InlayHintLabelPart2) {
757
+ function create(value) {
758
+ return { value };
759
+ }
760
+ __name(create, "create"), InlayHintLabelPart2.create = create;
761
+ function is(value) {
762
+ const candidate = value;
763
+ return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command));
764
+ }
765
+ __name(is, "is"), InlayHintLabelPart2.is = is;
766
+ })(InlayHintLabelPart || (InlayHintLabelPart = {}));
767
+ var InlayHint;
768
+ (function(InlayHint2) {
769
+ function create(position, label, kind) {
770
+ const result = { position, label };
771
+ return kind !== void 0 && (result.kind = kind), result;
772
+ }
773
+ __name(create, "create"), InlayHint2.create = create;
774
+ function is(value) {
775
+ const candidate = value;
776
+ return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
777
+ }
778
+ __name(is, "is"), InlayHint2.is = is;
779
+ })(InlayHint || (InlayHint = {}));
780
+ var StringValue;
781
+ (function(StringValue2) {
782
+ function createSnippet(value) {
783
+ return { kind: "snippet", value };
784
+ }
785
+ __name(createSnippet, "createSnippet"), StringValue2.createSnippet = createSnippet;
786
+ })(StringValue || (StringValue = {}));
787
+ var InlineCompletionItem;
788
+ (function(InlineCompletionItem2) {
789
+ function create(insertText, filterText, range, command) {
790
+ return { insertText, filterText, range, command };
791
+ }
792
+ __name(create, "create"), InlineCompletionItem2.create = create;
793
+ })(InlineCompletionItem || (InlineCompletionItem = {}));
794
+ var InlineCompletionList;
795
+ (function(InlineCompletionList2) {
796
+ function create(items) {
797
+ return { items };
798
+ }
799
+ __name(create, "create"), InlineCompletionList2.create = create;
800
+ })(InlineCompletionList || (InlineCompletionList = {}));
801
+ var InlineCompletionTriggerKind;
802
+ (function(InlineCompletionTriggerKind2) {
803
+ InlineCompletionTriggerKind2.Invoked = 0, InlineCompletionTriggerKind2.Automatic = 1;
804
+ })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
805
+ var SelectedCompletionInfo;
806
+ (function(SelectedCompletionInfo2) {
807
+ function create(range, text) {
808
+ return { range, text };
809
+ }
810
+ __name(create, "create"), SelectedCompletionInfo2.create = create;
811
+ })(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
812
+ var InlineCompletionContext;
813
+ (function(InlineCompletionContext2) {
814
+ function create(triggerKind, selectedCompletionInfo) {
815
+ return { triggerKind, selectedCompletionInfo };
816
+ }
817
+ __name(create, "create"), InlineCompletionContext2.create = create;
818
+ })(InlineCompletionContext || (InlineCompletionContext = {}));
819
+ var WorkspaceFolder;
820
+ (function(WorkspaceFolder2) {
821
+ function is(value) {
822
+ const candidate = value;
823
+ return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
824
+ }
825
+ __name(is, "is"), WorkspaceFolder2.is = is;
826
+ })(WorkspaceFolder || (WorkspaceFolder = {}));
827
+ var TextDocument;
828
+ (function(TextDocument2) {
829
+ function create(uri, languageId, version, content) {
830
+ return new FullTextDocument(uri, languageId, version, content);
831
+ }
832
+ __name(create, "create"), TextDocument2.create = create;
833
+ function is(value) {
834
+ let candidate = value;
835
+ return !!(Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt));
836
+ }
837
+ __name(is, "is"), TextDocument2.is = is;
838
+ function applyEdits(document, edits) {
839
+ let text = document.getText(), sortedEdits = mergeSort(edits, (a, b) => {
840
+ let diff = a.range.start.line - b.range.start.line;
841
+ return diff === 0 ? a.range.start.character - b.range.start.character : diff;
842
+ }), lastModifiedOffset = text.length;
843
+ for (let i = sortedEdits.length - 1; i >= 0; i--) {
844
+ let e = sortedEdits[i], startOffset = document.offsetAt(e.range.start), endOffset = document.offsetAt(e.range.end);
845
+ if (endOffset <= lastModifiedOffset)
846
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
847
+ else
848
+ throw new Error("Overlapping edit");
849
+ lastModifiedOffset = startOffset;
850
+ }
851
+ return text;
852
+ }
853
+ __name(applyEdits, "applyEdits"), TextDocument2.applyEdits = applyEdits;
854
+ function mergeSort(data, compare) {
855
+ if (data.length <= 1)
856
+ return data;
857
+ const p = data.length / 2 | 0, left = data.slice(0, p), right = data.slice(p);
858
+ mergeSort(left, compare), mergeSort(right, compare);
859
+ let leftIdx = 0, rightIdx = 0, i = 0;
860
+ for (; leftIdx < left.length && rightIdx < right.length; )
861
+ compare(left[leftIdx], right[rightIdx]) <= 0 ? data[i++] = left[leftIdx++] : data[i++] = right[rightIdx++];
862
+ for (; leftIdx < left.length; )
863
+ data[i++] = left[leftIdx++];
864
+ for (; rightIdx < right.length; )
865
+ data[i++] = right[rightIdx++];
866
+ return data;
867
+ }
868
+ __name(mergeSort, "mergeSort");
869
+ })(TextDocument || (TextDocument = {}));
870
+ var _a2, FullTextDocument = (_a2 = class {
871
+ constructor(uri, languageId, version, content) {
872
+ this._uri = uri, this._languageId = languageId, this._version = version, this._content = content, this._lineOffsets = void 0;
873
+ }
874
+ get uri() {
875
+ return this._uri;
876
+ }
877
+ get languageId() {
878
+ return this._languageId;
879
+ }
880
+ get version() {
881
+ return this._version;
882
+ }
883
+ getText(range) {
884
+ if (range) {
885
+ let start = this.offsetAt(range.start), end = this.offsetAt(range.end);
886
+ return this._content.substring(start, end);
887
+ }
888
+ return this._content;
889
+ }
890
+ update(event, version) {
891
+ this._content = event.text, this._version = version, this._lineOffsets = void 0;
892
+ }
893
+ getLineOffsets() {
894
+ if (this._lineOffsets === void 0) {
895
+ let lineOffsets = [], text = this._content, isLineStart = !0;
896
+ for (let i = 0; i < text.length; i++) {
897
+ isLineStart && (lineOffsets.push(i), isLineStart = !1);
898
+ let ch = text.charAt(i);
899
+ isLineStart = ch === "\r" || ch === `
900
+ `, ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === `
901
+ ` && i++;
902
+ }
903
+ isLineStart && text.length > 0 && lineOffsets.push(text.length), this._lineOffsets = lineOffsets;
904
+ }
905
+ return this._lineOffsets;
906
+ }
907
+ positionAt(offset) {
908
+ offset = Math.max(Math.min(offset, this._content.length), 0);
909
+ let lineOffsets = this.getLineOffsets(), low = 0, high = lineOffsets.length;
910
+ if (high === 0)
911
+ return Position.create(0, offset);
912
+ for (; low < high; ) {
913
+ let mid = Math.floor((low + high) / 2);
914
+ lineOffsets[mid] > offset ? high = mid : low = mid + 1;
915
+ }
916
+ let line = low - 1;
917
+ return Position.create(line, offset - lineOffsets[line]);
918
+ }
919
+ offsetAt(position) {
920
+ let lineOffsets = this.getLineOffsets();
921
+ if (position.line >= lineOffsets.length)
922
+ return this._content.length;
923
+ if (position.line < 0)
924
+ return 0;
925
+ let lineOffset = lineOffsets[position.line], nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
926
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
927
+ }
928
+ get lineCount() {
929
+ return this.getLineOffsets().length;
930
+ }
931
+ }, __name(_a2, "FullTextDocument"), _a2), Is;
932
+ (function(Is2) {
933
+ const toString = Object.prototype.toString;
934
+ function defined(value) {
935
+ return typeof value < "u";
936
+ }
937
+ __name(defined, "defined"), Is2.defined = defined;
938
+ function undefined2(value) {
939
+ return typeof value > "u";
940
+ }
941
+ __name(undefined2, "undefined2"), Is2.undefined = undefined2;
942
+ function boolean(value) {
943
+ return value === !0 || value === !1;
944
+ }
945
+ __name(boolean, "boolean"), Is2.boolean = boolean;
946
+ function string(value) {
947
+ return toString.call(value) === "[object String]";
948
+ }
949
+ __name(string, "string"), Is2.string = string;
950
+ function number(value) {
951
+ return toString.call(value) === "[object Number]";
952
+ }
953
+ __name(number, "number"), Is2.number = number;
954
+ function numberRange(value, min, max) {
955
+ return toString.call(value) === "[object Number]" && min <= value && value <= max;
956
+ }
957
+ __name(numberRange, "numberRange"), Is2.numberRange = numberRange;
958
+ function integer2(value) {
959
+ return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
960
+ }
961
+ __name(integer2, "integer2"), Is2.integer = integer2;
962
+ function uinteger2(value) {
963
+ return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
964
+ }
965
+ __name(uinteger2, "uinteger2"), Is2.uinteger = uinteger2;
966
+ function func(value) {
967
+ return toString.call(value) === "[object Function]";
968
+ }
969
+ __name(func, "func"), Is2.func = func;
970
+ function objectLiteral(value) {
971
+ return value !== null && typeof value == "object";
972
+ }
973
+ __name(objectLiteral, "objectLiteral"), Is2.objectLiteral = objectLiteral;
974
+ function typedArray(value, check) {
975
+ return Array.isArray(value) && value.every(check);
976
+ }
977
+ __name(typedArray, "typedArray"), Is2.typedArray = typedArray;
978
+ })(Is || (Is = {}));
979
+ var _a3, DiagnosticsAdapter = (_a3 = class {
980
+ constructor(_languageId, _worker, configChangeEvent) {
981
+ this._languageId = _languageId, this._worker = _worker, this._disposables = [], this._listener = /* @__PURE__ */ Object.create(null);
982
+ const onModelAdd = /* @__PURE__ */ __name((model) => {
983
+ let modeId = model.getLanguageId();
984
+ if (modeId !== this._languageId)
985
+ return;
986
+ let handle;
987
+ this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
988
+ window.clearTimeout(handle), handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
989
+ }), this._doValidate(model.uri, modeId);
990
+ }, "onModelAdd"), onModelRemoved = /* @__PURE__ */ __name((model) => {
991
+ monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);
992
+ let uriStr = model.uri.toString(), listener = this._listener[uriStr];
993
+ listener && (listener.dispose(), delete this._listener[uriStr]);
994
+ }, "onModelRemoved");
995
+ this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd)), this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved)), this._disposables.push(
996
+ monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
997
+ onModelRemoved(event.model), onModelAdd(event.model);
998
+ })
999
+ ), this._disposables.push(
1000
+ configChangeEvent((_) => {
1001
+ monaco_editor_core_exports.editor.getModels().forEach((model) => {
1002
+ model.getLanguageId() === this._languageId && (onModelRemoved(model), onModelAdd(model));
1003
+ });
1004
+ })
1005
+ ), this._disposables.push({
1006
+ dispose: /* @__PURE__ */ __name(() => {
1007
+ monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);
1008
+ for (let key in this._listener)
1009
+ this._listener[key].dispose();
1010
+ }, "dispose")
1011
+ }), monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);
1012
+ }
1013
+ dispose() {
1014
+ this._disposables.forEach((d) => d && d.dispose()), this._disposables.length = 0;
1015
+ }
1016
+ _doValidate(resource, languageId) {
1017
+ this._worker(resource).then((worker2) => worker2.doValidation(resource.toString())).then((diagnostics) => {
1018
+ const markers = diagnostics.map((d) => toDiagnostics(resource, d));
1019
+ let model = monaco_editor_core_exports.editor.getModel(resource);
1020
+ model && model.getLanguageId() === languageId && monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);
1021
+ }).then(void 0, (err) => {
1022
+ console.error(err);
1023
+ });
1024
+ }
1025
+ }, __name(_a3, "DiagnosticsAdapter"), _a3);
1026
+ function toSeverity(lsSeverity) {
1027
+ switch (lsSeverity) {
1028
+ case DiagnosticSeverity.Error:
1029
+ return monaco_editor_core_exports.MarkerSeverity.Error;
1030
+ case DiagnosticSeverity.Warning:
1031
+ return monaco_editor_core_exports.MarkerSeverity.Warning;
1032
+ case DiagnosticSeverity.Information:
1033
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1034
+ case DiagnosticSeverity.Hint:
1035
+ return monaco_editor_core_exports.MarkerSeverity.Hint;
1036
+ default:
1037
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1038
+ }
1039
+ }
1040
+ __name(toSeverity, "toSeverity");
1041
+ function toDiagnostics(resource, diag) {
1042
+ let code = typeof diag.code == "number" ? String(diag.code) : diag.code;
1043
+ return {
1044
+ severity: toSeverity(diag.severity),
1045
+ startLineNumber: diag.range.start.line + 1,
1046
+ startColumn: diag.range.start.character + 1,
1047
+ endLineNumber: diag.range.end.line + 1,
1048
+ endColumn: diag.range.end.character + 1,
1049
+ message: diag.message,
1050
+ code,
1051
+ source: diag.source
1052
+ };
1053
+ }
1054
+ __name(toDiagnostics, "toDiagnostics");
1055
+ var _a4, CompletionAdapter = (_a4 = class {
1056
+ constructor(_worker, _triggerCharacters) {
1057
+ this._worker = _worker, this._triggerCharacters = _triggerCharacters;
1058
+ }
1059
+ get triggerCharacters() {
1060
+ return this._triggerCharacters;
1061
+ }
1062
+ provideCompletionItems(model, position, context, token) {
1063
+ const resource = model.uri;
1064
+ return this._worker(resource).then((worker2) => worker2.doComplete(resource.toString(), fromPosition(position))).then((info) => {
1065
+ if (!info)
1066
+ return;
1067
+ const wordInfo = model.getWordUntilPosition(position), wordRange = new monaco_editor_core_exports.Range(
1068
+ position.lineNumber,
1069
+ wordInfo.startColumn,
1070
+ position.lineNumber,
1071
+ wordInfo.endColumn
1072
+ ), items = info.items.map((entry) => {
1073
+ const item = {
1074
+ label: entry.label,
1075
+ insertText: entry.insertText || entry.label,
1076
+ sortText: entry.sortText,
1077
+ filterText: entry.filterText,
1078
+ documentation: entry.documentation,
1079
+ detail: entry.detail,
1080
+ command: toCommand(entry.command),
1081
+ range: wordRange,
1082
+ kind: toCompletionItemKind(entry.kind)
1083
+ };
1084
+ return entry.textEdit && (isInsertReplaceEdit(entry.textEdit) ? item.range = {
1085
+ insert: toRange(entry.textEdit.insert),
1086
+ replace: toRange(entry.textEdit.replace)
1087
+ } : item.range = toRange(entry.textEdit.range), item.insertText = entry.textEdit.newText), entry.additionalTextEdits && (item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit)), entry.insertTextFormat === InsertTextFormat.Snippet && (item.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet), item;
1088
+ });
1089
+ return {
1090
+ isIncomplete: info.isIncomplete,
1091
+ suggestions: items
1092
+ };
1093
+ });
1094
+ }
1095
+ }, __name(_a4, "CompletionAdapter"), _a4);
1096
+ function fromPosition(position) {
1097
+ if (position)
1098
+ return { character: position.column - 1, line: position.lineNumber - 1 };
1099
+ }
1100
+ __name(fromPosition, "fromPosition");
1101
+ function fromRange(range) {
1102
+ if (range)
1103
+ return {
1104
+ start: {
1105
+ line: range.startLineNumber - 1,
1106
+ character: range.startColumn - 1
1107
+ },
1108
+ end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
1109
+ };
1110
+ }
1111
+ __name(fromRange, "fromRange");
1112
+ function toRange(range) {
1113
+ if (range)
1114
+ return new monaco_editor_core_exports.Range(
1115
+ range.start.line + 1,
1116
+ range.start.character + 1,
1117
+ range.end.line + 1,
1118
+ range.end.character + 1
1119
+ );
1120
+ }
1121
+ __name(toRange, "toRange");
1122
+ function isInsertReplaceEdit(edit) {
1123
+ return typeof edit.insert < "u" && typeof edit.replace < "u";
1124
+ }
1125
+ __name(isInsertReplaceEdit, "isInsertReplaceEdit");
1126
+ function toCompletionItemKind(kind) {
1127
+ const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;
1128
+ switch (kind) {
1129
+ case CompletionItemKind.Text:
1130
+ return mItemKind.Text;
1131
+ case CompletionItemKind.Method:
1132
+ return mItemKind.Method;
1133
+ case CompletionItemKind.Function:
1134
+ return mItemKind.Function;
1135
+ case CompletionItemKind.Constructor:
1136
+ return mItemKind.Constructor;
1137
+ case CompletionItemKind.Field:
1138
+ return mItemKind.Field;
1139
+ case CompletionItemKind.Variable:
1140
+ return mItemKind.Variable;
1141
+ case CompletionItemKind.Class:
1142
+ return mItemKind.Class;
1143
+ case CompletionItemKind.Interface:
1144
+ return mItemKind.Interface;
1145
+ case CompletionItemKind.Module:
1146
+ return mItemKind.Module;
1147
+ case CompletionItemKind.Property:
1148
+ return mItemKind.Property;
1149
+ case CompletionItemKind.Unit:
1150
+ return mItemKind.Unit;
1151
+ case CompletionItemKind.Value:
1152
+ return mItemKind.Value;
1153
+ case CompletionItemKind.Enum:
1154
+ return mItemKind.Enum;
1155
+ case CompletionItemKind.Keyword:
1156
+ return mItemKind.Keyword;
1157
+ case CompletionItemKind.Snippet:
1158
+ return mItemKind.Snippet;
1159
+ case CompletionItemKind.Color:
1160
+ return mItemKind.Color;
1161
+ case CompletionItemKind.File:
1162
+ return mItemKind.File;
1163
+ case CompletionItemKind.Reference:
1164
+ return mItemKind.Reference;
1165
+ }
1166
+ return mItemKind.Property;
1167
+ }
1168
+ __name(toCompletionItemKind, "toCompletionItemKind");
1169
+ function toTextEdit(textEdit) {
1170
+ if (textEdit)
1171
+ return {
1172
+ range: toRange(textEdit.range),
1173
+ text: textEdit.newText
1174
+ };
1175
+ }
1176
+ __name(toTextEdit, "toTextEdit");
1177
+ function toCommand(c) {
1178
+ return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
1179
+ }
1180
+ __name(toCommand, "toCommand");
1181
+ var _a5, HoverAdapter = (_a5 = class {
1182
+ constructor(_worker) {
1183
+ this._worker = _worker;
1184
+ }
1185
+ provideHover(model, position, token) {
1186
+ let resource = model.uri;
1187
+ return this._worker(resource).then((worker2) => worker2.doHover(resource.toString(), fromPosition(position))).then((info) => {
1188
+ if (info)
1189
+ return {
1190
+ range: toRange(info.range),
1191
+ contents: toMarkedStringArray(info.contents)
1192
+ };
1193
+ });
1194
+ }
1195
+ }, __name(_a5, "HoverAdapter"), _a5);
1196
+ function isMarkupContent(thing) {
1197
+ return thing && typeof thing == "object" && typeof thing.kind == "string";
1198
+ }
1199
+ __name(isMarkupContent, "isMarkupContent");
1200
+ function toMarkdownString(entry) {
1201
+ return typeof entry == "string" ? {
1202
+ value: entry
1203
+ } : isMarkupContent(entry) ? entry.kind === "plaintext" ? {
1204
+ value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1205
+ } : {
1206
+ value: entry.value
1207
+ } : { value: "```" + entry.language + `
1208
+ ` + entry.value + "\n```\n" };
1209
+ }
1210
+ __name(toMarkdownString, "toMarkdownString");
1211
+ function toMarkedStringArray(contents) {
1212
+ if (contents)
1213
+ return Array.isArray(contents) ? contents.map(toMarkdownString) : [toMarkdownString(contents)];
1214
+ }
1215
+ __name(toMarkedStringArray, "toMarkedStringArray");
1216
+ var _a6, DocumentHighlightAdapter = (_a6 = class {
1217
+ constructor(_worker) {
1218
+ this._worker = _worker;
1219
+ }
1220
+ provideDocumentHighlights(model, position, token) {
1221
+ const resource = model.uri;
1222
+ return this._worker(resource).then((worker2) => worker2.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
1223
+ if (entries)
1224
+ return entries.map((entry) => ({
1225
+ range: toRange(entry.range),
1226
+ kind: toDocumentHighlightKind(entry.kind)
1227
+ }));
1228
+ });
1229
+ }
1230
+ }, __name(_a6, "DocumentHighlightAdapter"), _a6);
1231
+ function toDocumentHighlightKind(kind) {
1232
+ switch (kind) {
1233
+ case DocumentHighlightKind.Read:
1234
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
1235
+ case DocumentHighlightKind.Write:
1236
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
1237
+ case DocumentHighlightKind.Text:
1238
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1239
+ }
1240
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1241
+ }
1242
+ __name(toDocumentHighlightKind, "toDocumentHighlightKind");
1243
+ var _a7, DefinitionAdapter = (_a7 = class {
1244
+ constructor(_worker) {
1245
+ this._worker = _worker;
1246
+ }
1247
+ provideDefinition(model, position, token) {
1248
+ const resource = model.uri;
1249
+ return this._worker(resource).then((worker2) => worker2.findDefinition(resource.toString(), fromPosition(position))).then((definition) => {
1250
+ if (definition)
1251
+ return [toLocation(definition)];
1252
+ });
1253
+ }
1254
+ }, __name(_a7, "DefinitionAdapter"), _a7);
1255
+ function toLocation(location) {
1256
+ return {
1257
+ uri: monaco_editor_core_exports.Uri.parse(location.uri),
1258
+ range: toRange(location.range)
1259
+ };
1260
+ }
1261
+ __name(toLocation, "toLocation");
1262
+ var _a8, ReferenceAdapter = (_a8 = class {
1263
+ constructor(_worker) {
1264
+ this._worker = _worker;
1265
+ }
1266
+ provideReferences(model, position, context, token) {
1267
+ const resource = model.uri;
1268
+ return this._worker(resource).then((worker2) => worker2.findReferences(resource.toString(), fromPosition(position))).then((entries) => {
1269
+ if (entries)
1270
+ return entries.map(toLocation);
1271
+ });
1272
+ }
1273
+ }, __name(_a8, "ReferenceAdapter"), _a8), _a9, RenameAdapter = (_a9 = class {
1274
+ constructor(_worker) {
1275
+ this._worker = _worker;
1276
+ }
1277
+ provideRenameEdits(model, position, newName, token) {
1278
+ const resource = model.uri;
1279
+ return this._worker(resource).then((worker2) => worker2.doRename(resource.toString(), fromPosition(position), newName)).then((edit) => toWorkspaceEdit(edit));
1280
+ }
1281
+ }, __name(_a9, "RenameAdapter"), _a9);
1282
+ function toWorkspaceEdit(edit) {
1283
+ if (!edit || !edit.changes)
1284
+ return;
1285
+ let resourceEdits = [];
1286
+ for (let uri in edit.changes) {
1287
+ const _uri = monaco_editor_core_exports.Uri.parse(uri);
1288
+ for (let e of edit.changes[uri])
1289
+ resourceEdits.push({
1290
+ resource: _uri,
1291
+ versionId: void 0,
1292
+ textEdit: {
1293
+ range: toRange(e.range),
1294
+ text: e.newText
1295
+ }
1296
+ });
1297
+ }
1298
+ return {
1299
+ edits: resourceEdits
1300
+ };
1301
+ }
1302
+ __name(toWorkspaceEdit, "toWorkspaceEdit");
1303
+ var _a10, DocumentSymbolAdapter = (_a10 = class {
1304
+ constructor(_worker) {
1305
+ this._worker = _worker;
1306
+ }
1307
+ provideDocumentSymbols(model, token) {
1308
+ const resource = model.uri;
1309
+ return this._worker(resource).then((worker2) => worker2.findDocumentSymbols(resource.toString())).then((items) => {
1310
+ if (items)
1311
+ return items.map((item) => isDocumentSymbol(item) ? toDocumentSymbol(item) : {
1312
+ name: item.name,
1313
+ detail: "",
1314
+ containerName: item.containerName,
1315
+ kind: toSymbolKind(item.kind),
1316
+ range: toRange(item.location.range),
1317
+ selectionRange: toRange(item.location.range),
1318
+ tags: []
1319
+ });
1320
+ });
1321
+ }
1322
+ }, __name(_a10, "DocumentSymbolAdapter"), _a10);
1323
+ function isDocumentSymbol(symbol) {
1324
+ return "children" in symbol;
1325
+ }
1326
+ __name(isDocumentSymbol, "isDocumentSymbol");
1327
+ function toDocumentSymbol(symbol) {
1328
+ var _a20, _b, _c;
1329
+ return {
1330
+ name: symbol.name,
1331
+ detail: (_a20 = symbol.detail) != null ? _a20 : "",
1332
+ kind: toSymbolKind(symbol.kind),
1333
+ range: toRange(symbol.range),
1334
+ selectionRange: toRange(symbol.selectionRange),
1335
+ tags: (_b = symbol.tags) != null ? _b : [],
1336
+ children: ((_c = symbol.children) != null ? _c : []).map((item) => toDocumentSymbol(item))
1337
+ };
1338
+ }
1339
+ __name(toDocumentSymbol, "toDocumentSymbol");
1340
+ function toSymbolKind(kind) {
1341
+ let mKind = monaco_editor_core_exports.languages.SymbolKind;
1342
+ switch (kind) {
1343
+ case SymbolKind.File:
1344
+ return mKind.File;
1345
+ case SymbolKind.Module:
1346
+ return mKind.Module;
1347
+ case SymbolKind.Namespace:
1348
+ return mKind.Namespace;
1349
+ case SymbolKind.Package:
1350
+ return mKind.Package;
1351
+ case SymbolKind.Class:
1352
+ return mKind.Class;
1353
+ case SymbolKind.Method:
1354
+ return mKind.Method;
1355
+ case SymbolKind.Property:
1356
+ return mKind.Property;
1357
+ case SymbolKind.Field:
1358
+ return mKind.Field;
1359
+ case SymbolKind.Constructor:
1360
+ return mKind.Constructor;
1361
+ case SymbolKind.Enum:
1362
+ return mKind.Enum;
1363
+ case SymbolKind.Interface:
1364
+ return mKind.Interface;
1365
+ case SymbolKind.Function:
1366
+ return mKind.Function;
1367
+ case SymbolKind.Variable:
1368
+ return mKind.Variable;
1369
+ case SymbolKind.Constant:
1370
+ return mKind.Constant;
1371
+ case SymbolKind.String:
1372
+ return mKind.String;
1373
+ case SymbolKind.Number:
1374
+ return mKind.Number;
1375
+ case SymbolKind.Boolean:
1376
+ return mKind.Boolean;
1377
+ case SymbolKind.Array:
1378
+ return mKind.Array;
1379
+ }
1380
+ return mKind.Function;
1381
+ }
1382
+ __name(toSymbolKind, "toSymbolKind");
1383
+ var _a11, DocumentLinkAdapter = (_a11 = class {
1384
+ constructor(_worker) {
1385
+ this._worker = _worker;
1386
+ }
1387
+ provideLinks(model, token) {
1388
+ const resource = model.uri;
1389
+ return this._worker(resource).then((worker2) => worker2.findDocumentLinks(resource.toString())).then((items) => {
1390
+ if (items)
1391
+ return {
1392
+ links: items.map((item) => ({
1393
+ range: toRange(item.range),
1394
+ url: item.target
1395
+ }))
1396
+ };
1397
+ });
1398
+ }
1399
+ }, __name(_a11, "DocumentLinkAdapter"), _a11), _a12, DocumentFormattingEditProvider = (_a12 = class {
1400
+ constructor(_worker) {
1401
+ this._worker = _worker;
1402
+ }
1403
+ provideDocumentFormattingEdits(model, options, token) {
1404
+ const resource = model.uri;
1405
+ return this._worker(resource).then((worker2) => worker2.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
1406
+ if (!(!edits || edits.length === 0))
1407
+ return edits.map(toTextEdit);
1408
+ }));
1409
+ }
1410
+ }, __name(_a12, "DocumentFormattingEditProvider"), _a12), _a13, DocumentRangeFormattingEditProvider = (_a13 = class {
1411
+ constructor(_worker) {
1412
+ this._worker = _worker, this.canFormatMultipleRanges = !1;
1413
+ }
1414
+ provideDocumentRangeFormattingEdits(model, range, options, token) {
1415
+ const resource = model.uri;
1416
+ return this._worker(resource).then((worker2) => worker2.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
1417
+ if (!(!edits || edits.length === 0))
1418
+ return edits.map(toTextEdit);
1419
+ }));
1420
+ }
1421
+ }, __name(_a13, "DocumentRangeFormattingEditProvider"), _a13);
1422
+ function fromFormattingOptions(options) {
1423
+ return {
1424
+ tabSize: options.tabSize,
1425
+ insertSpaces: options.insertSpaces
1426
+ };
1427
+ }
1428
+ __name(fromFormattingOptions, "fromFormattingOptions");
1429
+ var _a14, DocumentColorAdapter = (_a14 = class {
1430
+ constructor(_worker) {
1431
+ this._worker = _worker;
1432
+ }
1433
+ provideDocumentColors(model, token) {
1434
+ const resource = model.uri;
1435
+ return this._worker(resource).then((worker2) => worker2.findDocumentColors(resource.toString())).then((infos) => {
1436
+ if (infos)
1437
+ return infos.map((item) => ({
1438
+ color: item.color,
1439
+ range: toRange(item.range)
1440
+ }));
1441
+ });
1442
+ }
1443
+ provideColorPresentations(model, info, token) {
1444
+ const resource = model.uri;
1445
+ return this._worker(resource).then(
1446
+ (worker2) => worker2.getColorPresentations(resource.toString(), info.color, fromRange(info.range))
1447
+ ).then((presentations) => {
1448
+ if (presentations)
1449
+ return presentations.map((presentation) => {
1450
+ let item = {
1451
+ label: presentation.label
1452
+ };
1453
+ return presentation.textEdit && (item.textEdit = toTextEdit(presentation.textEdit)), presentation.additionalTextEdits && (item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit)), item;
1454
+ });
1455
+ });
1456
+ }
1457
+ }, __name(_a14, "DocumentColorAdapter"), _a14), _a15, FoldingRangeAdapter = (_a15 = class {
1458
+ constructor(_worker) {
1459
+ this._worker = _worker;
1460
+ }
1461
+ provideFoldingRanges(model, context, token) {
1462
+ const resource = model.uri;
1463
+ return this._worker(resource).then((worker2) => worker2.getFoldingRanges(resource.toString(), context)).then((ranges) => {
1464
+ if (ranges)
1465
+ return ranges.map((range) => {
1466
+ const result = {
1467
+ start: range.startLine + 1,
1468
+ end: range.endLine + 1
1469
+ };
1470
+ return typeof range.kind < "u" && (result.kind = toFoldingRangeKind(range.kind)), result;
1471
+ });
1472
+ });
1473
+ }
1474
+ }, __name(_a15, "FoldingRangeAdapter"), _a15);
1475
+ function toFoldingRangeKind(kind) {
1476
+ switch (kind) {
1477
+ case FoldingRangeKind.Comment:
1478
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
1479
+ case FoldingRangeKind.Imports:
1480
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
1481
+ case FoldingRangeKind.Region:
1482
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
1483
+ }
1484
+ }
1485
+ __name(toFoldingRangeKind, "toFoldingRangeKind");
1486
+ var _a16, SelectionRangeAdapter = (_a16 = class {
1487
+ constructor(_worker) {
1488
+ this._worker = _worker;
1489
+ }
1490
+ provideSelectionRanges(model, positions, token) {
1491
+ const resource = model.uri;
1492
+ return this._worker(resource).then(
1493
+ (worker2) => worker2.getSelectionRanges(
1494
+ resource.toString(),
1495
+ positions.map(fromPosition)
1496
+ )
1497
+ ).then((selectionRanges) => {
1498
+ if (selectionRanges)
1499
+ return selectionRanges.map((selectionRange) => {
1500
+ const result = [];
1501
+ for (; selectionRange; )
1502
+ result.push({ range: toRange(selectionRange.range) }), selectionRange = selectionRange.parent;
1503
+ return result;
1504
+ });
1505
+ });
1506
+ }
1507
+ }, __name(_a16, "SelectionRangeAdapter"), _a16);
1508
+ function createScanner(text, ignoreTrivia = !1) {
1509
+ const len = text.length;
1510
+ let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
1511
+ function scanHexDigits(count, exact) {
1512
+ let digits = 0, value2 = 0;
1513
+ for (; digits < count || !exact; ) {
1514
+ let ch = text.charCodeAt(pos);
1515
+ if (ch >= 48 && ch <= 57)
1516
+ value2 = value2 * 16 + ch - 48;
1517
+ else if (ch >= 65 && ch <= 70)
1518
+ value2 = value2 * 16 + ch - 65 + 10;
1519
+ else if (ch >= 97 && ch <= 102)
1520
+ value2 = value2 * 16 + ch - 97 + 10;
1521
+ else
1522
+ break;
1523
+ pos++, digits++;
1524
+ }
1525
+ return digits < count && (value2 = -1), value2;
1526
+ }
1527
+ __name(scanHexDigits, "scanHexDigits");
1528
+ function setPosition(newPosition) {
1529
+ pos = newPosition, value = "", tokenOffset = 0, token = 16, scanError = 0;
1530
+ }
1531
+ __name(setPosition, "setPosition");
1532
+ function scanNumber() {
1533
+ let start = pos;
1534
+ if (text.charCodeAt(pos) === 48)
1535
+ pos++;
1536
+ else
1537
+ for (pos++; pos < text.length && isDigit(text.charCodeAt(pos)); )
1538
+ pos++;
1539
+ if (pos < text.length && text.charCodeAt(pos) === 46)
1540
+ if (pos++, pos < text.length && isDigit(text.charCodeAt(pos)))
1541
+ for (pos++; pos < text.length && isDigit(text.charCodeAt(pos)); )
1542
+ pos++;
1543
+ else
1544
+ return scanError = 3, text.substring(start, pos);
1545
+ let end = pos;
1546
+ if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101))
1547
+ if (pos++, (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) && pos++, pos < text.length && isDigit(text.charCodeAt(pos))) {
1548
+ for (pos++; pos < text.length && isDigit(text.charCodeAt(pos)); )
1549
+ pos++;
1550
+ end = pos;
1551
+ } else
1552
+ scanError = 3;
1553
+ return text.substring(start, end);
1554
+ }
1555
+ __name(scanNumber, "scanNumber");
1556
+ function scanString() {
1557
+ let result = "", start = pos;
1558
+ for (; ; ) {
1559
+ if (pos >= len) {
1560
+ result += text.substring(start, pos), scanError = 2;
1561
+ break;
1562
+ }
1563
+ const ch = text.charCodeAt(pos);
1564
+ if (ch === 34) {
1565
+ result += text.substring(start, pos), pos++;
1566
+ break;
1567
+ }
1568
+ if (ch === 92) {
1569
+ if (result += text.substring(start, pos), pos++, pos >= len) {
1570
+ scanError = 2;
1571
+ break;
1572
+ }
1573
+ switch (text.charCodeAt(pos++)) {
1574
+ case 34:
1575
+ result += '"';
1576
+ break;
1577
+ case 92:
1578
+ result += "\\";
1579
+ break;
1580
+ case 47:
1581
+ result += "/";
1582
+ break;
1583
+ case 98:
1584
+ result += "\b";
1585
+ break;
1586
+ case 102:
1587
+ result += "\f";
1588
+ break;
1589
+ case 110:
1590
+ result += `
1591
+ `;
1592
+ break;
1593
+ case 114:
1594
+ result += "\r";
1595
+ break;
1596
+ case 116:
1597
+ result += " ";
1598
+ break;
1599
+ case 117:
1600
+ const ch3 = scanHexDigits(4, !0);
1601
+ ch3 >= 0 ? result += String.fromCharCode(ch3) : scanError = 4;
1602
+ break;
1603
+ default:
1604
+ scanError = 5;
1605
+ }
1606
+ start = pos;
1607
+ continue;
1608
+ }
1609
+ if (ch >= 0 && ch <= 31)
1610
+ if (isLineBreak(ch)) {
1611
+ result += text.substring(start, pos), scanError = 2;
1612
+ break;
1613
+ } else
1614
+ scanError = 6;
1615
+ pos++;
1616
+ }
1617
+ return result;
1618
+ }
1619
+ __name(scanString, "scanString");
1620
+ function scanNext() {
1621
+ if (value = "", scanError = 0, tokenOffset = pos, lineStartOffset = lineNumber, prevTokenLineStartOffset = tokenLineStartOffset, pos >= len)
1622
+ return tokenOffset = len, token = 17;
1623
+ let code = text.charCodeAt(pos);
1624
+ if (isWhiteSpace(code)) {
1625
+ do
1626
+ pos++, value += String.fromCharCode(code), code = text.charCodeAt(pos);
1627
+ while (isWhiteSpace(code));
1628
+ return token = 15;
1629
+ }
1630
+ if (isLineBreak(code))
1631
+ return pos++, value += String.fromCharCode(code), code === 13 && text.charCodeAt(pos) === 10 && (pos++, value += `
1632
+ `), lineNumber++, tokenLineStartOffset = pos, token = 14;
1633
+ switch (code) {
1634
+ case 123:
1635
+ return pos++, token = 1;
1636
+ case 125:
1637
+ return pos++, token = 2;
1638
+ case 91:
1639
+ return pos++, token = 3;
1640
+ case 93:
1641
+ return pos++, token = 4;
1642
+ case 58:
1643
+ return pos++, token = 6;
1644
+ case 44:
1645
+ return pos++, token = 5;
1646
+ case 34:
1647
+ return pos++, value = scanString(), token = 10;
1648
+ case 47:
1649
+ const start = pos - 1;
1650
+ if (text.charCodeAt(pos + 1) === 47) {
1651
+ for (pos += 2; pos < len && !isLineBreak(text.charCodeAt(pos)); )
1652
+ pos++;
1653
+ return value = text.substring(start, pos), token = 12;
1654
+ }
1655
+ if (text.charCodeAt(pos + 1) === 42) {
1656
+ pos += 2;
1657
+ const safeLength = len - 1;
1658
+ let commentClosed = !1;
1659
+ for (; pos < safeLength; ) {
1660
+ const ch = text.charCodeAt(pos);
1661
+ if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
1662
+ pos += 2, commentClosed = !0;
1663
+ break;
1664
+ }
1665
+ pos++, isLineBreak(ch) && (ch === 13 && text.charCodeAt(pos) === 10 && pos++, lineNumber++, tokenLineStartOffset = pos);
1666
+ }
1667
+ return commentClosed || (pos++, scanError = 1), value = text.substring(start, pos), token = 13;
1668
+ }
1669
+ return value += String.fromCharCode(code), pos++, token = 16;
1670
+ case 45:
1671
+ if (value += String.fromCharCode(code), pos++, pos === len || !isDigit(text.charCodeAt(pos)))
1672
+ return token = 16;
1673
+ case 48:
1674
+ case 49:
1675
+ case 50:
1676
+ case 51:
1677
+ case 52:
1678
+ case 53:
1679
+ case 54:
1680
+ case 55:
1681
+ case 56:
1682
+ case 57:
1683
+ return value += scanNumber(), token = 11;
1684
+ default:
1685
+ for (; pos < len && isUnknownContentCharacter(code); )
1686
+ pos++, code = text.charCodeAt(pos);
1687
+ if (tokenOffset !== pos) {
1688
+ switch (value = text.substring(tokenOffset, pos), value) {
1689
+ case "true":
1690
+ return token = 8;
1691
+ case "false":
1692
+ return token = 9;
1693
+ case "null":
1694
+ return token = 7;
1695
+ }
1696
+ return token = 16;
1697
+ }
1698
+ return value += String.fromCharCode(code), pos++, token = 16;
1699
+ }
1700
+ }
1701
+ __name(scanNext, "scanNext");
1702
+ function isUnknownContentCharacter(code) {
1703
+ if (isWhiteSpace(code) || isLineBreak(code))
1704
+ return !1;
1705
+ switch (code) {
1706
+ case 125:
1707
+ case 93:
1708
+ case 123:
1709
+ case 91:
1710
+ case 34:
1711
+ case 58:
1712
+ case 44:
1713
+ case 47:
1714
+ return !1;
1715
+ }
1716
+ return !0;
1717
+ }
1718
+ __name(isUnknownContentCharacter, "isUnknownContentCharacter");
1719
+ function scanNextNonTrivia() {
1720
+ let result;
1721
+ do
1722
+ result = scanNext();
1723
+ while (result >= 12 && result <= 15);
1724
+ return result;
1725
+ }
1726
+ return __name(scanNextNonTrivia, "scanNextNonTrivia"), {
1727
+ setPosition,
1728
+ getPosition: /* @__PURE__ */ __name(() => pos, "getPosition"),
1729
+ scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
1730
+ getToken: /* @__PURE__ */ __name(() => token, "getToken"),
1731
+ getTokenValue: /* @__PURE__ */ __name(() => value, "getTokenValue"),
1732
+ getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, "getTokenOffset"),
1733
+ getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, "getTokenLength"),
1734
+ getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, "getTokenStartLine"),
1735
+ getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
1736
+ getTokenError: /* @__PURE__ */ __name(() => scanError, "getTokenError")
1737
+ };
1738
+ }
1739
+ __name(createScanner, "createScanner");
1740
+ function isWhiteSpace(ch) {
1741
+ return ch === 32 || ch === 9;
1742
+ }
1743
+ __name(isWhiteSpace, "isWhiteSpace");
1744
+ function isLineBreak(ch) {
1745
+ return ch === 10 || ch === 13;
1746
+ }
1747
+ __name(isLineBreak, "isLineBreak");
1748
+ function isDigit(ch) {
1749
+ return ch >= 48 && ch <= 57;
1750
+ }
1751
+ __name(isDigit, "isDigit");
1752
+ var CharacterCodes;
1753
+ (function(CharacterCodes2) {
1754
+ CharacterCodes2[CharacterCodes2.lineFeed = 10] = "lineFeed", CharacterCodes2[CharacterCodes2.carriageReturn = 13] = "carriageReturn", CharacterCodes2[CharacterCodes2.space = 32] = "space", CharacterCodes2[CharacterCodes2._0 = 48] = "_0", CharacterCodes2[CharacterCodes2._1 = 49] = "_1", CharacterCodes2[CharacterCodes2._2 = 50] = "_2", CharacterCodes2[CharacterCodes2._3 = 51] = "_3", CharacterCodes2[CharacterCodes2._4 = 52] = "_4", CharacterCodes2[CharacterCodes2._5 = 53] = "_5", CharacterCodes2[CharacterCodes2._6 = 54] = "_6", CharacterCodes2[CharacterCodes2._7 = 55] = "_7", CharacterCodes2[CharacterCodes2._8 = 56] = "_8", CharacterCodes2[CharacterCodes2._9 = 57] = "_9", CharacterCodes2[CharacterCodes2.a = 97] = "a", CharacterCodes2[CharacterCodes2.b = 98] = "b", CharacterCodes2[CharacterCodes2.c = 99] = "c", CharacterCodes2[CharacterCodes2.d = 100] = "d", CharacterCodes2[CharacterCodes2.e = 101] = "e", CharacterCodes2[CharacterCodes2.f = 102] = "f", CharacterCodes2[CharacterCodes2.g = 103] = "g", CharacterCodes2[CharacterCodes2.h = 104] = "h", CharacterCodes2[CharacterCodes2.i = 105] = "i", CharacterCodes2[CharacterCodes2.j = 106] = "j", CharacterCodes2[CharacterCodes2.k = 107] = "k", CharacterCodes2[CharacterCodes2.l = 108] = "l", CharacterCodes2[CharacterCodes2.m = 109] = "m", CharacterCodes2[CharacterCodes2.n = 110] = "n", CharacterCodes2[CharacterCodes2.o = 111] = "o", CharacterCodes2[CharacterCodes2.p = 112] = "p", CharacterCodes2[CharacterCodes2.q = 113] = "q", CharacterCodes2[CharacterCodes2.r = 114] = "r", CharacterCodes2[CharacterCodes2.s = 115] = "s", CharacterCodes2[CharacterCodes2.t = 116] = "t", CharacterCodes2[CharacterCodes2.u = 117] = "u", CharacterCodes2[CharacterCodes2.v = 118] = "v", CharacterCodes2[CharacterCodes2.w = 119] = "w", CharacterCodes2[CharacterCodes2.x = 120] = "x", CharacterCodes2[CharacterCodes2.y = 121] = "y", CharacterCodes2[CharacterCodes2.z = 122] = "z", CharacterCodes2[CharacterCodes2.A = 65] = "A", CharacterCodes2[CharacterCodes2.B = 66] = "B", CharacterCodes2[CharacterCodes2.C = 67] = "C", CharacterCodes2[CharacterCodes2.D = 68] = "D", CharacterCodes2[CharacterCodes2.E = 69] = "E", CharacterCodes2[CharacterCodes2.F = 70] = "F", CharacterCodes2[CharacterCodes2.G = 71] = "G", CharacterCodes2[CharacterCodes2.H = 72] = "H", CharacterCodes2[CharacterCodes2.I = 73] = "I", CharacterCodes2[CharacterCodes2.J = 74] = "J", CharacterCodes2[CharacterCodes2.K = 75] = "K", CharacterCodes2[CharacterCodes2.L = 76] = "L", CharacterCodes2[CharacterCodes2.M = 77] = "M", CharacterCodes2[CharacterCodes2.N = 78] = "N", CharacterCodes2[CharacterCodes2.O = 79] = "O", CharacterCodes2[CharacterCodes2.P = 80] = "P", CharacterCodes2[CharacterCodes2.Q = 81] = "Q", CharacterCodes2[CharacterCodes2.R = 82] = "R", CharacterCodes2[CharacterCodes2.S = 83] = "S", CharacterCodes2[CharacterCodes2.T = 84] = "T", CharacterCodes2[CharacterCodes2.U = 85] = "U", CharacterCodes2[CharacterCodes2.V = 86] = "V", CharacterCodes2[CharacterCodes2.W = 87] = "W", CharacterCodes2[CharacterCodes2.X = 88] = "X", CharacterCodes2[CharacterCodes2.Y = 89] = "Y", CharacterCodes2[CharacterCodes2.Z = 90] = "Z", CharacterCodes2[CharacterCodes2.asterisk = 42] = "asterisk", CharacterCodes2[CharacterCodes2.backslash = 92] = "backslash", CharacterCodes2[CharacterCodes2.closeBrace = 125] = "closeBrace", CharacterCodes2[CharacterCodes2.closeBracket = 93] = "closeBracket", CharacterCodes2[CharacterCodes2.colon = 58] = "colon", CharacterCodes2[CharacterCodes2.comma = 44] = "comma", CharacterCodes2[CharacterCodes2.dot = 46] = "dot", CharacterCodes2[CharacterCodes2.doubleQuote = 34] = "doubleQuote", CharacterCodes2[CharacterCodes2.minus = 45] = "minus", CharacterCodes2[CharacterCodes2.openBrace = 123] = "openBrace", CharacterCodes2[CharacterCodes2.openBracket = 91] = "openBracket", CharacterCodes2[CharacterCodes2.plus = 43] = "plus", CharacterCodes2[CharacterCodes2.slash = 47] = "slash", CharacterCodes2[CharacterCodes2.formFeed = 12] = "formFeed", CharacterCodes2[CharacterCodes2.tab = 9] = "tab";
1755
+ })(CharacterCodes || (CharacterCodes = {}));
1756
+ new Array(20).fill(0).map((_, index) => " ".repeat(index));
1757
+ var maxCachedValues = 200;
1758
+ new Array(maxCachedValues).fill(0).map((_, index) => `
1759
+ ` + " ".repeat(index)), new Array(maxCachedValues).fill(0).map((_, index) => "\r" + " ".repeat(index)), new Array(maxCachedValues).fill(0).map((_, index) => `\r
1760
+ ` + " ".repeat(index)), new Array(maxCachedValues).fill(0).map((_, index) => `
1761
+ ` + " ".repeat(index)), new Array(maxCachedValues).fill(0).map((_, index) => "\r" + " ".repeat(index)), new Array(maxCachedValues).fill(0).map((_, index) => `\r
1762
+ ` + " ".repeat(index));
1763
+ var ParseOptions;
1764
+ (function(ParseOptions2) {
1765
+ ParseOptions2.DEFAULT = {
1766
+ allowTrailingComma: !1
1767
+ };
1768
+ })(ParseOptions || (ParseOptions = {}));
1769
+ var createScanner2 = createScanner, ScanError;
1770
+ (function(ScanError2) {
1771
+ ScanError2[ScanError2.None = 0] = "None", ScanError2[ScanError2.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", ScanError2[ScanError2.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", ScanError2[ScanError2.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", ScanError2[ScanError2.InvalidUnicode = 4] = "InvalidUnicode", ScanError2[ScanError2.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", ScanError2[ScanError2.InvalidCharacter = 6] = "InvalidCharacter";
1772
+ })(ScanError || (ScanError = {}));
1773
+ var SyntaxKind;
1774
+ (function(SyntaxKind2) {
1775
+ SyntaxKind2[SyntaxKind2.OpenBraceToken = 1] = "OpenBraceToken", SyntaxKind2[SyntaxKind2.CloseBraceToken = 2] = "CloseBraceToken", SyntaxKind2[SyntaxKind2.OpenBracketToken = 3] = "OpenBracketToken", SyntaxKind2[SyntaxKind2.CloseBracketToken = 4] = "CloseBracketToken", SyntaxKind2[SyntaxKind2.CommaToken = 5] = "CommaToken", SyntaxKind2[SyntaxKind2.ColonToken = 6] = "ColonToken", SyntaxKind2[SyntaxKind2.NullKeyword = 7] = "NullKeyword", SyntaxKind2[SyntaxKind2.TrueKeyword = 8] = "TrueKeyword", SyntaxKind2[SyntaxKind2.FalseKeyword = 9] = "FalseKeyword", SyntaxKind2[SyntaxKind2.StringLiteral = 10] = "StringLiteral", SyntaxKind2[SyntaxKind2.NumericLiteral = 11] = "NumericLiteral", SyntaxKind2[SyntaxKind2.LineCommentTrivia = 12] = "LineCommentTrivia", SyntaxKind2[SyntaxKind2.BlockCommentTrivia = 13] = "BlockCommentTrivia", SyntaxKind2[SyntaxKind2.LineBreakTrivia = 14] = "LineBreakTrivia", SyntaxKind2[SyntaxKind2.Trivia = 15] = "Trivia", SyntaxKind2[SyntaxKind2.Unknown = 16] = "Unknown", SyntaxKind2[SyntaxKind2.EOF = 17] = "EOF";
1776
+ })(SyntaxKind || (SyntaxKind = {}));
1777
+ var ParseErrorCode;
1778
+ (function(ParseErrorCode2) {
1779
+ ParseErrorCode2[ParseErrorCode2.InvalidSymbol = 1] = "InvalidSymbol", ParseErrorCode2[ParseErrorCode2.InvalidNumberFormat = 2] = "InvalidNumberFormat", ParseErrorCode2[ParseErrorCode2.PropertyNameExpected = 3] = "PropertyNameExpected", ParseErrorCode2[ParseErrorCode2.ValueExpected = 4] = "ValueExpected", ParseErrorCode2[ParseErrorCode2.ColonExpected = 5] = "ColonExpected", ParseErrorCode2[ParseErrorCode2.CommaExpected = 6] = "CommaExpected", ParseErrorCode2[ParseErrorCode2.CloseBraceExpected = 7] = "CloseBraceExpected", ParseErrorCode2[ParseErrorCode2.CloseBracketExpected = 8] = "CloseBracketExpected", ParseErrorCode2[ParseErrorCode2.EndOfFileExpected = 9] = "EndOfFileExpected", ParseErrorCode2[ParseErrorCode2.InvalidCommentToken = 10] = "InvalidCommentToken", ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", ParseErrorCode2[ParseErrorCode2.InvalidUnicode = 14] = "InvalidUnicode", ParseErrorCode2[ParseErrorCode2.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", ParseErrorCode2[ParseErrorCode2.InvalidCharacter = 16] = "InvalidCharacter";
1780
+ })(ParseErrorCode || (ParseErrorCode = {}));
1781
+ function createTokenizationSupport(supportComments) {
1782
+ return {
1783
+ getInitialState: /* @__PURE__ */ __name(() => new JSONState(null, null, !1, null), "getInitialState"),
1784
+ tokenize: /* @__PURE__ */ __name((line, state) => tokenize(supportComments, line, state), "tokenize")
1785
+ };
1786
+ }
1787
+ __name(createTokenizationSupport, "createTokenizationSupport");
1788
+ var TOKEN_DELIM_OBJECT = "delimiter.bracket.json", TOKEN_DELIM_ARRAY = "delimiter.array.json", TOKEN_DELIM_COLON = "delimiter.colon.json", TOKEN_DELIM_COMMA = "delimiter.comma.json", TOKEN_VALUE_BOOLEAN = "keyword.json", TOKEN_VALUE_NULL = "keyword.json", TOKEN_VALUE_STRING = "string.value.json", TOKEN_VALUE_NUMBER = "number.json", TOKEN_PROPERTY_NAME = "string.key.json", TOKEN_COMMENT_BLOCK = "comment.block.json", TOKEN_COMMENT_LINE = "comment.line.json", _a17, ParentsStack = (_a17 = class {
1789
+ constructor(parent, type) {
1790
+ this.parent = parent, this.type = type;
1791
+ }
1792
+ static pop(parents) {
1793
+ return parents ? parents.parent : null;
1794
+ }
1795
+ static push(parents, type) {
1796
+ return new _a17(parents, type);
1797
+ }
1798
+ static equals(a, b) {
1799
+ if (!a && !b)
1800
+ return !0;
1801
+ if (!a || !b)
1802
+ return !1;
1803
+ for (; a && b; ) {
1804
+ if (a === b)
1805
+ return !0;
1806
+ if (a.type !== b.type)
1807
+ return !1;
1808
+ a = a.parent, b = b.parent;
1809
+ }
1810
+ return !0;
1811
+ }
1812
+ }, __name(_a17, "_ParentsStack"), _a17), _a18, JSONState = (_a18 = class {
1813
+ constructor(state, scanError, lastWasColon, parents) {
1814
+ this._state = state, this.scanError = scanError, this.lastWasColon = lastWasColon, this.parents = parents;
1815
+ }
1816
+ clone() {
1817
+ return new _a18(this._state, this.scanError, this.lastWasColon, this.parents);
1818
+ }
1819
+ equals(other) {
1820
+ return other === this ? !0 : !other || !(other instanceof _a18) ? !1 : this.scanError === other.scanError && this.lastWasColon === other.lastWasColon && ParentsStack.equals(this.parents, other.parents);
1821
+ }
1822
+ getStateData() {
1823
+ return this._state;
1824
+ }
1825
+ setStateData(state) {
1826
+ this._state = state;
1827
+ }
1828
+ }, __name(_a18, "_JSONState"), _a18);
1829
+ function tokenize(comments, line, state, offsetDelta = 0) {
1830
+ let numberOfInsertedCharacters = 0, adjustOffset = !1;
1831
+ switch (state.scanError) {
1832
+ case 2:
1833
+ line = '"' + line, numberOfInsertedCharacters = 1;
1834
+ break;
1835
+ case 1:
1836
+ line = "/*" + line, numberOfInsertedCharacters = 2;
1837
+ break;
1838
+ }
1839
+ const scanner = createScanner2(line);
1840
+ let lastWasColon = state.lastWasColon, parents = state.parents;
1841
+ const ret = {
1842
+ tokens: [],
1843
+ endState: state.clone()
1844
+ };
1845
+ for (; ; ) {
1846
+ let offset = offsetDelta + scanner.getPosition(), type = "";
1847
+ const kind = scanner.scan();
1848
+ if (kind === 17)
1849
+ break;
1850
+ if (offset === offsetDelta + scanner.getPosition())
1851
+ throw new Error(
1852
+ "Scanner did not advance, next 3 characters are: " + line.substr(scanner.getPosition(), 3)
1853
+ );
1854
+ switch (adjustOffset && (offset -= numberOfInsertedCharacters), adjustOffset = numberOfInsertedCharacters > 0, kind) {
1855
+ case 1:
1856
+ parents = ParentsStack.push(
1857
+ parents,
1858
+ 0
1859
+ /* Object */
1860
+ ), type = TOKEN_DELIM_OBJECT, lastWasColon = !1;
1861
+ break;
1862
+ case 2:
1863
+ parents = ParentsStack.pop(parents), type = TOKEN_DELIM_OBJECT, lastWasColon = !1;
1864
+ break;
1865
+ case 3:
1866
+ parents = ParentsStack.push(
1867
+ parents,
1868
+ 1
1869
+ /* Array */
1870
+ ), type = TOKEN_DELIM_ARRAY, lastWasColon = !1;
1871
+ break;
1872
+ case 4:
1873
+ parents = ParentsStack.pop(parents), type = TOKEN_DELIM_ARRAY, lastWasColon = !1;
1874
+ break;
1875
+ case 6:
1876
+ type = TOKEN_DELIM_COLON, lastWasColon = !0;
1877
+ break;
1878
+ case 5:
1879
+ type = TOKEN_DELIM_COMMA, lastWasColon = !1;
1880
+ break;
1881
+ case 8:
1882
+ case 9:
1883
+ type = TOKEN_VALUE_BOOLEAN, lastWasColon = !1;
1884
+ break;
1885
+ case 7:
1886
+ type = TOKEN_VALUE_NULL, lastWasColon = !1;
1887
+ break;
1888
+ case 10:
1889
+ const inArray = (parents ? parents.type : 0) === 1;
1890
+ type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME, lastWasColon = !1;
1891
+ break;
1892
+ case 11:
1893
+ type = TOKEN_VALUE_NUMBER, lastWasColon = !1;
1894
+ break;
1895
+ }
1896
+ switch (kind) {
1897
+ case 12:
1898
+ type = TOKEN_COMMENT_LINE;
1899
+ break;
1900
+ case 13:
1901
+ type = TOKEN_COMMENT_BLOCK;
1902
+ break;
1903
+ }
1904
+ ret.endState = new JSONState(
1905
+ state.getStateData(),
1906
+ scanner.getTokenError(),
1907
+ lastWasColon,
1908
+ parents
1909
+ ), ret.tokens.push({
1910
+ startIndex: offset,
1911
+ scopes: type
1912
+ });
1913
+ }
1914
+ return ret;
1915
+ }
1916
+ __name(tokenize, "tokenize");
1917
+ var worker;
1918
+ function getWorker() {
1919
+ return new Promise((resolve, reject) => {
1920
+ if (!worker)
1921
+ return reject("JSON not registered!");
1922
+ resolve(worker);
1923
+ });
1924
+ }
1925
+ __name(getWorker, "getWorker");
1926
+ var _a19, JSONDiagnosticsAdapter = (_a19 = class extends DiagnosticsAdapter {
1927
+ constructor(languageId, worker2, defaults) {
1928
+ super(languageId, worker2, defaults.onDidChange), this._disposables.push(
1929
+ monaco_editor_core_exports.editor.onWillDisposeModel((model) => {
1930
+ this._resetSchema(model.uri);
1931
+ })
1932
+ ), this._disposables.push(
1933
+ monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
1934
+ this._resetSchema(event.model.uri);
1935
+ })
1936
+ );
1937
+ }
1938
+ _resetSchema(resource) {
1939
+ this._worker().then((worker2) => {
1940
+ worker2.resetSchema(resource.toString());
1941
+ });
1942
+ }
1943
+ }, __name(_a19, "JSONDiagnosticsAdapter"), _a19);
1944
+ function setupMode(defaults) {
1945
+ const disposables = [], providers = [], client = new WorkerManager(defaults);
1946
+ disposables.push(client), worker = /* @__PURE__ */ __name((...uris) => client.getLanguageServiceWorker(...uris), "worker");
1947
+ function registerProviders() {
1948
+ const { languageId, modeConfiguration: modeConfiguration2 } = defaults;
1949
+ disposeAll(providers), modeConfiguration2.documentFormattingEdits && providers.push(
1950
+ monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(
1951
+ languageId,
1952
+ new DocumentFormattingEditProvider(worker)
1953
+ )
1954
+ ), modeConfiguration2.documentRangeFormattingEdits && providers.push(
1955
+ monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(
1956
+ languageId,
1957
+ new DocumentRangeFormattingEditProvider(worker)
1958
+ )
1959
+ ), modeConfiguration2.completionItems && providers.push(
1960
+ monaco_editor_core_exports.languages.registerCompletionItemProvider(
1961
+ languageId,
1962
+ new CompletionAdapter(worker, [" ", ":", '"'])
1963
+ )
1964
+ ), modeConfiguration2.hovers && providers.push(
1965
+ monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker))
1966
+ ), modeConfiguration2.documentSymbols && providers.push(
1967
+ monaco_editor_core_exports.languages.registerDocumentSymbolProvider(
1968
+ languageId,
1969
+ new DocumentSymbolAdapter(worker)
1970
+ )
1971
+ ), modeConfiguration2.tokens && providers.push(monaco_editor_core_exports.languages.setTokensProvider(languageId, createTokenizationSupport(!0))), modeConfiguration2.colors && providers.push(
1972
+ monaco_editor_core_exports.languages.registerColorProvider(
1973
+ languageId,
1974
+ new DocumentColorAdapter(worker)
1975
+ )
1976
+ ), modeConfiguration2.foldingRanges && providers.push(
1977
+ monaco_editor_core_exports.languages.registerFoldingRangeProvider(
1978
+ languageId,
1979
+ new FoldingRangeAdapter(worker)
1980
+ )
1981
+ ), modeConfiguration2.diagnostics && providers.push(new JSONDiagnosticsAdapter(languageId, worker, defaults)), modeConfiguration2.selectionRanges && providers.push(
1982
+ monaco_editor_core_exports.languages.registerSelectionRangeProvider(
1983
+ languageId,
1984
+ new SelectionRangeAdapter(worker)
1985
+ )
1986
+ );
1987
+ }
1988
+ __name(registerProviders, "registerProviders"), registerProviders(), disposables.push(monaco_editor_core_exports.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration));
1989
+ let modeConfiguration = defaults.modeConfiguration;
1990
+ return defaults.onDidChange((newDefaults) => {
1991
+ newDefaults.modeConfiguration !== modeConfiguration && (modeConfiguration = newDefaults.modeConfiguration, registerProviders());
1992
+ }), disposables.push(asDisposable(providers)), asDisposable(disposables);
1993
+ }
1994
+ __name(setupMode, "setupMode");
1995
+ function asDisposable(disposables) {
1996
+ return { dispose: /* @__PURE__ */ __name(() => disposeAll(disposables), "dispose") };
1997
+ }
1998
+ __name(asDisposable, "asDisposable");
1999
+ function disposeAll(disposables) {
2000
+ for (; disposables.length; )
2001
+ disposables.pop().dispose();
2002
+ }
2003
+ __name(disposeAll, "disposeAll");
2004
+ var richEditConfiguration = {
2005
+ wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
2006
+ comments: {
2007
+ lineComment: "//",
2008
+ blockComment: ["/*", "*/"]
2009
+ },
2010
+ brackets: [
2011
+ ["{", "}"],
2012
+ ["[", "]"]
2013
+ ],
2014
+ autoClosingPairs: [
2015
+ { open: "{", close: "}", notIn: ["string"] },
2016
+ { open: "[", close: "]", notIn: ["string"] },
2017
+ { open: '"', close: '"', notIn: ["string"] }
2018
+ ]
2019
+ };
2020
+ export {
2021
+ CompletionAdapter,
2022
+ DefinitionAdapter,
2023
+ DiagnosticsAdapter,
2024
+ DocumentColorAdapter,
2025
+ DocumentFormattingEditProvider,
2026
+ DocumentHighlightAdapter,
2027
+ DocumentLinkAdapter,
2028
+ DocumentRangeFormattingEditProvider,
2029
+ DocumentSymbolAdapter,
2030
+ FoldingRangeAdapter,
2031
+ HoverAdapter,
2032
+ ReferenceAdapter,
2033
+ RenameAdapter,
2034
+ SelectionRangeAdapter,
2035
+ WorkerManager,
2036
+ fromPosition,
2037
+ fromRange,
2038
+ getWorker,
2039
+ setupMode,
2040
+ toRange,
2041
+ toTextEdit
2042
+ };