easy-email-pro-theme 0.2.0

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 (271) hide show
  1. package/lib/VariablesEditorContent-08997e30.mjs +147384 -0
  2. package/lib/abap-e7729493.mjs +1315 -0
  3. package/lib/apex-ea0b1b44.mjs +320 -0
  4. package/lib/assets/json.worker-2db083a8.js +16634 -0
  5. package/lib/azcli-92ca1f6b.mjs +75 -0
  6. package/lib/bat-a8aff72a.mjs +96 -0
  7. package/lib/bicep-a4d73496.mjs +116 -0
  8. package/lib/cameligo-93a61573.mjs +169 -0
  9. package/lib/clojure-a4292303.mjs +755 -0
  10. package/lib/coffee-c79fd580.mjs +229 -0
  11. package/lib/cpp-4bbc4355.mjs +391 -0
  12. package/lib/csharp-8ee8b919.mjs +321 -0
  13. package/lib/csp-7ff23ab5.mjs +58 -0
  14. package/lib/css-675efd06.mjs +185 -0
  15. package/lib/cssMode-e5b02650.mjs +2031 -0
  16. package/lib/cypher-ff6c93d1.mjs +263 -0
  17. package/lib/dart-b81ee8da.mjs +271 -0
  18. package/lib/dockerfile-4d34b657.mjs +133 -0
  19. package/lib/ecl-829c6c9f.mjs +455 -0
  20. package/lib/elixir-d20ab92c.mjs +490 -0
  21. package/lib/flow9-d363677c.mjs +142 -0
  22. package/lib/freemarker2-07352200.mjs +675 -0
  23. package/lib/fsharp-e5e10937.mjs +211 -0
  24. package/lib/go-49d8dd1b.mjs +209 -0
  25. package/lib/graphql-397d36cc.mjs +142 -0
  26. package/lib/handlebars-eb587af4.mjs +403 -0
  27. package/lib/hcl-2bc5a11b.mjs +178 -0
  28. package/lib/html-805b20b1.mjs +293 -0
  29. package/lib/html2canvas.esm-858519c4.mjs +7837 -0
  30. package/lib/htmlMode-a339a06a.mjs +2047 -0
  31. package/lib/index.js +40838 -0
  32. package/lib/ini-777fd0a6.mjs +69 -0
  33. package/lib/java-88c2ae93.mjs +222 -0
  34. package/lib/javascript-b5849f55.mjs +78 -0
  35. package/lib/jsonMode-1b509c19.mjs +2607 -0
  36. package/lib/julia-7e1d65a2.mjs +497 -0
  37. package/lib/kotlin-da15198d.mjs +246 -0
  38. package/lib/less-0057666d.mjs +168 -0
  39. package/lib/lexon-4f74b04c.mjs +152 -0
  40. package/lib/liquid-d5c8a287.mjs +250 -0
  41. package/lib/lua-da0a0c60.mjs +158 -0
  42. package/lib/m3-14d67e1c.mjs +211 -0
  43. package/lib/markdown-37ba20b1.mjs +203 -0
  44. package/lib/mips-d0b2c227.mjs +195 -0
  45. package/lib/monacoeditorwork/css.worker.bundle.js +46736 -0
  46. package/lib/monacoeditorwork/editor.worker.bundle.js +9954 -0
  47. package/lib/monacoeditorwork/html.worker.bundle.js +25985 -0
  48. package/lib/monacoeditorwork/json.worker.bundle.js +17214 -0
  49. package/lib/monacoeditorwork/ts.worker.bundle.js +172133 -0
  50. package/lib/msdax-29068c66.mjs +378 -0
  51. package/lib/mysql-7833c854.mjs +877 -0
  52. package/lib/objective-c-91c200d7.mjs +189 -0
  53. package/lib/pascal-eb8fa4fd.mjs +246 -0
  54. package/lib/pascaligo-855a8af1.mjs +159 -0
  55. package/lib/perl-6aab1ca2.mjs +600 -0
  56. package/lib/pgsql-f2266c91.mjs +848 -0
  57. package/lib/php-9806c791.mjs +472 -0
  58. package/lib/pla-c1d8ec04.mjs +132 -0
  59. package/lib/postiats-04d6db22.mjs +545 -0
  60. package/lib/powerquery-ec4dd65a.mjs +891 -0
  61. package/lib/powershell-cc02a40e.mjs +234 -0
  62. package/lib/protobuf-83b8e701.mjs +423 -0
  63. package/lib/pug-06fecd70.mjs +394 -0
  64. package/lib/python-7da9e073.mjs +270 -0
  65. package/lib/qsharp-232171da.mjs +283 -0
  66. package/lib/r-c048a1d4.mjs +246 -0
  67. package/lib/razor-c88b46b3.mjs +524 -0
  68. package/lib/redis-4399e06c.mjs +299 -0
  69. package/lib/redshift-ba36da77.mjs +807 -0
  70. package/lib/restructuredtext-cac6fcb7.mjs +163 -0
  71. package/lib/ruby-dca5ee98.mjs +445 -0
  72. package/lib/rust-c0b8769e.mjs +338 -0
  73. package/lib/sb-2b0bce6c.mjs +111 -0
  74. package/lib/scala-58e9dfc7.mjs +354 -0
  75. package/lib/scheme-fdc48747.mjs +115 -0
  76. package/lib/scss-defea6f2.mjs +243 -0
  77. package/lib/shell-8e11dc85.mjs +225 -0
  78. package/lib/solidity-8d74b890.mjs +1352 -0
  79. package/lib/sophia-b97eb718.mjs +191 -0
  80. package/lib/sparql-68163824.mjs +194 -0
  81. package/lib/sql-59977475.mjs +819 -0
  82. package/lib/st-febe75da.mjs +415 -0
  83. package/lib/style.css +6503 -0
  84. package/lib/swift-b95bae51.mjs +316 -0
  85. package/lib/systemverilog-4461e8b3.mjs +557 -0
  86. package/lib/tcl-8f97c15f.mjs +233 -0
  87. package/lib/tsMode-934544e6.mjs +1216 -0
  88. package/lib/twig-a68d494c.mjs +324 -0
  89. package/lib/typescript-049ec7b9.mjs +339 -0
  90. package/lib/typings/assets/font/iconfont.d.ts +0 -0
  91. package/lib/typings/components/BlockSideBar/BlockItem/index.d.ts +9 -0
  92. package/lib/typings/components/BlockSideBar/BlockList/index.d.ts +5 -0
  93. package/lib/typings/components/BlockSideBar/BlocksPanel/index.d.ts +2 -0
  94. package/lib/typings/components/BlockSideBar/LayoutItem/index.d.ts +6 -0
  95. package/lib/typings/components/BlockSideBar/index.d.ts +5 -0
  96. package/lib/typings/components/ColumnLayout/LayoutItemList.d.ts +6 -0
  97. package/lib/typings/components/ColumnLayout/index.d.ts +5 -0
  98. package/lib/typings/components/ConfigurationDrawer/index.d.ts +5 -0
  99. package/lib/typings/components/ConfigurationPanel/Elements/Button/index.d.ts +5 -0
  100. package/lib/typings/components/ConfigurationPanel/Elements/Column/index.d.ts +5 -0
  101. package/lib/typings/components/ConfigurationPanel/Elements/Divider/index.d.ts +5 -0
  102. package/lib/typings/components/ConfigurationPanel/Elements/Hero/index.d.ts +5 -0
  103. package/lib/typings/components/ConfigurationPanel/Elements/Image/index.d.ts +5 -0
  104. package/lib/typings/components/ConfigurationPanel/Elements/Navbar/index.d.ts +5 -0
  105. package/lib/typings/components/ConfigurationPanel/Elements/Page/index.d.ts +5 -0
  106. package/lib/typings/components/ConfigurationPanel/Elements/Section/index.d.ts +5 -0
  107. package/lib/typings/components/ConfigurationPanel/Elements/Social/index.d.ts +5 -0
  108. package/lib/typings/components/ConfigurationPanel/Elements/Spacer/index.d.ts +5 -0
  109. package/lib/typings/components/ConfigurationPanel/Elements/Text/index.d.ts +5 -0
  110. package/lib/typings/components/ConfigurationPanel/Elements/Wrapper/index.d.ts +5 -0
  111. package/lib/typings/components/ConfigurationPanel/Elements/index.d.ts +5 -0
  112. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundColor.d.ts +5 -0
  113. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundImage.d.ts +8 -0
  114. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundPosition.d.ts +8 -0
  115. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Border.d.ts +11 -0
  116. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BorderRadius.d.ts +5 -0
  117. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ButtonCategory.d.ts +10 -0
  118. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Buttons.d.ts +18 -0
  119. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Columns.d.ts +8 -0
  120. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Direction.d.ts +9 -0
  121. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Condition.d.ts +9 -0
  122. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Iteration.d.ts +9 -0
  123. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/index.d.ts +3 -0
  124. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DividerLine.d.ts +10 -0
  125. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontFamily.d.ts +5 -0
  126. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontSize.d.ts +5 -0
  127. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontWeight.d.ts +5 -0
  128. package/lib/typings/components/ConfigurationPanel/components/AttributeField/GlobalLink.d.ts +2 -0
  129. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Heading.d.ts +7 -0
  130. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Height.d.ts +5 -0
  131. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageUrl.d.ts +6 -0
  132. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageWidth.d.ts +7 -0
  133. package/lib/typings/components/ConfigurationPanel/components/AttributeField/LetterSpacing.d.ts +5 -0
  134. package/lib/typings/components/ConfigurationPanel/components/AttributeField/LineHeight.d.ts +7 -0
  135. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Link.d.ts +5 -0
  136. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Padding.d.ts +10 -0
  137. package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelAndPercentField.d.ts +11 -0
  138. package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelField.d.ts +3 -0
  139. package/lib/typings/components/ConfigurationPanel/components/AttributeField/StackOnMobile.d.ts +7 -0
  140. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAlign.d.ts +5 -0
  141. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingList.d.ts +6 -0
  142. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingStyle.d.ts +8 -0
  143. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Typography.d.ts +17 -0
  144. package/lib/typings/components/ConfigurationPanel/components/AttributeField/VerticalAlign.d.ts +5 -0
  145. package/lib/typings/components/ConfigurationPanel/components/AttributeField/WebFonts.d.ts +2 -0
  146. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Width.d.ts +5 -0
  147. package/lib/typings/components/ConfigurationPanel/components/AttributeField/index.d.ts +103 -0
  148. package/lib/typings/components/ConfigurationPanel/components/AttributePanel.d.ts +2 -0
  149. package/lib/typings/components/ConfigurationPanel/components/AttributesPanelWrapper/index.d.ts +8 -0
  150. package/lib/typings/components/ConfigurationPanel/components/CollapseWrapper/index.d.ts +7 -0
  151. package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/ResponsiveField.d.ts +5 -0
  152. package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/index.d.ts +11 -0
  153. package/lib/typings/components/ConfigurationPanel/components/SourceCodePanel/index.d.ts +2 -0
  154. package/lib/typings/components/ConfigurationPanel/components/UniversalElementPanel/index.d.ts +2 -0
  155. package/lib/typings/components/ConfigurationPanel/index.d.ts +8 -0
  156. package/lib/typings/components/Controller/index.d.ts +3 -0
  157. package/lib/typings/components/EditorTabs/components/PreviewEmail/components/DesktopEmailPreview/index.d.ts +5 -0
  158. package/lib/typings/components/EditorTabs/components/PreviewEmail/components/MobilePreview/index.d.ts +5 -0
  159. package/lib/typings/components/EditorTabs/components/PreviewEmail/index.d.ts +8 -0
  160. package/lib/typings/components/EditorTabs/components/PreviewEmailDrawer/index.d.ts +4 -0
  161. package/lib/typings/components/EditorTabs/components/TabHeader/index.d.ts +5 -0
  162. package/lib/typings/components/EditorTabs/index.d.ts +4 -0
  163. package/lib/typings/components/Form/ButtonField.d.ts +13 -0
  164. package/lib/typings/components/Form/ButtonGroupField.d.ts +15 -0
  165. package/lib/typings/components/Form/ColorPicker/ColorPickerContent.d.ts +7 -0
  166. package/lib/typings/components/Form/ColorPicker/index.d.ts +14 -0
  167. package/lib/typings/components/Form/EditPanelListField.d.ts +17 -0
  168. package/lib/typings/components/Form/EditPanelTabsField.d.ts +13 -0
  169. package/lib/typings/components/Form/ImageUploaderField/index.d.ts +20 -0
  170. package/lib/typings/components/Form/RichTextField/index.d.ts +10 -0
  171. package/lib/typings/components/Form/Select.d.ts +11 -0
  172. package/lib/typings/components/Form/SwitchField/index.d.ts +5 -0
  173. package/lib/typings/components/Form/SyncChildrenField.d.ts +11 -0
  174. package/lib/typings/components/Form/VariablesEditor/VariablesEditorContent.d.ts +7 -0
  175. package/lib/typings/components/Form/VariablesEditor/index.d.ts +2 -0
  176. package/lib/typings/components/Form/WatchField.d.ts +11 -0
  177. package/lib/typings/components/Form/adapter/JsonAdapter.d.ts +4 -0
  178. package/lib/typings/components/Form/adapter/color.adapter.d.ts +4 -0
  179. package/lib/typings/components/Form/adapter/fontStyle.adapter.d.ts +4 -0
  180. package/lib/typings/components/Form/adapter/fontWeight.adapter.d.ts +4 -0
  181. package/lib/typings/components/Form/adapter/index.d.ts +8 -0
  182. package/lib/typings/components/Form/adapter/italic.adapter.d.ts +4 -0
  183. package/lib/typings/components/Form/adapter/pixel.adapter.d.ts +4 -0
  184. package/lib/typings/components/Form/adapter/pixelNumber.adapter.d.ts +4 -0
  185. package/lib/typings/components/Form/adapter/slider.adapter.d.ts +4 -0
  186. package/lib/typings/components/Form/enhancer.d.ts +12 -0
  187. package/lib/typings/components/Form/index.d.ts +26 -0
  188. package/lib/typings/components/FullHeightOverlayScrollbars/index.d.ts +9 -0
  189. package/lib/typings/components/FullScreenLoading/index.d.ts +7 -0
  190. package/lib/typings/components/Hotkeys/index.d.ts +2 -0
  191. package/lib/typings/components/HoveringToolbar/RichTextBar.d.ts +6 -0
  192. package/lib/typings/components/HoveringToolbar/componens/BgColor.d.ts +2 -0
  193. package/lib/typings/components/HoveringToolbar/componens/FontColor.d.ts +2 -0
  194. package/lib/typings/components/HoveringToolbar/componens/FontFamily.d.ts +2 -0
  195. package/lib/typings/components/HoveringToolbar/componens/FontSize.d.ts +2 -0
  196. package/lib/typings/components/HoveringToolbar/componens/FormatButton.d.ts +9 -0
  197. package/lib/typings/components/HoveringToolbar/componens/MergeTag.d.ts +8 -0
  198. package/lib/typings/components/HoveringToolbar/componens/TextAlign.d.ts +2 -0
  199. package/lib/typings/components/HoveringToolbar/componens/TextLink.d.ts +2 -0
  200. package/lib/typings/components/HoveringToolbar/componens/TurnInto.d.ts +2 -0
  201. package/lib/typings/components/HoveringToolbar/constants.d.ts +0 -0
  202. package/lib/typings/components/HoveringToolbar/index.d.ts +3 -0
  203. package/lib/typings/components/HoveringToolbar/utils/getLinkNode.d.ts +3 -0
  204. package/lib/typings/components/IconFont/index.d.ts +10 -0
  205. package/lib/typings/components/MergeTagComponent/index.d.ts +7 -0
  206. package/lib/typings/components/MergetagPopover/index.d.ts +2 -0
  207. package/lib/typings/components/Providers/ControllerProvider.d.ts +4 -0
  208. package/lib/typings/components/Providers/DraggingProvider.d.ts +20 -0
  209. package/lib/typings/components/Providers/FormProvider.d.ts +4 -0
  210. package/lib/typings/components/Providers/UniversalElementProvider.d.ts +10 -0
  211. package/lib/typings/components/Providers/index.d.ts +6 -0
  212. package/lib/typings/components/UniversalElementEditorDrawer/index.d.ts +5 -0
  213. package/lib/typings/components/UnsplashImages/index.d.ts +206 -0
  214. package/lib/typings/components/index.d.ts +69 -0
  215. package/lib/typings/hooks/index.d.ts +6 -0
  216. package/lib/typings/hooks/useDragging.d.ts +15 -0
  217. package/lib/typings/hooks/useEditorForm.d.ts +12 -0
  218. package/lib/typings/hooks/useElementDefault.d.ts +9 -0
  219. package/lib/typings/hooks/useElementInteract.d.ts +6 -0
  220. package/lib/typings/hooks/useFontFamily.d.ts +7 -0
  221. package/lib/typings/hooks/useUniversalContent.d.ts +1 -0
  222. package/lib/typings/index.d.ts +5 -0
  223. package/lib/typings/store/ColorState.d.ts +9 -0
  224. package/lib/typings/store/EditorState.d.ts +12 -0
  225. package/lib/typings/store/Minimalist.d.ts +35 -0
  226. package/lib/typings/store/index.d.ts +49 -0
  227. package/lib/typings/themes/Minimalist/components/AutoSelectElement.d.ts +2 -0
  228. package/lib/typings/themes/Minimalist/components/BlockMenusOverlay/index.d.ts +2 -0
  229. package/lib/typings/themes/Minimalist/components/BlockResizer/index.d.ts +12 -0
  230. package/lib/typings/themes/Minimalist/components/ColumnLayoutOverlay/index.d.ts +2 -0
  231. package/lib/typings/themes/Minimalist/components/ElementHover/index.d.ts +2 -0
  232. package/lib/typings/themes/Minimalist/components/ElementPlaceholder/index.d.ts +2 -0
  233. package/lib/typings/themes/Minimalist/components/ElementSelected/index.d.ts +2 -0
  234. package/lib/typings/themes/Minimalist/components/ElementTools/index.d.ts +8 -0
  235. package/lib/typings/themes/Minimalist/components/ImageAction/MoreActionsMenusOverlay/index.d.ts +10 -0
  236. package/lib/typings/themes/Minimalist/components/ImageAction/MoreIcon/index.d.ts +5 -0
  237. package/lib/typings/themes/Minimalist/components/ImageAction/index.d.ts +7 -0
  238. package/lib/typings/themes/Minimalist/index.d.ts +10 -0
  239. package/lib/typings/themes/Minimalist/withTheme.d.ts +4 -0
  240. package/lib/typings/themes/Retro/components/AutoDeselectElement.d.ts +2 -0
  241. package/lib/typings/themes/Retro/components/ElementInteract/AddIcon/index.d.ts +2 -0
  242. package/lib/typings/themes/Retro/components/ElementInteract/DragIcon/index.d.ts +4 -0
  243. package/lib/typings/themes/Retro/components/ElementInteract/ElementHover/index.d.ts +2 -0
  244. package/lib/typings/themes/Retro/components/ElementInteract/ElementPlaceholder/index.d.ts +2 -0
  245. package/lib/typings/themes/Retro/components/ElementInteract/ElementSelected/index.d.ts +2 -0
  246. package/lib/typings/themes/Retro/components/ElementInteract/ElementTools/index.d.ts +8 -0
  247. package/lib/typings/themes/Retro/components/ElementInteract/index.d.ts +3 -0
  248. package/lib/typings/themes/Retro/index.d.ts +10 -0
  249. package/lib/typings/themes/Retro/withTheme.d.ts +2 -0
  250. package/lib/typings/themes/index.d.ts +2 -0
  251. package/lib/typings/typings/custom-types.d.ts +96 -0
  252. package/lib/typings/typings/index.d.ts +1 -0
  253. package/lib/typings/utils/Uploader.d.ts +35 -0
  254. package/lib/typings/utils/environment.d.ts +1 -0
  255. package/lib/typings/utils/generateLogic.d.ts +3 -0
  256. package/lib/typings/utils/getElementPageLayout.d.ts +16 -0
  257. package/lib/typings/utils/getFallbackValue.d.ts +7 -0
  258. package/lib/typings/utils/hideCursor.d.ts +2 -0
  259. package/lib/typings/utils/hotkeys.d.ts +18 -0
  260. package/lib/typings/utils/index.d.ts +2 -0
  261. package/lib/typings/utils/isValidHttpUrl.d.ts +1 -0
  262. package/lib/typings/utils/mjmlToJson/HtmlNodeAdapter.d.ts +2 -0
  263. package/lib/typings/utils/mjmlToJson/basicElementToStandardElement.d.ts +2 -0
  264. package/lib/typings/utils/mjmlToJson/formatPadding.d.ts +1 -0
  265. package/lib/typings/utils/mjmlToJson/index.d.ts +2 -0
  266. package/lib/typings/utils/onDrag.d.ts +10 -0
  267. package/lib/typings/utils/previewLoadImage.d.ts +1 -0
  268. package/lib/vb-dfbee74a.mjs +365 -0
  269. package/lib/xml-c6d1e274.mjs +106 -0
  270. package/lib/yaml-3c88ef61.mjs +195 -0
  271. package/package.json +44 -0
