@difizen/libro-language-client 0.1.18

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 (298) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/es/common/api.d.ts +38 -0
  4. package/es/common/api.d.ts.map +1 -0
  5. package/es/common/api.js +9 -0
  6. package/es/common/callHierarchy.d.ts +39 -0
  7. package/es/common/callHierarchy.d.ts.map +1 -0
  8. package/es/common/callHierarchy.js +139 -0
  9. package/es/common/client.d.ts +482 -0
  10. package/es/common/client.d.ts.map +1 -0
  11. package/es/common/client.js +2731 -0
  12. package/es/common/codeAction.d.ts +22 -0
  13. package/es/common/codeAction.d.ts.map +1 -0
  14. package/es/common/codeAction.js +149 -0
  15. package/es/common/codeConverter.d.ts +81 -0
  16. package/es/common/codeConverter.d.ts.map +1 -0
  17. package/es/common/codeConverter.js +1040 -0
  18. package/es/common/codeLens.d.ts +26 -0
  19. package/es/common/codeLens.d.ts.map +1 -0
  20. package/es/common/codeLens.js +125 -0
  21. package/es/common/colorProvider.d.ts +27 -0
  22. package/es/common/colorProvider.d.ts.map +1 -0
  23. package/es/common/colorProvider.js +104 -0
  24. package/es/common/completion.d.ts +22 -0
  25. package/es/common/completion.d.ts.map +1 -0
  26. package/es/common/completion.js +130 -0
  27. package/es/common/configuration.d.ts +71 -0
  28. package/es/common/configuration.d.ts.map +1 -0
  29. package/es/common/configuration.js +292 -0
  30. package/es/common/declaration.d.ts +18 -0
  31. package/es/common/declaration.d.ts.map +1 -0
  32. package/es/common/declaration.js +88 -0
  33. package/es/common/definition.d.ts +18 -0
  34. package/es/common/definition.d.ts.map +1 -0
  35. package/es/common/definition.js +80 -0
  36. package/es/common/diagnostic.d.ts +125 -0
  37. package/es/common/diagnostic.d.ts.map +1 -0
  38. package/es/common/diagnostic.js +1442 -0
  39. package/es/common/documentHighlight.d.ts +17 -0
  40. package/es/common/documentHighlight.d.ts.map +1 -0
  41. package/es/common/documentHighlight.js +73 -0
  42. package/es/common/documentLink.d.ts +21 -0
  43. package/es/common/documentLink.d.ts.map +1 -0
  44. package/es/common/documentLink.js +90 -0
  45. package/es/common/documentSymbol.d.ts +20 -0
  46. package/es/common/documentSymbol.d.ts.map +1 -0
  47. package/es/common/documentSymbol.js +134 -0
  48. package/es/common/executeCommand.d.ts +22 -0
  49. package/es/common/executeCommand.d.ts.map +1 -0
  50. package/es/common/executeCommand.js +117 -0
  51. package/es/common/features.d.ts +421 -0
  52. package/es/common/features.d.ts.map +1 -0
  53. package/es/common/features.js +576 -0
  54. package/es/common/fileOperations.d.ts +118 -0
  55. package/es/common/fileOperations.d.ts.map +1 -0
  56. package/es/common/fileOperations.js +705 -0
  57. package/es/common/fileSystemWatcher.d.ts +19 -0
  58. package/es/common/fileSystemWatcher.d.ts.map +1 -0
  59. package/es/common/fileSystemWatcher.js +173 -0
  60. package/es/common/foldingRange.d.ts +22 -0
  61. package/es/common/foldingRange.d.ts.map +1 -0
  62. package/es/common/foldingRange.js +127 -0
  63. package/es/common/formatting.d.ts +41 -0
  64. package/es/common/formatting.d.ts.map +1 -0
  65. package/es/common/formatting.js +233 -0
  66. package/es/common/hover.d.ts +18 -0
  67. package/es/common/hover.d.ts.map +1 -0
  68. package/es/common/hover.js +80 -0
  69. package/es/common/implementation.d.ts +18 -0
  70. package/es/common/implementation.d.ts.map +1 -0
  71. package/es/common/implementation.js +88 -0
  72. package/es/common/inlayHint.d.ts +23 -0
  73. package/es/common/inlayHint.d.ts.map +1 -0
  74. package/es/common/inlayHint.js +187 -0
  75. package/es/common/inlineCompletion.d.ts +20 -0
  76. package/es/common/inlineCompletion.d.ts.map +1 -0
  77. package/es/common/inlineCompletion.js +74 -0
  78. package/es/common/inlineValue.d.ts +21 -0
  79. package/es/common/inlineValue.d.ts.map +1 -0
  80. package/es/common/inlineValue.js +124 -0
  81. package/es/common/linkedEditingRange.d.ts +23 -0
  82. package/es/common/linkedEditingRange.d.ts.map +1 -0
  83. package/es/common/linkedEditingRange.js +94 -0
  84. package/es/common/notebook.d.ts +97 -0
  85. package/es/common/notebook.d.ts.map +1 -0
  86. package/es/common/notebook.js +1444 -0
  87. package/es/common/progress.d.ts +12 -0
  88. package/es/common/progress.d.ts.map +1 -0
  89. package/es/common/progress.js +75 -0
  90. package/es/common/progressPart.d.ts +25 -0
  91. package/es/common/progressPart.d.ts.map +1 -0
  92. package/es/common/progressPart.js +147 -0
  93. package/es/common/protocolCallHierarchyItem.d.ts +9 -0
  94. package/es/common/protocolCallHierarchyItem.d.ts.map +1 -0
  95. package/es/common/protocolCallHierarchyItem.js +34 -0
  96. package/es/common/protocolCodeAction.d.ts +7 -0
  97. package/es/common/protocolCodeAction.d.ts.map +1 -0
  98. package/es/common/protocolCodeAction.js +32 -0
  99. package/es/common/protocolCodeLens.d.ts +7 -0
  100. package/es/common/protocolCodeLens.d.ts.map +1 -0
  101. package/es/common/protocolCodeLens.js +29 -0
  102. package/es/common/protocolCompletionItem.d.ts +13 -0
  103. package/es/common/protocolCompletionItem.d.ts.map +1 -0
  104. package/es/common/protocolCompletionItem.js +29 -0
  105. package/es/common/protocolConverter.d.ts +174 -0
  106. package/es/common/protocolConverter.d.ts.map +1 -0
  107. package/es/common/protocolConverter.js +1982 -0
  108. package/es/common/protocolDiagnostic.d.ts +20 -0
  109. package/es/common/protocolDiagnostic.d.ts.map +1 -0
  110. package/es/common/protocolDiagnostic.js +46 -0
  111. package/es/common/protocolDocumentLink.d.ts +8 -0
  112. package/es/common/protocolDocumentLink.d.ts.map +1 -0
  113. package/es/common/protocolDocumentLink.js +29 -0
  114. package/es/common/protocolInlayHint.d.ts +8 -0
  115. package/es/common/protocolInlayHint.d.ts.map +1 -0
  116. package/es/common/protocolInlayHint.js +29 -0
  117. package/es/common/protocolTypeHierarchyItem.d.ts +9 -0
  118. package/es/common/protocolTypeHierarchyItem.d.ts.map +1 -0
  119. package/es/common/protocolTypeHierarchyItem.js +34 -0
  120. package/es/common/protocolWorkspaceSymbol.d.ts +9 -0
  121. package/es/common/protocolWorkspaceSymbol.d.ts.map +1 -0
  122. package/es/common/protocolWorkspaceSymbol.js +36 -0
  123. package/es/common/reference.d.ts +22 -0
  124. package/es/common/reference.d.ts.map +1 -0
  125. package/es/common/reference.js +78 -0
  126. package/es/common/rename.d.ts +29 -0
  127. package/es/common/rename.d.ts.map +1 -0
  128. package/es/common/rename.js +132 -0
  129. package/es/common/selectionRange.d.ts +18 -0
  130. package/es/common/selectionRange.d.ts.map +1 -0
  131. package/es/common/selectionRange.js +108 -0
  132. package/es/common/semanticTokens.d.ts +36 -0
  133. package/es/common/semanticTokens.d.ts.map +1 -0
  134. package/es/common/semanticTokens.js +226 -0
  135. package/es/common/signatureHelp.d.ts +18 -0
  136. package/es/common/signatureHelp.d.ts.map +1 -0
  137. package/es/common/signatureHelp.js +103 -0
  138. package/es/common/textSynchronization.d.ts +104 -0
  139. package/es/common/textSynchronization.d.ts.map +1 -0
  140. package/es/common/textSynchronization.js +771 -0
  141. package/es/common/typeDefinition.d.ts +18 -0
  142. package/es/common/typeDefinition.d.ts.map +1 -0
  143. package/es/common/typeDefinition.js +89 -0
  144. package/es/common/typeHierarchy.d.ts +33 -0
  145. package/es/common/typeHierarchy.d.ts.map +1 -0
  146. package/es/common/typeHierarchy.js +138 -0
  147. package/es/common/utils/async.d.ts +42 -0
  148. package/es/common/utils/async.d.ts.map +1 -0
  149. package/es/common/utils/async.js +441 -0
  150. package/es/common/utils/is.d.ts +13 -0
  151. package/es/common/utils/is.d.ts.map +1 -0
  152. package/es/common/utils/is.js +52 -0
  153. package/es/common/utils/uuid.d.ts +23 -0
  154. package/es/common/utils/uuid.d.ts.map +1 -0
  155. package/es/common/utils/uuid.js +85 -0
  156. package/es/common/vscodeAdaptor/convertor.d.ts +7 -0
  157. package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -0
  158. package/es/common/vscodeAdaptor/convertor.js +66 -0
  159. package/es/common/vscodeAdaptor/diagnosticCollection.d.ts +33 -0
  160. package/es/common/vscodeAdaptor/diagnosticCollection.d.ts.map +1 -0
  161. package/es/common/vscodeAdaptor/diagnosticCollection.js +310 -0
  162. package/es/common/vscodeAdaptor/extHostTypes.d.ts +1496 -0
  163. package/es/common/vscodeAdaptor/extHostTypes.d.ts.map +1 -0
  164. package/es/common/vscodeAdaptor/extHostTypes.js +3825 -0
  165. package/es/common/vscodeAdaptor/fileWatcher.d.ts +19 -0
  166. package/es/common/vscodeAdaptor/fileWatcher.d.ts.map +1 -0
  167. package/es/common/vscodeAdaptor/fileWatcher.js +45 -0
  168. package/es/common/vscodeAdaptor/hostTypeUtil.d.ts +192 -0
  169. package/es/common/vscodeAdaptor/hostTypeUtil.d.ts.map +1 -0
  170. package/es/common/vscodeAdaptor/hostTypeUtil.js +566 -0
  171. package/es/common/vscodeAdaptor/libro-fs.d.ts +21 -0
  172. package/es/common/vscodeAdaptor/libro-fs.d.ts.map +1 -0
  173. package/es/common/vscodeAdaptor/libro-fs.js +64 -0
  174. package/es/common/vscodeAdaptor/libroWindow.d.ts +21 -0
  175. package/es/common/vscodeAdaptor/libroWindow.d.ts.map +1 -0
  176. package/es/common/vscodeAdaptor/libroWindow.js +75 -0
  177. package/es/common/vscodeAdaptor/libroWorkspace.d.ts +33 -0
  178. package/es/common/vscodeAdaptor/libroWorkspace.d.ts.map +1 -0
  179. package/es/common/vscodeAdaptor/libroWorkspace.js +250 -0
  180. package/es/common/vscodeAdaptor/lspEnv.d.ts +8 -0
  181. package/es/common/vscodeAdaptor/lspEnv.d.ts.map +1 -0
  182. package/es/common/vscodeAdaptor/lspEnv.js +31 -0
  183. package/es/common/vscodeAdaptor/monaco-converter.d.ts +229 -0
  184. package/es/common/vscodeAdaptor/monaco-converter.d.ts.map +1 -0
  185. package/es/common/vscodeAdaptor/monaco-converter.js +1613 -0
  186. package/es/common/vscodeAdaptor/monacoLanguages.d.ts +48 -0
  187. package/es/common/vscodeAdaptor/monacoLanguages.d.ts.map +1 -0
  188. package/es/common/vscodeAdaptor/monacoLanguages.js +484 -0
  189. package/es/common/vscodeAdaptor/services.d.ts +85 -0
  190. package/es/common/vscodeAdaptor/services.d.ts.map +1 -0
  191. package/es/common/vscodeAdaptor/services.js +3 -0
  192. package/es/common/vscodeAdaptor/typings.d.ts +10 -0
  193. package/es/common/vscodeAdaptor/util.d.ts +3 -0
  194. package/es/common/vscodeAdaptor/util.d.ts.map +1 -0
  195. package/es/common/vscodeAdaptor/util.js +6 -0
  196. package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts +77 -0
  197. package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts.map +1 -0
  198. package/es/common/vscodeAdaptor/vscodeAdaptor.js +124 -0
  199. package/es/common/workspaceFolder.d.ts +32 -0
  200. package/es/common/workspaceFolder.d.ts.map +1 -0
  201. package/es/common/workspaceFolder.js +204 -0
  202. package/es/common/workspaceSymbol.d.ts +21 -0
  203. package/es/common/workspaceSymbol.d.ts.map +1 -0
  204. package/es/common/workspaceSymbol.js +101 -0
  205. package/es/constants.d.ts +2 -0
  206. package/es/constants.d.ts.map +1 -0
  207. package/es/constants.js +1 -0
  208. package/es/index.d.ts +6 -0
  209. package/es/index.d.ts.map +1 -0
  210. package/es/index.js +5 -0
  211. package/es/libro-language-client-contribution.d.ts +10 -0
  212. package/es/libro-language-client-contribution.d.ts.map +1 -0
  213. package/es/libro-language-client-contribution.js +143 -0
  214. package/es/libro-language-client-manager.d.ts +34 -0
  215. package/es/libro-language-client-manager.d.ts.map +1 -0
  216. package/es/libro-language-client-manager.js +277 -0
  217. package/es/libro-language-client.d.ts +27 -0
  218. package/es/libro-language-client.d.ts.map +1 -0
  219. package/es/libro-language-client.js +141 -0
  220. package/es/module.d.ts +3 -0
  221. package/es/module.d.ts.map +1 -0
  222. package/es/module.js +13 -0
  223. package/package.json +69 -0
  224. package/src/common/api.ts +155 -0
  225. package/src/common/callHierarchy.ts +269 -0
  226. package/src/common/client.ts +3192 -0
  227. package/src/common/codeAction.ts +237 -0
  228. package/src/common/codeConverter.ts +1409 -0
  229. package/src/common/codeLens.ts +188 -0
  230. package/src/common/colorProvider.ts +192 -0
  231. package/src/common/completion.ts +281 -0
  232. package/src/common/configuration.ts +338 -0
  233. package/src/common/declaration.ts +140 -0
  234. package/src/common/definition.ts +138 -0
  235. package/src/common/diagnostic.ts +1408 -0
  236. package/src/common/documentHighlight.ts +140 -0
  237. package/src/common/documentLink.ts +180 -0
  238. package/src/common/documentSymbol.ts +186 -0
  239. package/src/common/executeCommand.ts +129 -0
  240. package/src/common/features.ts +1157 -0
  241. package/src/common/fileOperations.ts +635 -0
  242. package/src/common/fileSystemWatcher.ts +184 -0
  243. package/src/common/foldingRange.ts +160 -0
  244. package/src/common/formatting.ts +465 -0
  245. package/src/common/hover.ts +133 -0
  246. package/src/common/implementation.ts +142 -0
  247. package/src/common/inlayHint.ts +201 -0
  248. package/src/common/inlineCompletion.ts +160 -0
  249. package/src/common/inlineValue.ts +158 -0
  250. package/src/common/linkedEditingRange.ts +141 -0
  251. package/src/common/notebook.ts +1443 -0
  252. package/src/common/progress.ts +61 -0
  253. package/src/common/progressPart.ts +151 -0
  254. package/src/common/protocolCallHierarchyItem.ts +29 -0
  255. package/src/common/protocolCodeAction.ts +17 -0
  256. package/src/common/protocolCodeLens.ts +15 -0
  257. package/src/common/protocolCompletionItem.ts +22 -0
  258. package/src/common/protocolConverter.ts +2627 -0
  259. package/src/common/protocolDiagnostic.ts +47 -0
  260. package/src/common/protocolDocumentLink.ts +17 -0
  261. package/src/common/protocolInlayHint.ts +21 -0
  262. package/src/common/protocolTypeHierarchyItem.ts +29 -0
  263. package/src/common/protocolWorkspaceSymbol.ts +39 -0
  264. package/src/common/reference.ts +144 -0
  265. package/src/common/rename.ts +230 -0
  266. package/src/common/selectionRange.ts +136 -0
  267. package/src/common/semanticTokens.ts +383 -0
  268. package/src/common/signatureHelp.ts +170 -0
  269. package/src/common/textSynchronization.ts +819 -0
  270. package/src/common/typeDefinition.ts +146 -0
  271. package/src/common/typeHierarchy.ts +248 -0
  272. package/src/common/utils/async.ts +354 -0
  273. package/src/common/utils/is.ts +63 -0
  274. package/src/common/utils/uuid.ts +136 -0
  275. package/src/common/vscodeAdaptor/convertor.ts +73 -0
  276. package/src/common/vscodeAdaptor/diagnosticCollection.ts +238 -0
  277. package/src/common/vscodeAdaptor/extHostTypes.ts +4498 -0
  278. package/src/common/vscodeAdaptor/fileWatcher.ts +36 -0
  279. package/src/common/vscodeAdaptor/hostTypeUtil.ts +539 -0
  280. package/src/common/vscodeAdaptor/libro-fs.ts +51 -0
  281. package/src/common/vscodeAdaptor/libroWindow.ts +85 -0
  282. package/src/common/vscodeAdaptor/libroWorkspace.ts +261 -0
  283. package/src/common/vscodeAdaptor/lspEnv.ts +16 -0
  284. package/src/common/vscodeAdaptor/monaco-converter.ts +1800 -0
  285. package/src/common/vscodeAdaptor/monacoLanguages.ts +511 -0
  286. package/src/common/vscodeAdaptor/services.ts +278 -0
  287. package/src/common/vscodeAdaptor/typings.d.ts +10 -0
  288. package/src/common/vscodeAdaptor/util.ts +7 -0
  289. package/src/common/vscodeAdaptor/vscodeAdaptor.ts +122 -0
  290. package/src/common/workspaceFolder.ts +236 -0
  291. package/src/common/workspaceSymbol.ts +166 -0
  292. package/src/constants.ts +1 -0
  293. package/src/index.spec.ts +7 -0
  294. package/src/index.ts +5 -0
  295. package/src/libro-language-client-contribution.ts +49 -0
  296. package/src/libro-language-client-manager.ts +131 -0
  297. package/src/libro-language-client.ts +100 -0
  298. package/src/module.ts +19 -0
