@univerjs/uniscript 0.4.0-alpha.0 → 0.4.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) 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
@@ -0,0 +1,1615 @@
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 `HTMLWorker` instance
35
+ moduleId: "vs/language/html/htmlWorker",
36
+ // passed in to the create() method
37
+ createData: {
38
+ languageSettings: this._defaults.options,
39
+ languageId: this._defaults.languageId
40
+ },
41
+ label: this._defaults.languageId
42
+ }), this._client = this._worker.getProxy()), this._client;
43
+ }
44
+ getLanguageServiceWorker(...resources) {
45
+ let _client;
46
+ return this._getClient().then((client) => {
47
+ _client = client;
48
+ }).then((_) => {
49
+ if (this._worker)
50
+ return this._worker.withSyncedResources(resources);
51
+ }).then((_) => _client);
52
+ }
53
+ }, __name(_a, "WorkerManager"), _a), DocumentUri;
54
+ (function(DocumentUri2) {
55
+ function is(value) {
56
+ return typeof value == "string";
57
+ }
58
+ __name(is, "is"), DocumentUri2.is = is;
59
+ })(DocumentUri || (DocumentUri = {}));
60
+ var URI;
61
+ (function(URI2) {
62
+ function is(value) {
63
+ return typeof value == "string";
64
+ }
65
+ __name(is, "is"), URI2.is = is;
66
+ })(URI || (URI = {}));
67
+ var integer;
68
+ (function(integer2) {
69
+ integer2.MIN_VALUE = -2147483648, integer2.MAX_VALUE = 2147483647;
70
+ function is(value) {
71
+ return typeof value == "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE;
72
+ }
73
+ __name(is, "is"), integer2.is = is;
74
+ })(integer || (integer = {}));
75
+ var uinteger;
76
+ (function(uinteger2) {
77
+ uinteger2.MIN_VALUE = 0, uinteger2.MAX_VALUE = 2147483647;
78
+ function is(value) {
79
+ return typeof value == "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE;
80
+ }
81
+ __name(is, "is"), uinteger2.is = is;
82
+ })(uinteger || (uinteger = {}));
83
+ var Position;
84
+ (function(Position3) {
85
+ function create(line, character) {
86
+ return line === Number.MAX_VALUE && (line = uinteger.MAX_VALUE), character === Number.MAX_VALUE && (character = uinteger.MAX_VALUE), { line, character };
87
+ }
88
+ __name(create, "create"), Position3.create = create;
89
+ function is(value) {
90
+ let candidate = value;
91
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
92
+ }
93
+ __name(is, "is"), Position3.is = is;
94
+ })(Position || (Position = {}));
95
+ var Range;
96
+ (function(Range3) {
97
+ function create(one, two, three, four) {
98
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four))
99
+ return { start: Position.create(one, two), end: Position.create(three, four) };
100
+ if (Position.is(one) && Position.is(two))
101
+ return { start: one, end: two };
102
+ throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
103
+ }
104
+ __name(create, "create"), Range3.create = create;
105
+ function is(value) {
106
+ let candidate = value;
107
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
108
+ }
109
+ __name(is, "is"), Range3.is = is;
110
+ })(Range || (Range = {}));
111
+ var Location;
112
+ (function(Location2) {
113
+ function create(uri, range) {
114
+ return { uri, range };
115
+ }
116
+ __name(create, "create"), Location2.create = create;
117
+ function is(value) {
118
+ let candidate = value;
119
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
120
+ }
121
+ __name(is, "is"), Location2.is = is;
122
+ })(Location || (Location = {}));
123
+ var LocationLink;
124
+ (function(LocationLink2) {
125
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
126
+ return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
127
+ }
128
+ __name(create, "create"), LocationLink2.create = create;
129
+ function is(value) {
130
+ let candidate = value;
131
+ return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
132
+ }
133
+ __name(is, "is"), LocationLink2.is = is;
134
+ })(LocationLink || (LocationLink = {}));
135
+ var Color;
136
+ (function(Color2) {
137
+ function create(red, green, blue, alpha) {
138
+ return {
139
+ red,
140
+ green,
141
+ blue,
142
+ alpha
143
+ };
144
+ }
145
+ __name(create, "create"), Color2.create = create;
146
+ function is(value) {
147
+ const candidate = value;
148
+ 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);
149
+ }
150
+ __name(is, "is"), Color2.is = is;
151
+ })(Color || (Color = {}));
152
+ var ColorInformation;
153
+ (function(ColorInformation2) {
154
+ function create(range, color) {
155
+ return {
156
+ range,
157
+ color
158
+ };
159
+ }
160
+ __name(create, "create"), ColorInformation2.create = create;
161
+ function is(value) {
162
+ const candidate = value;
163
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
164
+ }
165
+ __name(is, "is"), ColorInformation2.is = is;
166
+ })(ColorInformation || (ColorInformation = {}));
167
+ var ColorPresentation;
168
+ (function(ColorPresentation2) {
169
+ function create(label, textEdit, additionalTextEdits) {
170
+ return {
171
+ label,
172
+ textEdit,
173
+ additionalTextEdits
174
+ };
175
+ }
176
+ __name(create, "create"), ColorPresentation2.create = create;
177
+ function is(value) {
178
+ const candidate = value;
179
+ 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));
180
+ }
181
+ __name(is, "is"), ColorPresentation2.is = is;
182
+ })(ColorPresentation || (ColorPresentation = {}));
183
+ var FoldingRangeKind;
184
+ (function(FoldingRangeKind2) {
185
+ FoldingRangeKind2.Comment = "comment", FoldingRangeKind2.Imports = "imports", FoldingRangeKind2.Region = "region";
186
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
187
+ var FoldingRange;
188
+ (function(FoldingRange2) {
189
+ function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
190
+ const result = {
191
+ startLine,
192
+ endLine
193
+ };
194
+ 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;
195
+ }
196
+ __name(create, "create"), FoldingRange2.create = create;
197
+ function is(value) {
198
+ const candidate = value;
199
+ 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));
200
+ }
201
+ __name(is, "is"), FoldingRange2.is = is;
202
+ })(FoldingRange || (FoldingRange = {}));
203
+ var DiagnosticRelatedInformation;
204
+ (function(DiagnosticRelatedInformation2) {
205
+ function create(location, message) {
206
+ return {
207
+ location,
208
+ message
209
+ };
210
+ }
211
+ __name(create, "create"), DiagnosticRelatedInformation2.create = create;
212
+ function is(value) {
213
+ let candidate = value;
214
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
215
+ }
216
+ __name(is, "is"), DiagnosticRelatedInformation2.is = is;
217
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
218
+ var DiagnosticSeverity;
219
+ (function(DiagnosticSeverity2) {
220
+ DiagnosticSeverity2.Error = 1, DiagnosticSeverity2.Warning = 2, DiagnosticSeverity2.Information = 3, DiagnosticSeverity2.Hint = 4;
221
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
222
+ var DiagnosticTag;
223
+ (function(DiagnosticTag2) {
224
+ DiagnosticTag2.Unnecessary = 1, DiagnosticTag2.Deprecated = 2;
225
+ })(DiagnosticTag || (DiagnosticTag = {}));
226
+ var CodeDescription;
227
+ (function(CodeDescription2) {
228
+ function is(value) {
229
+ const candidate = value;
230
+ return Is.objectLiteral(candidate) && Is.string(candidate.href);
231
+ }
232
+ __name(is, "is"), CodeDescription2.is = is;
233
+ })(CodeDescription || (CodeDescription = {}));
234
+ var Diagnostic;
235
+ (function(Diagnostic2) {
236
+ function create(range, message, severity, code, source, relatedInformation) {
237
+ let result = { range, message };
238
+ 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;
239
+ }
240
+ __name(create, "create"), Diagnostic2.create = create;
241
+ function is(value) {
242
+ var _a18;
243
+ let candidate = value;
244
+ 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((_a18 = candidate.codeDescription) === null || _a18 === void 0 ? void 0 : _a18.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
245
+ }
246
+ __name(is, "is"), Diagnostic2.is = is;
247
+ })(Diagnostic || (Diagnostic = {}));
248
+ var Command;
249
+ (function(Command2) {
250
+ function create(title, command, ...args) {
251
+ let result = { title, command };
252
+ return Is.defined(args) && args.length > 0 && (result.arguments = args), result;
253
+ }
254
+ __name(create, "create"), Command2.create = create;
255
+ function is(value) {
256
+ let candidate = value;
257
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
258
+ }
259
+ __name(is, "is"), Command2.is = is;
260
+ })(Command || (Command = {}));
261
+ var TextEdit;
262
+ (function(TextEdit2) {
263
+ function replace(range, newText) {
264
+ return { range, newText };
265
+ }
266
+ __name(replace, "replace"), TextEdit2.replace = replace;
267
+ function insert(position, newText) {
268
+ return { range: { start: position, end: position }, newText };
269
+ }
270
+ __name(insert, "insert"), TextEdit2.insert = insert;
271
+ function del(range) {
272
+ return { range, newText: "" };
273
+ }
274
+ __name(del, "del"), TextEdit2.del = del;
275
+ function is(value) {
276
+ const candidate = value;
277
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
278
+ }
279
+ __name(is, "is"), TextEdit2.is = is;
280
+ })(TextEdit || (TextEdit = {}));
281
+ var ChangeAnnotation;
282
+ (function(ChangeAnnotation2) {
283
+ function create(label, needsConfirmation, description) {
284
+ const result = { label };
285
+ return needsConfirmation !== void 0 && (result.needsConfirmation = needsConfirmation), description !== void 0 && (result.description = description), result;
286
+ }
287
+ __name(create, "create"), ChangeAnnotation2.create = create;
288
+ function is(value) {
289
+ const candidate = value;
290
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
291
+ }
292
+ __name(is, "is"), ChangeAnnotation2.is = is;
293
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
294
+ var ChangeAnnotationIdentifier;
295
+ (function(ChangeAnnotationIdentifier2) {
296
+ function is(value) {
297
+ const candidate = value;
298
+ return Is.string(candidate);
299
+ }
300
+ __name(is, "is"), ChangeAnnotationIdentifier2.is = is;
301
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
302
+ var AnnotatedTextEdit;
303
+ (function(AnnotatedTextEdit2) {
304
+ function replace(range, newText, annotation) {
305
+ return { range, newText, annotationId: annotation };
306
+ }
307
+ __name(replace, "replace"), AnnotatedTextEdit2.replace = replace;
308
+ function insert(position, newText, annotation) {
309
+ return { range: { start: position, end: position }, newText, annotationId: annotation };
310
+ }
311
+ __name(insert, "insert"), AnnotatedTextEdit2.insert = insert;
312
+ function del(range, annotation) {
313
+ return { range, newText: "", annotationId: annotation };
314
+ }
315
+ __name(del, "del"), AnnotatedTextEdit2.del = del;
316
+ function is(value) {
317
+ const candidate = value;
318
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
319
+ }
320
+ __name(is, "is"), AnnotatedTextEdit2.is = is;
321
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
322
+ var TextDocumentEdit;
323
+ (function(TextDocumentEdit2) {
324
+ function create(textDocument, edits) {
325
+ return { textDocument, edits };
326
+ }
327
+ __name(create, "create"), TextDocumentEdit2.create = create;
328
+ function is(value) {
329
+ let candidate = value;
330
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
331
+ }
332
+ __name(is, "is"), TextDocumentEdit2.is = is;
333
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
334
+ var CreateFile;
335
+ (function(CreateFile2) {
336
+ function create(uri, options, annotation) {
337
+ let result = {
338
+ kind: "create",
339
+ uri
340
+ };
341
+ return options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
342
+ }
343
+ __name(create, "create"), CreateFile2.create = create;
344
+ function is(value) {
345
+ let candidate = value;
346
+ 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));
347
+ }
348
+ __name(is, "is"), CreateFile2.is = is;
349
+ })(CreateFile || (CreateFile = {}));
350
+ var RenameFile;
351
+ (function(RenameFile2) {
352
+ function create(oldUri, newUri, options, annotation) {
353
+ let result = {
354
+ kind: "rename",
355
+ oldUri,
356
+ newUri
357
+ };
358
+ return options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
359
+ }
360
+ __name(create, "create"), RenameFile2.create = create;
361
+ function is(value) {
362
+ let candidate = value;
363
+ 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));
364
+ }
365
+ __name(is, "is"), RenameFile2.is = is;
366
+ })(RenameFile || (RenameFile = {}));
367
+ var DeleteFile;
368
+ (function(DeleteFile2) {
369
+ function create(uri, options, annotation) {
370
+ let result = {
371
+ kind: "delete",
372
+ uri
373
+ };
374
+ return options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0) && (result.options = options), annotation !== void 0 && (result.annotationId = annotation), result;
375
+ }
376
+ __name(create, "create"), DeleteFile2.create = create;
377
+ function is(value) {
378
+ let candidate = value;
379
+ 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));
380
+ }
381
+ __name(is, "is"), DeleteFile2.is = is;
382
+ })(DeleteFile || (DeleteFile = {}));
383
+ var WorkspaceEdit;
384
+ (function(WorkspaceEdit2) {
385
+ function is(value) {
386
+ let candidate = value;
387
+ 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)));
388
+ }
389
+ __name(is, "is"), WorkspaceEdit2.is = is;
390
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
391
+ var TextDocumentIdentifier;
392
+ (function(TextDocumentIdentifier2) {
393
+ function create(uri) {
394
+ return { uri };
395
+ }
396
+ __name(create, "create"), TextDocumentIdentifier2.create = create;
397
+ function is(value) {
398
+ let candidate = value;
399
+ return Is.defined(candidate) && Is.string(candidate.uri);
400
+ }
401
+ __name(is, "is"), TextDocumentIdentifier2.is = is;
402
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
403
+ var VersionedTextDocumentIdentifier;
404
+ (function(VersionedTextDocumentIdentifier2) {
405
+ function create(uri, version) {
406
+ return { uri, version };
407
+ }
408
+ __name(create, "create"), VersionedTextDocumentIdentifier2.create = create;
409
+ function is(value) {
410
+ let candidate = value;
411
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
412
+ }
413
+ __name(is, "is"), VersionedTextDocumentIdentifier2.is = is;
414
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
415
+ var OptionalVersionedTextDocumentIdentifier;
416
+ (function(OptionalVersionedTextDocumentIdentifier2) {
417
+ function create(uri, version) {
418
+ return { uri, version };
419
+ }
420
+ __name(create, "create"), OptionalVersionedTextDocumentIdentifier2.create = create;
421
+ function is(value) {
422
+ let candidate = value;
423
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
424
+ }
425
+ __name(is, "is"), OptionalVersionedTextDocumentIdentifier2.is = is;
426
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
427
+ var TextDocumentItem;
428
+ (function(TextDocumentItem2) {
429
+ function create(uri, languageId, version, text) {
430
+ return { uri, languageId, version, text };
431
+ }
432
+ __name(create, "create"), TextDocumentItem2.create = create;
433
+ function is(value) {
434
+ let candidate = value;
435
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
436
+ }
437
+ __name(is, "is"), TextDocumentItem2.is = is;
438
+ })(TextDocumentItem || (TextDocumentItem = {}));
439
+ var MarkupKind;
440
+ (function(MarkupKind2) {
441
+ MarkupKind2.PlainText = "plaintext", MarkupKind2.Markdown = "markdown";
442
+ function is(value) {
443
+ const candidate = value;
444
+ return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
445
+ }
446
+ __name(is, "is"), MarkupKind2.is = is;
447
+ })(MarkupKind || (MarkupKind = {}));
448
+ var MarkupContent;
449
+ (function(MarkupContent2) {
450
+ function is(value) {
451
+ const candidate = value;
452
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
453
+ }
454
+ __name(is, "is"), MarkupContent2.is = is;
455
+ })(MarkupContent || (MarkupContent = {}));
456
+ var CompletionItemKind;
457
+ (function(CompletionItemKind2) {
458
+ 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;
459
+ })(CompletionItemKind || (CompletionItemKind = {}));
460
+ var InsertTextFormat;
461
+ (function(InsertTextFormat2) {
462
+ InsertTextFormat2.PlainText = 1, InsertTextFormat2.Snippet = 2;
463
+ })(InsertTextFormat || (InsertTextFormat = {}));
464
+ var CompletionItemTag;
465
+ (function(CompletionItemTag2) {
466
+ CompletionItemTag2.Deprecated = 1;
467
+ })(CompletionItemTag || (CompletionItemTag = {}));
468
+ var InsertReplaceEdit;
469
+ (function(InsertReplaceEdit2) {
470
+ function create(newText, insert, replace) {
471
+ return { newText, insert, replace };
472
+ }
473
+ __name(create, "create"), InsertReplaceEdit2.create = create;
474
+ function is(value) {
475
+ const candidate = value;
476
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
477
+ }
478
+ __name(is, "is"), InsertReplaceEdit2.is = is;
479
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
480
+ var InsertTextMode;
481
+ (function(InsertTextMode2) {
482
+ InsertTextMode2.asIs = 1, InsertTextMode2.adjustIndentation = 2;
483
+ })(InsertTextMode || (InsertTextMode = {}));
484
+ var CompletionItemLabelDetails;
485
+ (function(CompletionItemLabelDetails2) {
486
+ function is(value) {
487
+ const candidate = value;
488
+ return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
489
+ }
490
+ __name(is, "is"), CompletionItemLabelDetails2.is = is;
491
+ })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
492
+ var CompletionItem;
493
+ (function(CompletionItem2) {
494
+ function create(label) {
495
+ return { label };
496
+ }
497
+ __name(create, "create"), CompletionItem2.create = create;
498
+ })(CompletionItem || (CompletionItem = {}));
499
+ var CompletionList;
500
+ (function(CompletionList2) {
501
+ function create(items, isIncomplete) {
502
+ return { items: items || [], isIncomplete: !!isIncomplete };
503
+ }
504
+ __name(create, "create"), CompletionList2.create = create;
505
+ })(CompletionList || (CompletionList = {}));
506
+ var MarkedString;
507
+ (function(MarkedString2) {
508
+ function fromPlainText(plainText) {
509
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
510
+ }
511
+ __name(fromPlainText, "fromPlainText"), MarkedString2.fromPlainText = fromPlainText;
512
+ function is(value) {
513
+ const candidate = value;
514
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
515
+ }
516
+ __name(is, "is"), MarkedString2.is = is;
517
+ })(MarkedString || (MarkedString = {}));
518
+ var Hover;
519
+ (function(Hover2) {
520
+ function is(value) {
521
+ let candidate = value;
522
+ 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));
523
+ }
524
+ __name(is, "is"), Hover2.is = is;
525
+ })(Hover || (Hover = {}));
526
+ var ParameterInformation;
527
+ (function(ParameterInformation2) {
528
+ function create(label, documentation) {
529
+ return documentation ? { label, documentation } : { label };
530
+ }
531
+ __name(create, "create"), ParameterInformation2.create = create;
532
+ })(ParameterInformation || (ParameterInformation = {}));
533
+ var SignatureInformation;
534
+ (function(SignatureInformation2) {
535
+ function create(label, documentation, ...parameters) {
536
+ let result = { label };
537
+ return Is.defined(documentation) && (result.documentation = documentation), Is.defined(parameters) ? result.parameters = parameters : result.parameters = [], result;
538
+ }
539
+ __name(create, "create"), SignatureInformation2.create = create;
540
+ })(SignatureInformation || (SignatureInformation = {}));
541
+ var DocumentHighlightKind;
542
+ (function(DocumentHighlightKind2) {
543
+ DocumentHighlightKind2.Text = 1, DocumentHighlightKind2.Read = 2, DocumentHighlightKind2.Write = 3;
544
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
545
+ var DocumentHighlight;
546
+ (function(DocumentHighlight2) {
547
+ function create(range, kind) {
548
+ let result = { range };
549
+ return Is.number(kind) && (result.kind = kind), result;
550
+ }
551
+ __name(create, "create"), DocumentHighlight2.create = create;
552
+ })(DocumentHighlight || (DocumentHighlight = {}));
553
+ var SymbolKind;
554
+ (function(SymbolKind2) {
555
+ 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;
556
+ })(SymbolKind || (SymbolKind = {}));
557
+ var SymbolTag;
558
+ (function(SymbolTag2) {
559
+ SymbolTag2.Deprecated = 1;
560
+ })(SymbolTag || (SymbolTag = {}));
561
+ var SymbolInformation;
562
+ (function(SymbolInformation2) {
563
+ function create(name, kind, range, uri, containerName) {
564
+ let result = {
565
+ name,
566
+ kind,
567
+ location: { uri, range }
568
+ };
569
+ return containerName && (result.containerName = containerName), result;
570
+ }
571
+ __name(create, "create"), SymbolInformation2.create = create;
572
+ })(SymbolInformation || (SymbolInformation = {}));
573
+ var WorkspaceSymbol;
574
+ (function(WorkspaceSymbol2) {
575
+ function create(name, kind, uri, range) {
576
+ return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } };
577
+ }
578
+ __name(create, "create"), WorkspaceSymbol2.create = create;
579
+ })(WorkspaceSymbol || (WorkspaceSymbol = {}));
580
+ var DocumentSymbol;
581
+ (function(DocumentSymbol2) {
582
+ function create(name, detail, kind, range, selectionRange, children) {
583
+ let result = {
584
+ name,
585
+ detail,
586
+ kind,
587
+ range,
588
+ selectionRange
589
+ };
590
+ return children !== void 0 && (result.children = children), result;
591
+ }
592
+ __name(create, "create"), DocumentSymbol2.create = create;
593
+ function is(value) {
594
+ let candidate = value;
595
+ 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));
596
+ }
597
+ __name(is, "is"), DocumentSymbol2.is = is;
598
+ })(DocumentSymbol || (DocumentSymbol = {}));
599
+ var CodeActionKind;
600
+ (function(CodeActionKind2) {
601
+ 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";
602
+ })(CodeActionKind || (CodeActionKind = {}));
603
+ var CodeActionTriggerKind;
604
+ (function(CodeActionTriggerKind2) {
605
+ CodeActionTriggerKind2.Invoked = 1, CodeActionTriggerKind2.Automatic = 2;
606
+ })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
607
+ var CodeActionContext;
608
+ (function(CodeActionContext2) {
609
+ function create(diagnostics, only, triggerKind) {
610
+ let result = { diagnostics };
611
+ return only != null && (result.only = only), triggerKind != null && (result.triggerKind = triggerKind), result;
612
+ }
613
+ __name(create, "create"), CodeActionContext2.create = create;
614
+ function is(value) {
615
+ let candidate = value;
616
+ 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);
617
+ }
618
+ __name(is, "is"), CodeActionContext2.is = is;
619
+ })(CodeActionContext || (CodeActionContext = {}));
620
+ var CodeAction;
621
+ (function(CodeAction2) {
622
+ function create(title, kindOrCommandOrEdit, kind) {
623
+ let result = { title }, checkKind = !0;
624
+ 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;
625
+ }
626
+ __name(create, "create"), CodeAction2.create = create;
627
+ function is(value) {
628
+ let candidate = value;
629
+ 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));
630
+ }
631
+ __name(is, "is"), CodeAction2.is = is;
632
+ })(CodeAction || (CodeAction = {}));
633
+ var CodeLens;
634
+ (function(CodeLens2) {
635
+ function create(range, data) {
636
+ let result = { range };
637
+ return Is.defined(data) && (result.data = data), result;
638
+ }
639
+ __name(create, "create"), CodeLens2.create = create;
640
+ function is(value) {
641
+ let candidate = value;
642
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
643
+ }
644
+ __name(is, "is"), CodeLens2.is = is;
645
+ })(CodeLens || (CodeLens = {}));
646
+ var FormattingOptions;
647
+ (function(FormattingOptions2) {
648
+ function create(tabSize, insertSpaces) {
649
+ return { tabSize, insertSpaces };
650
+ }
651
+ __name(create, "create"), FormattingOptions2.create = create;
652
+ function is(value) {
653
+ let candidate = value;
654
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
655
+ }
656
+ __name(is, "is"), FormattingOptions2.is = is;
657
+ })(FormattingOptions || (FormattingOptions = {}));
658
+ var DocumentLink;
659
+ (function(DocumentLink2) {
660
+ function create(range, target, data) {
661
+ return { range, target, data };
662
+ }
663
+ __name(create, "create"), DocumentLink2.create = create;
664
+ function is(value) {
665
+ let candidate = value;
666
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
667
+ }
668
+ __name(is, "is"), DocumentLink2.is = is;
669
+ })(DocumentLink || (DocumentLink = {}));
670
+ var SelectionRange;
671
+ (function(SelectionRange2) {
672
+ function create(range, parent) {
673
+ return { range, parent };
674
+ }
675
+ __name(create, "create"), SelectionRange2.create = create;
676
+ function is(value) {
677
+ let candidate = value;
678
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
679
+ }
680
+ __name(is, "is"), SelectionRange2.is = is;
681
+ })(SelectionRange || (SelectionRange = {}));
682
+ var SemanticTokenTypes;
683
+ (function(SemanticTokenTypes2) {
684
+ 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";
685
+ })(SemanticTokenTypes || (SemanticTokenTypes = {}));
686
+ var SemanticTokenModifiers;
687
+ (function(SemanticTokenModifiers2) {
688
+ 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";
689
+ })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
690
+ var SemanticTokens;
691
+ (function(SemanticTokens2) {
692
+ function is(value) {
693
+ const candidate = value;
694
+ 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");
695
+ }
696
+ __name(is, "is"), SemanticTokens2.is = is;
697
+ })(SemanticTokens || (SemanticTokens = {}));
698
+ var InlineValueText;
699
+ (function(InlineValueText2) {
700
+ function create(range, text) {
701
+ return { range, text };
702
+ }
703
+ __name(create, "create"), InlineValueText2.create = create;
704
+ function is(value) {
705
+ const candidate = value;
706
+ return candidate != null && Range.is(candidate.range) && Is.string(candidate.text);
707
+ }
708
+ __name(is, "is"), InlineValueText2.is = is;
709
+ })(InlineValueText || (InlineValueText = {}));
710
+ var InlineValueVariableLookup;
711
+ (function(InlineValueVariableLookup2) {
712
+ function create(range, variableName, caseSensitiveLookup) {
713
+ return { range, variableName, caseSensitiveLookup };
714
+ }
715
+ __name(create, "create"), InlineValueVariableLookup2.create = create;
716
+ function is(value) {
717
+ const candidate = value;
718
+ return candidate != null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
719
+ }
720
+ __name(is, "is"), InlineValueVariableLookup2.is = is;
721
+ })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
722
+ var InlineValueEvaluatableExpression;
723
+ (function(InlineValueEvaluatableExpression2) {
724
+ function create(range, expression) {
725
+ return { range, expression };
726
+ }
727
+ __name(create, "create"), InlineValueEvaluatableExpression2.create = create;
728
+ function is(value) {
729
+ const candidate = value;
730
+ return candidate != null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
731
+ }
732
+ __name(is, "is"), InlineValueEvaluatableExpression2.is = is;
733
+ })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
734
+ var InlineValueContext;
735
+ (function(InlineValueContext2) {
736
+ function create(frameId, stoppedLocation) {
737
+ return { frameId, stoppedLocation };
738
+ }
739
+ __name(create, "create"), InlineValueContext2.create = create;
740
+ function is(value) {
741
+ const candidate = value;
742
+ return Is.defined(candidate) && Range.is(value.stoppedLocation);
743
+ }
744
+ __name(is, "is"), InlineValueContext2.is = is;
745
+ })(InlineValueContext || (InlineValueContext = {}));
746
+ var InlayHintKind;
747
+ (function(InlayHintKind2) {
748
+ InlayHintKind2.Type = 1, InlayHintKind2.Parameter = 2;
749
+ function is(value) {
750
+ return value === 1 || value === 2;
751
+ }
752
+ __name(is, "is"), InlayHintKind2.is = is;
753
+ })(InlayHintKind || (InlayHintKind = {}));
754
+ var InlayHintLabelPart;
755
+ (function(InlayHintLabelPart2) {
756
+ function create(value) {
757
+ return { value };
758
+ }
759
+ __name(create, "create"), InlayHintLabelPart2.create = create;
760
+ function is(value) {
761
+ const candidate = value;
762
+ 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));
763
+ }
764
+ __name(is, "is"), InlayHintLabelPart2.is = is;
765
+ })(InlayHintLabelPart || (InlayHintLabelPart = {}));
766
+ var InlayHint;
767
+ (function(InlayHint2) {
768
+ function create(position, label, kind) {
769
+ const result = { position, label };
770
+ return kind !== void 0 && (result.kind = kind), result;
771
+ }
772
+ __name(create, "create"), InlayHint2.create = create;
773
+ function is(value) {
774
+ const candidate = value;
775
+ 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));
776
+ }
777
+ __name(is, "is"), InlayHint2.is = is;
778
+ })(InlayHint || (InlayHint = {}));
779
+ var StringValue;
780
+ (function(StringValue2) {
781
+ function createSnippet(value) {
782
+ return { kind: "snippet", value };
783
+ }
784
+ __name(createSnippet, "createSnippet"), StringValue2.createSnippet = createSnippet;
785
+ })(StringValue || (StringValue = {}));
786
+ var InlineCompletionItem;
787
+ (function(InlineCompletionItem2) {
788
+ function create(insertText, filterText, range, command) {
789
+ return { insertText, filterText, range, command };
790
+ }
791
+ __name(create, "create"), InlineCompletionItem2.create = create;
792
+ })(InlineCompletionItem || (InlineCompletionItem = {}));
793
+ var InlineCompletionList;
794
+ (function(InlineCompletionList2) {
795
+ function create(items) {
796
+ return { items };
797
+ }
798
+ __name(create, "create"), InlineCompletionList2.create = create;
799
+ })(InlineCompletionList || (InlineCompletionList = {}));
800
+ var InlineCompletionTriggerKind;
801
+ (function(InlineCompletionTriggerKind2) {
802
+ InlineCompletionTriggerKind2.Invoked = 0, InlineCompletionTriggerKind2.Automatic = 1;
803
+ })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
804
+ var SelectedCompletionInfo;
805
+ (function(SelectedCompletionInfo2) {
806
+ function create(range, text) {
807
+ return { range, text };
808
+ }
809
+ __name(create, "create"), SelectedCompletionInfo2.create = create;
810
+ })(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
811
+ var InlineCompletionContext;
812
+ (function(InlineCompletionContext2) {
813
+ function create(triggerKind, selectedCompletionInfo) {
814
+ return { triggerKind, selectedCompletionInfo };
815
+ }
816
+ __name(create, "create"), InlineCompletionContext2.create = create;
817
+ })(InlineCompletionContext || (InlineCompletionContext = {}));
818
+ var WorkspaceFolder;
819
+ (function(WorkspaceFolder2) {
820
+ function is(value) {
821
+ const candidate = value;
822
+ return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
823
+ }
824
+ __name(is, "is"), WorkspaceFolder2.is = is;
825
+ })(WorkspaceFolder || (WorkspaceFolder = {}));
826
+ var TextDocument;
827
+ (function(TextDocument2) {
828
+ function create(uri, languageId, version, content) {
829
+ return new FullTextDocument(uri, languageId, version, content);
830
+ }
831
+ __name(create, "create"), TextDocument2.create = create;
832
+ function is(value) {
833
+ let candidate = value;
834
+ 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));
835
+ }
836
+ __name(is, "is"), TextDocument2.is = is;
837
+ function applyEdits(document, edits) {
838
+ let text = document.getText(), sortedEdits = mergeSort(edits, (a, b) => {
839
+ let diff = a.range.start.line - b.range.start.line;
840
+ return diff === 0 ? a.range.start.character - b.range.start.character : diff;
841
+ }), lastModifiedOffset = text.length;
842
+ for (let i = sortedEdits.length - 1; i >= 0; i--) {
843
+ let e = sortedEdits[i], startOffset = document.offsetAt(e.range.start), endOffset = document.offsetAt(e.range.end);
844
+ if (endOffset <= lastModifiedOffset)
845
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
846
+ else
847
+ throw new Error("Overlapping edit");
848
+ lastModifiedOffset = startOffset;
849
+ }
850
+ return text;
851
+ }
852
+ __name(applyEdits, "applyEdits"), TextDocument2.applyEdits = applyEdits;
853
+ function mergeSort(data, compare) {
854
+ if (data.length <= 1)
855
+ return data;
856
+ const p = data.length / 2 | 0, left = data.slice(0, p), right = data.slice(p);
857
+ mergeSort(left, compare), mergeSort(right, compare);
858
+ let leftIdx = 0, rightIdx = 0, i = 0;
859
+ for (; leftIdx < left.length && rightIdx < right.length; )
860
+ compare(left[leftIdx], right[rightIdx]) <= 0 ? data[i++] = left[leftIdx++] : data[i++] = right[rightIdx++];
861
+ for (; leftIdx < left.length; )
862
+ data[i++] = left[leftIdx++];
863
+ for (; rightIdx < right.length; )
864
+ data[i++] = right[rightIdx++];
865
+ return data;
866
+ }
867
+ __name(mergeSort, "mergeSort");
868
+ })(TextDocument || (TextDocument = {}));
869
+ var _a2, FullTextDocument = (_a2 = class {
870
+ constructor(uri, languageId, version, content) {
871
+ this._uri = uri, this._languageId = languageId, this._version = version, this._content = content, this._lineOffsets = void 0;
872
+ }
873
+ get uri() {
874
+ return this._uri;
875
+ }
876
+ get languageId() {
877
+ return this._languageId;
878
+ }
879
+ get version() {
880
+ return this._version;
881
+ }
882
+ getText(range) {
883
+ if (range) {
884
+ let start = this.offsetAt(range.start), end = this.offsetAt(range.end);
885
+ return this._content.substring(start, end);
886
+ }
887
+ return this._content;
888
+ }
889
+ update(event, version) {
890
+ this._content = event.text, this._version = version, this._lineOffsets = void 0;
891
+ }
892
+ getLineOffsets() {
893
+ if (this._lineOffsets === void 0) {
894
+ let lineOffsets = [], text = this._content, isLineStart = !0;
895
+ for (let i = 0; i < text.length; i++) {
896
+ isLineStart && (lineOffsets.push(i), isLineStart = !1);
897
+ let ch = text.charAt(i);
898
+ isLineStart = ch === "\r" || ch === `
899
+ `, ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === `
900
+ ` && i++;
901
+ }
902
+ isLineStart && text.length > 0 && lineOffsets.push(text.length), this._lineOffsets = lineOffsets;
903
+ }
904
+ return this._lineOffsets;
905
+ }
906
+ positionAt(offset) {
907
+ offset = Math.max(Math.min(offset, this._content.length), 0);
908
+ let lineOffsets = this.getLineOffsets(), low = 0, high = lineOffsets.length;
909
+ if (high === 0)
910
+ return Position.create(0, offset);
911
+ for (; low < high; ) {
912
+ let mid = Math.floor((low + high) / 2);
913
+ lineOffsets[mid] > offset ? high = mid : low = mid + 1;
914
+ }
915
+ let line = low - 1;
916
+ return Position.create(line, offset - lineOffsets[line]);
917
+ }
918
+ offsetAt(position) {
919
+ let lineOffsets = this.getLineOffsets();
920
+ if (position.line >= lineOffsets.length)
921
+ return this._content.length;
922
+ if (position.line < 0)
923
+ return 0;
924
+ let lineOffset = lineOffsets[position.line], nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
925
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
926
+ }
927
+ get lineCount() {
928
+ return this.getLineOffsets().length;
929
+ }
930
+ }, __name(_a2, "FullTextDocument"), _a2), Is;
931
+ (function(Is2) {
932
+ const toString = Object.prototype.toString;
933
+ function defined(value) {
934
+ return typeof value < "u";
935
+ }
936
+ __name(defined, "defined"), Is2.defined = defined;
937
+ function undefined2(value) {
938
+ return typeof value > "u";
939
+ }
940
+ __name(undefined2, "undefined2"), Is2.undefined = undefined2;
941
+ function boolean(value) {
942
+ return value === !0 || value === !1;
943
+ }
944
+ __name(boolean, "boolean"), Is2.boolean = boolean;
945
+ function string(value) {
946
+ return toString.call(value) === "[object String]";
947
+ }
948
+ __name(string, "string"), Is2.string = string;
949
+ function number(value) {
950
+ return toString.call(value) === "[object Number]";
951
+ }
952
+ __name(number, "number"), Is2.number = number;
953
+ function numberRange(value, min, max) {
954
+ return toString.call(value) === "[object Number]" && min <= value && value <= max;
955
+ }
956
+ __name(numberRange, "numberRange"), Is2.numberRange = numberRange;
957
+ function integer2(value) {
958
+ return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
959
+ }
960
+ __name(integer2, "integer2"), Is2.integer = integer2;
961
+ function uinteger2(value) {
962
+ return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
963
+ }
964
+ __name(uinteger2, "uinteger2"), Is2.uinteger = uinteger2;
965
+ function func(value) {
966
+ return toString.call(value) === "[object Function]";
967
+ }
968
+ __name(func, "func"), Is2.func = func;
969
+ function objectLiteral(value) {
970
+ return value !== null && typeof value == "object";
971
+ }
972
+ __name(objectLiteral, "objectLiteral"), Is2.objectLiteral = objectLiteral;
973
+ function typedArray(value, check) {
974
+ return Array.isArray(value) && value.every(check);
975
+ }
976
+ __name(typedArray, "typedArray"), Is2.typedArray = typedArray;
977
+ })(Is || (Is = {}));
978
+ var _a3, DiagnosticsAdapter = (_a3 = class {
979
+ constructor(_languageId, _worker, configChangeEvent) {
980
+ this._languageId = _languageId, this._worker = _worker, this._disposables = [], this._listener = /* @__PURE__ */ Object.create(null);
981
+ const onModelAdd = /* @__PURE__ */ __name((model) => {
982
+ let modeId = model.getLanguageId();
983
+ if (modeId !== this._languageId)
984
+ return;
985
+ let handle;
986
+ this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
987
+ window.clearTimeout(handle), handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
988
+ }), this._doValidate(model.uri, modeId);
989
+ }, "onModelAdd"), onModelRemoved = /* @__PURE__ */ __name((model) => {
990
+ monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);
991
+ let uriStr = model.uri.toString(), listener = this._listener[uriStr];
992
+ listener && (listener.dispose(), delete this._listener[uriStr]);
993
+ }, "onModelRemoved");
994
+ this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd)), this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved)), this._disposables.push(
995
+ monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
996
+ onModelRemoved(event.model), onModelAdd(event.model);
997
+ })
998
+ ), this._disposables.push(
999
+ configChangeEvent((_) => {
1000
+ monaco_editor_core_exports.editor.getModels().forEach((model) => {
1001
+ model.getLanguageId() === this._languageId && (onModelRemoved(model), onModelAdd(model));
1002
+ });
1003
+ })
1004
+ ), this._disposables.push({
1005
+ dispose: /* @__PURE__ */ __name(() => {
1006
+ monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);
1007
+ for (let key in this._listener)
1008
+ this._listener[key].dispose();
1009
+ }, "dispose")
1010
+ }), monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);
1011
+ }
1012
+ dispose() {
1013
+ this._disposables.forEach((d) => d && d.dispose()), this._disposables.length = 0;
1014
+ }
1015
+ _doValidate(resource, languageId) {
1016
+ this._worker(resource).then((worker) => worker.doValidation(resource.toString())).then((diagnostics) => {
1017
+ const markers = diagnostics.map((d) => toDiagnostics(resource, d));
1018
+ let model = monaco_editor_core_exports.editor.getModel(resource);
1019
+ model && model.getLanguageId() === languageId && monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);
1020
+ }).then(void 0, (err) => {
1021
+ console.error(err);
1022
+ });
1023
+ }
1024
+ }, __name(_a3, "DiagnosticsAdapter"), _a3);
1025
+ function toSeverity(lsSeverity) {
1026
+ switch (lsSeverity) {
1027
+ case DiagnosticSeverity.Error:
1028
+ return monaco_editor_core_exports.MarkerSeverity.Error;
1029
+ case DiagnosticSeverity.Warning:
1030
+ return monaco_editor_core_exports.MarkerSeverity.Warning;
1031
+ case DiagnosticSeverity.Information:
1032
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1033
+ case DiagnosticSeverity.Hint:
1034
+ return monaco_editor_core_exports.MarkerSeverity.Hint;
1035
+ default:
1036
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1037
+ }
1038
+ }
1039
+ __name(toSeverity, "toSeverity");
1040
+ function toDiagnostics(resource, diag) {
1041
+ let code = typeof diag.code == "number" ? String(diag.code) : diag.code;
1042
+ return {
1043
+ severity: toSeverity(diag.severity),
1044
+ startLineNumber: diag.range.start.line + 1,
1045
+ startColumn: diag.range.start.character + 1,
1046
+ endLineNumber: diag.range.end.line + 1,
1047
+ endColumn: diag.range.end.character + 1,
1048
+ message: diag.message,
1049
+ code,
1050
+ source: diag.source
1051
+ };
1052
+ }
1053
+ __name(toDiagnostics, "toDiagnostics");
1054
+ var _a4, CompletionAdapter = (_a4 = class {
1055
+ constructor(_worker, _triggerCharacters) {
1056
+ this._worker = _worker, this._triggerCharacters = _triggerCharacters;
1057
+ }
1058
+ get triggerCharacters() {
1059
+ return this._triggerCharacters;
1060
+ }
1061
+ provideCompletionItems(model, position, context, token) {
1062
+ const resource = model.uri;
1063
+ return this._worker(resource).then((worker) => worker.doComplete(resource.toString(), fromPosition(position))).then((info) => {
1064
+ if (!info)
1065
+ return;
1066
+ const wordInfo = model.getWordUntilPosition(position), wordRange = new monaco_editor_core_exports.Range(
1067
+ position.lineNumber,
1068
+ wordInfo.startColumn,
1069
+ position.lineNumber,
1070
+ wordInfo.endColumn
1071
+ ), items = info.items.map((entry) => {
1072
+ const item = {
1073
+ label: entry.label,
1074
+ insertText: entry.insertText || entry.label,
1075
+ sortText: entry.sortText,
1076
+ filterText: entry.filterText,
1077
+ documentation: entry.documentation,
1078
+ detail: entry.detail,
1079
+ command: toCommand(entry.command),
1080
+ range: wordRange,
1081
+ kind: toCompletionItemKind(entry.kind)
1082
+ };
1083
+ return entry.textEdit && (isInsertReplaceEdit(entry.textEdit) ? item.range = {
1084
+ insert: toRange(entry.textEdit.insert),
1085
+ replace: toRange(entry.textEdit.replace)
1086
+ } : 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;
1087
+ });
1088
+ return {
1089
+ isIncomplete: info.isIncomplete,
1090
+ suggestions: items
1091
+ };
1092
+ });
1093
+ }
1094
+ }, __name(_a4, "CompletionAdapter"), _a4);
1095
+ function fromPosition(position) {
1096
+ if (position)
1097
+ return { character: position.column - 1, line: position.lineNumber - 1 };
1098
+ }
1099
+ __name(fromPosition, "fromPosition");
1100
+ function fromRange(range) {
1101
+ if (range)
1102
+ return {
1103
+ start: {
1104
+ line: range.startLineNumber - 1,
1105
+ character: range.startColumn - 1
1106
+ },
1107
+ end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
1108
+ };
1109
+ }
1110
+ __name(fromRange, "fromRange");
1111
+ function toRange(range) {
1112
+ if (range)
1113
+ return new monaco_editor_core_exports.Range(
1114
+ range.start.line + 1,
1115
+ range.start.character + 1,
1116
+ range.end.line + 1,
1117
+ range.end.character + 1
1118
+ );
1119
+ }
1120
+ __name(toRange, "toRange");
1121
+ function isInsertReplaceEdit(edit) {
1122
+ return typeof edit.insert < "u" && typeof edit.replace < "u";
1123
+ }
1124
+ __name(isInsertReplaceEdit, "isInsertReplaceEdit");
1125
+ function toCompletionItemKind(kind) {
1126
+ const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;
1127
+ switch (kind) {
1128
+ case CompletionItemKind.Text:
1129
+ return mItemKind.Text;
1130
+ case CompletionItemKind.Method:
1131
+ return mItemKind.Method;
1132
+ case CompletionItemKind.Function:
1133
+ return mItemKind.Function;
1134
+ case CompletionItemKind.Constructor:
1135
+ return mItemKind.Constructor;
1136
+ case CompletionItemKind.Field:
1137
+ return mItemKind.Field;
1138
+ case CompletionItemKind.Variable:
1139
+ return mItemKind.Variable;
1140
+ case CompletionItemKind.Class:
1141
+ return mItemKind.Class;
1142
+ case CompletionItemKind.Interface:
1143
+ return mItemKind.Interface;
1144
+ case CompletionItemKind.Module:
1145
+ return mItemKind.Module;
1146
+ case CompletionItemKind.Property:
1147
+ return mItemKind.Property;
1148
+ case CompletionItemKind.Unit:
1149
+ return mItemKind.Unit;
1150
+ case CompletionItemKind.Value:
1151
+ return mItemKind.Value;
1152
+ case CompletionItemKind.Enum:
1153
+ return mItemKind.Enum;
1154
+ case CompletionItemKind.Keyword:
1155
+ return mItemKind.Keyword;
1156
+ case CompletionItemKind.Snippet:
1157
+ return mItemKind.Snippet;
1158
+ case CompletionItemKind.Color:
1159
+ return mItemKind.Color;
1160
+ case CompletionItemKind.File:
1161
+ return mItemKind.File;
1162
+ case CompletionItemKind.Reference:
1163
+ return mItemKind.Reference;
1164
+ }
1165
+ return mItemKind.Property;
1166
+ }
1167
+ __name(toCompletionItemKind, "toCompletionItemKind");
1168
+ function toTextEdit(textEdit) {
1169
+ if (textEdit)
1170
+ return {
1171
+ range: toRange(textEdit.range),
1172
+ text: textEdit.newText
1173
+ };
1174
+ }
1175
+ __name(toTextEdit, "toTextEdit");
1176
+ function toCommand(c) {
1177
+ return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
1178
+ }
1179
+ __name(toCommand, "toCommand");
1180
+ var _a5, HoverAdapter = (_a5 = class {
1181
+ constructor(_worker) {
1182
+ this._worker = _worker;
1183
+ }
1184
+ provideHover(model, position, token) {
1185
+ let resource = model.uri;
1186
+ return this._worker(resource).then((worker) => worker.doHover(resource.toString(), fromPosition(position))).then((info) => {
1187
+ if (info)
1188
+ return {
1189
+ range: toRange(info.range),
1190
+ contents: toMarkedStringArray(info.contents)
1191
+ };
1192
+ });
1193
+ }
1194
+ }, __name(_a5, "HoverAdapter"), _a5);
1195
+ function isMarkupContent(thing) {
1196
+ return thing && typeof thing == "object" && typeof thing.kind == "string";
1197
+ }
1198
+ __name(isMarkupContent, "isMarkupContent");
1199
+ function toMarkdownString(entry) {
1200
+ return typeof entry == "string" ? {
1201
+ value: entry
1202
+ } : isMarkupContent(entry) ? entry.kind === "plaintext" ? {
1203
+ value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1204
+ } : {
1205
+ value: entry.value
1206
+ } : { value: "```" + entry.language + `
1207
+ ` + entry.value + "\n```\n" };
1208
+ }
1209
+ __name(toMarkdownString, "toMarkdownString");
1210
+ function toMarkedStringArray(contents) {
1211
+ if (contents)
1212
+ return Array.isArray(contents) ? contents.map(toMarkdownString) : [toMarkdownString(contents)];
1213
+ }
1214
+ __name(toMarkedStringArray, "toMarkedStringArray");
1215
+ var _a6, DocumentHighlightAdapter = (_a6 = class {
1216
+ constructor(_worker) {
1217
+ this._worker = _worker;
1218
+ }
1219
+ provideDocumentHighlights(model, position, token) {
1220
+ const resource = model.uri;
1221
+ return this._worker(resource).then((worker) => worker.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
1222
+ if (entries)
1223
+ return entries.map((entry) => ({
1224
+ range: toRange(entry.range),
1225
+ kind: toDocumentHighlightKind(entry.kind)
1226
+ }));
1227
+ });
1228
+ }
1229
+ }, __name(_a6, "DocumentHighlightAdapter"), _a6);
1230
+ function toDocumentHighlightKind(kind) {
1231
+ switch (kind) {
1232
+ case DocumentHighlightKind.Read:
1233
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
1234
+ case DocumentHighlightKind.Write:
1235
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
1236
+ case DocumentHighlightKind.Text:
1237
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1238
+ }
1239
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1240
+ }
1241
+ __name(toDocumentHighlightKind, "toDocumentHighlightKind");
1242
+ var _a7, DefinitionAdapter = (_a7 = class {
1243
+ constructor(_worker) {
1244
+ this._worker = _worker;
1245
+ }
1246
+ provideDefinition(model, position, token) {
1247
+ const resource = model.uri;
1248
+ return this._worker(resource).then((worker) => worker.findDefinition(resource.toString(), fromPosition(position))).then((definition) => {
1249
+ if (definition)
1250
+ return [toLocation(definition)];
1251
+ });
1252
+ }
1253
+ }, __name(_a7, "DefinitionAdapter"), _a7);
1254
+ function toLocation(location) {
1255
+ return {
1256
+ uri: monaco_editor_core_exports.Uri.parse(location.uri),
1257
+ range: toRange(location.range)
1258
+ };
1259
+ }
1260
+ __name(toLocation, "toLocation");
1261
+ var _a8, ReferenceAdapter = (_a8 = class {
1262
+ constructor(_worker) {
1263
+ this._worker = _worker;
1264
+ }
1265
+ provideReferences(model, position, context, token) {
1266
+ const resource = model.uri;
1267
+ return this._worker(resource).then((worker) => worker.findReferences(resource.toString(), fromPosition(position))).then((entries) => {
1268
+ if (entries)
1269
+ return entries.map(toLocation);
1270
+ });
1271
+ }
1272
+ }, __name(_a8, "ReferenceAdapter"), _a8), _a9, RenameAdapter = (_a9 = class {
1273
+ constructor(_worker) {
1274
+ this._worker = _worker;
1275
+ }
1276
+ provideRenameEdits(model, position, newName, token) {
1277
+ const resource = model.uri;
1278
+ return this._worker(resource).then((worker) => worker.doRename(resource.toString(), fromPosition(position), newName)).then((edit) => toWorkspaceEdit(edit));
1279
+ }
1280
+ }, __name(_a9, "RenameAdapter"), _a9);
1281
+ function toWorkspaceEdit(edit) {
1282
+ if (!edit || !edit.changes)
1283
+ return;
1284
+ let resourceEdits = [];
1285
+ for (let uri in edit.changes) {
1286
+ const _uri = monaco_editor_core_exports.Uri.parse(uri);
1287
+ for (let e of edit.changes[uri])
1288
+ resourceEdits.push({
1289
+ resource: _uri,
1290
+ versionId: void 0,
1291
+ textEdit: {
1292
+ range: toRange(e.range),
1293
+ text: e.newText
1294
+ }
1295
+ });
1296
+ }
1297
+ return {
1298
+ edits: resourceEdits
1299
+ };
1300
+ }
1301
+ __name(toWorkspaceEdit, "toWorkspaceEdit");
1302
+ var _a10, DocumentSymbolAdapter = (_a10 = class {
1303
+ constructor(_worker) {
1304
+ this._worker = _worker;
1305
+ }
1306
+ provideDocumentSymbols(model, token) {
1307
+ const resource = model.uri;
1308
+ return this._worker(resource).then((worker) => worker.findDocumentSymbols(resource.toString())).then((items) => {
1309
+ if (items)
1310
+ return items.map((item) => isDocumentSymbol(item) ? toDocumentSymbol(item) : {
1311
+ name: item.name,
1312
+ detail: "",
1313
+ containerName: item.containerName,
1314
+ kind: toSymbolKind(item.kind),
1315
+ range: toRange(item.location.range),
1316
+ selectionRange: toRange(item.location.range),
1317
+ tags: []
1318
+ });
1319
+ });
1320
+ }
1321
+ }, __name(_a10, "DocumentSymbolAdapter"), _a10);
1322
+ function isDocumentSymbol(symbol) {
1323
+ return "children" in symbol;
1324
+ }
1325
+ __name(isDocumentSymbol, "isDocumentSymbol");
1326
+ function toDocumentSymbol(symbol) {
1327
+ var _a18, _b, _c;
1328
+ return {
1329
+ name: symbol.name,
1330
+ detail: (_a18 = symbol.detail) != null ? _a18 : "",
1331
+ kind: toSymbolKind(symbol.kind),
1332
+ range: toRange(symbol.range),
1333
+ selectionRange: toRange(symbol.selectionRange),
1334
+ tags: (_b = symbol.tags) != null ? _b : [],
1335
+ children: ((_c = symbol.children) != null ? _c : []).map((item) => toDocumentSymbol(item))
1336
+ };
1337
+ }
1338
+ __name(toDocumentSymbol, "toDocumentSymbol");
1339
+ function toSymbolKind(kind) {
1340
+ let mKind = monaco_editor_core_exports.languages.SymbolKind;
1341
+ switch (kind) {
1342
+ case SymbolKind.File:
1343
+ return mKind.File;
1344
+ case SymbolKind.Module:
1345
+ return mKind.Module;
1346
+ case SymbolKind.Namespace:
1347
+ return mKind.Namespace;
1348
+ case SymbolKind.Package:
1349
+ return mKind.Package;
1350
+ case SymbolKind.Class:
1351
+ return mKind.Class;
1352
+ case SymbolKind.Method:
1353
+ return mKind.Method;
1354
+ case SymbolKind.Property:
1355
+ return mKind.Property;
1356
+ case SymbolKind.Field:
1357
+ return mKind.Field;
1358
+ case SymbolKind.Constructor:
1359
+ return mKind.Constructor;
1360
+ case SymbolKind.Enum:
1361
+ return mKind.Enum;
1362
+ case SymbolKind.Interface:
1363
+ return mKind.Interface;
1364
+ case SymbolKind.Function:
1365
+ return mKind.Function;
1366
+ case SymbolKind.Variable:
1367
+ return mKind.Variable;
1368
+ case SymbolKind.Constant:
1369
+ return mKind.Constant;
1370
+ case SymbolKind.String:
1371
+ return mKind.String;
1372
+ case SymbolKind.Number:
1373
+ return mKind.Number;
1374
+ case SymbolKind.Boolean:
1375
+ return mKind.Boolean;
1376
+ case SymbolKind.Array:
1377
+ return mKind.Array;
1378
+ }
1379
+ return mKind.Function;
1380
+ }
1381
+ __name(toSymbolKind, "toSymbolKind");
1382
+ var _a11, DocumentLinkAdapter = (_a11 = class {
1383
+ constructor(_worker) {
1384
+ this._worker = _worker;
1385
+ }
1386
+ provideLinks(model, token) {
1387
+ const resource = model.uri;
1388
+ return this._worker(resource).then((worker) => worker.findDocumentLinks(resource.toString())).then((items) => {
1389
+ if (items)
1390
+ return {
1391
+ links: items.map((item) => ({
1392
+ range: toRange(item.range),
1393
+ url: item.target
1394
+ }))
1395
+ };
1396
+ });
1397
+ }
1398
+ }, __name(_a11, "DocumentLinkAdapter"), _a11), _a12, DocumentFormattingEditProvider = (_a12 = class {
1399
+ constructor(_worker) {
1400
+ this._worker = _worker;
1401
+ }
1402
+ provideDocumentFormattingEdits(model, options, token) {
1403
+ const resource = model.uri;
1404
+ return this._worker(resource).then((worker) => worker.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
1405
+ if (!(!edits || edits.length === 0))
1406
+ return edits.map(toTextEdit);
1407
+ }));
1408
+ }
1409
+ }, __name(_a12, "DocumentFormattingEditProvider"), _a12), _a13, DocumentRangeFormattingEditProvider = (_a13 = class {
1410
+ constructor(_worker) {
1411
+ this._worker = _worker, this.canFormatMultipleRanges = !1;
1412
+ }
1413
+ provideDocumentRangeFormattingEdits(model, range, options, token) {
1414
+ const resource = model.uri;
1415
+ return this._worker(resource).then((worker) => worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
1416
+ if (!(!edits || edits.length === 0))
1417
+ return edits.map(toTextEdit);
1418
+ }));
1419
+ }
1420
+ }, __name(_a13, "DocumentRangeFormattingEditProvider"), _a13);
1421
+ function fromFormattingOptions(options) {
1422
+ return {
1423
+ tabSize: options.tabSize,
1424
+ insertSpaces: options.insertSpaces
1425
+ };
1426
+ }
1427
+ __name(fromFormattingOptions, "fromFormattingOptions");
1428
+ var _a14, DocumentColorAdapter = (_a14 = class {
1429
+ constructor(_worker) {
1430
+ this._worker = _worker;
1431
+ }
1432
+ provideDocumentColors(model, token) {
1433
+ const resource = model.uri;
1434
+ return this._worker(resource).then((worker) => worker.findDocumentColors(resource.toString())).then((infos) => {
1435
+ if (infos)
1436
+ return infos.map((item) => ({
1437
+ color: item.color,
1438
+ range: toRange(item.range)
1439
+ }));
1440
+ });
1441
+ }
1442
+ provideColorPresentations(model, info, token) {
1443
+ const resource = model.uri;
1444
+ return this._worker(resource).then(
1445
+ (worker) => worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range))
1446
+ ).then((presentations) => {
1447
+ if (presentations)
1448
+ return presentations.map((presentation) => {
1449
+ let item = {
1450
+ label: presentation.label
1451
+ };
1452
+ return presentation.textEdit && (item.textEdit = toTextEdit(presentation.textEdit)), presentation.additionalTextEdits && (item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit)), item;
1453
+ });
1454
+ });
1455
+ }
1456
+ }, __name(_a14, "DocumentColorAdapter"), _a14), _a15, FoldingRangeAdapter = (_a15 = class {
1457
+ constructor(_worker) {
1458
+ this._worker = _worker;
1459
+ }
1460
+ provideFoldingRanges(model, context, token) {
1461
+ const resource = model.uri;
1462
+ return this._worker(resource).then((worker) => worker.getFoldingRanges(resource.toString(), context)).then((ranges) => {
1463
+ if (ranges)
1464
+ return ranges.map((range) => {
1465
+ const result = {
1466
+ start: range.startLine + 1,
1467
+ end: range.endLine + 1
1468
+ };
1469
+ return typeof range.kind < "u" && (result.kind = toFoldingRangeKind(range.kind)), result;
1470
+ });
1471
+ });
1472
+ }
1473
+ }, __name(_a15, "FoldingRangeAdapter"), _a15);
1474
+ function toFoldingRangeKind(kind) {
1475
+ switch (kind) {
1476
+ case FoldingRangeKind.Comment:
1477
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
1478
+ case FoldingRangeKind.Imports:
1479
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
1480
+ case FoldingRangeKind.Region:
1481
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
1482
+ }
1483
+ }
1484
+ __name(toFoldingRangeKind, "toFoldingRangeKind");
1485
+ var _a16, SelectionRangeAdapter = (_a16 = class {
1486
+ constructor(_worker) {
1487
+ this._worker = _worker;
1488
+ }
1489
+ provideSelectionRanges(model, positions, token) {
1490
+ const resource = model.uri;
1491
+ return this._worker(resource).then(
1492
+ (worker) => worker.getSelectionRanges(
1493
+ resource.toString(),
1494
+ positions.map(fromPosition)
1495
+ )
1496
+ ).then((selectionRanges) => {
1497
+ if (selectionRanges)
1498
+ return selectionRanges.map((selectionRange) => {
1499
+ const result = [];
1500
+ for (; selectionRange; )
1501
+ result.push({ range: toRange(selectionRange.range) }), selectionRange = selectionRange.parent;
1502
+ return result;
1503
+ });
1504
+ });
1505
+ }
1506
+ }, __name(_a16, "SelectionRangeAdapter"), _a16), _a17, HTMLCompletionAdapter = (_a17 = class extends CompletionAdapter {
1507
+ constructor(worker) {
1508
+ super(worker, [".", ":", "<", '"', "=", "/"]);
1509
+ }
1510
+ }, __name(_a17, "HTMLCompletionAdapter"), _a17);
1511
+ function setupMode1(defaults) {
1512
+ const client = new WorkerManager(defaults), worker = /* @__PURE__ */ __name((...uris) => client.getLanguageServiceWorker(...uris), "worker");
1513
+ let languageId = defaults.languageId;
1514
+ monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new HTMLCompletionAdapter(worker)), monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker)), monaco_editor_core_exports.languages.registerDocumentHighlightProvider(
1515
+ languageId,
1516
+ new DocumentHighlightAdapter(worker)
1517
+ ), monaco_editor_core_exports.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker)), monaco_editor_core_exports.languages.registerFoldingRangeProvider(
1518
+ languageId,
1519
+ new FoldingRangeAdapter(worker)
1520
+ ), monaco_editor_core_exports.languages.registerDocumentSymbolProvider(
1521
+ languageId,
1522
+ new DocumentSymbolAdapter(worker)
1523
+ ), monaco_editor_core_exports.languages.registerSelectionRangeProvider(
1524
+ languageId,
1525
+ new SelectionRangeAdapter(worker)
1526
+ ), monaco_editor_core_exports.languages.registerRenameProvider(languageId, new RenameAdapter(worker)), languageId === "html" && (monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(
1527
+ languageId,
1528
+ new DocumentFormattingEditProvider(worker)
1529
+ ), monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(
1530
+ languageId,
1531
+ new DocumentRangeFormattingEditProvider(worker)
1532
+ ));
1533
+ }
1534
+ __name(setupMode1, "setupMode1");
1535
+ function setupMode(defaults) {
1536
+ const disposables = [], providers = [], client = new WorkerManager(defaults);
1537
+ disposables.push(client);
1538
+ const worker = /* @__PURE__ */ __name((...uris) => client.getLanguageServiceWorker(...uris), "worker");
1539
+ function registerProviders() {
1540
+ const { languageId, modeConfiguration } = defaults;
1541
+ disposeAll(providers), modeConfiguration.completionItems && providers.push(
1542
+ monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new HTMLCompletionAdapter(worker))
1543
+ ), modeConfiguration.hovers && providers.push(
1544
+ monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker))
1545
+ ), modeConfiguration.documentHighlights && providers.push(
1546
+ monaco_editor_core_exports.languages.registerDocumentHighlightProvider(
1547
+ languageId,
1548
+ new DocumentHighlightAdapter(worker)
1549
+ )
1550
+ ), modeConfiguration.links && providers.push(
1551
+ monaco_editor_core_exports.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker))
1552
+ ), modeConfiguration.documentSymbols && providers.push(
1553
+ monaco_editor_core_exports.languages.registerDocumentSymbolProvider(
1554
+ languageId,
1555
+ new DocumentSymbolAdapter(worker)
1556
+ )
1557
+ ), modeConfiguration.rename && providers.push(
1558
+ monaco_editor_core_exports.languages.registerRenameProvider(languageId, new RenameAdapter(worker))
1559
+ ), modeConfiguration.foldingRanges && providers.push(
1560
+ monaco_editor_core_exports.languages.registerFoldingRangeProvider(
1561
+ languageId,
1562
+ new FoldingRangeAdapter(worker)
1563
+ )
1564
+ ), modeConfiguration.selectionRanges && providers.push(
1565
+ monaco_editor_core_exports.languages.registerSelectionRangeProvider(
1566
+ languageId,
1567
+ new SelectionRangeAdapter(worker)
1568
+ )
1569
+ ), modeConfiguration.documentFormattingEdits && providers.push(
1570
+ monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(
1571
+ languageId,
1572
+ new DocumentFormattingEditProvider(worker)
1573
+ )
1574
+ ), modeConfiguration.documentRangeFormattingEdits && providers.push(
1575
+ monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(
1576
+ languageId,
1577
+ new DocumentRangeFormattingEditProvider(worker)
1578
+ )
1579
+ );
1580
+ }
1581
+ return __name(registerProviders, "registerProviders"), registerProviders(), disposables.push(asDisposable(providers)), asDisposable(disposables);
1582
+ }
1583
+ __name(setupMode, "setupMode");
1584
+ function asDisposable(disposables) {
1585
+ return { dispose: /* @__PURE__ */ __name(() => disposeAll(disposables), "dispose") };
1586
+ }
1587
+ __name(asDisposable, "asDisposable");
1588
+ function disposeAll(disposables) {
1589
+ for (; disposables.length; )
1590
+ disposables.pop().dispose();
1591
+ }
1592
+ __name(disposeAll, "disposeAll");
1593
+ export {
1594
+ CompletionAdapter,
1595
+ DefinitionAdapter,
1596
+ DiagnosticsAdapter,
1597
+ DocumentColorAdapter,
1598
+ DocumentFormattingEditProvider,
1599
+ DocumentHighlightAdapter,
1600
+ DocumentLinkAdapter,
1601
+ DocumentRangeFormattingEditProvider,
1602
+ DocumentSymbolAdapter,
1603
+ FoldingRangeAdapter,
1604
+ HoverAdapter,
1605
+ ReferenceAdapter,
1606
+ RenameAdapter,
1607
+ SelectionRangeAdapter,
1608
+ WorkerManager,
1609
+ fromPosition,
1610
+ fromRange,
1611
+ setupMode,
1612
+ setupMode1,
1613
+ toRange,
1614
+ toTextEdit
1615
+ };