@@ -0,0 +1,2607 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { m as monaco_editor_core_star } from "./VariablesEditorContent-08997e30.mjs";
8
+ import "react";
9
+ import "easy-email-pro-core";
10
+ /*!-----------------------------------------------------------------------------
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Version: 0.36.1(6c56744c3419458f0dd48864520b759d1a3a1ca8)
13
+ * Released under the MIT license
14
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
15
+ *-----------------------------------------------------------------------------*/
16
+ var __defProp2 = Object.defineProperty;
17
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
18
+ var __getOwnPropNames = Object.getOwnPropertyNames;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
+ var monaco_editor_core_exports = {};
30
+ __reExport(monaco_editor_core_exports, monaco_editor_core_star);
31
+ var STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
32
+ var WorkerManager = class {
33
+ constructor(defaults) {
34
+ __publicField(this, "_defaults");
35
+ __publicField(this, "_idleCheckInterval");
36
+ __publicField(this, "_lastUsedTime");
37
+ __publicField(this, "_configChangeListener");
38
+ __publicField(this, "_worker");
39
+ __publicField(this, "_client");
40
+ this._defaults = defaults;
41
+ this._worker = null;
42
+ this._client = null;
43
+ this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3);
44
+ this._lastUsedTime = 0;
45
+ this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
46
+ }
47
+ _stopWorker() {
48
+ if (this._worker) {
49
+ this._worker.dispose();
50
+ this._worker = null;
51
+ }
52
+ this._client = null;
53
+ }
54
+ dispose() {
55
+ clearInterval(this._idleCheckInterval);
56
+ this._configChangeListener.dispose();
57
+ this._stopWorker();
58
+ }
59
+ _checkIfIdle() {
60
+ if (!this._worker) {
61
+ return;
62
+ }
63
+ let timePassedSinceLastUsed = Date.now() - this._lastUsedTime;
64
+ if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {
65
+ this._stopWorker();
66
+ }
67
+ }
68
+ _getClient() {
69
+ this._lastUsedTime = Date.now();
70
+ if (!this._client) {
71
+ this._worker = monaco_editor_core_exports.editor.createWebWorker({
72
+ moduleId: "vs/language/json/jsonWorker",
73
+ label: this._defaults.languageId,
74
+ createData: {
75
+ languageSettings: this._defaults.diagnosticsOptions,
76
+ languageId: this._defaults.languageId,
77
+ enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest
78
+ }
79
+ });
80
+ this._client = this._worker.getProxy();
81
+ }
82
+ return this._client;
83
+ }
84
+ getLanguageServiceWorker(...resources) {
85
+ let _client;
86
+ return this._getClient().then((client) => {
87
+ _client = client;
88
+ }).then((_) => {
89
+ if (this._worker) {
90
+ return this._worker.withSyncedResources(resources);
91
+ }
92
+ }).then((_) => _client);
93
+ }
94
+ };
95
+ var integer;
96
+ (function(integer2) {
97
+ integer2.MIN_VALUE = -2147483648;
98
+ integer2.MAX_VALUE = 2147483647;
99
+ })(integer || (integer = {}));
100
+ var uinteger;
101
+ (function(uinteger2) {
102
+ uinteger2.MIN_VALUE = 0;
103
+ uinteger2.MAX_VALUE = 2147483647;
104
+ })(uinteger || (uinteger = {}));
105
+ var Position;
106
+ (function(Position3) {
107
+ function create(line, character) {
108
+ if (line === Number.MAX_VALUE) {
109
+ line = uinteger.MAX_VALUE;
110
+ }
111
+ if (character === Number.MAX_VALUE) {
112
+ character = uinteger.MAX_VALUE;
113
+ }
114
+ return { line, character };
115
+ }
116
+ Position3.create = create;
117
+ function is(value) {
118
+ var candidate = value;
119
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
120
+ }
121
+ Position3.is = is;
122
+ })(Position || (Position = {}));
123
+ var Range;
124
+ (function(Range3) {
125
+ function create(one, two, three, four) {
126
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
127
+ return { start: Position.create(one, two), end: Position.create(three, four) };
128
+ } else if (Position.is(one) && Position.is(two)) {
129
+ return { start: one, end: two };
130
+ } else {
131
+ throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
132
+ }
133
+ }
134
+ Range3.create = create;
135
+ function is(value) {
136
+ var candidate = value;
137
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
138
+ }
139
+ Range3.is = is;
140
+ })(Range || (Range = {}));
141
+ var Location;
142
+ (function(Location2) {
143
+ function create(uri, range) {
144
+ return { uri, range };
145
+ }
146
+ Location2.create = create;
147
+ function is(value) {
148
+ var candidate = value;
149
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
150
+ }
151
+ Location2.is = is;
152
+ })(Location || (Location = {}));
153
+ var LocationLink;
154
+ (function(LocationLink2) {
155
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
156
+ return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
157
+ }
158
+ LocationLink2.create = create;
159
+ function is(value) {
160
+ var candidate = value;
161
+ return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
162
+ }
163
+ LocationLink2.is = is;
164
+ })(LocationLink || (LocationLink = {}));
165
+ var Color;
166
+ (function(Color2) {
167
+ function create(red, green, blue, alpha) {
168
+ return {
169
+ red,
170
+ green,
171
+ blue,
172
+ alpha
173
+ };
174
+ }
175
+ Color2.create = create;
176
+ function is(value) {
177
+ var candidate = value;
178
+ return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
179
+ }
180
+ Color2.is = is;
181
+ })(Color || (Color = {}));
182
+ var ColorInformation;
183
+ (function(ColorInformation2) {
184
+ function create(range, color) {
185
+ return {
186
+ range,
187
+ color
188
+ };
189
+ }
190
+ ColorInformation2.create = create;
191
+ function is(value) {
192
+ var candidate = value;
193
+ return Range.is(candidate.range) && Color.is(candidate.color);
194
+ }
195
+ ColorInformation2.is = is;
196
+ })(ColorInformation || (ColorInformation = {}));
197
+ var ColorPresentation;
198
+ (function(ColorPresentation2) {
199
+ function create(label, textEdit, additionalTextEdits) {
200
+ return {
201
+ label,
202
+ textEdit,
203
+ additionalTextEdits
204
+ };
205
+ }
206
+ ColorPresentation2.create = create;
207
+ function is(value) {
208
+ var candidate = value;
209
+ return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
210
+ }
211
+ ColorPresentation2.is = is;
212
+ })(ColorPresentation || (ColorPresentation = {}));
213
+ var FoldingRangeKind;
214
+ (function(FoldingRangeKind2) {
215
+ FoldingRangeKind2["Comment"] = "comment";
216
+ FoldingRangeKind2["Imports"] = "imports";
217
+ FoldingRangeKind2["Region"] = "region";
218
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
219
+ var FoldingRange;
220
+ (function(FoldingRange2) {
221
+ function create(startLine, endLine, startCharacter, endCharacter, kind) {
222
+ var result = {
223
+ startLine,
224
+ endLine
225
+ };
226
+ if (Is.defined(startCharacter)) {
227
+ result.startCharacter = startCharacter;
228
+ }
229
+ if (Is.defined(endCharacter)) {
230
+ result.endCharacter = endCharacter;
231
+ }
232
+ if (Is.defined(kind)) {
233
+ result.kind = kind;
234
+ }
235
+ return result;
236
+ }
237
+ FoldingRange2.create = create;
238
+ function is(value) {
239
+ var candidate = value;
240
+ return 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));
241
+ }
242
+ FoldingRange2.is = is;
243
+ })(FoldingRange || (FoldingRange = {}));
244
+ var DiagnosticRelatedInformation;
245
+ (function(DiagnosticRelatedInformation2) {
246
+ function create(location, message) {
247
+ return {
248
+ location,
249
+ message
250
+ };
251
+ }
252
+ DiagnosticRelatedInformation2.create = create;
253
+ function is(value) {
254
+ var candidate = value;
255
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
256
+ }
257
+ DiagnosticRelatedInformation2.is = is;
258
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
259
+ var DiagnosticSeverity;
260
+ (function(DiagnosticSeverity2) {
261
+ DiagnosticSeverity2.Error = 1;
262
+ DiagnosticSeverity2.Warning = 2;
263
+ DiagnosticSeverity2.Information = 3;
264
+ DiagnosticSeverity2.Hint = 4;
265
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
266
+ var DiagnosticTag;
267
+ (function(DiagnosticTag2) {
268
+ DiagnosticTag2.Unnecessary = 1;
269
+ DiagnosticTag2.Deprecated = 2;
270
+ })(DiagnosticTag || (DiagnosticTag = {}));
271
+ var CodeDescription;
272
+ (function(CodeDescription2) {
273
+ function is(value) {
274
+ var candidate = value;
275
+ return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
276
+ }
277
+ CodeDescription2.is = is;
278
+ })(CodeDescription || (CodeDescription = {}));
279
+ var Diagnostic;
280
+ (function(Diagnostic2) {
281
+ function create(range, message, severity, code, source, relatedInformation) {
282
+ var result = { range, message };
283
+ if (Is.defined(severity)) {
284
+ result.severity = severity;
285
+ }
286
+ if (Is.defined(code)) {
287
+ result.code = code;
288
+ }
289
+ if (Is.defined(source)) {
290
+ result.source = source;
291
+ }
292
+ if (Is.defined(relatedInformation)) {
293
+ result.relatedInformation = relatedInformation;
294
+ }
295
+ return result;
296
+ }
297
+ Diagnostic2.create = create;
298
+ function is(value) {
299
+ var _a;
300
+ var candidate = value;
301
+ 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));
302
+ }
303
+ Diagnostic2.is = is;
304
+ })(Diagnostic || (Diagnostic = {}));
305
+ var Command;
306
+ (function(Command2) {
307
+ function create(title, command) {
308
+ var args = [];
309
+ for (var _i = 2; _i < arguments.length; _i++) {
310
+ args[_i - 2] = arguments[_i];
311
+ }
312
+ var result = { title, command };
313
+ if (Is.defined(args) && args.length > 0) {
314
+ result.arguments = args;
315
+ }
316
+ return result;
317
+ }
318
+ Command2.create = create;
319
+ function is(value) {
320
+ var candidate = value;
321
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
322
+ }
323
+ Command2.is = is;
324
+ })(Command || (Command = {}));
325
+ var TextEdit;
326
+ (function(TextEdit2) {
327
+ function replace(range, newText) {
328
+ return { range, newText };
329
+ }
330
+ TextEdit2.replace = replace;
331
+ function insert(position, newText) {
332
+ return { range: { start: position, end: position }, newText };
333
+ }
334
+ TextEdit2.insert = insert;
335
+ function del(range) {
336
+ return { range, newText: "" };
337
+ }
338
+ TextEdit2.del = del;
339
+ function is(value) {
340
+ var candidate = value;
341
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
342
+ }
343
+ TextEdit2.is = is;
344
+ })(TextEdit || (TextEdit = {}));
345
+ var ChangeAnnotation;
346
+ (function(ChangeAnnotation2) {
347
+ function create(label, needsConfirmation, description) {
348
+ var result = { label };
349
+ if (needsConfirmation !== void 0) {
350
+ result.needsConfirmation = needsConfirmation;
351
+ }
352
+ if (description !== void 0) {
353
+ result.description = description;
354
+ }
355
+ return result;
356
+ }
357
+ ChangeAnnotation2.create = create;
358
+ function is(value) {
359
+ var candidate = value;
360
+ return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
361
+ }
362
+ ChangeAnnotation2.is = is;
363
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
364
+ var ChangeAnnotationIdentifier;
365
+ (function(ChangeAnnotationIdentifier2) {
366
+ function is(value) {
367
+ var candidate = value;
368
+ return typeof candidate === "string";
369
+ }
370
+ ChangeAnnotationIdentifier2.is = is;
371
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
372
+ var AnnotatedTextEdit;
373
+ (function(AnnotatedTextEdit2) {
374
+ function replace(range, newText, annotation) {
375
+ return { range, newText, annotationId: annotation };
376
+ }
377
+ AnnotatedTextEdit2.replace = replace;
378
+ function insert(position, newText, annotation) {
379
+ return { range: { start: position, end: position }, newText, annotationId: annotation };
380
+ }
381
+ AnnotatedTextEdit2.insert = insert;
382
+ function del(range, annotation) {
383
+ return { range, newText: "", annotationId: annotation };
384
+ }
385
+ AnnotatedTextEdit2.del = del;
386
+ function is(value) {
387
+ var candidate = value;
388
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
389
+ }
390
+ AnnotatedTextEdit2.is = is;
391
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
392
+ var TextDocumentEdit;
393
+ (function(TextDocumentEdit2) {
394
+ function create(textDocument, edits) {
395
+ return { textDocument, edits };
396
+ }
397
+ TextDocumentEdit2.create = create;
398
+ function is(value) {
399
+ var candidate = value;
400
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
401
+ }
402
+ TextDocumentEdit2.is = is;
403
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
404
+ var CreateFile;
405
+ (function(CreateFile2) {
406
+ function create(uri, options, annotation) {
407
+ var result = {
408
+ kind: "create",
409
+ uri
410
+ };
411
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
412
+ result.options = options;
413
+ }
414
+ if (annotation !== void 0) {
415
+ result.annotationId = annotation;
416
+ }
417
+ return result;
418
+ }
419
+ CreateFile2.create = create;
420
+ function is(value) {
421
+ var candidate = value;
422
+ 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));
423
+ }
424
+ CreateFile2.is = is;
425
+ })(CreateFile || (CreateFile = {}));
426
+ var RenameFile;
427
+ (function(RenameFile2) {
428
+ function create(oldUri, newUri, options, annotation) {
429
+ var result = {
430
+ kind: "rename",
431
+ oldUri,
432
+ newUri
433
+ };
434
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
435
+ result.options = options;
436
+ }
437
+ if (annotation !== void 0) {
438
+ result.annotationId = annotation;
439
+ }
440
+ return result;
441
+ }
442
+ RenameFile2.create = create;
443
+ function is(value) {
444
+ var candidate = value;
445
+ 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));
446
+ }
447
+ RenameFile2.is = is;
448
+ })(RenameFile || (RenameFile = {}));
449
+ var DeleteFile;
450
+ (function(DeleteFile2) {
451
+ function create(uri, options, annotation) {
452
+ var result = {
453
+ kind: "delete",
454
+ uri
455
+ };
456
+ if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
457
+ result.options = options;
458
+ }
459
+ if (annotation !== void 0) {
460
+ result.annotationId = annotation;
461
+ }
462
+ return result;
463
+ }
464
+ DeleteFile2.create = create;
465
+ function is(value) {
466
+ var candidate = value;
467
+ 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));
468
+ }
469
+ DeleteFile2.is = is;
470
+ })(DeleteFile || (DeleteFile = {}));
471
+ var WorkspaceEdit;
472
+ (function(WorkspaceEdit2) {
473
+ function is(value) {
474
+ var candidate = value;
475
+ return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
476
+ if (Is.string(change.kind)) {
477
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
478
+ } else {
479
+ return TextDocumentEdit.is(change);
480
+ }
481
+ }));
482
+ }
483
+ WorkspaceEdit2.is = is;
484
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
485
+ var TextEditChangeImpl = function() {
486
+ function TextEditChangeImpl2(edits, changeAnnotations) {
487
+ this.edits = edits;
488
+ this.changeAnnotations = changeAnnotations;
489
+ }
490
+ TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
491
+ var edit;
492
+ var id;
493
+ if (annotation === void 0) {
494
+ edit = TextEdit.insert(position, newText);
495
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
496
+ id = annotation;
497
+ edit = AnnotatedTextEdit.insert(position, newText, annotation);
498
+ } else {
499
+ this.assertChangeAnnotations(this.changeAnnotations);
500
+ id = this.changeAnnotations.manage(annotation);
501
+ edit = AnnotatedTextEdit.insert(position, newText, id);
502
+ }
503
+ this.edits.push(edit);
504
+ if (id !== void 0) {
505
+ return id;
506
+ }
507
+ };
508
+ TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
509
+ var edit;
510
+ var id;
511
+ if (annotation === void 0) {
512
+ edit = TextEdit.replace(range, newText);
513
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
514
+ id = annotation;
515
+ edit = AnnotatedTextEdit.replace(range, newText, annotation);
516
+ } else {
517
+ this.assertChangeAnnotations(this.changeAnnotations);
518
+ id = this.changeAnnotations.manage(annotation);
519
+ edit = AnnotatedTextEdit.replace(range, newText, id);
520
+ }
521
+ this.edits.push(edit);
522
+ if (id !== void 0) {
523
+ return id;
524
+ }
525
+ };
526
+ TextEditChangeImpl2.prototype.delete = function(range, annotation) {
527
+ var edit;
528
+ var id;
529
+ if (annotation === void 0) {
530
+ edit = TextEdit.del(range);
531
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
532
+ id = annotation;
533
+ edit = AnnotatedTextEdit.del(range, annotation);
534
+ } else {
535
+ this.assertChangeAnnotations(this.changeAnnotations);
536
+ id = this.changeAnnotations.manage(annotation);
537
+ edit = AnnotatedTextEdit.del(range, id);
538
+ }
539
+ this.edits.push(edit);
540
+ if (id !== void 0) {
541
+ return id;
542
+ }
543
+ };
544
+ TextEditChangeImpl2.prototype.add = function(edit) {
545
+ this.edits.push(edit);
546
+ };
547
+ TextEditChangeImpl2.prototype.all = function() {
548
+ return this.edits;
549
+ };
550
+ TextEditChangeImpl2.prototype.clear = function() {
551
+ this.edits.splice(0, this.edits.length);
552
+ };
553
+ TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
554
+ if (value === void 0) {
555
+ throw new Error("Text edit change is not configured to manage change annotations.");
556
+ }
557
+ };
558
+ return TextEditChangeImpl2;
559
+ }();
560
+ var ChangeAnnotations = function() {
561
+ function ChangeAnnotations2(annotations) {
562
+ this._annotations = annotations === void 0 ? /* @__PURE__ */ Object.create(null) : annotations;
563
+ this._counter = 0;
564
+ this._size = 0;
565
+ }
566
+ ChangeAnnotations2.prototype.all = function() {
567
+ return this._annotations;
568
+ };
569
+ Object.defineProperty(ChangeAnnotations2.prototype, "size", {
570
+ get: function() {
571
+ return this._size;
572
+ },
573
+ enumerable: false,
574
+ configurable: true
575
+ });
576
+ ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
577
+ var id;
578
+ if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
579
+ id = idOrAnnotation;
580
+ } else {
581
+ id = this.nextId();
582
+ annotation = idOrAnnotation;
583
+ }
584
+ if (this._annotations[id] !== void 0) {
585
+ throw new Error("Id " + id + " is already in use.");
586
+ }
587
+ if (annotation === void 0) {
588
+ throw new Error("No annotation provided for id " + id);
589
+ }
590
+ this._annotations[id] = annotation;
591
+ this._size++;
592
+ return id;
593
+ };
594
+ ChangeAnnotations2.prototype.nextId = function() {
595
+ this._counter++;
596
+ return this._counter.toString();
597
+ };
598
+ return ChangeAnnotations2;
599
+ }();
600
+ (function() {
601
+ function WorkspaceChange2(workspaceEdit) {
602
+ var _this = this;
603
+ this._textEditChanges = /* @__PURE__ */ Object.create(null);
604
+ if (workspaceEdit !== void 0) {
605
+ this._workspaceEdit = workspaceEdit;
606
+ if (workspaceEdit.documentChanges) {
607
+ this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
608
+ workspaceEdit.changeAnnotations = this._changeAnnotations.all();
609
+ workspaceEdit.documentChanges.forEach(function(change) {
610
+ if (TextDocumentEdit.is(change)) {
611
+ var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
612
+ _this._textEditChanges[change.textDocument.uri] = textEditChange;
613
+ }
614
+ });
615
+ } else if (workspaceEdit.changes) {
616
+ Object.keys(workspaceEdit.changes).forEach(function(key) {
617
+ var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
618
+ _this._textEditChanges[key] = textEditChange;
619
+ });
620
+ }
621
+ } else {
622
+ this._workspaceEdit = {};
623
+ }
624
+ }
625
+ Object.defineProperty(WorkspaceChange2.prototype, "edit", {
626
+ get: function() {
627
+ this.initDocumentChanges();
628
+ if (this._changeAnnotations !== void 0) {
629
+ if (this._changeAnnotations.size === 0) {
630
+ this._workspaceEdit.changeAnnotations = void 0;
631
+ } else {
632
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
633
+ }
634
+ }
635
+ return this._workspaceEdit;
636
+ },
637
+ enumerable: false,
638
+ configurable: true
639
+ });
640
+ WorkspaceChange2.prototype.getTextEditChange = function(key) {
641
+ if (OptionalVersionedTextDocumentIdentifier.is(key)) {
642
+ this.initDocumentChanges();
643
+ if (this._workspaceEdit.documentChanges === void 0) {
644
+ throw new Error("Workspace edit is not configured for document changes.");
645
+ }
646
+ var textDocument = { uri: key.uri, version: key.version };
647
+ var result = this._textEditChanges[textDocument.uri];
648
+ if (!result) {
649
+ var edits = [];
650
+ var textDocumentEdit = {
651
+ textDocument,
652
+ edits
653
+ };
654
+ this._workspaceEdit.documentChanges.push(textDocumentEdit);
655
+ result = new TextEditChangeImpl(edits, this._changeAnnotations);
656
+ this._textEditChanges[textDocument.uri] = result;
657
+ }
658
+ return result;
659
+ } else {
660
+ this.initChanges();
661
+ if (this._workspaceEdit.changes === void 0) {
662
+ throw new Error("Workspace edit is not configured for normal text edit changes.");
663
+ }
664
+ var result = this._textEditChanges[key];
665
+ if (!result) {
666
+ var edits = [];
667
+ this._workspaceEdit.changes[key] = edits;
668
+ result = new TextEditChangeImpl(edits);
669
+ this._textEditChanges[key] = result;
670
+ }
671
+ return result;
672
+ }
673
+ };
674
+ WorkspaceChange2.prototype.initDocumentChanges = function() {
675
+ if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
676
+ this._changeAnnotations = new ChangeAnnotations();
677
+ this._workspaceEdit.documentChanges = [];
678
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
679
+ }
680
+ };
681
+ WorkspaceChange2.prototype.initChanges = function() {
682
+ if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
683
+ this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null);
684
+ }
685
+ };
686
+ WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
687
+ this.initDocumentChanges();
688
+ if (this._workspaceEdit.documentChanges === void 0) {
689
+ throw new Error("Workspace edit is not configured for document changes.");
690
+ }
691
+ var annotation;
692
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
693
+ annotation = optionsOrAnnotation;
694
+ } else {
695
+ options = optionsOrAnnotation;
696
+ }
697
+ var operation;
698
+ var id;
699
+ if (annotation === void 0) {
700
+ operation = CreateFile.create(uri, options);
701
+ } else {
702
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
703
+ operation = CreateFile.create(uri, options, id);
704
+ }
705
+ this._workspaceEdit.documentChanges.push(operation);
706
+ if (id !== void 0) {
707
+ return id;
708
+ }
709
+ };
710
+ WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
711
+ this.initDocumentChanges();
712
+ if (this._workspaceEdit.documentChanges === void 0) {
713
+ throw new Error("Workspace edit is not configured for document changes.");
714
+ }
715
+ var annotation;
716
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
717
+ annotation = optionsOrAnnotation;
718
+ } else {
719
+ options = optionsOrAnnotation;
720
+ }
721
+ var operation;
722
+ var id;
723
+ if (annotation === void 0) {
724
+ operation = RenameFile.create(oldUri, newUri, options);
725
+ } else {
726
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
727
+ operation = RenameFile.create(oldUri, newUri, options, id);
728
+ }
729
+ this._workspaceEdit.documentChanges.push(operation);
730
+ if (id !== void 0) {
731
+ return id;
732
+ }
733
+ };
734
+ WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
735
+ this.initDocumentChanges();
736
+ if (this._workspaceEdit.documentChanges === void 0) {
737
+ throw new Error("Workspace edit is not configured for document changes.");
738
+ }
739
+ var annotation;
740
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
741
+ annotation = optionsOrAnnotation;
742
+ } else {
743
+ options = optionsOrAnnotation;
744
+ }
745
+ var operation;
746
+ var id;
747
+ if (annotation === void 0) {
748
+ operation = DeleteFile.create(uri, options);
749
+ } else {
750
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
751
+ operation = DeleteFile.create(uri, options, id);
752
+ }
753
+ this._workspaceEdit.documentChanges.push(operation);
754
+ if (id !== void 0) {
755
+ return id;
756
+ }
757
+ };
758
+ return WorkspaceChange2;
759
+ })();
760
+ var TextDocumentIdentifier;
761
+ (function(TextDocumentIdentifier2) {
762
+ function create(uri) {
763
+ return { uri };
764
+ }
765
+ TextDocumentIdentifier2.create = create;
766
+ function is(value) {
767
+ var candidate = value;
768
+ return Is.defined(candidate) && Is.string(candidate.uri);
769
+ }
770
+ TextDocumentIdentifier2.is = is;
771
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
772
+ var VersionedTextDocumentIdentifier;
773
+ (function(VersionedTextDocumentIdentifier2) {
774
+ function create(uri, version) {
775
+ return { uri, version };
776
+ }
777
+ VersionedTextDocumentIdentifier2.create = create;
778
+ function is(value) {
779
+ var candidate = value;
780
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
781
+ }
782
+ VersionedTextDocumentIdentifier2.is = is;
783
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
784
+ var OptionalVersionedTextDocumentIdentifier;
785
+ (function(OptionalVersionedTextDocumentIdentifier2) {
786
+ function create(uri, version) {
787
+ return { uri, version };
788
+ }
789
+ OptionalVersionedTextDocumentIdentifier2.create = create;
790
+ function is(value) {
791
+ var candidate = value;
792
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
793
+ }
794
+ OptionalVersionedTextDocumentIdentifier2.is = is;
795
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
796
+ var TextDocumentItem;
797
+ (function(TextDocumentItem2) {
798
+ function create(uri, languageId, version, text) {
799
+ return { uri, languageId, version, text };
800
+ }
801
+ TextDocumentItem2.create = create;
802
+ function is(value) {
803
+ var candidate = value;
804
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
805
+ }
806
+ TextDocumentItem2.is = is;
807
+ })(TextDocumentItem || (TextDocumentItem = {}));
808
+ var MarkupKind;
809
+ (function(MarkupKind2) {
810
+ MarkupKind2.PlainText = "plaintext";
811
+ MarkupKind2.Markdown = "markdown";
812
+ })(MarkupKind || (MarkupKind = {}));
813
+ (function(MarkupKind2) {
814
+ function is(value) {
815
+ var candidate = value;
816
+ return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
817
+ }
818
+ MarkupKind2.is = is;
819
+ })(MarkupKind || (MarkupKind = {}));
820
+ var MarkupContent;
821
+ (function(MarkupContent2) {
822
+ function is(value) {
823
+ var candidate = value;
824
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
825
+ }
826
+ MarkupContent2.is = is;
827
+ })(MarkupContent || (MarkupContent = {}));
828
+ var CompletionItemKind;
829
+ (function(CompletionItemKind2) {
830
+ CompletionItemKind2.Text = 1;
831
+ CompletionItemKind2.Method = 2;
832
+ CompletionItemKind2.Function = 3;
833
+ CompletionItemKind2.Constructor = 4;
834
+ CompletionItemKind2.Field = 5;
835
+ CompletionItemKind2.Variable = 6;
836
+ CompletionItemKind2.Class = 7;
837
+ CompletionItemKind2.Interface = 8;
838
+ CompletionItemKind2.Module = 9;
839
+ CompletionItemKind2.Property = 10;
840
+ CompletionItemKind2.Unit = 11;
841
+ CompletionItemKind2.Value = 12;
842
+ CompletionItemKind2.Enum = 13;
843
+ CompletionItemKind2.Keyword = 14;
844
+ CompletionItemKind2.Snippet = 15;
845
+ CompletionItemKind2.Color = 16;
846
+ CompletionItemKind2.File = 17;
847
+ CompletionItemKind2.Reference = 18;
848
+ CompletionItemKind2.Folder = 19;
849
+ CompletionItemKind2.EnumMember = 20;
850
+ CompletionItemKind2.Constant = 21;
851
+ CompletionItemKind2.Struct = 22;
852
+ CompletionItemKind2.Event = 23;
853
+ CompletionItemKind2.Operator = 24;
854
+ CompletionItemKind2.TypeParameter = 25;
855
+ })(CompletionItemKind || (CompletionItemKind = {}));
856
+ var InsertTextFormat;
857
+ (function(InsertTextFormat2) {
858
+ InsertTextFormat2.PlainText = 1;
859
+ InsertTextFormat2.Snippet = 2;
860
+ })(InsertTextFormat || (InsertTextFormat = {}));
861
+ var CompletionItemTag;
862
+ (function(CompletionItemTag2) {
863
+ CompletionItemTag2.Deprecated = 1;
864
+ })(CompletionItemTag || (CompletionItemTag = {}));
865
+ var InsertReplaceEdit;
866
+ (function(InsertReplaceEdit2) {
867
+ function create(newText, insert, replace) {
868
+ return { newText, insert, replace };
869
+ }
870
+ InsertReplaceEdit2.create = create;
871
+ function is(value) {
872
+ var candidate = value;
873
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
874
+ }
875
+ InsertReplaceEdit2.is = is;
876
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
877
+ var InsertTextMode;
878
+ (function(InsertTextMode2) {
879
+ InsertTextMode2.asIs = 1;
880
+ InsertTextMode2.adjustIndentation = 2;
881
+ })(InsertTextMode || (InsertTextMode = {}));
882
+ var CompletionItem;
883
+ (function(CompletionItem2) {
884
+ function create(label) {
885
+ return { label };
886
+ }
887
+ CompletionItem2.create = create;
888
+ })(CompletionItem || (CompletionItem = {}));
889
+ var CompletionList;
890
+ (function(CompletionList2) {
891
+ function create(items, isIncomplete) {
892
+ return { items: items ? items : [], isIncomplete: !!isIncomplete };
893
+ }
894
+ CompletionList2.create = create;
895
+ })(CompletionList || (CompletionList = {}));
896
+ var MarkedString;
897
+ (function(MarkedString2) {
898
+ function fromPlainText(plainText) {
899
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
900
+ }
901
+ MarkedString2.fromPlainText = fromPlainText;
902
+ function is(value) {
903
+ var candidate = value;
904
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
905
+ }
906
+ MarkedString2.is = is;
907
+ })(MarkedString || (MarkedString = {}));
908
+ var Hover;
909
+ (function(Hover2) {
910
+ function is(value) {
911
+ var candidate = value;
912
+ 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));
913
+ }
914
+ Hover2.is = is;
915
+ })(Hover || (Hover = {}));
916
+ var ParameterInformation;
917
+ (function(ParameterInformation2) {
918
+ function create(label, documentation) {
919
+ return documentation ? { label, documentation } : { label };
920
+ }
921
+ ParameterInformation2.create = create;
922
+ })(ParameterInformation || (ParameterInformation = {}));
923
+ var SignatureInformation;
924
+ (function(SignatureInformation2) {
925
+ function create(label, documentation) {
926
+ var parameters = [];
927
+ for (var _i = 2; _i < arguments.length; _i++) {
928
+ parameters[_i - 2] = arguments[_i];
929
+ }
930
+ var result = { label };
931
+ if (Is.defined(documentation)) {
932
+ result.documentation = documentation;
933
+ }
934
+ if (Is.defined(parameters)) {
935
+ result.parameters = parameters;
936
+ } else {
937
+ result.parameters = [];
938
+ }
939
+ return result;
940
+ }
941
+ SignatureInformation2.create = create;
942
+ })(SignatureInformation || (SignatureInformation = {}));
943
+ var DocumentHighlightKind;
944
+ (function(DocumentHighlightKind2) {
945
+ DocumentHighlightKind2.Text = 1;
946
+ DocumentHighlightKind2.Read = 2;
947
+ DocumentHighlightKind2.Write = 3;
948
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
949
+ var DocumentHighlight;
950
+ (function(DocumentHighlight2) {
951
+ function create(range, kind) {
952
+ var result = { range };
953
+ if (Is.number(kind)) {
954
+ result.kind = kind;
955
+ }
956
+ return result;
957
+ }
958
+ DocumentHighlight2.create = create;
959
+ })(DocumentHighlight || (DocumentHighlight = {}));
960
+ var SymbolKind;
961
+ (function(SymbolKind2) {
962
+ SymbolKind2.File = 1;
963
+ SymbolKind2.Module = 2;
964
+ SymbolKind2.Namespace = 3;
965
+ SymbolKind2.Package = 4;
966
+ SymbolKind2.Class = 5;
967
+ SymbolKind2.Method = 6;
968
+ SymbolKind2.Property = 7;
969
+ SymbolKind2.Field = 8;
970
+ SymbolKind2.Constructor = 9;
971
+ SymbolKind2.Enum = 10;
972
+ SymbolKind2.Interface = 11;
973
+ SymbolKind2.Function = 12;
974
+ SymbolKind2.Variable = 13;
975
+ SymbolKind2.Constant = 14;
976
+ SymbolKind2.String = 15;
977
+ SymbolKind2.Number = 16;
978
+ SymbolKind2.Boolean = 17;
979
+ SymbolKind2.Array = 18;
980
+ SymbolKind2.Object = 19;
981
+ SymbolKind2.Key = 20;
982
+ SymbolKind2.Null = 21;
983
+ SymbolKind2.EnumMember = 22;
984
+ SymbolKind2.Struct = 23;
985
+ SymbolKind2.Event = 24;
986
+ SymbolKind2.Operator = 25;
987
+ SymbolKind2.TypeParameter = 26;
988
+ })(SymbolKind || (SymbolKind = {}));
989
+ var SymbolTag;
990
+ (function(SymbolTag2) {
991
+ SymbolTag2.Deprecated = 1;
992
+ })(SymbolTag || (SymbolTag = {}));
993
+ var SymbolInformation;
994
+ (function(SymbolInformation2) {
995
+ function create(name, kind, range, uri, containerName) {
996
+ var result = {
997
+ name,
998
+ kind,
999
+ location: { uri, range }
1000
+ };
1001
+ if (containerName) {
1002
+ result.containerName = containerName;
1003
+ }
1004
+ return result;
1005
+ }
1006
+ SymbolInformation2.create = create;
1007
+ })(SymbolInformation || (SymbolInformation = {}));
1008
+ var DocumentSymbol;
1009
+ (function(DocumentSymbol2) {
1010
+ function create(name, detail, kind, range, selectionRange, children) {
1011
+ var result = {
1012
+ name,
1013
+ detail,
1014
+ kind,
1015
+ range,
1016
+ selectionRange
1017
+ };
1018
+ if (children !== void 0) {
1019
+ result.children = children;
1020
+ }
1021
+ return result;
1022
+ }
1023
+ DocumentSymbol2.create = create;
1024
+ function is(value) {
1025
+ var candidate = value;
1026
+ 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));
1027
+ }
1028
+ DocumentSymbol2.is = is;
1029
+ })(DocumentSymbol || (DocumentSymbol = {}));
1030
+ var CodeActionKind;
1031
+ (function(CodeActionKind2) {
1032
+ CodeActionKind2.Empty = "";
1033
+ CodeActionKind2.QuickFix = "quickfix";
1034
+ CodeActionKind2.Refactor = "refactor";
1035
+ CodeActionKind2.RefactorExtract = "refactor.extract";
1036
+ CodeActionKind2.RefactorInline = "refactor.inline";
1037
+ CodeActionKind2.RefactorRewrite = "refactor.rewrite";
1038
+ CodeActionKind2.Source = "source";
1039
+ CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
1040
+ CodeActionKind2.SourceFixAll = "source.fixAll";
1041
+ })(CodeActionKind || (CodeActionKind = {}));
1042
+ var CodeActionContext;
1043
+ (function(CodeActionContext2) {
1044
+ function create(diagnostics, only) {
1045
+ var result = { diagnostics };
1046
+ if (only !== void 0 && only !== null) {
1047
+ result.only = only;
1048
+ }
1049
+ return result;
1050
+ }
1051
+ CodeActionContext2.create = create;
1052
+ function is(value) {
1053
+ var candidate = value;
1054
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
1055
+ }
1056
+ CodeActionContext2.is = is;
1057
+ })(CodeActionContext || (CodeActionContext = {}));
1058
+ var CodeAction;
1059
+ (function(CodeAction2) {
1060
+ function create(title, kindOrCommandOrEdit, kind) {
1061
+ var result = { title };
1062
+ var checkKind = true;
1063
+ if (typeof kindOrCommandOrEdit === "string") {
1064
+ checkKind = false;
1065
+ result.kind = kindOrCommandOrEdit;
1066
+ } else if (Command.is(kindOrCommandOrEdit)) {
1067
+ result.command = kindOrCommandOrEdit;
1068
+ } else {
1069
+ result.edit = kindOrCommandOrEdit;
1070
+ }
1071
+ if (checkKind && kind !== void 0) {
1072
+ result.kind = kind;
1073
+ }
1074
+ return result;
1075
+ }
1076
+ CodeAction2.create = create;
1077
+ function is(value) {
1078
+ var candidate = value;
1079
+ 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));
1080
+ }
1081
+ CodeAction2.is = is;
1082
+ })(CodeAction || (CodeAction = {}));
1083
+ var CodeLens;
1084
+ (function(CodeLens2) {
1085
+ function create(range, data) {
1086
+ var result = { range };
1087
+ if (Is.defined(data)) {
1088
+ result.data = data;
1089
+ }
1090
+ return result;
1091
+ }
1092
+ CodeLens2.create = create;
1093
+ function is(value) {
1094
+ var candidate = value;
1095
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1096
+ }
1097
+ CodeLens2.is = is;
1098
+ })(CodeLens || (CodeLens = {}));
1099
+ var FormattingOptions;
1100
+ (function(FormattingOptions2) {
1101
+ function create(tabSize, insertSpaces) {
1102
+ return { tabSize, insertSpaces };
1103
+ }
1104
+ FormattingOptions2.create = create;
1105
+ function is(value) {
1106
+ var candidate = value;
1107
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1108
+ }
1109
+ FormattingOptions2.is = is;
1110
+ })(FormattingOptions || (FormattingOptions = {}));
1111
+ var DocumentLink;
1112
+ (function(DocumentLink2) {
1113
+ function create(range, target, data) {
1114
+ return { range, target, data };
1115
+ }
1116
+ DocumentLink2.create = create;
1117
+ function is(value) {
1118
+ var candidate = value;
1119
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1120
+ }
1121
+ DocumentLink2.is = is;
1122
+ })(DocumentLink || (DocumentLink = {}));
1123
+ var SelectionRange;
1124
+ (function(SelectionRange2) {
1125
+ function create(range, parent) {
1126
+ return { range, parent };
1127
+ }
1128
+ SelectionRange2.create = create;
1129
+ function is(value) {
1130
+ var candidate = value;
1131
+ return candidate !== void 0 && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
1132
+ }
1133
+ SelectionRange2.is = is;
1134
+ })(SelectionRange || (SelectionRange = {}));
1135
+ var TextDocument;
1136
+ (function(TextDocument2) {
1137
+ function create(uri, languageId, version, content) {
1138
+ return new FullTextDocument(uri, languageId, version, content);
1139
+ }
1140
+ TextDocument2.create = create;
1141
+ function is(value) {
1142
+ var candidate = value;
1143
+ 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;
1144
+ }
1145
+ TextDocument2.is = is;
1146
+ function applyEdits(document, edits) {
1147
+ var text = document.getText();
1148
+ var sortedEdits = mergeSort(edits, function(a, b) {
1149
+ var diff = a.range.start.line - b.range.start.line;
1150
+ if (diff === 0) {
1151
+ return a.range.start.character - b.range.start.character;
1152
+ }
1153
+ return diff;
1154
+ });
1155
+ var lastModifiedOffset = text.length;
1156
+ for (var i = sortedEdits.length - 1; i >= 0; i--) {
1157
+ var e = sortedEdits[i];
1158
+ var startOffset = document.offsetAt(e.range.start);
1159
+ var endOffset = document.offsetAt(e.range.end);
1160
+ if (endOffset <= lastModifiedOffset) {
1161
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1162
+ } else {
1163
+ throw new Error("Overlapping edit");
1164
+ }
1165
+ lastModifiedOffset = startOffset;
1166
+ }
1167
+ return text;
1168
+ }
1169
+ TextDocument2.applyEdits = applyEdits;
1170
+ function mergeSort(data, compare) {
1171
+ if (data.length <= 1) {
1172
+ return data;
1173
+ }
1174
+ var p = data.length / 2 | 0;
1175
+ var left = data.slice(0, p);
1176
+ var right = data.slice(p);
1177
+ mergeSort(left, compare);
1178
+ mergeSort(right, compare);
1179
+ var leftIdx = 0;
1180
+ var rightIdx = 0;
1181
+ var i = 0;
1182
+ while (leftIdx < left.length && rightIdx < right.length) {
1183
+ var ret = compare(left[leftIdx], right[rightIdx]);
1184
+ if (ret <= 0) {
1185
+ data[i++] = left[leftIdx++];
1186
+ } else {
1187
+ data[i++] = right[rightIdx++];
1188
+ }
1189
+ }
1190
+ while (leftIdx < left.length) {
1191
+ data[i++] = left[leftIdx++];
1192
+ }
1193
+ while (rightIdx < right.length) {
1194
+ data[i++] = right[rightIdx++];
1195
+ }
1196
+ return data;
1197
+ }
1198
+ })(TextDocument || (TextDocument = {}));
1199
+ var FullTextDocument = function() {
1200
+ function FullTextDocument2(uri, languageId, version, content) {
1201
+ this._uri = uri;
1202
+ this._languageId = languageId;
1203
+ this._version = version;
1204
+ this._content = content;
1205
+ this._lineOffsets = void 0;
1206
+ }
1207
+ Object.defineProperty(FullTextDocument2.prototype, "uri", {
1208
+ get: function() {
1209
+ return this._uri;
1210
+ },
1211
+ enumerable: false,
1212
+ configurable: true
1213
+ });
1214
+ Object.defineProperty(FullTextDocument2.prototype, "languageId", {
1215
+ get: function() {
1216
+ return this._languageId;
1217
+ },
1218
+ enumerable: false,
1219
+ configurable: true
1220
+ });
1221
+ Object.defineProperty(FullTextDocument2.prototype, "version", {
1222
+ get: function() {
1223
+ return this._version;
1224
+ },
1225
+ enumerable: false,
1226
+ configurable: true
1227
+ });
1228
+ FullTextDocument2.prototype.getText = function(range) {
1229
+ if (range) {
1230
+ var start = this.offsetAt(range.start);
1231
+ var end = this.offsetAt(range.end);
1232
+ return this._content.substring(start, end);
1233
+ }
1234
+ return this._content;
1235
+ };
1236
+ FullTextDocument2.prototype.update = function(event, version) {
1237
+ this._content = event.text;
1238
+ this._version = version;
1239
+ this._lineOffsets = void 0;
1240
+ };
1241
+ FullTextDocument2.prototype.getLineOffsets = function() {
1242
+ if (this._lineOffsets === void 0) {
1243
+ var lineOffsets = [];
1244
+ var text = this._content;
1245
+ var isLineStart = true;
1246
+ for (var i = 0; i < text.length; i++) {
1247
+ if (isLineStart) {
1248
+ lineOffsets.push(i);
1249
+ isLineStart = false;
1250
+ }
1251
+ var ch = text.charAt(i);
1252
+ isLineStart = ch === "\r" || ch === "\n";
1253
+ if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
1254
+ i++;
1255
+ }
1256
+ }
1257
+ if (isLineStart && text.length > 0) {
1258
+ lineOffsets.push(text.length);
1259
+ }
1260
+ this._lineOffsets = lineOffsets;
1261
+ }
1262
+ return this._lineOffsets;
1263
+ };
1264
+ FullTextDocument2.prototype.positionAt = function(offset) {
1265
+ offset = Math.max(Math.min(offset, this._content.length), 0);
1266
+ var lineOffsets = this.getLineOffsets();
1267
+ var low = 0, high = lineOffsets.length;
1268
+ if (high === 0) {
1269
+ return Position.create(0, offset);
1270
+ }
1271
+ while (low < high) {
1272
+ var mid = Math.floor((low + high) / 2);
1273
+ if (lineOffsets[mid] > offset) {
1274
+ high = mid;
1275
+ } else {
1276
+ low = mid + 1;
1277
+ }
1278
+ }
1279
+ var line = low - 1;
1280
+ return Position.create(line, offset - lineOffsets[line]);
1281
+ };
1282
+ FullTextDocument2.prototype.offsetAt = function(position) {
1283
+ var lineOffsets = this.getLineOffsets();
1284
+ if (position.line >= lineOffsets.length) {
1285
+ return this._content.length;
1286
+ } else if (position.line < 0) {
1287
+ return 0;
1288
+ }
1289
+ var lineOffset = lineOffsets[position.line];
1290
+ var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
1291
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1292
+ };
1293
+ Object.defineProperty(FullTextDocument2.prototype, "lineCount", {
1294
+ get: function() {
1295
+ return this.getLineOffsets().length;
1296
+ },
1297
+ enumerable: false,
1298
+ configurable: true
1299
+ });
1300
+ return FullTextDocument2;
1301
+ }();
1302
+ var Is;
1303
+ (function(Is2) {
1304
+ var toString = Object.prototype.toString;
1305
+ function defined(value) {
1306
+ return typeof value !== "undefined";
1307
+ }
1308
+ Is2.defined = defined;
1309
+ function undefined2(value) {
1310
+ return typeof value === "undefined";
1311
+ }
1312
+ Is2.undefined = undefined2;
1313
+ function boolean(value) {
1314
+ return value === true || value === false;
1315
+ }
1316
+ Is2.boolean = boolean;
1317
+ function string(value) {
1318
+ return toString.call(value) === "[object String]";
1319
+ }
1320
+ Is2.string = string;
1321
+ function number(value) {
1322
+ return toString.call(value) === "[object Number]";
1323
+ }
1324
+ Is2.number = number;
1325
+ function numberRange(value, min, max) {
1326
+ return toString.call(value) === "[object Number]" && min <= value && value <= max;
1327
+ }
1328
+ Is2.numberRange = numberRange;
1329
+ function integer2(value) {
1330
+ return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
1331
+ }
1332
+ Is2.integer = integer2;
1333
+ function uinteger2(value) {
1334
+ return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
1335
+ }
1336
+ Is2.uinteger = uinteger2;
1337
+ function func(value) {
1338
+ return toString.call(value) === "[object Function]";
1339
+ }
1340
+ Is2.func = func;
1341
+ function objectLiteral(value) {
1342
+ return value !== null && typeof value === "object";
1343
+ }
1344
+ Is2.objectLiteral = objectLiteral;
1345
+ function typedArray(value, check) {
1346
+ return Array.isArray(value) && value.every(check);
1347
+ }
1348
+ Is2.typedArray = typedArray;
1349
+ })(Is || (Is = {}));
1350
+ var DiagnosticsAdapter = class {
1351
+ constructor(_languageId, _worker, configChangeEvent) {
1352
+ __publicField(this, "_disposables", []);
1353
+ __publicField(this, "_listener", /* @__PURE__ */ Object.create(null));
1354
+ this._languageId = _languageId;
1355
+ this._worker = _worker;
1356
+ const onModelAdd = (model) => {
1357
+ let modeId = model.getLanguageId();
1358
+ if (modeId !== this._languageId) {
1359
+ return;
1360
+ }
1361
+ let handle;
1362
+ this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
1363
+ window.clearTimeout(handle);
1364
+ handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
1365
+ });
1366
+ this._doValidate(model.uri, modeId);
1367
+ };
1368
+ const onModelRemoved = (model) => {
1369
+ monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);
1370
+ let uriStr = model.uri.toString();
1371
+ let listener = this._listener[uriStr];
1372
+ if (listener) {
1373
+ listener.dispose();
1374
+ delete this._listener[uriStr];
1375
+ }
1376
+ };
1377
+ this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd));
1378
+ this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved));
1379
+ this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
1380
+ onModelRemoved(event.model);
1381
+ onModelAdd(event.model);
1382
+ }));
1383
+ this._disposables.push(configChangeEvent((_) => {
1384
+ monaco_editor_core_exports.editor.getModels().forEach((model) => {
1385
+ if (model.getLanguageId() === this._languageId) {
1386
+ onModelRemoved(model);
1387
+ onModelAdd(model);
1388
+ }
1389
+ });
1390
+ }));
1391
+ this._disposables.push({
1392
+ dispose: () => {
1393
+ monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);
1394
+ for (let key in this._listener) {
1395
+ this._listener[key].dispose();
1396
+ }
1397
+ }
1398
+ });
1399
+ monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);
1400
+ }
1401
+ dispose() {
1402
+ this._disposables.forEach((d) => d && d.dispose());
1403
+ this._disposables.length = 0;
1404
+ }
1405
+ _doValidate(resource, languageId) {
1406
+ this._worker(resource).then((worker) => {
1407
+ return worker.doValidation(resource.toString());
1408
+ }).then((diagnostics) => {
1409
+ const markers = diagnostics.map((d) => toDiagnostics(resource, d));
1410
+ let model = monaco_editor_core_exports.editor.getModel(resource);
1411
+ if (model && model.getLanguageId() === languageId) {
1412
+ monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);
1413
+ }
1414
+ }).then(void 0, (err) => {
1415
+ console.error(err);
1416
+ });
1417
+ }
1418
+ };
1419
+ function toSeverity(lsSeverity) {
1420
+ switch (lsSeverity) {
1421
+ case DiagnosticSeverity.Error:
1422
+ return monaco_editor_core_exports.MarkerSeverity.Error;
1423
+ case DiagnosticSeverity.Warning:
1424
+ return monaco_editor_core_exports.MarkerSeverity.Warning;
1425
+ case DiagnosticSeverity.Information:
1426
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1427
+ case DiagnosticSeverity.Hint:
1428
+ return monaco_editor_core_exports.MarkerSeverity.Hint;
1429
+ default:
1430
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1431
+ }
1432
+ }
1433
+ function toDiagnostics(resource, diag) {
1434
+ let code = typeof diag.code === "number" ? String(diag.code) : diag.code;
1435
+ return {
1436
+ severity: toSeverity(diag.severity),
1437
+ startLineNumber: diag.range.start.line + 1,
1438
+ startColumn: diag.range.start.character + 1,
1439
+ endLineNumber: diag.range.end.line + 1,
1440
+ endColumn: diag.range.end.character + 1,
1441
+ message: diag.message,
1442
+ code,
1443
+ source: diag.source
1444
+ };
1445
+ }
1446
+ var CompletionAdapter = class {
1447
+ constructor(_worker, _triggerCharacters) {
1448
+ this._worker = _worker;
1449
+ this._triggerCharacters = _triggerCharacters;
1450
+ }
1451
+ get triggerCharacters() {
1452
+ return this._triggerCharacters;
1453
+ }
1454
+ provideCompletionItems(model, position, context, token) {
1455
+ const resource = model.uri;
1456
+ return this._worker(resource).then((worker) => {
1457
+ return worker.doComplete(resource.toString(), fromPosition(position));
1458
+ }).then((info) => {
1459
+ if (!info) {
1460
+ return;
1461
+ }
1462
+ const wordInfo = model.getWordUntilPosition(position);
1463
+ const wordRange = new monaco_editor_core_exports.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1464
+ const items = info.items.map((entry) => {
1465
+ const item = {
1466
+ label: entry.label,
1467
+ insertText: entry.insertText || entry.label,
1468
+ sortText: entry.sortText,
1469
+ filterText: entry.filterText,
1470
+ documentation: entry.documentation,
1471
+ detail: entry.detail,
1472
+ command: toCommand(entry.command),
1473
+ range: wordRange,
1474
+ kind: toCompletionItemKind(entry.kind)
1475
+ };
1476
+ if (entry.textEdit) {
1477
+ if (isInsertReplaceEdit(entry.textEdit)) {
1478
+ item.range = {
1479
+ insert: toRange(entry.textEdit.insert),
1480
+ replace: toRange(entry.textEdit.replace)
1481
+ };
1482
+ } else {
1483
+ item.range = toRange(entry.textEdit.range);
1484
+ }
1485
+ item.insertText = entry.textEdit.newText;
1486
+ }
1487
+ if (entry.additionalTextEdits) {
1488
+ item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
1489
+ }
1490
+ if (entry.insertTextFormat === InsertTextFormat.Snippet) {
1491
+ item.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet;
1492
+ }
1493
+ return item;
1494
+ });
1495
+ return {
1496
+ isIncomplete: info.isIncomplete,
1497
+ suggestions: items
1498
+ };
1499
+ });
1500
+ }
1501
+ };
1502
+ function fromPosition(position) {
1503
+ if (!position) {
1504
+ return void 0;
1505
+ }
1506
+ return { character: position.column - 1, line: position.lineNumber - 1 };
1507
+ }
1508
+ function fromRange(range) {
1509
+ if (!range) {
1510
+ return void 0;
1511
+ }
1512
+ return {
1513
+ start: {
1514
+ line: range.startLineNumber - 1,
1515
+ character: range.startColumn - 1
1516
+ },
1517
+ end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
1518
+ };
1519
+ }
1520
+ function toRange(range) {
1521
+ if (!range) {
1522
+ return void 0;
1523
+ }
1524
+ return new monaco_editor_core_exports.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
1525
+ }
1526
+ function isInsertReplaceEdit(edit) {
1527
+ return typeof edit.insert !== "undefined" && typeof edit.replace !== "undefined";
1528
+ }
1529
+ function toCompletionItemKind(kind) {
1530
+ const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;
1531
+ switch (kind) {
1532
+ case CompletionItemKind.Text:
1533
+ return mItemKind.Text;
1534
+ case CompletionItemKind.Method:
1535
+ return mItemKind.Method;
1536
+ case CompletionItemKind.Function:
1537
+ return mItemKind.Function;
1538
+ case CompletionItemKind.Constructor:
1539
+ return mItemKind.Constructor;
1540
+ case CompletionItemKind.Field:
1541
+ return mItemKind.Field;
1542
+ case CompletionItemKind.Variable:
1543
+ return mItemKind.Variable;
1544
+ case CompletionItemKind.Class:
1545
+ return mItemKind.Class;
1546
+ case CompletionItemKind.Interface:
1547
+ return mItemKind.Interface;
1548
+ case CompletionItemKind.Module:
1549
+ return mItemKind.Module;
1550
+ case CompletionItemKind.Property:
1551
+ return mItemKind.Property;
1552
+ case CompletionItemKind.Unit:
1553
+ return mItemKind.Unit;
1554
+ case CompletionItemKind.Value:
1555
+ return mItemKind.Value;
1556
+ case CompletionItemKind.Enum:
1557
+ return mItemKind.Enum;
1558
+ case CompletionItemKind.Keyword:
1559
+ return mItemKind.Keyword;
1560
+ case CompletionItemKind.Snippet:
1561
+ return mItemKind.Snippet;
1562
+ case CompletionItemKind.Color:
1563
+ return mItemKind.Color;
1564
+ case CompletionItemKind.File:
1565
+ return mItemKind.File;
1566
+ case CompletionItemKind.Reference:
1567
+ return mItemKind.Reference;
1568
+ }
1569
+ return mItemKind.Property;
1570
+ }
1571
+ function toTextEdit(textEdit) {
1572
+ if (!textEdit) {
1573
+ return void 0;
1574
+ }
1575
+ return {
1576
+ range: toRange(textEdit.range),
1577
+ text: textEdit.newText
1578
+ };
1579
+ }
1580
+ function toCommand(c) {
1581
+ return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
1582
+ }
1583
+ var HoverAdapter = class {
1584
+ constructor(_worker) {
1585
+ this._worker = _worker;
1586
+ }
1587
+ provideHover(model, position, token) {
1588
+ let resource = model.uri;
1589
+ return this._worker(resource).then((worker) => {
1590
+ return worker.doHover(resource.toString(), fromPosition(position));
1591
+ }).then((info) => {
1592
+ if (!info) {
1593
+ return;
1594
+ }
1595
+ return {
1596
+ range: toRange(info.range),
1597
+ contents: toMarkedStringArray(info.contents)
1598
+ };
1599
+ });
1600
+ }
1601
+ };
1602
+ function isMarkupContent(thing) {
1603
+ return thing && typeof thing === "object" && typeof thing.kind === "string";
1604
+ }
1605
+ function toMarkdownString(entry) {
1606
+ if (typeof entry === "string") {
1607
+ return {
1608
+ value: entry
1609
+ };
1610
+ }
1611
+ if (isMarkupContent(entry)) {
1612
+ if (entry.kind === "plaintext") {
1613
+ return {
1614
+ value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1615
+ };
1616
+ }
1617
+ return {
1618
+ value: entry.value
1619
+ };
1620
+ }
1621
+ return { value: "```" + entry.language + "\n" + entry.value + "\n```\n" };
1622
+ }
1623
+ function toMarkedStringArray(contents) {
1624
+ if (!contents) {
1625
+ return void 0;
1626
+ }
1627
+ if (Array.isArray(contents)) {
1628
+ return contents.map(toMarkdownString);
1629
+ }
1630
+ return [toMarkdownString(contents)];
1631
+ }
1632
+ var DocumentHighlightAdapter = class {
1633
+ constructor(_worker) {
1634
+ this._worker = _worker;
1635
+ }
1636
+ provideDocumentHighlights(model, position, token) {
1637
+ const resource = model.uri;
1638
+ return this._worker(resource).then((worker) => worker.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
1639
+ if (!entries) {
1640
+ return;
1641
+ }
1642
+ return entries.map((entry) => {
1643
+ return {
1644
+ range: toRange(entry.range),
1645
+ kind: toDocumentHighlightKind(entry.kind)
1646
+ };
1647
+ });
1648
+ });
1649
+ }
1650
+ };
1651
+ function toDocumentHighlightKind(kind) {
1652
+ switch (kind) {
1653
+ case DocumentHighlightKind.Read:
1654
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
1655
+ case DocumentHighlightKind.Write:
1656
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
1657
+ case DocumentHighlightKind.Text:
1658
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1659
+ }
1660
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1661
+ }
1662
+ var DefinitionAdapter = class {
1663
+ constructor(_worker) {
1664
+ this._worker = _worker;
1665
+ }
1666
+ provideDefinition(model, position, token) {
1667
+ const resource = model.uri;
1668
+ return this._worker(resource).then((worker) => {
1669
+ return worker.findDefinition(resource.toString(), fromPosition(position));
1670
+ }).then((definition) => {
1671
+ if (!definition) {
1672
+ return;
1673
+ }
1674
+ return [toLocation(definition)];
1675
+ });
1676
+ }
1677
+ };
1678
+ function toLocation(location) {
1679
+ return {
1680
+ uri: monaco_editor_core_exports.Uri.parse(location.uri),
1681
+ range: toRange(location.range)
1682
+ };
1683
+ }
1684
+ var ReferenceAdapter = class {
1685
+ constructor(_worker) {
1686
+ this._worker = _worker;
1687
+ }
1688
+ provideReferences(model, position, context, token) {
1689
+ const resource = model.uri;
1690
+ return this._worker(resource).then((worker) => {
1691
+ return worker.findReferences(resource.toString(), fromPosition(position));
1692
+ }).then((entries) => {
1693
+ if (!entries) {
1694
+ return;
1695
+ }
1696
+ return entries.map(toLocation);
1697
+ });
1698
+ }
1699
+ };
1700
+ var RenameAdapter = class {
1701
+ constructor(_worker) {
1702
+ this._worker = _worker;
1703
+ }
1704
+ provideRenameEdits(model, position, newName, token) {
1705
+ const resource = model.uri;
1706
+ return this._worker(resource).then((worker) => {
1707
+ return worker.doRename(resource.toString(), fromPosition(position), newName);
1708
+ }).then((edit) => {
1709
+ return toWorkspaceEdit(edit);
1710
+ });
1711
+ }
1712
+ };
1713
+ function toWorkspaceEdit(edit) {
1714
+ if (!edit || !edit.changes) {
1715
+ return void 0;
1716
+ }
1717
+ let resourceEdits = [];
1718
+ for (let uri in edit.changes) {
1719
+ const _uri = monaco_editor_core_exports.Uri.parse(uri);
1720
+ for (let e of edit.changes[uri]) {
1721
+ resourceEdits.push({
1722
+ resource: _uri,
1723
+ versionId: void 0,
1724
+ textEdit: {
1725
+ range: toRange(e.range),
1726
+ text: e.newText
1727
+ }
1728
+ });
1729
+ }
1730
+ }
1731
+ return {
1732
+ edits: resourceEdits
1733
+ };
1734
+ }
1735
+ var DocumentSymbolAdapter = class {
1736
+ constructor(_worker) {
1737
+ this._worker = _worker;
1738
+ }
1739
+ provideDocumentSymbols(model, token) {
1740
+ const resource = model.uri;
1741
+ return this._worker(resource).then((worker) => worker.findDocumentSymbols(resource.toString())).then((items) => {
1742
+ if (!items) {
1743
+ return;
1744
+ }
1745
+ return items.map((item) => ({
1746
+ name: item.name,
1747
+ detail: "",
1748
+ containerName: item.containerName,
1749
+ kind: toSymbolKind(item.kind),
1750
+ range: toRange(item.location.range),
1751
+ selectionRange: toRange(item.location.range),
1752
+ tags: []
1753
+ }));
1754
+ });
1755
+ }
1756
+ };
1757
+ function toSymbolKind(kind) {
1758
+ let mKind = monaco_editor_core_exports.languages.SymbolKind;
1759
+ switch (kind) {
1760
+ case SymbolKind.File:
1761
+ return mKind.Array;
1762
+ case SymbolKind.Module:
1763
+ return mKind.Module;
1764
+ case SymbolKind.Namespace:
1765
+ return mKind.Namespace;
1766
+ case SymbolKind.Package:
1767
+ return mKind.Package;
1768
+ case SymbolKind.Class:
1769
+ return mKind.Class;
1770
+ case SymbolKind.Method:
1771
+ return mKind.Method;
1772
+ case SymbolKind.Property:
1773
+ return mKind.Property;
1774
+ case SymbolKind.Field:
1775
+ return mKind.Field;
1776
+ case SymbolKind.Constructor:
1777
+ return mKind.Constructor;
1778
+ case SymbolKind.Enum:
1779
+ return mKind.Enum;
1780
+ case SymbolKind.Interface:
1781
+ return mKind.Interface;
1782
+ case SymbolKind.Function:
1783
+ return mKind.Function;
1784
+ case SymbolKind.Variable:
1785
+ return mKind.Variable;
1786
+ case SymbolKind.Constant:
1787
+ return mKind.Constant;
1788
+ case SymbolKind.String:
1789
+ return mKind.String;
1790
+ case SymbolKind.Number:
1791
+ return mKind.Number;
1792
+ case SymbolKind.Boolean:
1793
+ return mKind.Boolean;
1794
+ case SymbolKind.Array:
1795
+ return mKind.Array;
1796
+ }
1797
+ return mKind.Function;
1798
+ }
1799
+ var DocumentLinkAdapter = class {
1800
+ constructor(_worker) {
1801
+ this._worker = _worker;
1802
+ }
1803
+ provideLinks(model, token) {
1804
+ const resource = model.uri;
1805
+ return this._worker(resource).then((worker) => worker.findDocumentLinks(resource.toString())).then((items) => {
1806
+ if (!items) {
1807
+ return;
1808
+ }
1809
+ return {
1810
+ links: items.map((item) => ({
1811
+ range: toRange(item.range),
1812
+ url: item.target
1813
+ }))
1814
+ };
1815
+ });
1816
+ }
1817
+ };
1818
+ var DocumentFormattingEditProvider = class {
1819
+ constructor(_worker) {
1820
+ this._worker = _worker;
1821
+ }
1822
+ provideDocumentFormattingEdits(model, options, token) {
1823
+ const resource = model.uri;
1824
+ return this._worker(resource).then((worker) => {
1825
+ return worker.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
1826
+ if (!edits || edits.length === 0) {
1827
+ return;
1828
+ }
1829
+ return edits.map(toTextEdit);
1830
+ });
1831
+ });
1832
+ }
1833
+ };
1834
+ var DocumentRangeFormattingEditProvider = class {
1835
+ constructor(_worker) {
1836
+ this._worker = _worker;
1837
+ }
1838
+ provideDocumentRangeFormattingEdits(model, range, options, token) {
1839
+ const resource = model.uri;
1840
+ return this._worker(resource).then((worker) => {
1841
+ return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
1842
+ if (!edits || edits.length === 0) {
1843
+ return;
1844
+ }
1845
+ return edits.map(toTextEdit);
1846
+ });
1847
+ });
1848
+ }
1849
+ };
1850
+ function fromFormattingOptions(options) {
1851
+ return {
1852
+ tabSize: options.tabSize,
1853
+ insertSpaces: options.insertSpaces
1854
+ };
1855
+ }
1856
+ var DocumentColorAdapter = class {
1857
+ constructor(_worker) {
1858
+ this._worker = _worker;
1859
+ }
1860
+ provideDocumentColors(model, token) {
1861
+ const resource = model.uri;
1862
+ return this._worker(resource).then((worker) => worker.findDocumentColors(resource.toString())).then((infos) => {
1863
+ if (!infos) {
1864
+ return;
1865
+ }
1866
+ return infos.map((item) => ({
1867
+ color: item.color,
1868
+ range: toRange(item.range)
1869
+ }));
1870
+ });
1871
+ }
1872
+ provideColorPresentations(model, info, token) {
1873
+ const resource = model.uri;
1874
+ return this._worker(resource).then((worker) => worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range))).then((presentations) => {
1875
+ if (!presentations) {
1876
+ return;
1877
+ }
1878
+ return presentations.map((presentation) => {
1879
+ let item = {
1880
+ label: presentation.label
1881
+ };
1882
+ if (presentation.textEdit) {
1883
+ item.textEdit = toTextEdit(presentation.textEdit);
1884
+ }
1885
+ if (presentation.additionalTextEdits) {
1886
+ item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);
1887
+ }
1888
+ return item;
1889
+ });
1890
+ });
1891
+ }
1892
+ };
1893
+ var FoldingRangeAdapter = class {
1894
+ constructor(_worker) {
1895
+ this._worker = _worker;
1896
+ }
1897
+ provideFoldingRanges(model, context, token) {
1898
+ const resource = model.uri;
1899
+ return this._worker(resource).then((worker) => worker.getFoldingRanges(resource.toString(), context)).then((ranges) => {
1900
+ if (!ranges) {
1901
+ return;
1902
+ }
1903
+ return ranges.map((range) => {
1904
+ const result = {
1905
+ start: range.startLine + 1,
1906
+ end: range.endLine + 1
1907
+ };
1908
+ if (typeof range.kind !== "undefined") {
1909
+ result.kind = toFoldingRangeKind(range.kind);
1910
+ }
1911
+ return result;
1912
+ });
1913
+ });
1914
+ }
1915
+ };
1916
+ function toFoldingRangeKind(kind) {
1917
+ switch (kind) {
1918
+ case FoldingRangeKind.Comment:
1919
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
1920
+ case FoldingRangeKind.Imports:
1921
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
1922
+ case FoldingRangeKind.Region:
1923
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
1924
+ }
1925
+ return void 0;
1926
+ }
1927
+ var SelectionRangeAdapter = class {
1928
+ constructor(_worker) {
1929
+ this._worker = _worker;
1930
+ }
1931
+ provideSelectionRanges(model, positions, token) {
1932
+ const resource = model.uri;
1933
+ return this._worker(resource).then((worker) => worker.getSelectionRanges(resource.toString(), positions.map(fromPosition))).then((selectionRanges) => {
1934
+ if (!selectionRanges) {
1935
+ return;
1936
+ }
1937
+ return selectionRanges.map((selectionRange) => {
1938
+ const result = [];
1939
+ while (selectionRange) {
1940
+ result.push({ range: toRange(selectionRange.range) });
1941
+ selectionRange = selectionRange.parent;
1942
+ }
1943
+ return result;
1944
+ });
1945
+ });
1946
+ }
1947
+ };
1948
+ function createScanner(text, ignoreTrivia) {
1949
+ if (ignoreTrivia === void 0) {
1950
+ ignoreTrivia = false;
1951
+ }
1952
+ var len = text.length;
1953
+ var pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
1954
+ function scanHexDigits(count, exact) {
1955
+ var digits = 0;
1956
+ var value2 = 0;
1957
+ while (digits < count || !exact) {
1958
+ var ch = text.charCodeAt(pos);
1959
+ if (ch >= 48 && ch <= 57) {
1960
+ value2 = value2 * 16 + ch - 48;
1961
+ } else if (ch >= 65 && ch <= 70) {
1962
+ value2 = value2 * 16 + ch - 65 + 10;
1963
+ } else if (ch >= 97 && ch <= 102) {
1964
+ value2 = value2 * 16 + ch - 97 + 10;
1965
+ } else {
1966
+ break;
1967
+ }
1968
+ pos++;
1969
+ digits++;
1970
+ }
1971
+ if (digits < count) {
1972
+ value2 = -1;
1973
+ }
1974
+ return value2;
1975
+ }
1976
+ function setPosition(newPosition) {
1977
+ pos = newPosition;
1978
+ value = "";
1979
+ tokenOffset = 0;
1980
+ token = 16;
1981
+ scanError = 0;
1982
+ }
1983
+ function scanNumber() {
1984
+ var start = pos;
1985
+ if (text.charCodeAt(pos) === 48) {
1986
+ pos++;
1987
+ } else {
1988
+ pos++;
1989
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1990
+ pos++;
1991
+ }
1992
+ }
1993
+ if (pos < text.length && text.charCodeAt(pos) === 46) {
1994
+ pos++;
1995
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
1996
+ pos++;
1997
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1998
+ pos++;
1999
+ }
2000
+ } else {
2001
+ scanError = 3;
2002
+ return text.substring(start, pos);
2003
+ }
2004
+ }
2005
+ var end = pos;
2006
+ if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
2007
+ pos++;
2008
+ if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
2009
+ pos++;
2010
+ }
2011
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
2012
+ pos++;
2013
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
2014
+ pos++;
2015
+ }
2016
+ end = pos;
2017
+ } else {
2018
+ scanError = 3;
2019
+ }
2020
+ }
2021
+ return text.substring(start, end);
2022
+ }
2023
+ function scanString() {
2024
+ var result = "", start = pos;
2025
+ while (true) {
2026
+ if (pos >= len) {
2027
+ result += text.substring(start, pos);
2028
+ scanError = 2;
2029
+ break;
2030
+ }
2031
+ var ch = text.charCodeAt(pos);
2032
+ if (ch === 34) {
2033
+ result += text.substring(start, pos);
2034
+ pos++;
2035
+ break;
2036
+ }
2037
+ if (ch === 92) {
2038
+ result += text.substring(start, pos);
2039
+ pos++;
2040
+ if (pos >= len) {
2041
+ scanError = 2;
2042
+ break;
2043
+ }
2044
+ var ch2 = text.charCodeAt(pos++);
2045
+ switch (ch2) {
2046
+ case 34:
2047
+ result += '"';
2048
+ break;
2049
+ case 92:
2050
+ result += "\\";
2051
+ break;
2052
+ case 47:
2053
+ result += "/";
2054
+ break;
2055
+ case 98:
2056
+ result += "\b";
2057
+ break;
2058
+ case 102:
2059
+ result += "\f";
2060
+ break;
2061
+ case 110:
2062
+ result += "\n";
2063
+ break;
2064
+ case 114:
2065
+ result += "\r";
2066
+ break;
2067
+ case 116:
2068
+ result += " ";
2069
+ break;
2070
+ case 117:
2071
+ var ch3 = scanHexDigits(4, true);
2072
+ if (ch3 >= 0) {
2073
+ result += String.fromCharCode(ch3);
2074
+ } else {
2075
+ scanError = 4;
2076
+ }
2077
+ break;
2078
+ default:
2079
+ scanError = 5;
2080
+ }
2081
+ start = pos;
2082
+ continue;
2083
+ }
2084
+ if (ch >= 0 && ch <= 31) {
2085
+ if (isLineBreak(ch)) {
2086
+ result += text.substring(start, pos);
2087
+ scanError = 2;
2088
+ break;
2089
+ } else {
2090
+ scanError = 6;
2091
+ }
2092
+ }
2093
+ pos++;
2094
+ }
2095
+ return result;
2096
+ }
2097
+ function scanNext() {
2098
+ value = "";
2099
+ scanError = 0;
2100
+ tokenOffset = pos;
2101
+ lineStartOffset = lineNumber;
2102
+ prevTokenLineStartOffset = tokenLineStartOffset;
2103
+ if (pos >= len) {
2104
+ tokenOffset = len;
2105
+ return token = 17;
2106
+ }
2107
+ var code = text.charCodeAt(pos);
2108
+ if (isWhiteSpace(code)) {
2109
+ do {
2110
+ pos++;
2111
+ value += String.fromCharCode(code);
2112
+ code = text.charCodeAt(pos);
2113
+ } while (isWhiteSpace(code));
2114
+ return token = 15;
2115
+ }
2116
+ if (isLineBreak(code)) {
2117
+ pos++;
2118
+ value += String.fromCharCode(code);
2119
+ if (code === 13 && text.charCodeAt(pos) === 10) {
2120
+ pos++;
2121
+ value += "\n";
2122
+ }
2123
+ lineNumber++;
2124
+ tokenLineStartOffset = pos;
2125
+ return token = 14;
2126
+ }
2127
+ switch (code) {
2128
+ case 123:
2129
+ pos++;
2130
+ return token = 1;
2131
+ case 125:
2132
+ pos++;
2133
+ return token = 2;
2134
+ case 91:
2135
+ pos++;
2136
+ return token = 3;
2137
+ case 93:
2138
+ pos++;
2139
+ return token = 4;
2140
+ case 58:
2141
+ pos++;
2142
+ return token = 6;
2143
+ case 44:
2144
+ pos++;
2145
+ return token = 5;
2146
+ case 34:
2147
+ pos++;
2148
+ value = scanString();
2149
+ return token = 10;
2150
+ case 47:
2151
+ var start = pos - 1;
2152
+ if (text.charCodeAt(pos + 1) === 47) {
2153
+ pos += 2;
2154
+ while (pos < len) {
2155
+ if (isLineBreak(text.charCodeAt(pos))) {
2156
+ break;
2157
+ }
2158
+ pos++;
2159
+ }
2160
+ value = text.substring(start, pos);
2161
+ return token = 12;
2162
+ }
2163
+ if (text.charCodeAt(pos + 1) === 42) {
2164
+ pos += 2;
2165
+ var safeLength = len - 1;
2166
+ var commentClosed = false;
2167
+ while (pos < safeLength) {
2168
+ var ch = text.charCodeAt(pos);
2169
+ if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
2170
+ pos += 2;
2171
+ commentClosed = true;
2172
+ break;
2173
+ }
2174
+ pos++;
2175
+ if (isLineBreak(ch)) {
2176
+ if (ch === 13 && text.charCodeAt(pos) === 10) {
2177
+ pos++;
2178
+ }
2179
+ lineNumber++;
2180
+ tokenLineStartOffset = pos;
2181
+ }
2182
+ }
2183
+ if (!commentClosed) {
2184
+ pos++;
2185
+ scanError = 1;
2186
+ }
2187
+ value = text.substring(start, pos);
2188
+ return token = 13;
2189
+ }
2190
+ value += String.fromCharCode(code);
2191
+ pos++;
2192
+ return token = 16;
2193
+ case 45:
2194
+ value += String.fromCharCode(code);
2195
+ pos++;
2196
+ if (pos === len || !isDigit(text.charCodeAt(pos))) {
2197
+ return token = 16;
2198
+ }
2199
+ case 48:
2200
+ case 49:
2201
+ case 50:
2202
+ case 51:
2203
+ case 52:
2204
+ case 53:
2205
+ case 54:
2206
+ case 55:
2207
+ case 56:
2208
+ case 57:
2209
+ value += scanNumber();
2210
+ return token = 11;
2211
+ default:
2212
+ while (pos < len && isUnknownContentCharacter(code)) {
2213
+ pos++;
2214
+ code = text.charCodeAt(pos);
2215
+ }
2216
+ if (tokenOffset !== pos) {
2217
+ value = text.substring(tokenOffset, pos);
2218
+ switch (value) {
2219
+ case "true":
2220
+ return token = 8;
2221
+ case "false":
2222
+ return token = 9;
2223
+ case "null":
2224
+ return token = 7;
2225
+ }
2226
+ return token = 16;
2227
+ }
2228
+ value += String.fromCharCode(code);
2229
+ pos++;
2230
+ return token = 16;
2231
+ }
2232
+ }
2233
+ function isUnknownContentCharacter(code) {
2234
+ if (isWhiteSpace(code) || isLineBreak(code)) {
2235
+ return false;
2236
+ }
2237
+ switch (code) {
2238
+ case 125:
2239
+ case 93:
2240
+ case 123:
2241
+ case 91:
2242
+ case 34:
2243
+ case 58:
2244
+ case 44:
2245
+ case 47:
2246
+ return false;
2247
+ }
2248
+ return true;
2249
+ }
2250
+ function scanNextNonTrivia() {
2251
+ var result;
2252
+ do {
2253
+ result = scanNext();
2254
+ } while (result >= 12 && result <= 15);
2255
+ return result;
2256
+ }
2257
+ return {
2258
+ setPosition,
2259
+ getPosition: function() {
2260
+ return pos;
2261
+ },
2262
+ scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
2263
+ getToken: function() {
2264
+ return token;
2265
+ },
2266
+ getTokenValue: function() {
2267
+ return value;
2268
+ },
2269
+ getTokenOffset: function() {
2270
+ return tokenOffset;
2271
+ },
2272
+ getTokenLength: function() {
2273
+ return pos - tokenOffset;
2274
+ },
2275
+ getTokenStartLine: function() {
2276
+ return lineStartOffset;
2277
+ },
2278
+ getTokenStartCharacter: function() {
2279
+ return tokenOffset - prevTokenLineStartOffset;
2280
+ },
2281
+ getTokenError: function() {
2282
+ return scanError;
2283
+ }
2284
+ };
2285
+ }
2286
+ function isWhiteSpace(ch) {
2287
+ return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279;
2288
+ }
2289
+ function isLineBreak(ch) {
2290
+ return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
2291
+ }
2292
+ function isDigit(ch) {
2293
+ return ch >= 48 && ch <= 57;
2294
+ }
2295
+ var ParseOptions;
2296
+ (function(ParseOptions2) {
2297
+ ParseOptions2.DEFAULT = {
2298
+ allowTrailingComma: false
2299
+ };
2300
+ })(ParseOptions || (ParseOptions = {}));
2301
+ var createScanner2 = createScanner;
2302
+ function createTokenizationSupport(supportComments) {
2303
+ return {
2304
+ getInitialState: () => new JSONState(null, null, false, null),
2305
+ tokenize: (line, state) => tokenize(supportComments, line, state)
2306
+ };
2307
+ }
2308
+ var TOKEN_DELIM_OBJECT = "delimiter.bracket.json";
2309
+ var TOKEN_DELIM_ARRAY = "delimiter.array.json";
2310
+ var TOKEN_DELIM_COLON = "delimiter.colon.json";
2311
+ var TOKEN_DELIM_COMMA = "delimiter.comma.json";
2312
+ var TOKEN_VALUE_BOOLEAN = "keyword.json";
2313
+ var TOKEN_VALUE_NULL = "keyword.json";
2314
+ var TOKEN_VALUE_STRING = "string.value.json";
2315
+ var TOKEN_VALUE_NUMBER = "number.json";
2316
+ var TOKEN_PROPERTY_NAME = "string.key.json";
2317
+ var TOKEN_COMMENT_BLOCK = "comment.block.json";
2318
+ var TOKEN_COMMENT_LINE = "comment.line.json";
2319
+ var ParentsStack = class {
2320
+ constructor(parent, type) {
2321
+ this.parent = parent;
2322
+ this.type = type;
2323
+ }
2324
+ static pop(parents) {
2325
+ if (parents) {
2326
+ return parents.parent;
2327
+ }
2328
+ return null;
2329
+ }
2330
+ static push(parents, type) {
2331
+ return new ParentsStack(parents, type);
2332
+ }
2333
+ static equals(a, b) {
2334
+ if (!a && !b) {
2335
+ return true;
2336
+ }
2337
+ if (!a || !b) {
2338
+ return false;
2339
+ }
2340
+ while (a && b) {
2341
+ if (a === b) {
2342
+ return true;
2343
+ }
2344
+ if (a.type !== b.type) {
2345
+ return false;
2346
+ }
2347
+ a = a.parent;
2348
+ b = b.parent;
2349
+ }
2350
+ return true;
2351
+ }
2352
+ };
2353
+ var JSONState = class {
2354
+ constructor(state, scanError, lastWasColon, parents) {
2355
+ __publicField(this, "_state");
2356
+ __publicField(this, "scanError");
2357
+ __publicField(this, "lastWasColon");
2358
+ __publicField(this, "parents");
2359
+ this._state = state;
2360
+ this.scanError = scanError;
2361
+ this.lastWasColon = lastWasColon;
2362
+ this.parents = parents;
2363
+ }
2364
+ clone() {
2365
+ return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents);
2366
+ }
2367
+ equals(other) {
2368
+ if (other === this) {
2369
+ return true;
2370
+ }
2371
+ if (!other || !(other instanceof JSONState)) {
2372
+ return false;
2373
+ }
2374
+ return this.scanError === other.scanError && this.lastWasColon === other.lastWasColon && ParentsStack.equals(this.parents, other.parents);
2375
+ }
2376
+ getStateData() {
2377
+ return this._state;
2378
+ }
2379
+ setStateData(state) {
2380
+ this._state = state;
2381
+ }
2382
+ };
2383
+ function tokenize(comments, line, state, offsetDelta = 0) {
2384
+ let numberOfInsertedCharacters = 0;
2385
+ let adjustOffset = false;
2386
+ switch (state.scanError) {
2387
+ case 2:
2388
+ line = '"' + line;
2389
+ numberOfInsertedCharacters = 1;
2390
+ break;
2391
+ case 1:
2392
+ line = "/*" + line;
2393
+ numberOfInsertedCharacters = 2;
2394
+ break;
2395
+ }
2396
+ const scanner = createScanner2(line);
2397
+ let lastWasColon = state.lastWasColon;
2398
+ let parents = state.parents;
2399
+ const ret = {
2400
+ tokens: [],
2401
+ endState: state.clone()
2402
+ };
2403
+ while (true) {
2404
+ let offset = offsetDelta + scanner.getPosition();
2405
+ let type = "";
2406
+ const kind = scanner.scan();
2407
+ if (kind === 17) {
2408
+ break;
2409
+ }
2410
+ if (offset === offsetDelta + scanner.getPosition()) {
2411
+ throw new Error("Scanner did not advance, next 3 characters are: " + line.substr(scanner.getPosition(), 3));
2412
+ }
2413
+ if (adjustOffset) {
2414
+ offset -= numberOfInsertedCharacters;
2415
+ }
2416
+ adjustOffset = numberOfInsertedCharacters > 0;
2417
+ switch (kind) {
2418
+ case 1:
2419
+ parents = ParentsStack.push(
2420
+ parents,
2421
+ 0
2422
+ /* Object */
2423
+ );
2424
+ type = TOKEN_DELIM_OBJECT;
2425
+ lastWasColon = false;
2426
+ break;
2427
+ case 2:
2428
+ parents = ParentsStack.pop(parents);
2429
+ type = TOKEN_DELIM_OBJECT;
2430
+ lastWasColon = false;
2431
+ break;
2432
+ case 3:
2433
+ parents = ParentsStack.push(
2434
+ parents,
2435
+ 1
2436
+ /* Array */
2437
+ );
2438
+ type = TOKEN_DELIM_ARRAY;
2439
+ lastWasColon = false;
2440
+ break;
2441
+ case 4:
2442
+ parents = ParentsStack.pop(parents);
2443
+ type = TOKEN_DELIM_ARRAY;
2444
+ lastWasColon = false;
2445
+ break;
2446
+ case 6:
2447
+ type = TOKEN_DELIM_COLON;
2448
+ lastWasColon = true;
2449
+ break;
2450
+ case 5:
2451
+ type = TOKEN_DELIM_COMMA;
2452
+ lastWasColon = false;
2453
+ break;
2454
+ case 8:
2455
+ case 9:
2456
+ type = TOKEN_VALUE_BOOLEAN;
2457
+ lastWasColon = false;
2458
+ break;
2459
+ case 7:
2460
+ type = TOKEN_VALUE_NULL;
2461
+ lastWasColon = false;
2462
+ break;
2463
+ case 10:
2464
+ const currentParent = parents ? parents.type : 0;
2465
+ const inArray = currentParent === 1;
2466
+ type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;
2467
+ lastWasColon = false;
2468
+ break;
2469
+ case 11:
2470
+ type = TOKEN_VALUE_NUMBER;
2471
+ lastWasColon = false;
2472
+ break;
2473
+ }
2474
+ if (comments) {
2475
+ switch (kind) {
2476
+ case 12:
2477
+ type = TOKEN_COMMENT_LINE;
2478
+ break;
2479
+ case 13:
2480
+ type = TOKEN_COMMENT_BLOCK;
2481
+ break;
2482
+ }
2483
+ }
2484
+ ret.endState = new JSONState(state.getStateData(), scanner.getTokenError(), lastWasColon, parents);
2485
+ ret.tokens.push({
2486
+ startIndex: offset,
2487
+ scopes: type
2488
+ });
2489
+ }
2490
+ return ret;
2491
+ }
2492
+ var JSONDiagnosticsAdapter = class extends DiagnosticsAdapter {
2493
+ constructor(languageId, worker, defaults) {
2494
+ super(languageId, worker, defaults.onDidChange);
2495
+ this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel((model) => {
2496
+ this._resetSchema(model.uri);
2497
+ }));
2498
+ this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
2499
+ this._resetSchema(event.model.uri);
2500
+ }));
2501
+ }
2502
+ _resetSchema(resource) {
2503
+ this._worker().then((worker) => {
2504
+ worker.resetSchema(resource.toString());
2505
+ });
2506
+ }
2507
+ };
2508
+ function setupMode(defaults) {
2509
+ const disposables = [];
2510
+ const providers = [];
2511
+ const client = new WorkerManager(defaults);
2512
+ disposables.push(client);
2513
+ const worker = (...uris) => {
2514
+ return client.getLanguageServiceWorker(...uris);
2515
+ };
2516
+ function registerProviders() {
2517
+ const { languageId, modeConfiguration: modeConfiguration2 } = defaults;
2518
+ disposeAll(providers);
2519
+ if (modeConfiguration2.documentFormattingEdits) {
2520
+ providers.push(monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)));
2521
+ }
2522
+ if (modeConfiguration2.documentRangeFormattingEdits) {
2523
+ providers.push(monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)));
2524
+ }
2525
+ if (modeConfiguration2.completionItems) {
2526
+ providers.push(monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new CompletionAdapter(worker, [" ", ":", '"'])));
2527
+ }
2528
+ if (modeConfiguration2.hovers) {
2529
+ providers.push(monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker)));
2530
+ }
2531
+ if (modeConfiguration2.documentSymbols) {
2532
+ providers.push(monaco_editor_core_exports.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)));
2533
+ }
2534
+ if (modeConfiguration2.tokens) {
2535
+ providers.push(monaco_editor_core_exports.languages.setTokensProvider(languageId, createTokenizationSupport(true)));
2536
+ }
2537
+ if (modeConfiguration2.colors) {
2538
+ providers.push(monaco_editor_core_exports.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker)));
2539
+ }
2540
+ if (modeConfiguration2.foldingRanges) {
2541
+ providers.push(monaco_editor_core_exports.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)));
2542
+ }
2543
+ if (modeConfiguration2.diagnostics) {
2544
+ providers.push(new JSONDiagnosticsAdapter(languageId, worker, defaults));
2545
+ }
2546
+ if (modeConfiguration2.selectionRanges) {
2547
+ providers.push(monaco_editor_core_exports.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)));
2548
+ }
2549
+ }
2550
+ registerProviders();
2551
+ disposables.push(monaco_editor_core_exports.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration));
2552
+ let modeConfiguration = defaults.modeConfiguration;
2553
+ defaults.onDidChange((newDefaults) => {
2554
+ if (newDefaults.modeConfiguration !== modeConfiguration) {
2555
+ modeConfiguration = newDefaults.modeConfiguration;
2556
+ registerProviders();
2557
+ }
2558
+ });
2559
+ disposables.push(asDisposable(providers));
2560
+ return asDisposable(disposables);
2561
+ }
2562
+ function asDisposable(disposables) {
2563
+ return { dispose: () => disposeAll(disposables) };
2564
+ }
2565
+ function disposeAll(disposables) {
2566
+ while (disposables.length) {
2567
+ disposables.pop().dispose();
2568
+ }
2569
+ }
2570
+ var richEditConfiguration = {
2571
+ wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
2572
+ comments: {
2573
+ lineComment: "//",
2574
+ blockComment: ["/*", "*/"]
2575
+ },
2576
+ brackets: [
2577
+ ["{", "}"],
2578
+ ["[", "]"]
2579
+ ],
2580
+ autoClosingPairs: [
2581
+ { open: "{", close: "}", notIn: ["string"] },
2582
+ { open: "[", close: "]", notIn: ["string"] },
2583
+ { open: '"', close: '"', notIn: ["string"] }
2584
+ ]
2585
+ };
2586
+ export {
2587
+ CompletionAdapter,
2588
+ DefinitionAdapter,
2589
+ DiagnosticsAdapter,
2590
+ DocumentColorAdapter,
2591
+ DocumentFormattingEditProvider,
2592
+ DocumentHighlightAdapter,
2593
+ DocumentLinkAdapter,
2594
+ DocumentRangeFormattingEditProvider,
2595
+ DocumentSymbolAdapter,
2596
+ FoldingRangeAdapter,
2597
+ HoverAdapter,
2598
+ ReferenceAdapter,
2599
+ RenameAdapter,
2600
+ SelectionRangeAdapter,
2601
+ WorkerManager,
2602
+ fromPosition,
2603
+ fromRange,
2604
+ setupMode,
2605
+ toRange,
2606
+ toTextEdit
2607
+ };