@@ -0,0 +1,233 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ /* --------------------------------------------------------------------------------------------
21
+ * Copyright (c) Microsoft Corporation. All rights reserved.
22
+ * Licensed under the MIT License. See License.txt in the project root for license information.
23
+ * ------------------------------------------------------------------------------------------ */
24
+
25
+ import { DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentRangesFormattingRequest, DocumentOnTypeFormattingRequest } from '@difizen/vscode-languageserver-protocol';
26
+ import { TextDocumentLanguageFeature, ensure } from "./features.js";
27
+ import * as UUID from "./utils/uuid.js";
28
+ import { languages as Languages, workspace as Workspace } from "./vscodeAdaptor/vscodeAdaptor.js";
29
+ var FileFormattingOptions;
30
+ (function (_FileFormattingOptions) {
31
+ function fromConfiguration(document) {
32
+ var filesConfig = Workspace.getConfiguration('files', document);
33
+ return {
34
+ trimTrailingWhitespace: filesConfig.get('trimTrailingWhitespace'),
35
+ trimFinalNewlines: filesConfig.get('trimFinalNewlines'),
36
+ insertFinalNewline: filesConfig.get('insertFinalNewline')
37
+ };
38
+ }
39
+ _FileFormattingOptions.fromConfiguration = fromConfiguration;
40
+ })(FileFormattingOptions || (FileFormattingOptions = {}));
41
+ export var DocumentFormattingFeature = /*#__PURE__*/function (_TextDocumentLanguage) {
42
+ _inherits(DocumentFormattingFeature, _TextDocumentLanguage);
43
+ var _super = _createSuper(DocumentFormattingFeature);
44
+ function DocumentFormattingFeature(client) {
45
+ _classCallCheck(this, DocumentFormattingFeature);
46
+ return _super.call(this, client, DocumentFormattingRequest.type);
47
+ }
48
+ _createClass(DocumentFormattingFeature, [{
49
+ key: "fillClientCapabilities",
50
+ value: function fillClientCapabilities(capabilities) {
51
+ ensure(ensure(capabilities, 'textDocument'), 'formatting').dynamicRegistration = true;
52
+ }
53
+ }, {
54
+ key: "initialize",
55
+ value: function initialize(capabilities, documentSelector) {
56
+ var options = this.getRegistrationOptions(documentSelector, capabilities.documentFormattingProvider);
57
+ if (!options) {
58
+ return;
59
+ }
60
+ this.register({
61
+ id: UUID.generateUuid(),
62
+ registerOptions: options
63
+ });
64
+ }
65
+ }, {
66
+ key: "registerLanguageProvider",
67
+ value: function registerLanguageProvider(options) {
68
+ var _this = this;
69
+ var selector = options.documentSelector;
70
+ var provider = {
71
+ provideDocumentFormattingEdits: function provideDocumentFormattingEdits(document, options, token) {
72
+ var client = _this._client;
73
+ var provideDocumentFormattingEdits = function provideDocumentFormattingEdits(document, options, token) {
74
+ var params = {
75
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
76
+ options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))
77
+ };
78
+ return client.sendRequest(DocumentFormattingRequest.type, params, token).then(function (result) {
79
+ if (token.isCancellationRequested) {
80
+ return null;
81
+ }
82
+ return client.protocol2CodeConverter.asTextEdits(result, token);
83
+ }, function (error) {
84
+ return client.handleFailedRequest(DocumentFormattingRequest.type, token, error, null);
85
+ });
86
+ };
87
+ var middleware = client.middleware;
88
+ return middleware.provideDocumentFormattingEdits ? middleware.provideDocumentFormattingEdits(document, options, token, provideDocumentFormattingEdits) : provideDocumentFormattingEdits(document, options, token);
89
+ }
90
+ };
91
+ return [Languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];
92
+ }
93
+ }]);
94
+ return DocumentFormattingFeature;
95
+ }(TextDocumentLanguageFeature);
96
+ export var DocumentRangeFormattingFeature = /*#__PURE__*/function (_TextDocumentLanguage2) {
97
+ _inherits(DocumentRangeFormattingFeature, _TextDocumentLanguage2);
98
+ var _super2 = _createSuper(DocumentRangeFormattingFeature);
99
+ function DocumentRangeFormattingFeature(client) {
100
+ _classCallCheck(this, DocumentRangeFormattingFeature);
101
+ return _super2.call(this, client, DocumentRangeFormattingRequest.type);
102
+ }
103
+ _createClass(DocumentRangeFormattingFeature, [{
104
+ key: "fillClientCapabilities",
105
+ value: function fillClientCapabilities(capabilities) {
106
+ var capability = ensure(ensure(capabilities, 'textDocument'), 'rangeFormatting');
107
+ capability.dynamicRegistration = true;
108
+ capability.rangesSupport = true;
109
+ }
110
+ }, {
111
+ key: "initialize",
112
+ value: function initialize(capabilities, documentSelector) {
113
+ var options = this.getRegistrationOptions(documentSelector, capabilities.documentRangeFormattingProvider);
114
+ if (!options) {
115
+ return;
116
+ }
117
+ this.register({
118
+ id: UUID.generateUuid(),
119
+ registerOptions: options
120
+ });
121
+ }
122
+ }, {
123
+ key: "registerLanguageProvider",
124
+ value: function registerLanguageProvider(options) {
125
+ var _this2 = this;
126
+ var selector = options.documentSelector;
127
+ var provider = {
128
+ provideDocumentRangeFormattingEdits: function provideDocumentRangeFormattingEdits(document, range, options, token) {
129
+ var client = _this2._client;
130
+ var provideDocumentRangeFormattingEdits = function provideDocumentRangeFormattingEdits(document, range, options, token) {
131
+ var params = {
132
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
133
+ range: client.code2ProtocolConverter.asRange(range),
134
+ options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))
135
+ };
136
+ return client.sendRequest(DocumentRangeFormattingRequest.type, params, token).then(function (result) {
137
+ if (token.isCancellationRequested) {
138
+ return null;
139
+ }
140
+ return client.protocol2CodeConverter.asTextEdits(result, token);
141
+ }, function (error) {
142
+ return client.handleFailedRequest(DocumentRangeFormattingRequest.type, token, error, null);
143
+ });
144
+ };
145
+ var middleware = client.middleware;
146
+ return middleware.provideDocumentRangeFormattingEdits ? middleware.provideDocumentRangeFormattingEdits(document, range, options, token, provideDocumentRangeFormattingEdits) : provideDocumentRangeFormattingEdits(document, range, options, token);
147
+ }
148
+ };
149
+ if (options.rangesSupport) {
150
+ provider.provideDocumentRangesFormattingEdits = function (document, ranges, options, token) {
151
+ var client = _this2._client;
152
+ var provideDocumentRangesFormattingEdits = function provideDocumentRangesFormattingEdits(document, ranges, options, token) {
153
+ var params = {
154
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
155
+ ranges: client.code2ProtocolConverter.asRanges(ranges),
156
+ options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))
157
+ };
158
+ return client.sendRequest(DocumentRangesFormattingRequest.type, params, token).then(function (result) {
159
+ if (token.isCancellationRequested) {
160
+ return null;
161
+ }
162
+ return client.protocol2CodeConverter.asTextEdits(result, token);
163
+ }, function (error) {
164
+ return client.handleFailedRequest(DocumentRangesFormattingRequest.type, token, error, null);
165
+ });
166
+ };
167
+ var middleware = client.middleware;
168
+ return middleware.provideDocumentRangesFormattingEdits ? middleware.provideDocumentRangesFormattingEdits(document, ranges, options, token, provideDocumentRangesFormattingEdits) : provideDocumentRangesFormattingEdits(document, ranges, options, token);
169
+ };
170
+ }
171
+ return [Languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];
172
+ }
173
+ }]);
174
+ return DocumentRangeFormattingFeature;
175
+ }(TextDocumentLanguageFeature);
176
+ export var DocumentOnTypeFormattingFeature = /*#__PURE__*/function (_TextDocumentLanguage3) {
177
+ _inherits(DocumentOnTypeFormattingFeature, _TextDocumentLanguage3);
178
+ var _super3 = _createSuper(DocumentOnTypeFormattingFeature);
179
+ function DocumentOnTypeFormattingFeature(client) {
180
+ _classCallCheck(this, DocumentOnTypeFormattingFeature);
181
+ return _super3.call(this, client, DocumentOnTypeFormattingRequest.type);
182
+ }
183
+ _createClass(DocumentOnTypeFormattingFeature, [{
184
+ key: "fillClientCapabilities",
185
+ value: function fillClientCapabilities(capabilities) {
186
+ ensure(ensure(capabilities, 'textDocument'), 'onTypeFormatting').dynamicRegistration = true;
187
+ }
188
+ }, {
189
+ key: "initialize",
190
+ value: function initialize(capabilities, documentSelector) {
191
+ var options = this.getRegistrationOptions(documentSelector, capabilities.documentOnTypeFormattingProvider);
192
+ if (!options) {
193
+ return;
194
+ }
195
+ this.register({
196
+ id: UUID.generateUuid(),
197
+ registerOptions: options
198
+ });
199
+ }
200
+ }, {
201
+ key: "registerLanguageProvider",
202
+ value: function registerLanguageProvider(options) {
203
+ var _this3 = this;
204
+ var selector = options.documentSelector;
205
+ var provider = {
206
+ provideOnTypeFormattingEdits: function provideOnTypeFormattingEdits(document, position, ch, options, token) {
207
+ var client = _this3._client;
208
+ var provideOnTypeFormattingEdits = function provideOnTypeFormattingEdits(document, position, ch, options, token) {
209
+ var params = {
210
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
211
+ position: client.code2ProtocolConverter.asPosition(position),
212
+ ch: ch,
213
+ options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))
214
+ };
215
+ return client.sendRequest(DocumentOnTypeFormattingRequest.type, params, token).then(function (result) {
216
+ if (token.isCancellationRequested) {
217
+ return null;
218
+ }
219
+ return client.protocol2CodeConverter.asTextEdits(result, token);
220
+ }, function (error) {
221
+ return client.handleFailedRequest(DocumentOnTypeFormattingRequest.type, token, error, null);
222
+ });
223
+ };
224
+ var middleware = client.middleware;
225
+ return middleware.provideOnTypeFormattingEdits ? middleware.provideOnTypeFormattingEdits(document, position, ch, options, token, provideOnTypeFormattingEdits) : provideOnTypeFormattingEdits(document, position, ch, options, token);
226
+ }
227
+ };
228
+ var moreTriggerCharacter = options.moreTriggerCharacter || [];
229
+ return [Languages.registerOnTypeFormattingEditProvider.apply(Languages, [this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, options.firstTriggerCharacter].concat(_toConsumableArray(moreTriggerCharacter))), provider];
230
+ }
231
+ }]);
232
+ return DocumentOnTypeFormattingFeature;
233
+ }(TextDocumentLanguageFeature);
@@ -0,0 +1,18 @@
1
+ import type { ClientCapabilities, DocumentSelector, HoverOptions, HoverRegistrationOptions, ServerCapabilities } from '@difizen/vscode-languageserver-protocol';
2
+ import type { TextDocument, Disposable, Position as VPosition, CancellationToken, ProviderResult, HoverProvider, Hover as VHover } from 'vscode';
3
+ import type { FeatureClient } from './features.js';
4
+ import { TextDocumentLanguageFeature } from './features.js';
5
+ export interface ProvideHoverSignature {
6
+ (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VHover>;
7
+ }
8
+ export interface HoverMiddleware {
9
+ provideHover?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideHoverSignature) => ProviderResult<VHover>;
10
+ }
11
+ export declare class HoverFeature extends TextDocumentLanguageFeature<boolean | HoverOptions, HoverRegistrationOptions, HoverProvider, HoverMiddleware> {
12
+ constructor(client: FeatureClient<HoverMiddleware>);
13
+ fillClientCapabilities(capabilities: ClientCapabilities): void;
14
+ initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
15
+ protected registerLanguageProvider(options: HoverRegistrationOptions): [Disposable, HoverProvider];
16
+ private registerProvider;
17
+ }
18
+ //# sourceMappingURL=hover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/common/hover.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,IAAI,SAAS,EACrB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,IAAI,MAAM,EAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAU,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAIpE,MAAM,WAAW,qBAAqB;IACpC,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,qBAAqB,KACxB,cAAc,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,qBAAa,YAAa,SAAQ,2BAA2B,CAC3D,OAAO,GAAG,YAAY,EACtB,wBAAwB,EACxB,aAAa,EACb,eAAe,CAChB;gBACa,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC;IAI3C,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAM9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAcP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,wBAAwB,GAChC,CAAC,UAAU,EAAE,aAAa,CAAC;IAyC9B,OAAO,CAAC,gBAAgB;CASzB"}
@@ -0,0 +1,80 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
8
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
+ /* --------------------------------------------------------------------------------------------
15
+ * Copyright (c) Microsoft Corporation. All rights reserved.
16
+ * Licensed under the MIT License. See License.txt in the project root for license information.
17
+ * ------------------------------------------------------------------------------------------ */
18
+
19
+ import { HoverRequest, MarkupKind } from '@difizen/vscode-languageserver-protocol';
20
+ import { ensure, TextDocumentLanguageFeature } from "./features.js";
21
+ import * as UUID from "./utils/uuid.js";
22
+ import { languages as Languages } from "./vscodeAdaptor/vscodeAdaptor.js";
23
+ export var HoverFeature = /*#__PURE__*/function (_TextDocumentLanguage) {
24
+ _inherits(HoverFeature, _TextDocumentLanguage);
25
+ var _super = _createSuper(HoverFeature);
26
+ function HoverFeature(client) {
27
+ _classCallCheck(this, HoverFeature);
28
+ return _super.call(this, client, HoverRequest.type);
29
+ }
30
+ _createClass(HoverFeature, [{
31
+ key: "fillClientCapabilities",
32
+ value: function fillClientCapabilities(capabilities) {
33
+ var hoverCapability = ensure(ensure(capabilities, 'textDocument'), 'hover');
34
+ hoverCapability.dynamicRegistration = true;
35
+ hoverCapability.contentFormat = [MarkupKind.Markdown, MarkupKind.PlainText];
36
+ }
37
+ }, {
38
+ key: "initialize",
39
+ value: function initialize(capabilities, documentSelector) {
40
+ var options = this.getRegistrationOptions(documentSelector, capabilities.hoverProvider);
41
+ if (!options) {
42
+ return;
43
+ }
44
+ this.register({
45
+ id: UUID.generateUuid(),
46
+ registerOptions: options
47
+ });
48
+ }
49
+ }, {
50
+ key: "registerLanguageProvider",
51
+ value: function registerLanguageProvider(options) {
52
+ var _this = this;
53
+ var selector = options.documentSelector;
54
+ var provider = {
55
+ provideHover: function provideHover(document, position, token) {
56
+ var client = _this._client;
57
+ var provideHover = function provideHover(document, position, token) {
58
+ return client.sendRequest(HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(function (result) {
59
+ if (token.isCancellationRequested) {
60
+ return null;
61
+ }
62
+ return client.protocol2CodeConverter.asHover(result);
63
+ }, function (error) {
64
+ return client.handleFailedRequest(HoverRequest.type, token, error, null);
65
+ });
66
+ };
67
+ var middleware = client.middleware;
68
+ return middleware.provideHover ? middleware.provideHover(document, position, token, provideHover) : provideHover(document, position, token);
69
+ }
70
+ };
71
+ return [this.registerProvider(selector, provider), provider];
72
+ }
73
+ }, {
74
+ key: "registerProvider",
75
+ value: function registerProvider(selector, provider) {
76
+ return Languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);
77
+ }
78
+ }]);
79
+ return HoverFeature;
80
+ }(TextDocumentLanguageFeature);
@@ -0,0 +1,18 @@
1
+ import type { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, ImplementationRegistrationOptions, ImplementationOptions } from '@difizen/vscode-languageserver-protocol';
2
+ import type { Disposable, TextDocument, ProviderResult, Position as VPosition, Definition as VDefinition, DefinitionLink as VDefinitionLink, ImplementationProvider } from 'vscode';
3
+ import type { FeatureClient } from './features.js';
4
+ import { TextDocumentLanguageFeature } from './features.js';
5
+ export interface ProvideImplementationSignature {
6
+ (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VDefinition | VDefinitionLink[]>;
7
+ }
8
+ export interface ImplementationMiddleware {
9
+ provideImplementation?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideImplementationSignature) => ProviderResult<VDefinition | VDefinitionLink[]>;
10
+ }
11
+ export declare class ImplementationFeature extends TextDocumentLanguageFeature<boolean | ImplementationOptions, ImplementationRegistrationOptions, ImplementationProvider, ImplementationMiddleware> {
12
+ constructor(client: FeatureClient<ImplementationMiddleware>);
13
+ fillClientCapabilities(capabilities: ClientCapabilities): void;
14
+ initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
15
+ protected registerLanguageProvider(options: ImplementationRegistrationOptions): [Disposable, ImplementationProvider];
16
+ private registerProvider;
17
+ }
18
+ //# sourceMappingURL=implementation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../src/common/implementation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,QAAQ,IAAI,SAAS,EACrB,UAAU,IAAI,WAAW,EACzB,cAAc,IAAI,eAAe,EACjC,sBAAsB,EACvB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAU,MAAM,eAAe,CAAC;AAGpE,MAAM,WAAW,8BAA8B;IAC7C,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,WAAW,GAAG,eAAe,EAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,CAAC,EAAE,CACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,8BAA8B,KACjC,cAAc,CAAC,WAAW,GAAG,eAAe,EAAE,CAAC,CAAC;CACtD;AAED,qBAAa,qBAAsB,SAAQ,2BAA2B,CACpE,OAAO,GAAG,qBAAqB,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,wBAAwB,CACzB;gBACa,MAAM,EAAE,aAAa,CAAC,wBAAwB,CAAC;IAIpD,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAS9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAWP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,iCAAiC,GACzC,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAkDvC,OAAO,CAAC,gBAAgB;CASzB"}
@@ -0,0 +1,88 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ /* --------------------------------------------------------------------------------------------
21
+ * Copyright (c) Microsoft Corporation. All rights reserved.
22
+ * Licensed under the MIT License. See License.txt in the project root for license information.
23
+ * ------------------------------------------------------------------------------------------ */
24
+
25
+ import { ImplementationRequest } from '@difizen/vscode-languageserver-protocol';
26
+ import { TextDocumentLanguageFeature, ensure } from "./features.js";
27
+ import { languages as Languages } from "./vscodeAdaptor/vscodeAdaptor.js";
28
+ export var ImplementationFeature = /*#__PURE__*/function (_TextDocumentLanguage) {
29
+ _inherits(ImplementationFeature, _TextDocumentLanguage);
30
+ var _super = _createSuper(ImplementationFeature);
31
+ function ImplementationFeature(client) {
32
+ _classCallCheck(this, ImplementationFeature);
33
+ return _super.call(this, client, ImplementationRequest.type);
34
+ }
35
+ _createClass(ImplementationFeature, [{
36
+ key: "fillClientCapabilities",
37
+ value: function fillClientCapabilities(capabilities) {
38
+ var implementationSupport = ensure(ensure(capabilities, 'textDocument'), 'implementation');
39
+ implementationSupport.dynamicRegistration = true;
40
+ implementationSupport.linkSupport = true;
41
+ }
42
+ }, {
43
+ key: "initialize",
44
+ value: function initialize(capabilities, documentSelector) {
45
+ var _this$getRegistration = this.getRegistration(documentSelector, capabilities.implementationProvider),
46
+ _this$getRegistration2 = _slicedToArray(_this$getRegistration, 2),
47
+ id = _this$getRegistration2[0],
48
+ options = _this$getRegistration2[1];
49
+ if (!id || !options) {
50
+ return;
51
+ }
52
+ this.register({
53
+ id: id,
54
+ registerOptions: options
55
+ });
56
+ }
57
+ }, {
58
+ key: "registerLanguageProvider",
59
+ value: function registerLanguageProvider(options) {
60
+ var _this = this;
61
+ var selector = options.documentSelector;
62
+ var provider = {
63
+ provideImplementation: function provideImplementation(document, position, token) {
64
+ var client = _this._client;
65
+ var provideImplementation = function provideImplementation(document, position, token) {
66
+ return client.sendRequest(ImplementationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(function (result) {
67
+ if (token.isCancellationRequested) {
68
+ return null;
69
+ }
70
+ return client.protocol2CodeConverter.asDefinitionResult(result, token);
71
+ }, function (error) {
72
+ return client.handleFailedRequest(ImplementationRequest.type, token, error, null);
73
+ });
74
+ };
75
+ var middleware = client.middleware;
76
+ return middleware.provideImplementation ? middleware.provideImplementation(document, position, token, provideImplementation) : provideImplementation(document, position, token);
77
+ }
78
+ };
79
+ return [this.registerProvider(selector, provider), provider];
80
+ }
81
+ }, {
82
+ key: "registerProvider",
83
+ value: function registerProvider(selector, provider) {
84
+ return Languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);
85
+ }
86
+ }]);
87
+ return ImplementationFeature;
88
+ }(TextDocumentLanguageFeature);
@@ -0,0 +1,23 @@
1
+ import type { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, InlayHintOptions, InlayHintRegistrationOptions } from '@difizen/vscode-languageserver-protocol';
2
+ import type { Disposable, TextDocument, ProviderResult, Range as VRange, InlayHint as VInlayHint, InlayHintsProvider } from 'vscode';
3
+ import type { FeatureClient } from './features.js';
4
+ import { TextDocumentLanguageFeature } from './features.js';
5
+ import { EventEmitter } from './vscodeAdaptor/vscodeAdaptor.js';
6
+ export type ProvideInlayHintsSignature = (this: void, document: TextDocument, viewPort: VRange, token: CancellationToken) => ProviderResult<VInlayHint[]>;
7
+ export type ResolveInlayHintSignature = (this: void, item: VInlayHint, token: CancellationToken) => ProviderResult<VInlayHint>;
8
+ export type InlayHintsMiddleware = {
9
+ provideInlayHints?: (this: void, document: TextDocument, viewPort: VRange, token: CancellationToken, next: ProvideInlayHintsSignature) => ProviderResult<VInlayHint[]>;
10
+ resolveInlayHint?: (this: void, item: VInlayHint, token: CancellationToken, next: ResolveInlayHintSignature) => ProviderResult<VInlayHint>;
11
+ };
12
+ export type InlayHintsProviderShape = {
13
+ provider: InlayHintsProvider;
14
+ onDidChangeInlayHints: EventEmitter<void>;
15
+ };
16
+ export declare class InlayHintsFeature extends TextDocumentLanguageFeature<boolean | InlayHintOptions, InlayHintRegistrationOptions, InlayHintsProviderShape, InlayHintsMiddleware> {
17
+ constructor(client: FeatureClient<InlayHintsMiddleware>);
18
+ fillClientCapabilities(capabilities: ClientCapabilities): void;
19
+ initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
20
+ protected registerLanguageProvider(options: InlayHintRegistrationOptions): [Disposable, InlayHintsProviderShape];
21
+ private registerProvider;
22
+ }
23
+ //# sourceMappingURL=inlayHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlayHint.d.ts","sourceRoot":"","sources":["../../src/common/inlayHint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAE7B,MAAM,yCAAyC,CAAC;AAMjD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,KAAK,IAAI,MAAM,EACf,SAAS,IAAI,UAAU,EACvB,kBAAkB,EACnB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAU,MAAM,eAAe,CAAC;AACpE,OAAO,EAA0B,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAExF,MAAM,MAAM,0BAA0B,GAAG,CACvC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,iBAAiB,KACrB,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;AAClC,MAAM,MAAM,yBAAyB,GAAG,CACtC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,iBAAiB,KACrB,cAAc,CAAC,UAAU,CAAC,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG;IACjC,iBAAiB,CAAC,EAAE,CAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,0BAA0B,KAC7B,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,yBAAyB,KAC5B,cAAc,CAAC,UAAU,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,qBAAqB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,2BAA2B,CAChE,OAAO,GAAG,gBAAgB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,CACrB;gBACa,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC;IAIhD,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAe9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAiBP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,4BAA4B,GACpC,CAAC,UAAU,EAAE,uBAAuB,CAAC;IA+ExC,OAAO,CAAC,gBAAgB;CASzB"}