app-ai-solution-exp 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/bin/app-ai-solution-exp.js +20 -0
  2. package/out/main/index.js +1631 -0
  3. package/out/preload/index.js +108 -0
  4. package/out/renderer/assets/abap-D5KwWAsZ.js +1399 -0
  5. package/out/renderer/assets/apex-DVGUZ64i.js +331 -0
  6. package/out/renderer/assets/azcli-BEAhqcuE.js +69 -0
  7. package/out/renderer/assets/bat-Bqkp9Cfu.js +101 -0
  8. package/out/renderer/assets/bicep-DIlfshcM.js +110 -0
  9. package/out/renderer/assets/cameligo-CLaaYNMV.js +175 -0
  10. package/out/renderer/assets/clojure-fcgFaMHx.js +762 -0
  11. package/out/renderer/assets/codicon-ngg6Pgfi.ttf +0 -0
  12. package/out/renderer/assets/coffee-CzJ5oEdj.js +233 -0
  13. package/out/renderer/assets/cpp-CcN6f0ik.js +390 -0
  14. package/out/renderer/assets/csharp-BJeIuvde.js +327 -0
  15. package/out/renderer/assets/csp-D_3BK2Wp.js +54 -0
  16. package/out/renderer/assets/css-i3rI3_64.js +186 -0
  17. package/out/renderer/assets/css.worker-umuuUiIb.js +53567 -0
  18. package/out/renderer/assets/cssMode-BlKZF8mS.js +208 -0
  19. package/out/renderer/assets/cypher-D0--_GAN.js +264 -0
  20. package/out/renderer/assets/dart-vLMHv35g.js +282 -0
  21. package/out/renderer/assets/dockerfile--oxj0cAH.js +131 -0
  22. package/out/renderer/assets/ecl-CeuUgzaZ.js +457 -0
  23. package/out/renderer/assets/editor.worker-CNgWLVu7.js +13695 -0
  24. package/out/renderer/assets/elixir-eLfY1jWH.js +570 -0
  25. package/out/renderer/assets/flow9-ZSTChSMd.js +143 -0
  26. package/out/renderer/assets/freemarker2-BTb0QKKy.js +995 -0
  27. package/out/renderer/assets/fsharp-D2uoxuLH.js +218 -0
  28. package/out/renderer/assets/go-brnMpFrj.js +219 -0
  29. package/out/renderer/assets/graphql-BeiGgjIU.js +152 -0
  30. package/out/renderer/assets/handlebars-DKVnkZoO.js +414 -0
  31. package/out/renderer/assets/hcl-CrX1Es2W.js +184 -0
  32. package/out/renderer/assets/html-DSHBWNSF.js +303 -0
  33. package/out/renderer/assets/html.worker-BT47iy49.js +29777 -0
  34. package/out/renderer/assets/htmlMode-hdSFcfq-.js +224 -0
  35. package/out/renderer/assets/index-ByP1RhpK.js +309272 -0
  36. package/out/renderer/assets/index-CgixHIqL.css +11502 -0
  37. package/out/renderer/assets/ini-BcQysCTb.js +72 -0
  38. package/out/renderer/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  39. package/out/renderer/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  40. package/out/renderer/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
  41. package/out/renderer/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
  42. package/out/renderer/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
  43. package/out/renderer/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
  44. package/out/renderer/assets/inter-cyrillic-700-normal-CjBOestx.woff2 +0 -0
  45. package/out/renderer/assets/inter-cyrillic-700-normal-DrXBdSj3.woff +0 -0
  46. package/out/renderer/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  47. package/out/renderer/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  48. package/out/renderer/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
  49. package/out/renderer/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
  50. package/out/renderer/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
  51. package/out/renderer/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
  52. package/out/renderer/assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2 +0 -0
  53. package/out/renderer/assets/inter-cyrillic-ext-700-normal-LO58E6JB.woff +0 -0
  54. package/out/renderer/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  55. package/out/renderer/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  56. package/out/renderer/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
  57. package/out/renderer/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
  58. package/out/renderer/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
  59. package/out/renderer/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
  60. package/out/renderer/assets/inter-greek-700-normal-BUv2fZ6O.woff +0 -0
  61. package/out/renderer/assets/inter-greek-700-normal-C3JjAnD8.woff2 +0 -0
  62. package/out/renderer/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  63. package/out/renderer/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  64. package/out/renderer/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
  65. package/out/renderer/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
  66. package/out/renderer/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
  67. package/out/renderer/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
  68. package/out/renderer/assets/inter-greek-ext-700-normal-BoQ6DsYi.woff +0 -0
  69. package/out/renderer/assets/inter-greek-ext-700-normal-qfdV9bQt.woff2 +0 -0
  70. package/out/renderer/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  71. package/out/renderer/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  72. package/out/renderer/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  73. package/out/renderer/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  74. package/out/renderer/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  75. package/out/renderer/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  76. package/out/renderer/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
  77. package/out/renderer/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  78. package/out/renderer/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  79. package/out/renderer/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  80. package/out/renderer/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
  81. package/out/renderer/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
  82. package/out/renderer/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
  83. package/out/renderer/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
  84. package/out/renderer/assets/inter-latin-ext-700-normal-Ca8adRJv.woff2 +0 -0
  85. package/out/renderer/assets/inter-latin-ext-700-normal-TidjK2hL.woff +0 -0
  86. package/out/renderer/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  87. package/out/renderer/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  88. package/out/renderer/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  89. package/out/renderer/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
  90. package/out/renderer/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
  91. package/out/renderer/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
  92. package/out/renderer/assets/inter-vietnamese-700-normal-BZaoP0fm.woff +0 -0
  93. package/out/renderer/assets/inter-vietnamese-700-normal-DlLaEgI2.woff2 +0 -0
  94. package/out/renderer/assets/java-Dt3iMn2o.js +233 -0
  95. package/out/renderer/assets/javascript-Ae6t5gfn.js +72 -0
  96. package/out/renderer/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  97. package/out/renderer/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  98. package/out/renderer/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
  99. package/out/renderer/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  100. package/out/renderer/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  101. package/out/renderer/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  102. package/out/renderer/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
  103. package/out/renderer/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  104. package/out/renderer/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  105. package/out/renderer/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  106. package/out/renderer/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  107. package/out/renderer/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  108. package/out/renderer/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  109. package/out/renderer/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  110. package/out/renderer/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  111. package/out/renderer/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
  112. package/out/renderer/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  113. package/out/renderer/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
  114. package/out/renderer/assets/json.worker-D4JVmXIe.js +21424 -0
  115. package/out/renderer/assets/jsonMode-B3dQSNhP.js +931 -0
  116. package/out/renderer/assets/julia-Cm3ItYL_.js +512 -0
  117. package/out/renderer/assets/kotlin-Ddo1SjA5.js +253 -0
  118. package/out/renderer/assets/less-B7Qaxw-O.js +162 -0
  119. package/out/renderer/assets/lexon-C1U0m2n9.js +158 -0
  120. package/out/renderer/assets/liquid-Zgyb8DZ5.js +235 -0
  121. package/out/renderer/assets/lspLanguageFeatures-CkDn9c2y.js +1841 -0
  122. package/out/renderer/assets/lua-hNsuGJkO.js +163 -0
  123. package/out/renderer/assets/m3-6ko6q9-_.js +211 -0
  124. package/out/renderer/assets/markdown-B0YTnTxW.js +230 -0
  125. package/out/renderer/assets/mdx-C8e8DFOf.js +159 -0
  126. package/out/renderer/assets/mips-CJm71dS3.js +199 -0
  127. package/out/renderer/assets/msdax-BBeIktCY.js +376 -0
  128. package/out/renderer/assets/mysql-BWiizXSn.js +879 -0
  129. package/out/renderer/assets/objective-c-B1L1C5EC.js +184 -0
  130. package/out/renderer/assets/pascal-DMQyD4Xk.js +252 -0
  131. package/out/renderer/assets/pascaligo-VA_LQ1oU.js +165 -0
  132. package/out/renderer/assets/perl-DC0Z0tlO.js +627 -0
  133. package/out/renderer/assets/pgsql-DaSGFTLp.js +852 -0
  134. package/out/renderer/assets/php-Bkx1qpkQ.js +501 -0
  135. package/out/renderer/assets/pla-DEV89yYj.js +138 -0
  136. package/out/renderer/assets/postiats-CVVurEnu.js +908 -0
  137. package/out/renderer/assets/powerquery-BQ_t1ZiQ.js +891 -0
  138. package/out/renderer/assets/powershell-BXiKvz7Z.js +240 -0
  139. package/out/renderer/assets/protobuf-CndvAUGu.js +421 -0
  140. package/out/renderer/assets/pug-BxCXwerb.js +403 -0
  141. package/out/renderer/assets/python-8eSQckTG.js +295 -0
  142. package/out/renderer/assets/qsharp-BWK6YLKm.js +302 -0
  143. package/out/renderer/assets/r-CtqYUQ6l.js +244 -0
  144. package/out/renderer/assets/razor-eAkN4Qfv.js +545 -0
  145. package/out/renderer/assets/redis-O7gSt3oh.js +303 -0
  146. package/out/renderer/assets/redshift-CvYMMYZY.js +810 -0
  147. package/out/renderer/assets/restructuredtext-B-KQCVu_.js +175 -0
  148. package/out/renderer/assets/ruby-DCd4DmAr.js +512 -0
  149. package/out/renderer/assets/rust-B1c0VCeq.js +344 -0
  150. package/out/renderer/assets/sb-Chfc_wZF.js +116 -0
  151. package/out/renderer/assets/scala-DbVzH-3O.js +371 -0
  152. package/out/renderer/assets/scheme-D7PxodDG.js +109 -0
  153. package/out/renderer/assets/scss-B42qMyAu.js +261 -0
  154. package/out/renderer/assets/shell-vZEubQ82.js +222 -0
  155. package/out/renderer/assets/solidity-yHOxYChb.js +1368 -0
  156. package/out/renderer/assets/sophia-D7pU0Y1d.js +200 -0
  157. package/out/renderer/assets/sparql-DxuVdnRl.js +202 -0
  158. package/out/renderer/assets/sql-BAGepFCR.js +854 -0
  159. package/out/renderer/assets/st-C-b0Dh53.js +417 -0
  160. package/out/renderer/assets/swift-BmOZGynf.js +313 -0
  161. package/out/renderer/assets/systemverilog-BOC0OOdC.js +577 -0
  162. package/out/renderer/assets/tcl-Bb4GCwBr.js +233 -0
  163. package/out/renderer/assets/ts.worker-C7hW3aY-.js +225330 -0
  164. package/out/renderer/assets/tsMode-D7ET908H.js +1265 -0
  165. package/out/renderer/assets/twig-DvgEGWAV.js +393 -0
  166. package/out/renderer/assets/typescript-BhqUlrW4.js +337 -0
  167. package/out/renderer/assets/typespec-R77Ln7Jb.js +128 -0
  168. package/out/renderer/assets/vb-Bm6ESA0Q.js +373 -0
  169. package/out/renderer/assets/wgsl-_KPae5vw.js +454 -0
  170. package/out/renderer/assets/xml-Bg3Ctug6.js +89 -0
  171. package/out/renderer/assets/yaml-C9aCL4uU.js +200 -0
  172. package/out/renderer/index.html +13 -0
  173. package/package.json +110 -0
@@ -0,0 +1,1841 @@
1
+ import { R as Range$1, l as languages, e as editor, U as Uri, M as MarkerSeverity } from "./index-ByP1RhpK.js";
2
+ var DocumentUri;
3
+ (function(DocumentUri2) {
4
+ function is(value) {
5
+ return typeof value === "string";
6
+ }
7
+ DocumentUri2.is = is;
8
+ })(DocumentUri || (DocumentUri = {}));
9
+ var URI;
10
+ (function(URI2) {
11
+ function is(value) {
12
+ return typeof value === "string";
13
+ }
14
+ URI2.is = is;
15
+ })(URI || (URI = {}));
16
+ var integer;
17
+ (function(integer2) {
18
+ integer2.MIN_VALUE = -2147483648;
19
+ integer2.MAX_VALUE = 2147483647;
20
+ function is(value) {
21
+ return typeof value === "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE;
22
+ }
23
+ integer2.is = is;
24
+ })(integer || (integer = {}));
25
+ var uinteger;
26
+ (function(uinteger2) {
27
+ uinteger2.MIN_VALUE = 0;
28
+ uinteger2.MAX_VALUE = 2147483647;
29
+ function is(value) {
30
+ return typeof value === "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE;
31
+ }
32
+ uinteger2.is = is;
33
+ })(uinteger || (uinteger = {}));
34
+ var Position;
35
+ (function(Position2) {
36
+ function create(line, character) {
37
+ if (line === Number.MAX_VALUE) {
38
+ line = uinteger.MAX_VALUE;
39
+ }
40
+ if (character === Number.MAX_VALUE) {
41
+ character = uinteger.MAX_VALUE;
42
+ }
43
+ return { line, character };
44
+ }
45
+ Position2.create = create;
46
+ function is(value) {
47
+ let candidate = value;
48
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
49
+ }
50
+ Position2.is = is;
51
+ })(Position || (Position = {}));
52
+ var Range;
53
+ (function(Range2) {
54
+ function create(one, two, three, four) {
55
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
56
+ return { start: Position.create(one, two), end: Position.create(three, four) };
57
+ } else if (Position.is(one) && Position.is(two)) {
58
+ return { start: one, end: two };
59
+ } else {
60
+ throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
61
+ }
62
+ }
63
+ Range2.create = create;
64
+ function is(value) {
65
+ let candidate = value;
66
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
67
+ }
68
+ Range2.is = is;
69
+ })(Range || (Range = {}));
70
+ var Location;
71
+ (function(Location2) {
72
+ function create(uri, range) {
73
+ return { uri, range };
74
+ }
75
+ Location2.create = create;
76
+ function is(value) {
77
+ let candidate = value;
78
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
79
+ }
80
+ Location2.is = is;
81
+ })(Location || (Location = {}));
82
+ var LocationLink;
83
+ (function(LocationLink2) {
84
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
85
+ return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
86
+ }
87
+ LocationLink2.create = create;
88
+ function is(value) {
89
+ let candidate = value;
90
+ return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
91
+ }
92
+ LocationLink2.is = is;
93
+ })(LocationLink || (LocationLink = {}));
94
+ var Color;
95
+ (function(Color2) {
96
+ function create(red, green, blue, alpha) {
97
+ return {
98
+ red,
99
+ green,
100
+ blue,
101
+ alpha
102
+ };
103
+ }
104
+ Color2.create = create;
105
+ function is(value) {
106
+ const candidate = value;
107
+ 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);
108
+ }
109
+ Color2.is = is;
110
+ })(Color || (Color = {}));
111
+ var ColorInformation;
112
+ (function(ColorInformation2) {
113
+ function create(range, color) {
114
+ return {
115
+ range,
116
+ color
117
+ };
118
+ }
119
+ ColorInformation2.create = create;
120
+ function is(value) {
121
+ const candidate = value;
122
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
123
+ }
124
+ ColorInformation2.is = is;
125
+ })(ColorInformation || (ColorInformation = {}));
126
+ var ColorPresentation;
127
+ (function(ColorPresentation2) {
128
+ function create(label, textEdit, additionalTextEdits) {
129
+ return {
130
+ label,
131
+ textEdit,
132
+ additionalTextEdits
133
+ };
134
+ }
135
+ ColorPresentation2.create = create;
136
+ function is(value) {
137
+ const candidate = value;
138
+ 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));
139
+ }
140
+ ColorPresentation2.is = is;
141
+ })(ColorPresentation || (ColorPresentation = {}));
142
+ var FoldingRangeKind;
143
+ (function(FoldingRangeKind2) {
144
+ FoldingRangeKind2.Comment = "comment";
145
+ FoldingRangeKind2.Imports = "imports";
146
+ FoldingRangeKind2.Region = "region";
147
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
148
+ var FoldingRange;
149
+ (function(FoldingRange2) {
150
+ function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
151
+ const result = {
152
+ startLine,
153
+ endLine
154
+ };
155
+ if (Is.defined(startCharacter)) {
156
+ result.startCharacter = startCharacter;
157
+ }
158
+ if (Is.defined(endCharacter)) {
159
+ result.endCharacter = endCharacter;
160
+ }
161
+ if (Is.defined(kind)) {
162
+ result.kind = kind;
163
+ }
164
+ if (Is.defined(collapsedText)) {
165
+ result.collapsedText = collapsedText;
166
+ }
167
+ return result;
168
+ }
169
+ FoldingRange2.create = create;
170
+ function is(value) {
171
+ const candidate = value;
172
+ 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));
173
+ }
174
+ FoldingRange2.is = is;
175
+ })(FoldingRange || (FoldingRange = {}));
176
+ var DiagnosticRelatedInformation;
177
+ (function(DiagnosticRelatedInformation2) {
178
+ function create(location, message) {
179
+ return {
180
+ location,
181
+ message
182
+ };
183
+ }
184
+ DiagnosticRelatedInformation2.create = create;
185
+ function is(value) {
186
+ let candidate = value;
187
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
188
+ }
189
+ DiagnosticRelatedInformation2.is = is;
190
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
191
+ var DiagnosticSeverity;
192
+ (function(DiagnosticSeverity2) {
193
+ DiagnosticSeverity2.Error = 1;
194
+ DiagnosticSeverity2.Warning = 2;
195
+ DiagnosticSeverity2.Information = 3;
196
+ DiagnosticSeverity2.Hint = 4;
197
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
198
+ var DiagnosticTag;
199
+ (function(DiagnosticTag2) {
200
+ DiagnosticTag2.Unnecessary = 1;
201
+ DiagnosticTag2.Deprecated = 2;
202
+ })(DiagnosticTag || (DiagnosticTag = {}));
203
+ var CodeDescription;
204
+ (function(CodeDescription2) {
205
+ function is(value) {
206
+ const candidate = value;
207
+ return Is.objectLiteral(candidate) && Is.string(candidate.href);
208
+ }
209
+ CodeDescription2.is = is;
210
+ })(CodeDescription || (CodeDescription = {}));
211
+ var Diagnostic;
212
+ (function(Diagnostic2) {
213
+ function create(range, message, severity, code, source, relatedInformation) {
214
+ let result = { range, message };
215
+ if (Is.defined(severity)) {
216
+ result.severity = severity;
217
+ }
218
+ if (Is.defined(code)) {
219
+ result.code = code;
220
+ }
221
+ if (Is.defined(source)) {
222
+ result.source = source;
223
+ }
224
+ if (Is.defined(relatedInformation)) {
225
+ result.relatedInformation = relatedInformation;
226
+ }
227
+ return result;
228
+ }
229
+ Diagnostic2.create = create;
230
+ function is(value) {
231
+ var _a;
232
+ let candidate = value;
233
+ 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((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
234
+ }
235
+ Diagnostic2.is = is;
236
+ })(Diagnostic || (Diagnostic = {}));
237
+ var Command;
238
+ (function(Command2) {
239
+ function create(title, command, ...args) {
240
+ let result = { title, command };
241
+ if (Is.defined(args) && args.length > 0) {
242
+ result.arguments = args;
243
+ }
244
+ return result;
245
+ }
246
+ Command2.create = create;
247
+ function is(value) {
248
+ let candidate = value;
249
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
250
+ }
251
+ Command2.is = is;
252
+ })(Command || (Command = {}));
253
+ var TextEdit;
254
+ (function(TextEdit2) {
255
+ function replace(range, newText) {
256
+ return { range, newText };
257
+ }
258
+ TextEdit2.replace = replace;
259
+ function insert(position, newText) {
260
+ return { range: { start: position, end: position }, newText };
261
+ }
262
+ TextEdit2.insert = insert;
263
+ function del(range) {
264
+ return { range, newText: "" };
265
+ }
266
+ TextEdit2.del = del;
267
+ function is(value) {
268
+ const candidate = value;
269
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
270
+ }
271
+ TextEdit2.is = is;
272
+ })(TextEdit || (TextEdit = {}));
273
+ var ChangeAnnotation;
274
+ (function(ChangeAnnotation2) {
275
+ function create(label, needsConfirmation, description) {
276
+ const result = { label };
277
+ if (needsConfirmation !== void 0) {
278
+ result.needsConfirmation = needsConfirmation;
279
+ }
280
+ if (description !== void 0) {
281
+ result.description = description;
282
+ }
283
+ return result;
284
+ }
285
+ ChangeAnnotation2.create = create;
286
+ function is(value) {
287
+ const candidate = value;
288
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
289
+ }
290
+ ChangeAnnotation2.is = is;
291
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
292
+ var ChangeAnnotationIdentifier;
293
+ (function(ChangeAnnotationIdentifier2) {
294
+ function is(value) {
295
+ const candidate = value;
296
+ return Is.string(candidate);
297
+ }
298
+ ChangeAnnotationIdentifier2.is = is;
299
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
300
+ var AnnotatedTextEdit;
301
+ (function(AnnotatedTextEdit2) {
302
+ function replace(range, newText, annotation) {
303
+ return { range, newText, annotationId: annotation };
304
+ }
305
+ AnnotatedTextEdit2.replace = replace;
306
+ function insert(position, newText, annotation) {
307
+ return { range: { start: position, end: position }, newText, annotationId: annotation };
308
+ }
309
+ AnnotatedTextEdit2.insert = insert;
310
+ function del(range, annotation) {
311
+ return { range, newText: "", annotationId: annotation };
312
+ }
313
+ AnnotatedTextEdit2.del = del;
314
+ function is(value) {
315
+ const candidate = value;
316
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
317
+ }
318
+ AnnotatedTextEdit2.is = is;
319
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
320
+ var TextDocumentEdit;
321
+ (function(TextDocumentEdit2) {
322
+ function create(textDocument, edits) {
323
+ return { textDocument, edits };
324
+ }
325
+ TextDocumentEdit2.create = create;
326
+ function is(value) {
327
+ let candidate = value;
328
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
329
+ }
330
+ TextDocumentEdit2.is = is;
331
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
332
+ var CreateFile;
333
+ (function(CreateFile2) {
334
+ function create(uri, options, annotation) {
335
+ let result = {
336
+ kind: "create",
337
+ uri
338
+ };
339
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
340
+ result.options = options;
341
+ }
342
+ if (annotation !== void 0) {
343
+ result.annotationId = annotation;
344
+ }
345
+ return result;
346
+ }
347
+ CreateFile2.create = create;
348
+ function is(value) {
349
+ let candidate = value;
350
+ 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));
351
+ }
352
+ CreateFile2.is = is;
353
+ })(CreateFile || (CreateFile = {}));
354
+ var RenameFile;
355
+ (function(RenameFile2) {
356
+ function create(oldUri, newUri, options, annotation) {
357
+ let result = {
358
+ kind: "rename",
359
+ oldUri,
360
+ newUri
361
+ };
362
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
363
+ result.options = options;
364
+ }
365
+ if (annotation !== void 0) {
366
+ result.annotationId = annotation;
367
+ }
368
+ return result;
369
+ }
370
+ RenameFile2.create = create;
371
+ function is(value) {
372
+ let candidate = value;
373
+ 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));
374
+ }
375
+ RenameFile2.is = is;
376
+ })(RenameFile || (RenameFile = {}));
377
+ var DeleteFile;
378
+ (function(DeleteFile2) {
379
+ function create(uri, options, annotation) {
380
+ let result = {
381
+ kind: "delete",
382
+ uri
383
+ };
384
+ if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
385
+ result.options = options;
386
+ }
387
+ if (annotation !== void 0) {
388
+ result.annotationId = annotation;
389
+ }
390
+ return result;
391
+ }
392
+ DeleteFile2.create = create;
393
+ function is(value) {
394
+ let candidate = value;
395
+ 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));
396
+ }
397
+ DeleteFile2.is = is;
398
+ })(DeleteFile || (DeleteFile = {}));
399
+ var WorkspaceEdit;
400
+ (function(WorkspaceEdit2) {
401
+ function is(value) {
402
+ let candidate = value;
403
+ return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => {
404
+ if (Is.string(change.kind)) {
405
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
406
+ } else {
407
+ return TextDocumentEdit.is(change);
408
+ }
409
+ }));
410
+ }
411
+ WorkspaceEdit2.is = is;
412
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
413
+ var TextDocumentIdentifier;
414
+ (function(TextDocumentIdentifier2) {
415
+ function create(uri) {
416
+ return { uri };
417
+ }
418
+ TextDocumentIdentifier2.create = create;
419
+ function is(value) {
420
+ let candidate = value;
421
+ return Is.defined(candidate) && Is.string(candidate.uri);
422
+ }
423
+ TextDocumentIdentifier2.is = is;
424
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
425
+ var VersionedTextDocumentIdentifier;
426
+ (function(VersionedTextDocumentIdentifier2) {
427
+ function create(uri, version) {
428
+ return { uri, version };
429
+ }
430
+ VersionedTextDocumentIdentifier2.create = create;
431
+ function is(value) {
432
+ let candidate = value;
433
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
434
+ }
435
+ VersionedTextDocumentIdentifier2.is = is;
436
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
437
+ var OptionalVersionedTextDocumentIdentifier;
438
+ (function(OptionalVersionedTextDocumentIdentifier2) {
439
+ function create(uri, version) {
440
+ return { uri, version };
441
+ }
442
+ OptionalVersionedTextDocumentIdentifier2.create = create;
443
+ function is(value) {
444
+ let candidate = value;
445
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
446
+ }
447
+ OptionalVersionedTextDocumentIdentifier2.is = is;
448
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
449
+ var TextDocumentItem;
450
+ (function(TextDocumentItem2) {
451
+ function create(uri, languageId, version, text) {
452
+ return { uri, languageId, version, text };
453
+ }
454
+ TextDocumentItem2.create = create;
455
+ function is(value) {
456
+ let candidate = value;
457
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
458
+ }
459
+ TextDocumentItem2.is = is;
460
+ })(TextDocumentItem || (TextDocumentItem = {}));
461
+ var MarkupKind;
462
+ (function(MarkupKind2) {
463
+ MarkupKind2.PlainText = "plaintext";
464
+ MarkupKind2.Markdown = "markdown";
465
+ function is(value) {
466
+ const candidate = value;
467
+ return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
468
+ }
469
+ MarkupKind2.is = is;
470
+ })(MarkupKind || (MarkupKind = {}));
471
+ var MarkupContent;
472
+ (function(MarkupContent2) {
473
+ function is(value) {
474
+ const candidate = value;
475
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
476
+ }
477
+ MarkupContent2.is = is;
478
+ })(MarkupContent || (MarkupContent = {}));
479
+ var CompletionItemKind;
480
+ (function(CompletionItemKind2) {
481
+ CompletionItemKind2.Text = 1;
482
+ CompletionItemKind2.Method = 2;
483
+ CompletionItemKind2.Function = 3;
484
+ CompletionItemKind2.Constructor = 4;
485
+ CompletionItemKind2.Field = 5;
486
+ CompletionItemKind2.Variable = 6;
487
+ CompletionItemKind2.Class = 7;
488
+ CompletionItemKind2.Interface = 8;
489
+ CompletionItemKind2.Module = 9;
490
+ CompletionItemKind2.Property = 10;
491
+ CompletionItemKind2.Unit = 11;
492
+ CompletionItemKind2.Value = 12;
493
+ CompletionItemKind2.Enum = 13;
494
+ CompletionItemKind2.Keyword = 14;
495
+ CompletionItemKind2.Snippet = 15;
496
+ CompletionItemKind2.Color = 16;
497
+ CompletionItemKind2.File = 17;
498
+ CompletionItemKind2.Reference = 18;
499
+ CompletionItemKind2.Folder = 19;
500
+ CompletionItemKind2.EnumMember = 20;
501
+ CompletionItemKind2.Constant = 21;
502
+ CompletionItemKind2.Struct = 22;
503
+ CompletionItemKind2.Event = 23;
504
+ CompletionItemKind2.Operator = 24;
505
+ CompletionItemKind2.TypeParameter = 25;
506
+ })(CompletionItemKind || (CompletionItemKind = {}));
507
+ var InsertTextFormat;
508
+ (function(InsertTextFormat2) {
509
+ InsertTextFormat2.PlainText = 1;
510
+ InsertTextFormat2.Snippet = 2;
511
+ })(InsertTextFormat || (InsertTextFormat = {}));
512
+ var CompletionItemTag;
513
+ (function(CompletionItemTag2) {
514
+ CompletionItemTag2.Deprecated = 1;
515
+ })(CompletionItemTag || (CompletionItemTag = {}));
516
+ var InsertReplaceEdit;
517
+ (function(InsertReplaceEdit2) {
518
+ function create(newText, insert, replace) {
519
+ return { newText, insert, replace };
520
+ }
521
+ InsertReplaceEdit2.create = create;
522
+ function is(value) {
523
+ const candidate = value;
524
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
525
+ }
526
+ InsertReplaceEdit2.is = is;
527
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
528
+ var InsertTextMode;
529
+ (function(InsertTextMode2) {
530
+ InsertTextMode2.asIs = 1;
531
+ InsertTextMode2.adjustIndentation = 2;
532
+ })(InsertTextMode || (InsertTextMode = {}));
533
+ var CompletionItemLabelDetails;
534
+ (function(CompletionItemLabelDetails2) {
535
+ function is(value) {
536
+ const candidate = value;
537
+ return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
538
+ }
539
+ CompletionItemLabelDetails2.is = is;
540
+ })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
541
+ var CompletionItem;
542
+ (function(CompletionItem2) {
543
+ function create(label) {
544
+ return { label };
545
+ }
546
+ CompletionItem2.create = create;
547
+ })(CompletionItem || (CompletionItem = {}));
548
+ var CompletionList;
549
+ (function(CompletionList2) {
550
+ function create(items, isIncomplete) {
551
+ return { items: items ? items : [], isIncomplete: !!isIncomplete };
552
+ }
553
+ CompletionList2.create = create;
554
+ })(CompletionList || (CompletionList = {}));
555
+ var MarkedString;
556
+ (function(MarkedString2) {
557
+ function fromPlainText(plainText) {
558
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
559
+ }
560
+ MarkedString2.fromPlainText = fromPlainText;
561
+ function is(value) {
562
+ const candidate = value;
563
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
564
+ }
565
+ MarkedString2.is = is;
566
+ })(MarkedString || (MarkedString = {}));
567
+ var Hover;
568
+ (function(Hover2) {
569
+ function is(value) {
570
+ let candidate = value;
571
+ 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));
572
+ }
573
+ Hover2.is = is;
574
+ })(Hover || (Hover = {}));
575
+ var ParameterInformation;
576
+ (function(ParameterInformation2) {
577
+ function create(label, documentation) {
578
+ return documentation ? { label, documentation } : { label };
579
+ }
580
+ ParameterInformation2.create = create;
581
+ })(ParameterInformation || (ParameterInformation = {}));
582
+ var SignatureInformation;
583
+ (function(SignatureInformation2) {
584
+ function create(label, documentation, ...parameters) {
585
+ let result = { label };
586
+ if (Is.defined(documentation)) {
587
+ result.documentation = documentation;
588
+ }
589
+ if (Is.defined(parameters)) {
590
+ result.parameters = parameters;
591
+ } else {
592
+ result.parameters = [];
593
+ }
594
+ return result;
595
+ }
596
+ SignatureInformation2.create = create;
597
+ })(SignatureInformation || (SignatureInformation = {}));
598
+ var DocumentHighlightKind;
599
+ (function(DocumentHighlightKind2) {
600
+ DocumentHighlightKind2.Text = 1;
601
+ DocumentHighlightKind2.Read = 2;
602
+ DocumentHighlightKind2.Write = 3;
603
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
604
+ var DocumentHighlight;
605
+ (function(DocumentHighlight2) {
606
+ function create(range, kind) {
607
+ let result = { range };
608
+ if (Is.number(kind)) {
609
+ result.kind = kind;
610
+ }
611
+ return result;
612
+ }
613
+ DocumentHighlight2.create = create;
614
+ })(DocumentHighlight || (DocumentHighlight = {}));
615
+ var SymbolKind;
616
+ (function(SymbolKind2) {
617
+ SymbolKind2.File = 1;
618
+ SymbolKind2.Module = 2;
619
+ SymbolKind2.Namespace = 3;
620
+ SymbolKind2.Package = 4;
621
+ SymbolKind2.Class = 5;
622
+ SymbolKind2.Method = 6;
623
+ SymbolKind2.Property = 7;
624
+ SymbolKind2.Field = 8;
625
+ SymbolKind2.Constructor = 9;
626
+ SymbolKind2.Enum = 10;
627
+ SymbolKind2.Interface = 11;
628
+ SymbolKind2.Function = 12;
629
+ SymbolKind2.Variable = 13;
630
+ SymbolKind2.Constant = 14;
631
+ SymbolKind2.String = 15;
632
+ SymbolKind2.Number = 16;
633
+ SymbolKind2.Boolean = 17;
634
+ SymbolKind2.Array = 18;
635
+ SymbolKind2.Object = 19;
636
+ SymbolKind2.Key = 20;
637
+ SymbolKind2.Null = 21;
638
+ SymbolKind2.EnumMember = 22;
639
+ SymbolKind2.Struct = 23;
640
+ SymbolKind2.Event = 24;
641
+ SymbolKind2.Operator = 25;
642
+ SymbolKind2.TypeParameter = 26;
643
+ })(SymbolKind || (SymbolKind = {}));
644
+ var SymbolTag;
645
+ (function(SymbolTag2) {
646
+ SymbolTag2.Deprecated = 1;
647
+ })(SymbolTag || (SymbolTag = {}));
648
+ var SymbolInformation;
649
+ (function(SymbolInformation2) {
650
+ function create(name, kind, range, uri, containerName) {
651
+ let result = {
652
+ name,
653
+ kind,
654
+ location: { uri, range }
655
+ };
656
+ if (containerName) {
657
+ result.containerName = containerName;
658
+ }
659
+ return result;
660
+ }
661
+ SymbolInformation2.create = create;
662
+ })(SymbolInformation || (SymbolInformation = {}));
663
+ var WorkspaceSymbol;
664
+ (function(WorkspaceSymbol2) {
665
+ function create(name, kind, uri, range) {
666
+ return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } };
667
+ }
668
+ WorkspaceSymbol2.create = create;
669
+ })(WorkspaceSymbol || (WorkspaceSymbol = {}));
670
+ var DocumentSymbol;
671
+ (function(DocumentSymbol2) {
672
+ function create(name, detail, kind, range, selectionRange, children) {
673
+ let result = {
674
+ name,
675
+ detail,
676
+ kind,
677
+ range,
678
+ selectionRange
679
+ };
680
+ if (children !== void 0) {
681
+ result.children = children;
682
+ }
683
+ return result;
684
+ }
685
+ DocumentSymbol2.create = create;
686
+ function is(value) {
687
+ let candidate = value;
688
+ 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));
689
+ }
690
+ DocumentSymbol2.is = is;
691
+ })(DocumentSymbol || (DocumentSymbol = {}));
692
+ var CodeActionKind;
693
+ (function(CodeActionKind2) {
694
+ CodeActionKind2.Empty = "";
695
+ CodeActionKind2.QuickFix = "quickfix";
696
+ CodeActionKind2.Refactor = "refactor";
697
+ CodeActionKind2.RefactorExtract = "refactor.extract";
698
+ CodeActionKind2.RefactorInline = "refactor.inline";
699
+ CodeActionKind2.RefactorRewrite = "refactor.rewrite";
700
+ CodeActionKind2.Source = "source";
701
+ CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
702
+ CodeActionKind2.SourceFixAll = "source.fixAll";
703
+ })(CodeActionKind || (CodeActionKind = {}));
704
+ var CodeActionTriggerKind;
705
+ (function(CodeActionTriggerKind2) {
706
+ CodeActionTriggerKind2.Invoked = 1;
707
+ CodeActionTriggerKind2.Automatic = 2;
708
+ })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
709
+ var CodeActionContext;
710
+ (function(CodeActionContext2) {
711
+ function create(diagnostics, only, triggerKind) {
712
+ let result = { diagnostics };
713
+ if (only !== void 0 && only !== null) {
714
+ result.only = only;
715
+ }
716
+ if (triggerKind !== void 0 && triggerKind !== null) {
717
+ result.triggerKind = triggerKind;
718
+ }
719
+ return result;
720
+ }
721
+ CodeActionContext2.create = create;
722
+ function is(value) {
723
+ let candidate = value;
724
+ 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);
725
+ }
726
+ CodeActionContext2.is = is;
727
+ })(CodeActionContext || (CodeActionContext = {}));
728
+ var CodeAction;
729
+ (function(CodeAction2) {
730
+ function create(title, kindOrCommandOrEdit, kind) {
731
+ let result = { title };
732
+ let checkKind = true;
733
+ if (typeof kindOrCommandOrEdit === "string") {
734
+ checkKind = false;
735
+ result.kind = kindOrCommandOrEdit;
736
+ } else if (Command.is(kindOrCommandOrEdit)) {
737
+ result.command = kindOrCommandOrEdit;
738
+ } else {
739
+ result.edit = kindOrCommandOrEdit;
740
+ }
741
+ if (checkKind && kind !== void 0) {
742
+ result.kind = kind;
743
+ }
744
+ return result;
745
+ }
746
+ CodeAction2.create = create;
747
+ function is(value) {
748
+ let candidate = value;
749
+ 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));
750
+ }
751
+ CodeAction2.is = is;
752
+ })(CodeAction || (CodeAction = {}));
753
+ var CodeLens;
754
+ (function(CodeLens2) {
755
+ function create(range, data) {
756
+ let result = { range };
757
+ if (Is.defined(data)) {
758
+ result.data = data;
759
+ }
760
+ return result;
761
+ }
762
+ CodeLens2.create = create;
763
+ function is(value) {
764
+ let candidate = value;
765
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
766
+ }
767
+ CodeLens2.is = is;
768
+ })(CodeLens || (CodeLens = {}));
769
+ var FormattingOptions;
770
+ (function(FormattingOptions2) {
771
+ function create(tabSize, insertSpaces) {
772
+ return { tabSize, insertSpaces };
773
+ }
774
+ FormattingOptions2.create = create;
775
+ function is(value) {
776
+ let candidate = value;
777
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
778
+ }
779
+ FormattingOptions2.is = is;
780
+ })(FormattingOptions || (FormattingOptions = {}));
781
+ var DocumentLink;
782
+ (function(DocumentLink2) {
783
+ function create(range, target, data) {
784
+ return { range, target, data };
785
+ }
786
+ DocumentLink2.create = create;
787
+ function is(value) {
788
+ let candidate = value;
789
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
790
+ }
791
+ DocumentLink2.is = is;
792
+ })(DocumentLink || (DocumentLink = {}));
793
+ var SelectionRange;
794
+ (function(SelectionRange2) {
795
+ function create(range, parent) {
796
+ return { range, parent };
797
+ }
798
+ SelectionRange2.create = create;
799
+ function is(value) {
800
+ let candidate = value;
801
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
802
+ }
803
+ SelectionRange2.is = is;
804
+ })(SelectionRange || (SelectionRange = {}));
805
+ var SemanticTokenTypes;
806
+ (function(SemanticTokenTypes2) {
807
+ SemanticTokenTypes2["namespace"] = "namespace";
808
+ SemanticTokenTypes2["type"] = "type";
809
+ SemanticTokenTypes2["class"] = "class";
810
+ SemanticTokenTypes2["enum"] = "enum";
811
+ SemanticTokenTypes2["interface"] = "interface";
812
+ SemanticTokenTypes2["struct"] = "struct";
813
+ SemanticTokenTypes2["typeParameter"] = "typeParameter";
814
+ SemanticTokenTypes2["parameter"] = "parameter";
815
+ SemanticTokenTypes2["variable"] = "variable";
816
+ SemanticTokenTypes2["property"] = "property";
817
+ SemanticTokenTypes2["enumMember"] = "enumMember";
818
+ SemanticTokenTypes2["event"] = "event";
819
+ SemanticTokenTypes2["function"] = "function";
820
+ SemanticTokenTypes2["method"] = "method";
821
+ SemanticTokenTypes2["macro"] = "macro";
822
+ SemanticTokenTypes2["keyword"] = "keyword";
823
+ SemanticTokenTypes2["modifier"] = "modifier";
824
+ SemanticTokenTypes2["comment"] = "comment";
825
+ SemanticTokenTypes2["string"] = "string";
826
+ SemanticTokenTypes2["number"] = "number";
827
+ SemanticTokenTypes2["regexp"] = "regexp";
828
+ SemanticTokenTypes2["operator"] = "operator";
829
+ SemanticTokenTypes2["decorator"] = "decorator";
830
+ })(SemanticTokenTypes || (SemanticTokenTypes = {}));
831
+ var SemanticTokenModifiers;
832
+ (function(SemanticTokenModifiers2) {
833
+ SemanticTokenModifiers2["declaration"] = "declaration";
834
+ SemanticTokenModifiers2["definition"] = "definition";
835
+ SemanticTokenModifiers2["readonly"] = "readonly";
836
+ SemanticTokenModifiers2["static"] = "static";
837
+ SemanticTokenModifiers2["deprecated"] = "deprecated";
838
+ SemanticTokenModifiers2["abstract"] = "abstract";
839
+ SemanticTokenModifiers2["async"] = "async";
840
+ SemanticTokenModifiers2["modification"] = "modification";
841
+ SemanticTokenModifiers2["documentation"] = "documentation";
842
+ SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
843
+ })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
844
+ var SemanticTokens;
845
+ (function(SemanticTokens2) {
846
+ function is(value) {
847
+ const candidate = value;
848
+ 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");
849
+ }
850
+ SemanticTokens2.is = is;
851
+ })(SemanticTokens || (SemanticTokens = {}));
852
+ var InlineValueText;
853
+ (function(InlineValueText2) {
854
+ function create(range, text) {
855
+ return { range, text };
856
+ }
857
+ InlineValueText2.create = create;
858
+ function is(value) {
859
+ const candidate = value;
860
+ return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
861
+ }
862
+ InlineValueText2.is = is;
863
+ })(InlineValueText || (InlineValueText = {}));
864
+ var InlineValueVariableLookup;
865
+ (function(InlineValueVariableLookup2) {
866
+ function create(range, variableName, caseSensitiveLookup) {
867
+ return { range, variableName, caseSensitiveLookup };
868
+ }
869
+ InlineValueVariableLookup2.create = create;
870
+ function is(value) {
871
+ const candidate = value;
872
+ return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
873
+ }
874
+ InlineValueVariableLookup2.is = is;
875
+ })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
876
+ var InlineValueEvaluatableExpression;
877
+ (function(InlineValueEvaluatableExpression2) {
878
+ function create(range, expression) {
879
+ return { range, expression };
880
+ }
881
+ InlineValueEvaluatableExpression2.create = create;
882
+ function is(value) {
883
+ const candidate = value;
884
+ return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
885
+ }
886
+ InlineValueEvaluatableExpression2.is = is;
887
+ })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
888
+ var InlineValueContext;
889
+ (function(InlineValueContext2) {
890
+ function create(frameId, stoppedLocation) {
891
+ return { frameId, stoppedLocation };
892
+ }
893
+ InlineValueContext2.create = create;
894
+ function is(value) {
895
+ const candidate = value;
896
+ return Is.defined(candidate) && Range.is(value.stoppedLocation);
897
+ }
898
+ InlineValueContext2.is = is;
899
+ })(InlineValueContext || (InlineValueContext = {}));
900
+ var InlayHintKind;
901
+ (function(InlayHintKind2) {
902
+ InlayHintKind2.Type = 1;
903
+ InlayHintKind2.Parameter = 2;
904
+ function is(value) {
905
+ return value === 1 || value === 2;
906
+ }
907
+ InlayHintKind2.is = is;
908
+ })(InlayHintKind || (InlayHintKind = {}));
909
+ var InlayHintLabelPart;
910
+ (function(InlayHintLabelPart2) {
911
+ function create(value) {
912
+ return { value };
913
+ }
914
+ InlayHintLabelPart2.create = create;
915
+ function is(value) {
916
+ const candidate = value;
917
+ 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));
918
+ }
919
+ InlayHintLabelPart2.is = is;
920
+ })(InlayHintLabelPart || (InlayHintLabelPart = {}));
921
+ var InlayHint;
922
+ (function(InlayHint2) {
923
+ function create(position, label, kind) {
924
+ const result = { position, label };
925
+ if (kind !== void 0) {
926
+ result.kind = kind;
927
+ }
928
+ return result;
929
+ }
930
+ InlayHint2.create = create;
931
+ function is(value) {
932
+ const candidate = value;
933
+ 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));
934
+ }
935
+ InlayHint2.is = is;
936
+ })(InlayHint || (InlayHint = {}));
937
+ var StringValue;
938
+ (function(StringValue2) {
939
+ function createSnippet(value) {
940
+ return { kind: "snippet", value };
941
+ }
942
+ StringValue2.createSnippet = createSnippet;
943
+ })(StringValue || (StringValue = {}));
944
+ var InlineCompletionItem;
945
+ (function(InlineCompletionItem2) {
946
+ function create(insertText, filterText, range, command) {
947
+ return { insertText, filterText, range, command };
948
+ }
949
+ InlineCompletionItem2.create = create;
950
+ })(InlineCompletionItem || (InlineCompletionItem = {}));
951
+ var InlineCompletionList;
952
+ (function(InlineCompletionList2) {
953
+ function create(items) {
954
+ return { items };
955
+ }
956
+ InlineCompletionList2.create = create;
957
+ })(InlineCompletionList || (InlineCompletionList = {}));
958
+ var InlineCompletionTriggerKind;
959
+ (function(InlineCompletionTriggerKind2) {
960
+ InlineCompletionTriggerKind2.Invoked = 0;
961
+ InlineCompletionTriggerKind2.Automatic = 1;
962
+ })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
963
+ var SelectedCompletionInfo;
964
+ (function(SelectedCompletionInfo2) {
965
+ function create(range, text) {
966
+ return { range, text };
967
+ }
968
+ SelectedCompletionInfo2.create = create;
969
+ })(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
970
+ var InlineCompletionContext;
971
+ (function(InlineCompletionContext2) {
972
+ function create(triggerKind, selectedCompletionInfo) {
973
+ return { triggerKind, selectedCompletionInfo };
974
+ }
975
+ InlineCompletionContext2.create = create;
976
+ })(InlineCompletionContext || (InlineCompletionContext = {}));
977
+ var WorkspaceFolder;
978
+ (function(WorkspaceFolder2) {
979
+ function is(value) {
980
+ const candidate = value;
981
+ return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
982
+ }
983
+ WorkspaceFolder2.is = is;
984
+ })(WorkspaceFolder || (WorkspaceFolder = {}));
985
+ var TextDocument;
986
+ (function(TextDocument2) {
987
+ function create(uri, languageId, version, content) {
988
+ return new FullTextDocument(uri, languageId, version, content);
989
+ }
990
+ TextDocument2.create = create;
991
+ function is(value) {
992
+ let candidate = value;
993
+ 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) ? true : false;
994
+ }
995
+ TextDocument2.is = is;
996
+ function applyEdits(document, edits) {
997
+ let text = document.getText();
998
+ let sortedEdits = mergeSort(edits, (a, b) => {
999
+ let diff = a.range.start.line - b.range.start.line;
1000
+ if (diff === 0) {
1001
+ return a.range.start.character - b.range.start.character;
1002
+ }
1003
+ return diff;
1004
+ });
1005
+ let lastModifiedOffset = text.length;
1006
+ for (let i = sortedEdits.length - 1; i >= 0; i--) {
1007
+ let e = sortedEdits[i];
1008
+ let startOffset = document.offsetAt(e.range.start);
1009
+ let endOffset = document.offsetAt(e.range.end);
1010
+ if (endOffset <= lastModifiedOffset) {
1011
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1012
+ } else {
1013
+ throw new Error("Overlapping edit");
1014
+ }
1015
+ lastModifiedOffset = startOffset;
1016
+ }
1017
+ return text;
1018
+ }
1019
+ TextDocument2.applyEdits = applyEdits;
1020
+ function mergeSort(data, compare) {
1021
+ if (data.length <= 1) {
1022
+ return data;
1023
+ }
1024
+ const p = data.length / 2 | 0;
1025
+ const left = data.slice(0, p);
1026
+ const right = data.slice(p);
1027
+ mergeSort(left, compare);
1028
+ mergeSort(right, compare);
1029
+ let leftIdx = 0;
1030
+ let rightIdx = 0;
1031
+ let i = 0;
1032
+ while (leftIdx < left.length && rightIdx < right.length) {
1033
+ let ret = compare(left[leftIdx], right[rightIdx]);
1034
+ if (ret <= 0) {
1035
+ data[i++] = left[leftIdx++];
1036
+ } else {
1037
+ data[i++] = right[rightIdx++];
1038
+ }
1039
+ }
1040
+ while (leftIdx < left.length) {
1041
+ data[i++] = left[leftIdx++];
1042
+ }
1043
+ while (rightIdx < right.length) {
1044
+ data[i++] = right[rightIdx++];
1045
+ }
1046
+ return data;
1047
+ }
1048
+ })(TextDocument || (TextDocument = {}));
1049
+ class FullTextDocument {
1050
+ constructor(uri, languageId, version, content) {
1051
+ this._uri = uri;
1052
+ this._languageId = languageId;
1053
+ this._version = version;
1054
+ this._content = content;
1055
+ this._lineOffsets = void 0;
1056
+ }
1057
+ get uri() {
1058
+ return this._uri;
1059
+ }
1060
+ get languageId() {
1061
+ return this._languageId;
1062
+ }
1063
+ get version() {
1064
+ return this._version;
1065
+ }
1066
+ getText(range) {
1067
+ if (range) {
1068
+ let start = this.offsetAt(range.start);
1069
+ let end = this.offsetAt(range.end);
1070
+ return this._content.substring(start, end);
1071
+ }
1072
+ return this._content;
1073
+ }
1074
+ update(event, version) {
1075
+ this._content = event.text;
1076
+ this._version = version;
1077
+ this._lineOffsets = void 0;
1078
+ }
1079
+ getLineOffsets() {
1080
+ if (this._lineOffsets === void 0) {
1081
+ let lineOffsets = [];
1082
+ let text = this._content;
1083
+ let isLineStart = true;
1084
+ for (let i = 0; i < text.length; i++) {
1085
+ if (isLineStart) {
1086
+ lineOffsets.push(i);
1087
+ isLineStart = false;
1088
+ }
1089
+ let ch = text.charAt(i);
1090
+ isLineStart = ch === "\r" || ch === "\n";
1091
+ if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
1092
+ i++;
1093
+ }
1094
+ }
1095
+ if (isLineStart && text.length > 0) {
1096
+ lineOffsets.push(text.length);
1097
+ }
1098
+ this._lineOffsets = lineOffsets;
1099
+ }
1100
+ return this._lineOffsets;
1101
+ }
1102
+ positionAt(offset) {
1103
+ offset = Math.max(Math.min(offset, this._content.length), 0);
1104
+ let lineOffsets = this.getLineOffsets();
1105
+ let low = 0, high = lineOffsets.length;
1106
+ if (high === 0) {
1107
+ return Position.create(0, offset);
1108
+ }
1109
+ while (low < high) {
1110
+ let mid = Math.floor((low + high) / 2);
1111
+ if (lineOffsets[mid] > offset) {
1112
+ high = mid;
1113
+ } else {
1114
+ low = mid + 1;
1115
+ }
1116
+ }
1117
+ let line = low - 1;
1118
+ return Position.create(line, offset - lineOffsets[line]);
1119
+ }
1120
+ offsetAt(position) {
1121
+ let lineOffsets = this.getLineOffsets();
1122
+ if (position.line >= lineOffsets.length) {
1123
+ return this._content.length;
1124
+ } else if (position.line < 0) {
1125
+ return 0;
1126
+ }
1127
+ let lineOffset = lineOffsets[position.line];
1128
+ let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
1129
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1130
+ }
1131
+ get lineCount() {
1132
+ return this.getLineOffsets().length;
1133
+ }
1134
+ }
1135
+ var Is;
1136
+ (function(Is2) {
1137
+ const toString = Object.prototype.toString;
1138
+ function defined(value) {
1139
+ return typeof value !== "undefined";
1140
+ }
1141
+ Is2.defined = defined;
1142
+ function undefined$1(value) {
1143
+ return typeof value === "undefined";
1144
+ }
1145
+ Is2.undefined = undefined$1;
1146
+ function boolean(value) {
1147
+ return value === true || value === false;
1148
+ }
1149
+ Is2.boolean = boolean;
1150
+ function string(value) {
1151
+ return toString.call(value) === "[object String]";
1152
+ }
1153
+ Is2.string = string;
1154
+ function number(value) {
1155
+ return toString.call(value) === "[object Number]";
1156
+ }
1157
+ Is2.number = number;
1158
+ function numberRange(value, min, max) {
1159
+ return toString.call(value) === "[object Number]" && min <= value && value <= max;
1160
+ }
1161
+ Is2.numberRange = numberRange;
1162
+ function integer2(value) {
1163
+ return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
1164
+ }
1165
+ Is2.integer = integer2;
1166
+ function uinteger2(value) {
1167
+ return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
1168
+ }
1169
+ Is2.uinteger = uinteger2;
1170
+ function func(value) {
1171
+ return toString.call(value) === "[object Function]";
1172
+ }
1173
+ Is2.func = func;
1174
+ function objectLiteral(value) {
1175
+ return value !== null && typeof value === "object";
1176
+ }
1177
+ Is2.objectLiteral = objectLiteral;
1178
+ function typedArray(value, check) {
1179
+ return Array.isArray(value) && value.every(check);
1180
+ }
1181
+ Is2.typedArray = typedArray;
1182
+ })(Is || (Is = {}));
1183
+ class DiagnosticsAdapter {
1184
+ constructor(_languageId, _worker, configChangeEvent) {
1185
+ this._languageId = _languageId;
1186
+ this._worker = _worker;
1187
+ this._disposables = [];
1188
+ this._listener = /* @__PURE__ */ Object.create(null);
1189
+ const onModelAdd = (model) => {
1190
+ let modeId = model.getLanguageId();
1191
+ if (modeId !== this._languageId) {
1192
+ return;
1193
+ }
1194
+ let handle;
1195
+ this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
1196
+ window.clearTimeout(handle);
1197
+ handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
1198
+ });
1199
+ this._doValidate(model.uri, modeId);
1200
+ };
1201
+ const onModelRemoved = (model) => {
1202
+ editor.setModelMarkers(model, this._languageId, []);
1203
+ let uriStr = model.uri.toString();
1204
+ let listener = this._listener[uriStr];
1205
+ if (listener) {
1206
+ listener.dispose();
1207
+ delete this._listener[uriStr];
1208
+ }
1209
+ };
1210
+ this._disposables.push(editor.onDidCreateModel(onModelAdd));
1211
+ this._disposables.push(editor.onWillDisposeModel(onModelRemoved));
1212
+ this._disposables.push(
1213
+ editor.onDidChangeModelLanguage((event) => {
1214
+ onModelRemoved(event.model);
1215
+ onModelAdd(event.model);
1216
+ })
1217
+ );
1218
+ this._disposables.push(
1219
+ configChangeEvent((_) => {
1220
+ editor.getModels().forEach((model) => {
1221
+ if (model.getLanguageId() === this._languageId) {
1222
+ onModelRemoved(model);
1223
+ onModelAdd(model);
1224
+ }
1225
+ });
1226
+ })
1227
+ );
1228
+ this._disposables.push({
1229
+ dispose: () => {
1230
+ editor.getModels().forEach(onModelRemoved);
1231
+ for (let key in this._listener) {
1232
+ this._listener[key].dispose();
1233
+ }
1234
+ }
1235
+ });
1236
+ editor.getModels().forEach(onModelAdd);
1237
+ }
1238
+ dispose() {
1239
+ this._disposables.forEach((d) => d && d.dispose());
1240
+ this._disposables.length = 0;
1241
+ }
1242
+ _doValidate(resource, languageId) {
1243
+ this._worker(resource).then((worker) => {
1244
+ return worker.doValidation(resource.toString());
1245
+ }).then((diagnostics) => {
1246
+ const markers = diagnostics.map((d) => toDiagnostics(resource, d));
1247
+ let model = editor.getModel(resource);
1248
+ if (model && model.getLanguageId() === languageId) {
1249
+ editor.setModelMarkers(model, languageId, markers);
1250
+ }
1251
+ }).then(void 0, (err) => {
1252
+ console.error(err);
1253
+ });
1254
+ }
1255
+ }
1256
+ function toSeverity(lsSeverity) {
1257
+ switch (lsSeverity) {
1258
+ case DiagnosticSeverity.Error:
1259
+ return MarkerSeverity.Error;
1260
+ case DiagnosticSeverity.Warning:
1261
+ return MarkerSeverity.Warning;
1262
+ case DiagnosticSeverity.Information:
1263
+ return MarkerSeverity.Info;
1264
+ case DiagnosticSeverity.Hint:
1265
+ return MarkerSeverity.Hint;
1266
+ default:
1267
+ return MarkerSeverity.Info;
1268
+ }
1269
+ }
1270
+ function toDiagnostics(resource, diag) {
1271
+ let code = typeof diag.code === "number" ? String(diag.code) : diag.code;
1272
+ return {
1273
+ severity: toSeverity(diag.severity),
1274
+ startLineNumber: diag.range.start.line + 1,
1275
+ startColumn: diag.range.start.character + 1,
1276
+ endLineNumber: diag.range.end.line + 1,
1277
+ endColumn: diag.range.end.character + 1,
1278
+ message: diag.message,
1279
+ code,
1280
+ source: diag.source
1281
+ };
1282
+ }
1283
+ class CompletionAdapter {
1284
+ constructor(_worker, _triggerCharacters) {
1285
+ this._worker = _worker;
1286
+ this._triggerCharacters = _triggerCharacters;
1287
+ }
1288
+ get triggerCharacters() {
1289
+ return this._triggerCharacters;
1290
+ }
1291
+ provideCompletionItems(model, position, context, token) {
1292
+ const resource = model.uri;
1293
+ return this._worker(resource).then((worker) => {
1294
+ return worker.doComplete(resource.toString(), fromPosition(position));
1295
+ }).then((info) => {
1296
+ if (!info) {
1297
+ return;
1298
+ }
1299
+ const wordInfo = model.getWordUntilPosition(position);
1300
+ const wordRange = new Range$1(
1301
+ position.lineNumber,
1302
+ wordInfo.startColumn,
1303
+ position.lineNumber,
1304
+ wordInfo.endColumn
1305
+ );
1306
+ const items = info.items.map((entry) => {
1307
+ const item = {
1308
+ label: entry.label,
1309
+ insertText: entry.insertText || entry.label,
1310
+ sortText: entry.sortText,
1311
+ filterText: entry.filterText,
1312
+ documentation: entry.documentation,
1313
+ detail: entry.detail,
1314
+ command: toCommand(entry.command),
1315
+ range: wordRange,
1316
+ kind: toCompletionItemKind(entry.kind)
1317
+ };
1318
+ if (entry.textEdit) {
1319
+ if (isInsertReplaceEdit(entry.textEdit)) {
1320
+ item.range = {
1321
+ insert: toRange(entry.textEdit.insert),
1322
+ replace: toRange(entry.textEdit.replace)
1323
+ };
1324
+ } else {
1325
+ item.range = toRange(entry.textEdit.range);
1326
+ }
1327
+ item.insertText = entry.textEdit.newText;
1328
+ }
1329
+ if (entry.additionalTextEdits) {
1330
+ item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
1331
+ }
1332
+ if (entry.insertTextFormat === InsertTextFormat.Snippet) {
1333
+ item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;
1334
+ }
1335
+ return item;
1336
+ });
1337
+ return {
1338
+ isIncomplete: info.isIncomplete,
1339
+ suggestions: items
1340
+ };
1341
+ });
1342
+ }
1343
+ }
1344
+ function fromPosition(position) {
1345
+ if (!position) {
1346
+ return void 0;
1347
+ }
1348
+ return { character: position.column - 1, line: position.lineNumber - 1 };
1349
+ }
1350
+ function fromRange(range) {
1351
+ if (!range) {
1352
+ return void 0;
1353
+ }
1354
+ return {
1355
+ start: {
1356
+ line: range.startLineNumber - 1,
1357
+ character: range.startColumn - 1
1358
+ },
1359
+ end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
1360
+ };
1361
+ }
1362
+ function toRange(range) {
1363
+ if (!range) {
1364
+ return void 0;
1365
+ }
1366
+ return new Range$1(
1367
+ range.start.line + 1,
1368
+ range.start.character + 1,
1369
+ range.end.line + 1,
1370
+ range.end.character + 1
1371
+ );
1372
+ }
1373
+ function isInsertReplaceEdit(edit) {
1374
+ return typeof edit.insert !== "undefined" && typeof edit.replace !== "undefined";
1375
+ }
1376
+ function toCompletionItemKind(kind) {
1377
+ const mItemKind = languages.CompletionItemKind;
1378
+ switch (kind) {
1379
+ case CompletionItemKind.Text:
1380
+ return mItemKind.Text;
1381
+ case CompletionItemKind.Method:
1382
+ return mItemKind.Method;
1383
+ case CompletionItemKind.Function:
1384
+ return mItemKind.Function;
1385
+ case CompletionItemKind.Constructor:
1386
+ return mItemKind.Constructor;
1387
+ case CompletionItemKind.Field:
1388
+ return mItemKind.Field;
1389
+ case CompletionItemKind.Variable:
1390
+ return mItemKind.Variable;
1391
+ case CompletionItemKind.Class:
1392
+ return mItemKind.Class;
1393
+ case CompletionItemKind.Interface:
1394
+ return mItemKind.Interface;
1395
+ case CompletionItemKind.Module:
1396
+ return mItemKind.Module;
1397
+ case CompletionItemKind.Property:
1398
+ return mItemKind.Property;
1399
+ case CompletionItemKind.Unit:
1400
+ return mItemKind.Unit;
1401
+ case CompletionItemKind.Value:
1402
+ return mItemKind.Value;
1403
+ case CompletionItemKind.Enum:
1404
+ return mItemKind.Enum;
1405
+ case CompletionItemKind.Keyword:
1406
+ return mItemKind.Keyword;
1407
+ case CompletionItemKind.Snippet:
1408
+ return mItemKind.Snippet;
1409
+ case CompletionItemKind.Color:
1410
+ return mItemKind.Color;
1411
+ case CompletionItemKind.File:
1412
+ return mItemKind.File;
1413
+ case CompletionItemKind.Reference:
1414
+ return mItemKind.Reference;
1415
+ }
1416
+ return mItemKind.Property;
1417
+ }
1418
+ function toTextEdit(textEdit) {
1419
+ if (!textEdit) {
1420
+ return void 0;
1421
+ }
1422
+ return {
1423
+ range: toRange(textEdit.range),
1424
+ text: textEdit.newText
1425
+ };
1426
+ }
1427
+ function toCommand(c) {
1428
+ return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
1429
+ }
1430
+ class HoverAdapter {
1431
+ constructor(_worker) {
1432
+ this._worker = _worker;
1433
+ }
1434
+ provideHover(model, position, token) {
1435
+ let resource = model.uri;
1436
+ return this._worker(resource).then((worker) => {
1437
+ return worker.doHover(resource.toString(), fromPosition(position));
1438
+ }).then((info) => {
1439
+ if (!info) {
1440
+ return;
1441
+ }
1442
+ return {
1443
+ range: toRange(info.range),
1444
+ contents: toMarkedStringArray(info.contents)
1445
+ };
1446
+ });
1447
+ }
1448
+ }
1449
+ function isMarkupContent(thing) {
1450
+ return thing && typeof thing === "object" && typeof thing.kind === "string";
1451
+ }
1452
+ function toMarkdownString(entry) {
1453
+ if (typeof entry === "string") {
1454
+ return {
1455
+ value: entry
1456
+ };
1457
+ }
1458
+ if (isMarkupContent(entry)) {
1459
+ if (entry.kind === "plaintext") {
1460
+ return {
1461
+ value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1462
+ };
1463
+ }
1464
+ return {
1465
+ value: entry.value
1466
+ };
1467
+ }
1468
+ return { value: "```" + entry.language + "\n" + entry.value + "\n```\n" };
1469
+ }
1470
+ function toMarkedStringArray(contents) {
1471
+ if (!contents) {
1472
+ return void 0;
1473
+ }
1474
+ if (Array.isArray(contents)) {
1475
+ return contents.map(toMarkdownString);
1476
+ }
1477
+ return [toMarkdownString(contents)];
1478
+ }
1479
+ class DocumentHighlightAdapter {
1480
+ constructor(_worker) {
1481
+ this._worker = _worker;
1482
+ }
1483
+ provideDocumentHighlights(model, position, token) {
1484
+ const resource = model.uri;
1485
+ return this._worker(resource).then((worker) => worker.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
1486
+ if (!entries) {
1487
+ return;
1488
+ }
1489
+ return entries.map((entry) => {
1490
+ return {
1491
+ range: toRange(entry.range),
1492
+ kind: toDocumentHighlightKind(entry.kind)
1493
+ };
1494
+ });
1495
+ });
1496
+ }
1497
+ }
1498
+ function toDocumentHighlightKind(kind) {
1499
+ switch (kind) {
1500
+ case DocumentHighlightKind.Read:
1501
+ return languages.DocumentHighlightKind.Read;
1502
+ case DocumentHighlightKind.Write:
1503
+ return languages.DocumentHighlightKind.Write;
1504
+ case DocumentHighlightKind.Text:
1505
+ return languages.DocumentHighlightKind.Text;
1506
+ }
1507
+ return languages.DocumentHighlightKind.Text;
1508
+ }
1509
+ class DefinitionAdapter {
1510
+ constructor(_worker) {
1511
+ this._worker = _worker;
1512
+ }
1513
+ provideDefinition(model, position, token) {
1514
+ const resource = model.uri;
1515
+ return this._worker(resource).then((worker) => {
1516
+ return worker.findDefinition(resource.toString(), fromPosition(position));
1517
+ }).then((definition) => {
1518
+ if (!definition) {
1519
+ return;
1520
+ }
1521
+ return [toLocation(definition)];
1522
+ });
1523
+ }
1524
+ }
1525
+ function toLocation(location) {
1526
+ return {
1527
+ uri: Uri.parse(location.uri),
1528
+ range: toRange(location.range)
1529
+ };
1530
+ }
1531
+ class ReferenceAdapter {
1532
+ constructor(_worker) {
1533
+ this._worker = _worker;
1534
+ }
1535
+ provideReferences(model, position, context, token) {
1536
+ const resource = model.uri;
1537
+ return this._worker(resource).then((worker) => {
1538
+ return worker.findReferences(resource.toString(), fromPosition(position));
1539
+ }).then((entries) => {
1540
+ if (!entries) {
1541
+ return;
1542
+ }
1543
+ return entries.map(toLocation);
1544
+ });
1545
+ }
1546
+ }
1547
+ class RenameAdapter {
1548
+ constructor(_worker) {
1549
+ this._worker = _worker;
1550
+ }
1551
+ provideRenameEdits(model, position, newName, token) {
1552
+ const resource = model.uri;
1553
+ return this._worker(resource).then((worker) => {
1554
+ return worker.doRename(resource.toString(), fromPosition(position), newName);
1555
+ }).then((edit) => {
1556
+ return toWorkspaceEdit(edit);
1557
+ });
1558
+ }
1559
+ }
1560
+ function toWorkspaceEdit(edit) {
1561
+ if (!edit || !edit.changes) {
1562
+ return void 0;
1563
+ }
1564
+ let resourceEdits = [];
1565
+ for (let uri in edit.changes) {
1566
+ const _uri = Uri.parse(uri);
1567
+ for (let e of edit.changes[uri]) {
1568
+ resourceEdits.push({
1569
+ resource: _uri,
1570
+ versionId: void 0,
1571
+ textEdit: {
1572
+ range: toRange(e.range),
1573
+ text: e.newText
1574
+ }
1575
+ });
1576
+ }
1577
+ }
1578
+ return {
1579
+ edits: resourceEdits
1580
+ };
1581
+ }
1582
+ class DocumentSymbolAdapter {
1583
+ constructor(_worker) {
1584
+ this._worker = _worker;
1585
+ }
1586
+ provideDocumentSymbols(model, token) {
1587
+ const resource = model.uri;
1588
+ return this._worker(resource).then((worker) => worker.findDocumentSymbols(resource.toString())).then((items) => {
1589
+ if (!items) {
1590
+ return;
1591
+ }
1592
+ return items.map((item) => {
1593
+ if (isDocumentSymbol(item)) {
1594
+ return toDocumentSymbol(item);
1595
+ }
1596
+ return {
1597
+ name: item.name,
1598
+ detail: "",
1599
+ containerName: item.containerName,
1600
+ kind: toSymbolKind(item.kind),
1601
+ range: toRange(item.location.range),
1602
+ selectionRange: toRange(item.location.range),
1603
+ tags: []
1604
+ };
1605
+ });
1606
+ });
1607
+ }
1608
+ }
1609
+ function isDocumentSymbol(symbol) {
1610
+ return "children" in symbol;
1611
+ }
1612
+ function toDocumentSymbol(symbol) {
1613
+ return {
1614
+ name: symbol.name,
1615
+ detail: symbol.detail ?? "",
1616
+ kind: toSymbolKind(symbol.kind),
1617
+ range: toRange(symbol.range),
1618
+ selectionRange: toRange(symbol.selectionRange),
1619
+ tags: symbol.tags ?? [],
1620
+ children: (symbol.children ?? []).map((item) => toDocumentSymbol(item))
1621
+ };
1622
+ }
1623
+ function toSymbolKind(kind) {
1624
+ let mKind = languages.SymbolKind;
1625
+ switch (kind) {
1626
+ case SymbolKind.File:
1627
+ return mKind.File;
1628
+ case SymbolKind.Module:
1629
+ return mKind.Module;
1630
+ case SymbolKind.Namespace:
1631
+ return mKind.Namespace;
1632
+ case SymbolKind.Package:
1633
+ return mKind.Package;
1634
+ case SymbolKind.Class:
1635
+ return mKind.Class;
1636
+ case SymbolKind.Method:
1637
+ return mKind.Method;
1638
+ case SymbolKind.Property:
1639
+ return mKind.Property;
1640
+ case SymbolKind.Field:
1641
+ return mKind.Field;
1642
+ case SymbolKind.Constructor:
1643
+ return mKind.Constructor;
1644
+ case SymbolKind.Enum:
1645
+ return mKind.Enum;
1646
+ case SymbolKind.Interface:
1647
+ return mKind.Interface;
1648
+ case SymbolKind.Function:
1649
+ return mKind.Function;
1650
+ case SymbolKind.Variable:
1651
+ return mKind.Variable;
1652
+ case SymbolKind.Constant:
1653
+ return mKind.Constant;
1654
+ case SymbolKind.String:
1655
+ return mKind.String;
1656
+ case SymbolKind.Number:
1657
+ return mKind.Number;
1658
+ case SymbolKind.Boolean:
1659
+ return mKind.Boolean;
1660
+ case SymbolKind.Array:
1661
+ return mKind.Array;
1662
+ }
1663
+ return mKind.Function;
1664
+ }
1665
+ class DocumentLinkAdapter {
1666
+ constructor(_worker) {
1667
+ this._worker = _worker;
1668
+ }
1669
+ provideLinks(model, token) {
1670
+ const resource = model.uri;
1671
+ return this._worker(resource).then((worker) => worker.findDocumentLinks(resource.toString())).then((items) => {
1672
+ if (!items) {
1673
+ return;
1674
+ }
1675
+ return {
1676
+ links: items.map((item) => ({
1677
+ range: toRange(item.range),
1678
+ url: item.target
1679
+ }))
1680
+ };
1681
+ });
1682
+ }
1683
+ }
1684
+ class DocumentFormattingEditProvider {
1685
+ constructor(_worker) {
1686
+ this._worker = _worker;
1687
+ }
1688
+ provideDocumentFormattingEdits(model, options, token) {
1689
+ const resource = model.uri;
1690
+ return this._worker(resource).then((worker) => {
1691
+ return worker.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
1692
+ if (!edits || edits.length === 0) {
1693
+ return;
1694
+ }
1695
+ return edits.map(toTextEdit);
1696
+ });
1697
+ });
1698
+ }
1699
+ }
1700
+ class DocumentRangeFormattingEditProvider {
1701
+ constructor(_worker) {
1702
+ this._worker = _worker;
1703
+ this.canFormatMultipleRanges = false;
1704
+ }
1705
+ provideDocumentRangeFormattingEdits(model, range, options, token) {
1706
+ const resource = model.uri;
1707
+ return this._worker(resource).then((worker) => {
1708
+ return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
1709
+ if (!edits || edits.length === 0) {
1710
+ return;
1711
+ }
1712
+ return edits.map(toTextEdit);
1713
+ });
1714
+ });
1715
+ }
1716
+ }
1717
+ function fromFormattingOptions(options) {
1718
+ return {
1719
+ tabSize: options.tabSize,
1720
+ insertSpaces: options.insertSpaces
1721
+ };
1722
+ }
1723
+ class DocumentColorAdapter {
1724
+ constructor(_worker) {
1725
+ this._worker = _worker;
1726
+ }
1727
+ provideDocumentColors(model, token) {
1728
+ const resource = model.uri;
1729
+ return this._worker(resource).then((worker) => worker.findDocumentColors(resource.toString())).then((infos) => {
1730
+ if (!infos) {
1731
+ return;
1732
+ }
1733
+ return infos.map((item) => ({
1734
+ color: item.color,
1735
+ range: toRange(item.range)
1736
+ }));
1737
+ });
1738
+ }
1739
+ provideColorPresentations(model, info, token) {
1740
+ const resource = model.uri;
1741
+ return this._worker(resource).then(
1742
+ (worker) => worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range))
1743
+ ).then((presentations) => {
1744
+ if (!presentations) {
1745
+ return;
1746
+ }
1747
+ return presentations.map((presentation) => {
1748
+ let item = {
1749
+ label: presentation.label
1750
+ };
1751
+ if (presentation.textEdit) {
1752
+ item.textEdit = toTextEdit(presentation.textEdit);
1753
+ }
1754
+ if (presentation.additionalTextEdits) {
1755
+ item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);
1756
+ }
1757
+ return item;
1758
+ });
1759
+ });
1760
+ }
1761
+ }
1762
+ class FoldingRangeAdapter {
1763
+ constructor(_worker) {
1764
+ this._worker = _worker;
1765
+ }
1766
+ provideFoldingRanges(model, context, token) {
1767
+ const resource = model.uri;
1768
+ return this._worker(resource).then((worker) => worker.getFoldingRanges(resource.toString(), context)).then((ranges) => {
1769
+ if (!ranges) {
1770
+ return;
1771
+ }
1772
+ return ranges.map((range) => {
1773
+ const result = {
1774
+ start: range.startLine + 1,
1775
+ end: range.endLine + 1
1776
+ };
1777
+ if (typeof range.kind !== "undefined") {
1778
+ result.kind = toFoldingRangeKind(range.kind);
1779
+ }
1780
+ return result;
1781
+ });
1782
+ });
1783
+ }
1784
+ }
1785
+ function toFoldingRangeKind(kind) {
1786
+ switch (kind) {
1787
+ case FoldingRangeKind.Comment:
1788
+ return languages.FoldingRangeKind.Comment;
1789
+ case FoldingRangeKind.Imports:
1790
+ return languages.FoldingRangeKind.Imports;
1791
+ case FoldingRangeKind.Region:
1792
+ return languages.FoldingRangeKind.Region;
1793
+ }
1794
+ return void 0;
1795
+ }
1796
+ class SelectionRangeAdapter {
1797
+ constructor(_worker) {
1798
+ this._worker = _worker;
1799
+ }
1800
+ provideSelectionRanges(model, positions, token) {
1801
+ const resource = model.uri;
1802
+ return this._worker(resource).then(
1803
+ (worker) => worker.getSelectionRanges(
1804
+ resource.toString(),
1805
+ positions.map(fromPosition)
1806
+ )
1807
+ ).then((selectionRanges) => {
1808
+ if (!selectionRanges) {
1809
+ return;
1810
+ }
1811
+ return selectionRanges.map((selectionRange) => {
1812
+ const result = [];
1813
+ while (selectionRange) {
1814
+ result.push({ range: toRange(selectionRange.range) });
1815
+ selectionRange = selectionRange.parent;
1816
+ }
1817
+ return result;
1818
+ });
1819
+ });
1820
+ }
1821
+ }
1822
+ export {
1823
+ CompletionAdapter as C,
1824
+ DocumentHighlightAdapter as D,
1825
+ FoldingRangeAdapter as F,
1826
+ HoverAdapter as H,
1827
+ ReferenceAdapter as R,
1828
+ SelectionRangeAdapter as S,
1829
+ DefinitionAdapter as a,
1830
+ DocumentSymbolAdapter as b,
1831
+ RenameAdapter as c,
1832
+ DocumentColorAdapter as d,
1833
+ DiagnosticsAdapter as e,
1834
+ DocumentFormattingEditProvider as f,
1835
+ DocumentRangeFormattingEditProvider as g,
1836
+ DocumentLinkAdapter as h,
1837
+ fromPosition as i,
1838
+ fromRange as j,
1839
+ toTextEdit as k,
1840
+ toRange as t
1841
+ };