css-variable-lsp 1.0.0 → 1.0.1

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 (450) hide show
  1. package/README.md +5 -9
  2. package/package.json +2 -2
  3. package/server/out/cascadeAndInline.test.js +67 -0
  4. package/server/out/cascadeAndInline.test.js.map +1 -0
  5. package/server/out/cssVariableManager.js +390 -0
  6. package/server/out/cssVariableManager.js.map +1 -0
  7. package/server/out/domTree.js +115 -0
  8. package/server/out/domTree.js.map +1 -0
  9. package/server/out/domTree.test.js +77 -0
  10. package/server/out/domTree.test.js.map +1 -0
  11. package/server/out/fileLifecycle.test.js +163 -0
  12. package/server/out/fileLifecycle.test.js.map +1 -0
  13. package/server/out/fileTypesAndUpdates.test.js +78 -0
  14. package/server/out/fileTypesAndUpdates.test.js.map +1 -0
  15. package/server/out/htmlComments.test.js +180 -0
  16. package/server/out/htmlComments.test.js.map +1 -0
  17. package/server/out/server.js +457 -0
  18. package/server/out/server.js.map +1 -0
  19. package/server/out/specificity.js +138 -0
  20. package/server/out/specificity.js.map +1 -0
  21. package/server/out/specificity.test.js +66 -0
  22. package/server/out/specificity.test.js.map +1 -0
  23. package/server/out/test.js +112 -0
  24. package/server/out/test.js.map +1 -0
  25. package/server/tsconfig.tsbuildinfo +1 -0
  26. package/client/node_modules/.package-lock.json +0 -110
  27. package/client/node_modules/@types/node/LICENSE +0 -21
  28. package/client/node_modules/@types/node/README.md +0 -15
  29. package/client/node_modules/@types/node/assert/strict.d.ts +0 -8
  30. package/client/node_modules/@types/node/assert.d.ts +0 -1005
  31. package/client/node_modules/@types/node/async_hooks.d.ts +0 -586
  32. package/client/node_modules/@types/node/buffer.buffer.d.ts +0 -457
  33. package/client/node_modules/@types/node/buffer.d.ts +0 -1901
  34. package/client/node_modules/@types/node/child_process.d.ts +0 -1453
  35. package/client/node_modules/@types/node/cluster.d.ts +0 -578
  36. package/client/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  37. package/client/node_modules/@types/node/compatibility/index.d.ts +0 -9
  38. package/client/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  39. package/client/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  40. package/client/node_modules/@types/node/console.d.ts +0 -452
  41. package/client/node_modules/@types/node/constants.d.ts +0 -21
  42. package/client/node_modules/@types/node/crypto.d.ts +0 -4504
  43. package/client/node_modules/@types/node/dgram.d.ts +0 -596
  44. package/client/node_modules/@types/node/diagnostics_channel.d.ts +0 -551
  45. package/client/node_modules/@types/node/dns/promises.d.ts +0 -477
  46. package/client/node_modules/@types/node/dns.d.ts +0 -860
  47. package/client/node_modules/@types/node/domain.d.ts +0 -170
  48. package/client/node_modules/@types/node/events.d.ts +0 -863
  49. package/client/node_modules/@types/node/fs/promises.d.ts +0 -1208
  50. package/client/node_modules/@types/node/fs.d.ts +0 -4332
  51. package/client/node_modules/@types/node/globals.d.ts +0 -170
  52. package/client/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  53. package/client/node_modules/@types/node/http.d.ts +0 -1919
  54. package/client/node_modules/@types/node/http2.d.ts +0 -2580
  55. package/client/node_modules/@types/node/https.d.ts +0 -549
  56. package/client/node_modules/@types/node/index.d.ts +0 -92
  57. package/client/node_modules/@types/node/inspector.generated.d.ts +0 -2775
  58. package/client/node_modules/@types/node/module.d.ts +0 -503
  59. package/client/node_modules/@types/node/net.d.ts +0 -924
  60. package/client/node_modules/@types/node/os.d.ts +0 -480
  61. package/client/node_modules/@types/node/package.json +0 -145
  62. package/client/node_modules/@types/node/path.d.ts +0 -191
  63. package/client/node_modules/@types/node/perf_hooks.d.ts +0 -860
  64. package/client/node_modules/@types/node/process.d.ts +0 -1632
  65. package/client/node_modules/@types/node/punycode.d.ts +0 -117
  66. package/client/node_modules/@types/node/querystring.d.ts +0 -140
  67. package/client/node_modules/@types/node/readline/promises.d.ts +0 -154
  68. package/client/node_modules/@types/node/readline.d.ts +0 -715
  69. package/client/node_modules/@types/node/repl.d.ts +0 -430
  70. package/client/node_modules/@types/node/stream/consumers.d.ts +0 -38
  71. package/client/node_modules/@types/node/stream/promises.d.ts +0 -90
  72. package/client/node_modules/@types/node/stream/web.d.ts +0 -527
  73. package/client/node_modules/@types/node/stream.d.ts +0 -1680
  74. package/client/node_modules/@types/node/string_decoder.d.ts +0 -67
  75. package/client/node_modules/@types/node/test.d.ts +0 -1208
  76. package/client/node_modules/@types/node/timers/promises.d.ts +0 -108
  77. package/client/node_modules/@types/node/timers.d.ts +0 -286
  78. package/client/node_modules/@types/node/tls.d.ts +0 -1204
  79. package/client/node_modules/@types/node/trace_events.d.ts +0 -171
  80. package/client/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -455
  81. package/client/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  82. package/client/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  83. package/client/node_modules/@types/node/tty.d.ts +0 -206
  84. package/client/node_modules/@types/node/url.d.ts +0 -957
  85. package/client/node_modules/@types/node/util.d.ts +0 -2083
  86. package/client/node_modules/@types/node/v8.d.ts +0 -753
  87. package/client/node_modules/@types/node/vm.d.ts +0 -704
  88. package/client/node_modules/@types/node/wasi.d.ts +0 -160
  89. package/client/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  90. package/client/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  91. package/client/node_modules/@types/node/web-globals/events.d.ts +0 -81
  92. package/client/node_modules/@types/node/web-globals/fetch.d.ts +0 -38
  93. package/client/node_modules/@types/node/worker_threads.d.ts +0 -698
  94. package/client/node_modules/@types/node/zlib.d.ts +0 -517
  95. package/client/node_modules/@types/vscode/LICENSE +0 -21
  96. package/client/node_modules/@types/vscode/README.md +0 -15
  97. package/client/node_modules/@types/vscode/index.d.ts +0 -21145
  98. package/client/node_modules/@types/vscode/package.json +0 -26
  99. package/client/node_modules/balanced-match/.github/FUNDING.yml +0 -2
  100. package/client/node_modules/balanced-match/LICENSE.md +0 -21
  101. package/client/node_modules/balanced-match/README.md +0 -97
  102. package/client/node_modules/balanced-match/index.js +0 -62
  103. package/client/node_modules/balanced-match/package.json +0 -48
  104. package/client/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  105. package/client/node_modules/brace-expansion/LICENSE +0 -21
  106. package/client/node_modules/brace-expansion/README.md +0 -135
  107. package/client/node_modules/brace-expansion/index.js +0 -203
  108. package/client/node_modules/brace-expansion/package.json +0 -49
  109. package/client/node_modules/minimatch/LICENSE +0 -15
  110. package/client/node_modules/minimatch/README.md +0 -259
  111. package/client/node_modules/minimatch/lib/path.js +0 -4
  112. package/client/node_modules/minimatch/minimatch.js +0 -944
  113. package/client/node_modules/minimatch/package.json +0 -35
  114. package/client/node_modules/semver/LICENSE +0 -15
  115. package/client/node_modules/semver/README.md +0 -664
  116. package/client/node_modules/semver/bin/semver.js +0 -191
  117. package/client/node_modules/semver/classes/comparator.js +0 -143
  118. package/client/node_modules/semver/classes/index.js +0 -7
  119. package/client/node_modules/semver/classes/range.js +0 -557
  120. package/client/node_modules/semver/classes/semver.js +0 -333
  121. package/client/node_modules/semver/functions/clean.js +0 -8
  122. package/client/node_modules/semver/functions/cmp.js +0 -54
  123. package/client/node_modules/semver/functions/coerce.js +0 -62
  124. package/client/node_modules/semver/functions/compare-build.js +0 -9
  125. package/client/node_modules/semver/functions/compare-loose.js +0 -5
  126. package/client/node_modules/semver/functions/compare.js +0 -7
  127. package/client/node_modules/semver/functions/diff.js +0 -60
  128. package/client/node_modules/semver/functions/eq.js +0 -5
  129. package/client/node_modules/semver/functions/gt.js +0 -5
  130. package/client/node_modules/semver/functions/gte.js +0 -5
  131. package/client/node_modules/semver/functions/inc.js +0 -21
  132. package/client/node_modules/semver/functions/lt.js +0 -5
  133. package/client/node_modules/semver/functions/lte.js +0 -5
  134. package/client/node_modules/semver/functions/major.js +0 -5
  135. package/client/node_modules/semver/functions/minor.js +0 -5
  136. package/client/node_modules/semver/functions/neq.js +0 -5
  137. package/client/node_modules/semver/functions/parse.js +0 -18
  138. package/client/node_modules/semver/functions/patch.js +0 -5
  139. package/client/node_modules/semver/functions/prerelease.js +0 -8
  140. package/client/node_modules/semver/functions/rcompare.js +0 -5
  141. package/client/node_modules/semver/functions/rsort.js +0 -5
  142. package/client/node_modules/semver/functions/satisfies.js +0 -12
  143. package/client/node_modules/semver/functions/sort.js +0 -5
  144. package/client/node_modules/semver/functions/valid.js +0 -8
  145. package/client/node_modules/semver/index.js +0 -91
  146. package/client/node_modules/semver/internal/constants.js +0 -37
  147. package/client/node_modules/semver/internal/debug.js +0 -11
  148. package/client/node_modules/semver/internal/identifiers.js +0 -29
  149. package/client/node_modules/semver/internal/lrucache.js +0 -42
  150. package/client/node_modules/semver/internal/parse-options.js +0 -17
  151. package/client/node_modules/semver/internal/re.js +0 -223
  152. package/client/node_modules/semver/package.json +0 -78
  153. package/client/node_modules/semver/preload.js +0 -4
  154. package/client/node_modules/semver/range.bnf +0 -16
  155. package/client/node_modules/semver/ranges/gtr.js +0 -6
  156. package/client/node_modules/semver/ranges/intersects.js +0 -9
  157. package/client/node_modules/semver/ranges/ltr.js +0 -6
  158. package/client/node_modules/semver/ranges/max-satisfying.js +0 -27
  159. package/client/node_modules/semver/ranges/min-satisfying.js +0 -26
  160. package/client/node_modules/semver/ranges/min-version.js +0 -63
  161. package/client/node_modules/semver/ranges/outside.js +0 -82
  162. package/client/node_modules/semver/ranges/simplify.js +0 -49
  163. package/client/node_modules/semver/ranges/subset.js +0 -249
  164. package/client/node_modules/semver/ranges/to-comparators.js +0 -10
  165. package/client/node_modules/semver/ranges/valid.js +0 -13
  166. package/client/node_modules/undici-types/README.md +0 -6
  167. package/client/node_modules/undici-types/agent.d.ts +0 -31
  168. package/client/node_modules/undici-types/api.d.ts +0 -43
  169. package/client/node_modules/undici-types/balanced-pool.d.ts +0 -18
  170. package/client/node_modules/undici-types/cache.d.ts +0 -36
  171. package/client/node_modules/undici-types/client.d.ts +0 -97
  172. package/client/node_modules/undici-types/connector.d.ts +0 -34
  173. package/client/node_modules/undici-types/content-type.d.ts +0 -21
  174. package/client/node_modules/undici-types/cookies.d.ts +0 -28
  175. package/client/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  176. package/client/node_modules/undici-types/dispatcher.d.ts +0 -241
  177. package/client/node_modules/undici-types/errors.d.ts +0 -128
  178. package/client/node_modules/undici-types/fetch.d.ts +0 -209
  179. package/client/node_modules/undici-types/file.d.ts +0 -39
  180. package/client/node_modules/undici-types/filereader.d.ts +0 -54
  181. package/client/node_modules/undici-types/formdata.d.ts +0 -108
  182. package/client/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  183. package/client/node_modules/undici-types/global-origin.d.ts +0 -7
  184. package/client/node_modules/undici-types/handlers.d.ts +0 -9
  185. package/client/node_modules/undici-types/header.d.ts +0 -4
  186. package/client/node_modules/undici-types/index.d.ts +0 -63
  187. package/client/node_modules/undici-types/interceptors.d.ts +0 -5
  188. package/client/node_modules/undici-types/mock-agent.d.ts +0 -50
  189. package/client/node_modules/undici-types/mock-client.d.ts +0 -25
  190. package/client/node_modules/undici-types/mock-errors.d.ts +0 -12
  191. package/client/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  192. package/client/node_modules/undici-types/mock-pool.d.ts +0 -25
  193. package/client/node_modules/undici-types/package.json +0 -55
  194. package/client/node_modules/undici-types/patch.d.ts +0 -71
  195. package/client/node_modules/undici-types/pool-stats.d.ts +0 -19
  196. package/client/node_modules/undici-types/pool.d.ts +0 -28
  197. package/client/node_modules/undici-types/proxy-agent.d.ts +0 -30
  198. package/client/node_modules/undici-types/readable.d.ts +0 -61
  199. package/client/node_modules/undici-types/webidl.d.ts +0 -220
  200. package/client/node_modules/undici-types/websocket.d.ts +0 -131
  201. package/client/node_modules/vscode-jsonrpc/License.txt +0 -11
  202. package/client/node_modules/vscode-jsonrpc/README.md +0 -69
  203. package/client/node_modules/vscode-jsonrpc/browser.d.ts +0 -6
  204. package/client/node_modules/vscode-jsonrpc/browser.js +0 -7
  205. package/client/node_modules/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
  206. package/client/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -76
  207. package/client/node_modules/vscode-jsonrpc/lib/browser/ril.d.ts +0 -12
  208. package/client/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -156
  209. package/client/node_modules/vscode-jsonrpc/lib/common/api.d.ts +0 -14
  210. package/client/node_modules/vscode-jsonrpc/lib/common/api.js +0 -81
  211. package/client/node_modules/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
  212. package/client/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -96
  213. package/client/node_modules/vscode-jsonrpc/lib/common/connection.d.ts +0 -358
  214. package/client/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -1212
  215. package/client/node_modules/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
  216. package/client/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -16
  217. package/client/node_modules/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
  218. package/client/node_modules/vscode-jsonrpc/lib/common/encoding.js +0 -70
  219. package/client/node_modules/vscode-jsonrpc/lib/common/events.d.ts +0 -39
  220. package/client/node_modules/vscode-jsonrpc/lib/common/events.js +0 -128
  221. package/client/node_modules/vscode-jsonrpc/lib/common/is.d.ts +0 -7
  222. package/client/node_modules/vscode-jsonrpc/lib/common/is.js +0 -35
  223. package/client/node_modules/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -53
  224. package/client/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -398
  225. package/client/node_modules/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
  226. package/client/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -152
  227. package/client/node_modules/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
  228. package/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -197
  229. package/client/node_modules/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
  230. package/client/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -115
  231. package/client/node_modules/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
  232. package/client/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -306
  233. package/client/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
  234. package/client/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -23
  235. package/client/node_modules/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
  236. package/client/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -68
  237. package/client/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
  238. package/client/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -76
  239. package/client/node_modules/vscode-jsonrpc/lib/node/main.d.ts +0 -63
  240. package/client/node_modules/vscode-jsonrpc/lib/node/main.js +0 -257
  241. package/client/node_modules/vscode-jsonrpc/lib/node/ril.d.ts +0 -13
  242. package/client/node_modules/vscode-jsonrpc/lib/node/ril.js +0 -161
  243. package/client/node_modules/vscode-jsonrpc/node.cmd +0 -5
  244. package/client/node_modules/vscode-jsonrpc/node.d.ts +0 -6
  245. package/client/node_modules/vscode-jsonrpc/node.js +0 -7
  246. package/client/node_modules/vscode-jsonrpc/package.json +0 -45
  247. package/client/node_modules/vscode-jsonrpc/thirdpartynotices.txt +0 -16
  248. package/client/node_modules/vscode-jsonrpc/typings/thenable.d.ts +0 -5
  249. package/client/node_modules/vscode-languageclient/License.txt +0 -11
  250. package/client/node_modules/vscode-languageclient/README.md +0 -17
  251. package/client/node_modules/vscode-languageclient/browser.d.ts +0 -6
  252. package/client/node_modules/vscode-languageclient/browser.js +0 -7
  253. package/client/node_modules/vscode-languageclient/lib/browser/main.d.ts +0 -8
  254. package/client/node_modules/vscode-languageclient/lib/browser/main.js +0 -37
  255. package/client/node_modules/vscode-languageclient/lib/common/api.d.ts +0 -36
  256. package/client/node_modules/vscode-languageclient/lib/common/api.js +0 -27
  257. package/client/node_modules/vscode-languageclient/lib/common/callHierarchy.d.ts +0 -37
  258. package/client/node_modules/vscode-languageclient/lib/common/callHierarchy.js +0 -97
  259. package/client/node_modules/vscode-languageclient/lib/common/client.d.ts +0 -476
  260. package/client/node_modules/vscode-languageclient/lib/common/client.js +0 -1600
  261. package/client/node_modules/vscode-languageclient/lib/common/codeAction.d.ts +0 -19
  262. package/client/node_modules/vscode-languageclient/lib/common/codeAction.js +0 -99
  263. package/client/node_modules/vscode-languageclient/lib/common/codeConverter.d.ts +0 -78
  264. package/client/node_modules/vscode-languageclient/lib/common/codeConverter.js +0 -876
  265. package/client/node_modules/vscode-languageclient/lib/common/codeLens.d.ts +0 -23
  266. package/client/node_modules/vscode-languageclient/lib/common/codeLens.js +0 -78
  267. package/client/node_modules/vscode-languageclient/lib/common/colorProvider.d.ts +0 -25
  268. package/client/node_modules/vscode-languageclient/lib/common/colorProvider.js +0 -74
  269. package/client/node_modules/vscode-languageclient/lib/common/completion.d.ts +0 -20
  270. package/client/node_modules/vscode-languageclient/lib/common/completion.js +0 -126
  271. package/client/node_modules/vscode-languageclient/lib/common/configuration.d.ts +0 -69
  272. package/client/node_modules/vscode-languageclient/lib/common/configuration.js +0 -209
  273. package/client/node_modules/vscode-languageclient/lib/common/declaration.d.ts +0 -16
  274. package/client/node_modules/vscode-languageclient/lib/common/declaration.js +0 -54
  275. package/client/node_modules/vscode-languageclient/lib/common/definition.d.ts +0 -16
  276. package/client/node_modules/vscode-languageclient/lib/common/definition.js +0 -55
  277. package/client/node_modules/vscode-languageclient/lib/common/diagnostic.d.ts +0 -122
  278. package/client/node_modules/vscode-languageclient/lib/common/diagnostic.js +0 -814
  279. package/client/node_modules/vscode-languageclient/lib/common/documentHighlight.d.ts +0 -15
  280. package/client/node_modules/vscode-languageclient/lib/common/documentHighlight.js +0 -50
  281. package/client/node_modules/vscode-languageclient/lib/common/documentLink.d.ts +0 -19
  282. package/client/node_modules/vscode-languageclient/lib/common/documentLink.js +0 -71
  283. package/client/node_modules/vscode-languageclient/lib/common/documentSymbol.d.ts +0 -17
  284. package/client/node_modules/vscode-languageclient/lib/common/documentSymbol.js +0 -104
  285. package/client/node_modules/vscode-languageclient/lib/common/executeCommand.d.ts +0 -21
  286. package/client/node_modules/vscode-languageclient/lib/common/executeCommand.js +0 -72
  287. package/client/node_modules/vscode-languageclient/lib/common/features.d.ts +0 -418
  288. package/client/node_modules/vscode-languageclient/lib/common/features.js +0 -291
  289. package/client/node_modules/vscode-languageclient/lib/common/fileOperations.d.ts +0 -116
  290. package/client/node_modules/vscode-languageclient/lib/common/fileOperations.js +0 -333
  291. package/client/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.d.ts +0 -18
  292. package/client/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js +0 -95
  293. package/client/node_modules/vscode-languageclient/lib/common/foldingRange.d.ts +0 -19
  294. package/client/node_modules/vscode-languageclient/lib/common/foldingRange.js +0 -65
  295. package/client/node_modules/vscode-languageclient/lib/common/formatting.d.ts +0 -39
  296. package/client/node_modules/vscode-languageclient/lib/common/formatting.js +0 -182
  297. package/client/node_modules/vscode-languageclient/lib/common/hover.d.ts +0 -16
  298. package/client/node_modules/vscode-languageclient/lib/common/hover.js +0 -58
  299. package/client/node_modules/vscode-languageclient/lib/common/implementation.d.ts +0 -16
  300. package/client/node_modules/vscode-languageclient/lib/common/implementation.js +0 -54
  301. package/client/node_modules/vscode-languageclient/lib/common/inlayHint.d.ts +0 -20
  302. package/client/node_modules/vscode-languageclient/lib/common/inlayHint.js +0 -92
  303. package/client/node_modules/vscode-languageclient/lib/common/inlineCompletion.d.ts +0 -18
  304. package/client/node_modules/vscode-languageclient/lib/common/inlineCompletion.js +0 -54
  305. package/client/node_modules/vscode-languageclient/lib/common/inlineValue.d.ts +0 -18
  306. package/client/node_modules/vscode-languageclient/lib/common/inlineValue.js +0 -65
  307. package/client/node_modules/vscode-languageclient/lib/common/linkedEditingRange.d.ts +0 -21
  308. package/client/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js +0 -53
  309. package/client/node_modules/vscode-languageclient/lib/common/notebook.d.ts +0 -96
  310. package/client/node_modules/vscode-languageclient/lib/common/notebook.js +0 -851
  311. package/client/node_modules/vscode-languageclient/lib/common/progress.d.ts +0 -11
  312. package/client/node_modules/vscode-languageclient/lib/common/progress.js +0 -44
  313. package/client/node_modules/vscode-languageclient/lib/common/progressPart.d.ts +0 -24
  314. package/client/node_modules/vscode-languageclient/lib/common/progressPart.js +0 -96
  315. package/client/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.d.ts +0 -6
  316. package/client/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js +0 -16
  317. package/client/node_modules/vscode-languageclient/lib/common/protocolCodeAction.d.ts +0 -6
  318. package/client/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js +0 -14
  319. package/client/node_modules/vscode-languageclient/lib/common/protocolCodeLens.d.ts +0 -5
  320. package/client/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js +0 -13
  321. package/client/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.d.ts +0 -11
  322. package/client/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js +0 -13
  323. package/client/node_modules/vscode-languageclient/lib/common/protocolConverter.d.ts +0 -167
  324. package/client/node_modules/vscode-languageclient/lib/common/protocolConverter.js +0 -1134
  325. package/client/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.d.ts +0 -18
  326. package/client/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js +0 -25
  327. package/client/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.d.ts +0 -5
  328. package/client/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js +0 -13
  329. package/client/node_modules/vscode-languageclient/lib/common/protocolInlayHint.d.ts +0 -5
  330. package/client/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js +0 -13
  331. package/client/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.d.ts +0 -6
  332. package/client/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js +0 -16
  333. package/client/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.d.ts +0 -7
  334. package/client/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js +0 -18
  335. package/client/node_modules/vscode-languageclient/lib/common/reference.d.ts +0 -20
  336. package/client/node_modules/vscode-languageclient/lib/common/reference.js +0 -53
  337. package/client/node_modules/vscode-languageclient/lib/common/rename.d.ts +0 -27
  338. package/client/node_modules/vscode-languageclient/lib/common/rename.js +0 -113
  339. package/client/node_modules/vscode-languageclient/lib/common/selectionRange.d.ts +0 -16
  340. package/client/node_modules/vscode-languageclient/lib/common/selectionRange.js +0 -57
  341. package/client/node_modules/vscode-languageclient/lib/common/semanticTokens.d.ts +0 -33
  342. package/client/node_modules/vscode-languageclient/lib/common/semanticTokens.js +0 -179
  343. package/client/node_modules/vscode-languageclient/lib/common/signatureHelp.d.ts +0 -16
  344. package/client/node_modules/vscode-languageclient/lib/common/signatureHelp.js +0 -71
  345. package/client/node_modules/vscode-languageclient/lib/common/textSynchronization.d.ts +0 -101
  346. package/client/node_modules/vscode-languageclient/lib/common/textSynchronization.js +0 -402
  347. package/client/node_modules/vscode-languageclient/lib/common/typeDefinition.d.ts +0 -16
  348. package/client/node_modules/vscode-languageclient/lib/common/typeDefinition.js +0 -55
  349. package/client/node_modules/vscode-languageclient/lib/common/typeHierarchy.d.ts +0 -31
  350. package/client/node_modules/vscode-languageclient/lib/common/typeHierarchy.js +0 -96
  351. package/client/node_modules/vscode-languageclient/lib/common/utils/async.d.ts +0 -41
  352. package/client/node_modules/vscode-languageclient/lib/common/utils/async.js +0 -276
  353. package/client/node_modules/vscode-languageclient/lib/common/utils/is.d.ts +0 -12
  354. package/client/node_modules/vscode-languageclient/lib/common/utils/is.js +0 -57
  355. package/client/node_modules/vscode-languageclient/lib/common/utils/uuid.d.ts +0 -22
  356. package/client/node_modules/vscode-languageclient/lib/common/utils/uuid.js +0 -97
  357. package/client/node_modules/vscode-languageclient/lib/common/workspaceFolder.d.ts +0 -30
  358. package/client/node_modules/vscode-languageclient/lib/common/workspaceFolder.js +0 -148
  359. package/client/node_modules/vscode-languageclient/lib/common/workspaceSymbol.d.ts +0 -19
  360. package/client/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js +0 -79
  361. package/client/node_modules/vscode-languageclient/lib/node/main.d.ts +0 -100
  362. package/client/node_modules/vscode-languageclient/lib/node/main.js +0 -570
  363. package/client/node_modules/vscode-languageclient/lib/node/processes.d.ts +0 -6
  364. package/client/node_modules/vscode-languageclient/lib/node/processes.js +0 -47
  365. package/client/node_modules/vscode-languageclient/lib/node/terminateProcess.sh +0 -16
  366. package/client/node_modules/vscode-languageclient/node.cmd +0 -5
  367. package/client/node_modules/vscode-languageclient/node.d.ts +0 -6
  368. package/client/node_modules/vscode-languageclient/node.js +0 -7
  369. package/client/node_modules/vscode-languageclient/package.json +0 -50
  370. package/client/node_modules/vscode-languageserver-protocol/License.txt +0 -11
  371. package/client/node_modules/vscode-languageserver-protocol/README.md +0 -16
  372. package/client/node_modules/vscode-languageserver-protocol/browser.d.ts +0 -6
  373. package/client/node_modules/vscode-languageserver-protocol/browser.js +0 -7
  374. package/client/node_modules/vscode-languageserver-protocol/lib/browser/main.d.ts +0 -4
  375. package/client/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -28
  376. package/client/node_modules/vscode-languageserver-protocol/lib/common/api.d.ts +0 -58
  377. package/client/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -77
  378. package/client/node_modules/vscode-languageserver-protocol/lib/common/connection.d.ts +0 -187
  379. package/client/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -15
  380. package/client/node_modules/vscode-languageserver-protocol/lib/common/messages.d.ts +0 -51
  381. package/client/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -44
  382. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.d.ts +0 -1
  383. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.$.js +0 -43
  384. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.d.ts +0 -86
  385. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -42
  386. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.d.ts +0 -66
  387. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -32
  388. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.d.ts +0 -35
  389. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -24
  390. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.d.ts +0 -3252
  391. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.d.ts +0 -37
  392. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -22
  393. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.d.ts +0 -341
  394. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -74
  395. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.d.ts +0 -306
  396. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -101
  397. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.d.ts +0 -109
  398. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -30
  399. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.d.ts +0 -38
  400. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -21
  401. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.d.ts +0 -110
  402. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -43
  403. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.d.ts +0 -57
  404. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -22
  405. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.d.ts +0 -86
  406. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -30
  407. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -943
  408. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.d.ts +0 -52
  409. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -19
  410. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.d.ts +0 -106
  411. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -68
  412. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.d.ts +0 -400
  413. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -214
  414. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.d.ts +0 -107
  415. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -37
  416. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.d.ts +0 -41
  417. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -20
  418. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.d.ts +0 -223
  419. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -57
  420. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.d.ts +0 -72
  421. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -22
  422. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.d.ts +0 -38
  423. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -21
  424. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.d.ts +0 -83
  425. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -42
  426. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.d.ts +0 -74
  427. package/client/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -27
  428. package/client/node_modules/vscode-languageserver-protocol/lib/common/utils/is.d.ts +0 -9
  429. package/client/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -46
  430. package/client/node_modules/vscode-languageserver-protocol/lib/node/main.d.ts +0 -6
  431. package/client/node_modules/vscode-languageserver-protocol/lib/node/main.js +0 -28
  432. package/client/node_modules/vscode-languageserver-protocol/metaModel.schema.json +0 -783
  433. package/client/node_modules/vscode-languageserver-protocol/node.cmd +0 -5
  434. package/client/node_modules/vscode-languageserver-protocol/node.d.ts +0 -6
  435. package/client/node_modules/vscode-languageserver-protocol/node.js +0 -7
  436. package/client/node_modules/vscode-languageserver-protocol/package.json +0 -45
  437. package/client/node_modules/vscode-languageserver-protocol/thirdpartynotices.txt +0 -31
  438. package/client/node_modules/vscode-languageserver-types/License.txt +0 -11
  439. package/client/node_modules/vscode-languageserver-types/README.md +0 -17
  440. package/client/node_modules/vscode-languageserver-types/lib/esm/main.d.ts +0 -3139
  441. package/client/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -2222
  442. package/client/node_modules/vscode-languageserver-types/lib/esm/package.json +0 -3
  443. package/client/node_modules/vscode-languageserver-types/lib/umd/main.d.ts +0 -3139
  444. package/client/node_modules/vscode-languageserver-types/lib/umd/main.js +0 -2272
  445. package/client/node_modules/vscode-languageserver-types/package.json +0 -38
  446. package/client/node_modules/vscode-languageserver-types/thirdpartynotices.txt +0 -16
  447. package/client/package-lock.json +0 -125
  448. package/client/package.json +0 -42
  449. package/client/src/extension.ts +0 -56
  450. package/client/tsconfig.json +0 -12
@@ -1,2272 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- /* --------------------------------------------------------------------------------------------
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License. See License.txt in the project root for license information.
13
- * ------------------------------------------------------------------------------------------ */
14
- 'use strict';
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0;
17
- var DocumentUri;
18
- (function (DocumentUri) {
19
- function is(value) {
20
- return typeof value === 'string';
21
- }
22
- DocumentUri.is = is;
23
- })(DocumentUri || (exports.DocumentUri = DocumentUri = {}));
24
- var URI;
25
- (function (URI) {
26
- function is(value) {
27
- return typeof value === 'string';
28
- }
29
- URI.is = is;
30
- })(URI || (exports.URI = URI = {}));
31
- var integer;
32
- (function (integer) {
33
- integer.MIN_VALUE = -2147483648;
34
- integer.MAX_VALUE = 2147483647;
35
- function is(value) {
36
- return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
37
- }
38
- integer.is = is;
39
- })(integer || (exports.integer = integer = {}));
40
- var uinteger;
41
- (function (uinteger) {
42
- uinteger.MIN_VALUE = 0;
43
- uinteger.MAX_VALUE = 2147483647;
44
- function is(value) {
45
- return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
46
- }
47
- uinteger.is = is;
48
- })(uinteger || (exports.uinteger = uinteger = {}));
49
- /**
50
- * The Position namespace provides helper functions to work with
51
- * {@link Position} literals.
52
- */
53
- var Position;
54
- (function (Position) {
55
- /**
56
- * Creates a new Position literal from the given line and character.
57
- * @param line The position's line.
58
- * @param character The position's character.
59
- */
60
- function create(line, character) {
61
- if (line === Number.MAX_VALUE) {
62
- line = uinteger.MAX_VALUE;
63
- }
64
- if (character === Number.MAX_VALUE) {
65
- character = uinteger.MAX_VALUE;
66
- }
67
- return { line: line, character: character };
68
- }
69
- Position.create = create;
70
- /**
71
- * Checks whether the given literal conforms to the {@link Position} interface.
72
- */
73
- function is(value) {
74
- var candidate = value;
75
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
76
- }
77
- Position.is = is;
78
- })(Position || (exports.Position = Position = {}));
79
- /**
80
- * The Range namespace provides helper functions to work with
81
- * {@link Range} literals.
82
- */
83
- var Range;
84
- (function (Range) {
85
- function create(one, two, three, four) {
86
- if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
87
- return { start: Position.create(one, two), end: Position.create(three, four) };
88
- }
89
- else if (Position.is(one) && Position.is(two)) {
90
- return { start: one, end: two };
91
- }
92
- else {
93
- throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
94
- }
95
- }
96
- Range.create = create;
97
- /**
98
- * Checks whether the given literal conforms to the {@link Range} interface.
99
- */
100
- function is(value) {
101
- var candidate = value;
102
- return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
103
- }
104
- Range.is = is;
105
- })(Range || (exports.Range = Range = {}));
106
- /**
107
- * The Location namespace provides helper functions to work with
108
- * {@link Location} literals.
109
- */
110
- var Location;
111
- (function (Location) {
112
- /**
113
- * Creates a Location literal.
114
- * @param uri The location's uri.
115
- * @param range The location's range.
116
- */
117
- function create(uri, range) {
118
- return { uri: uri, range: range };
119
- }
120
- Location.create = create;
121
- /**
122
- * Checks whether the given literal conforms to the {@link Location} interface.
123
- */
124
- function is(value) {
125
- var candidate = value;
126
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
127
- }
128
- Location.is = is;
129
- })(Location || (exports.Location = Location = {}));
130
- /**
131
- * The LocationLink namespace provides helper functions to work with
132
- * {@link LocationLink} literals.
133
- */
134
- var LocationLink;
135
- (function (LocationLink) {
136
- /**
137
- * Creates a LocationLink literal.
138
- * @param targetUri The definition's uri.
139
- * @param targetRange The full range of the definition.
140
- * @param targetSelectionRange The span of the symbol definition at the target.
141
- * @param originSelectionRange The span of the symbol being defined in the originating source file.
142
- */
143
- function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
144
- return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
145
- }
146
- LocationLink.create = create;
147
- /**
148
- * Checks whether the given literal conforms to the {@link LocationLink} interface.
149
- */
150
- function is(value) {
151
- var candidate = value;
152
- return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
153
- && Range.is(candidate.targetSelectionRange)
154
- && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
155
- }
156
- LocationLink.is = is;
157
- })(LocationLink || (exports.LocationLink = LocationLink = {}));
158
- /**
159
- * The Color namespace provides helper functions to work with
160
- * {@link Color} literals.
161
- */
162
- var Color;
163
- (function (Color) {
164
- /**
165
- * Creates a new Color literal.
166
- */
167
- function create(red, green, blue, alpha) {
168
- return {
169
- red: red,
170
- green: green,
171
- blue: blue,
172
- alpha: alpha,
173
- };
174
- }
175
- Color.create = create;
176
- /**
177
- * Checks whether the given literal conforms to the {@link Color} interface.
178
- */
179
- function is(value) {
180
- var candidate = value;
181
- return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)
182
- && Is.numberRange(candidate.green, 0, 1)
183
- && Is.numberRange(candidate.blue, 0, 1)
184
- && Is.numberRange(candidate.alpha, 0, 1);
185
- }
186
- Color.is = is;
187
- })(Color || (exports.Color = Color = {}));
188
- /**
189
- * The ColorInformation namespace provides helper functions to work with
190
- * {@link ColorInformation} literals.
191
- */
192
- var ColorInformation;
193
- (function (ColorInformation) {
194
- /**
195
- * Creates a new ColorInformation literal.
196
- */
197
- function create(range, color) {
198
- return {
199
- range: range,
200
- color: color,
201
- };
202
- }
203
- ColorInformation.create = create;
204
- /**
205
- * Checks whether the given literal conforms to the {@link ColorInformation} interface.
206
- */
207
- function is(value) {
208
- var candidate = value;
209
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
210
- }
211
- ColorInformation.is = is;
212
- })(ColorInformation || (exports.ColorInformation = ColorInformation = {}));
213
- /**
214
- * The Color namespace provides helper functions to work with
215
- * {@link ColorPresentation} literals.
216
- */
217
- var ColorPresentation;
218
- (function (ColorPresentation) {
219
- /**
220
- * Creates a new ColorInformation literal.
221
- */
222
- function create(label, textEdit, additionalTextEdits) {
223
- return {
224
- label: label,
225
- textEdit: textEdit,
226
- additionalTextEdits: additionalTextEdits,
227
- };
228
- }
229
- ColorPresentation.create = create;
230
- /**
231
- * Checks whether the given literal conforms to the {@link ColorInformation} interface.
232
- */
233
- function is(value) {
234
- var candidate = value;
235
- return Is.objectLiteral(candidate) && Is.string(candidate.label)
236
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
237
- && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
238
- }
239
- ColorPresentation.is = is;
240
- })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {}));
241
- /**
242
- * A set of predefined range kinds.
243
- */
244
- var FoldingRangeKind;
245
- (function (FoldingRangeKind) {
246
- /**
247
- * Folding range for a comment
248
- */
249
- FoldingRangeKind.Comment = 'comment';
250
- /**
251
- * Folding range for an import or include
252
- */
253
- FoldingRangeKind.Imports = 'imports';
254
- /**
255
- * Folding range for a region (e.g. `#region`)
256
- */
257
- FoldingRangeKind.Region = 'region';
258
- })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {}));
259
- /**
260
- * The folding range namespace provides helper functions to work with
261
- * {@link FoldingRange} literals.
262
- */
263
- var FoldingRange;
264
- (function (FoldingRange) {
265
- /**
266
- * Creates a new FoldingRange literal.
267
- */
268
- function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
269
- var result = {
270
- startLine: startLine,
271
- endLine: endLine
272
- };
273
- if (Is.defined(startCharacter)) {
274
- result.startCharacter = startCharacter;
275
- }
276
- if (Is.defined(endCharacter)) {
277
- result.endCharacter = endCharacter;
278
- }
279
- if (Is.defined(kind)) {
280
- result.kind = kind;
281
- }
282
- if (Is.defined(collapsedText)) {
283
- result.collapsedText = collapsedText;
284
- }
285
- return result;
286
- }
287
- FoldingRange.create = create;
288
- /**
289
- * Checks whether the given literal conforms to the {@link FoldingRange} interface.
290
- */
291
- function is(value) {
292
- var candidate = value;
293
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
294
- && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
295
- && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
296
- && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
297
- }
298
- FoldingRange.is = is;
299
- })(FoldingRange || (exports.FoldingRange = FoldingRange = {}));
300
- /**
301
- * The DiagnosticRelatedInformation namespace provides helper functions to work with
302
- * {@link DiagnosticRelatedInformation} literals.
303
- */
304
- var DiagnosticRelatedInformation;
305
- (function (DiagnosticRelatedInformation) {
306
- /**
307
- * Creates a new DiagnosticRelatedInformation literal.
308
- */
309
- function create(location, message) {
310
- return {
311
- location: location,
312
- message: message
313
- };
314
- }
315
- DiagnosticRelatedInformation.create = create;
316
- /**
317
- * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
318
- */
319
- function is(value) {
320
- var candidate = value;
321
- return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
322
- }
323
- DiagnosticRelatedInformation.is = is;
324
- })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));
325
- /**
326
- * The diagnostic's severity.
327
- */
328
- var DiagnosticSeverity;
329
- (function (DiagnosticSeverity) {
330
- /**
331
- * Reports an error.
332
- */
333
- DiagnosticSeverity.Error = 1;
334
- /**
335
- * Reports a warning.
336
- */
337
- DiagnosticSeverity.Warning = 2;
338
- /**
339
- * Reports an information.
340
- */
341
- DiagnosticSeverity.Information = 3;
342
- /**
343
- * Reports a hint.
344
- */
345
- DiagnosticSeverity.Hint = 4;
346
- })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));
347
- /**
348
- * The diagnostic tags.
349
- *
350
- * @since 3.15.0
351
- */
352
- var DiagnosticTag;
353
- (function (DiagnosticTag) {
354
- /**
355
- * Unused or unnecessary code.
356
- *
357
- * Clients are allowed to render diagnostics with this tag faded out instead of having
358
- * an error squiggle.
359
- */
360
- DiagnosticTag.Unnecessary = 1;
361
- /**
362
- * Deprecated or obsolete code.
363
- *
364
- * Clients are allowed to rendered diagnostics with this tag strike through.
365
- */
366
- DiagnosticTag.Deprecated = 2;
367
- })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {}));
368
- /**
369
- * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
370
- *
371
- * @since 3.16.0
372
- */
373
- var CodeDescription;
374
- (function (CodeDescription) {
375
- function is(value) {
376
- var candidate = value;
377
- return Is.objectLiteral(candidate) && Is.string(candidate.href);
378
- }
379
- CodeDescription.is = is;
380
- })(CodeDescription || (exports.CodeDescription = CodeDescription = {}));
381
- /**
382
- * The Diagnostic namespace provides helper functions to work with
383
- * {@link Diagnostic} literals.
384
- */
385
- var Diagnostic;
386
- (function (Diagnostic) {
387
- /**
388
- * Creates a new Diagnostic literal.
389
- */
390
- function create(range, message, severity, code, source, relatedInformation) {
391
- var result = { range: range, message: message };
392
- if (Is.defined(severity)) {
393
- result.severity = severity;
394
- }
395
- if (Is.defined(code)) {
396
- result.code = code;
397
- }
398
- if (Is.defined(source)) {
399
- result.source = source;
400
- }
401
- if (Is.defined(relatedInformation)) {
402
- result.relatedInformation = relatedInformation;
403
- }
404
- return result;
405
- }
406
- Diagnostic.create = create;
407
- /**
408
- * Checks whether the given literal conforms to the {@link Diagnostic} interface.
409
- */
410
- function is(value) {
411
- var _a;
412
- var candidate = value;
413
- return Is.defined(candidate)
414
- && Range.is(candidate.range)
415
- && Is.string(candidate.message)
416
- && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
417
- && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
418
- && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
419
- && (Is.string(candidate.source) || Is.undefined(candidate.source))
420
- && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
421
- }
422
- Diagnostic.is = is;
423
- })(Diagnostic || (exports.Diagnostic = Diagnostic = {}));
424
- /**
425
- * The Command namespace provides helper functions to work with
426
- * {@link Command} literals.
427
- */
428
- var Command;
429
- (function (Command) {
430
- /**
431
- * Creates a new Command literal.
432
- */
433
- function create(title, command) {
434
- var args = [];
435
- for (var _i = 2; _i < arguments.length; _i++) {
436
- args[_i - 2] = arguments[_i];
437
- }
438
- var result = { title: title, command: command };
439
- if (Is.defined(args) && args.length > 0) {
440
- result.arguments = args;
441
- }
442
- return result;
443
- }
444
- Command.create = create;
445
- /**
446
- * Checks whether the given literal conforms to the {@link Command} interface.
447
- */
448
- function is(value) {
449
- var candidate = value;
450
- return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
451
- }
452
- Command.is = is;
453
- })(Command || (exports.Command = Command = {}));
454
- /**
455
- * The TextEdit namespace provides helper function to create replace,
456
- * insert and delete edits more easily.
457
- */
458
- var TextEdit;
459
- (function (TextEdit) {
460
- /**
461
- * Creates a replace text edit.
462
- * @param range The range of text to be replaced.
463
- * @param newText The new text.
464
- */
465
- function replace(range, newText) {
466
- return { range: range, newText: newText };
467
- }
468
- TextEdit.replace = replace;
469
- /**
470
- * Creates an insert text edit.
471
- * @param position The position to insert the text at.
472
- * @param newText The text to be inserted.
473
- */
474
- function insert(position, newText) {
475
- return { range: { start: position, end: position }, newText: newText };
476
- }
477
- TextEdit.insert = insert;
478
- /**
479
- * Creates a delete text edit.
480
- * @param range The range of text to be deleted.
481
- */
482
- function del(range) {
483
- return { range: range, newText: '' };
484
- }
485
- TextEdit.del = del;
486
- function is(value) {
487
- var candidate = value;
488
- return Is.objectLiteral(candidate)
489
- && Is.string(candidate.newText)
490
- && Range.is(candidate.range);
491
- }
492
- TextEdit.is = is;
493
- })(TextEdit || (exports.TextEdit = TextEdit = {}));
494
- var ChangeAnnotation;
495
- (function (ChangeAnnotation) {
496
- function create(label, needsConfirmation, description) {
497
- var result = { label: label };
498
- if (needsConfirmation !== undefined) {
499
- result.needsConfirmation = needsConfirmation;
500
- }
501
- if (description !== undefined) {
502
- result.description = description;
503
- }
504
- return result;
505
- }
506
- ChangeAnnotation.create = create;
507
- function is(value) {
508
- var candidate = value;
509
- return Is.objectLiteral(candidate) && Is.string(candidate.label) &&
510
- (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
511
- (Is.string(candidate.description) || candidate.description === undefined);
512
- }
513
- ChangeAnnotation.is = is;
514
- })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {}));
515
- var ChangeAnnotationIdentifier;
516
- (function (ChangeAnnotationIdentifier) {
517
- function is(value) {
518
- var candidate = value;
519
- return Is.string(candidate);
520
- }
521
- ChangeAnnotationIdentifier.is = is;
522
- })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));
523
- var AnnotatedTextEdit;
524
- (function (AnnotatedTextEdit) {
525
- /**
526
- * Creates an annotated replace text edit.
527
- *
528
- * @param range The range of text to be replaced.
529
- * @param newText The new text.
530
- * @param annotation The annotation.
531
- */
532
- function replace(range, newText, annotation) {
533
- return { range: range, newText: newText, annotationId: annotation };
534
- }
535
- AnnotatedTextEdit.replace = replace;
536
- /**
537
- * Creates an annotated insert text edit.
538
- *
539
- * @param position The position to insert the text at.
540
- * @param newText The text to be inserted.
541
- * @param annotation The annotation.
542
- */
543
- function insert(position, newText, annotation) {
544
- return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
545
- }
546
- AnnotatedTextEdit.insert = insert;
547
- /**
548
- * Creates an annotated delete text edit.
549
- *
550
- * @param range The range of text to be deleted.
551
- * @param annotation The annotation.
552
- */
553
- function del(range, annotation) {
554
- return { range: range, newText: '', annotationId: annotation };
555
- }
556
- AnnotatedTextEdit.del = del;
557
- function is(value) {
558
- var candidate = value;
559
- return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
560
- }
561
- AnnotatedTextEdit.is = is;
562
- })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {}));
563
- /**
564
- * The TextDocumentEdit namespace provides helper function to create
565
- * an edit that manipulates a text document.
566
- */
567
- var TextDocumentEdit;
568
- (function (TextDocumentEdit) {
569
- /**
570
- * Creates a new `TextDocumentEdit`
571
- */
572
- function create(textDocument, edits) {
573
- return { textDocument: textDocument, edits: edits };
574
- }
575
- TextDocumentEdit.create = create;
576
- function is(value) {
577
- var candidate = value;
578
- return Is.defined(candidate)
579
- && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
580
- && Array.isArray(candidate.edits);
581
- }
582
- TextDocumentEdit.is = is;
583
- })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {}));
584
- var CreateFile;
585
- (function (CreateFile) {
586
- function create(uri, options, annotation) {
587
- var result = {
588
- kind: 'create',
589
- uri: uri
590
- };
591
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
592
- result.options = options;
593
- }
594
- if (annotation !== undefined) {
595
- result.annotationId = annotation;
596
- }
597
- return result;
598
- }
599
- CreateFile.create = create;
600
- function is(value) {
601
- var candidate = value;
602
- return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
603
- ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
604
- }
605
- CreateFile.is = is;
606
- })(CreateFile || (exports.CreateFile = CreateFile = {}));
607
- var RenameFile;
608
- (function (RenameFile) {
609
- function create(oldUri, newUri, options, annotation) {
610
- var result = {
611
- kind: 'rename',
612
- oldUri: oldUri,
613
- newUri: newUri
614
- };
615
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
616
- result.options = options;
617
- }
618
- if (annotation !== undefined) {
619
- result.annotationId = annotation;
620
- }
621
- return result;
622
- }
623
- RenameFile.create = create;
624
- function is(value) {
625
- var candidate = value;
626
- return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
627
- ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
628
- }
629
- RenameFile.is = is;
630
- })(RenameFile || (exports.RenameFile = RenameFile = {}));
631
- var DeleteFile;
632
- (function (DeleteFile) {
633
- function create(uri, options, annotation) {
634
- var result = {
635
- kind: 'delete',
636
- uri: uri
637
- };
638
- if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
639
- result.options = options;
640
- }
641
- if (annotation !== undefined) {
642
- result.annotationId = annotation;
643
- }
644
- return result;
645
- }
646
- DeleteFile.create = create;
647
- function is(value) {
648
- var candidate = value;
649
- return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
650
- ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
651
- }
652
- DeleteFile.is = is;
653
- })(DeleteFile || (exports.DeleteFile = DeleteFile = {}));
654
- var WorkspaceEdit;
655
- (function (WorkspaceEdit) {
656
- function is(value) {
657
- var candidate = value;
658
- return candidate &&
659
- (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
660
- (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
661
- if (Is.string(change.kind)) {
662
- return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
663
- }
664
- else {
665
- return TextDocumentEdit.is(change);
666
- }
667
- }));
668
- }
669
- WorkspaceEdit.is = is;
670
- })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {}));
671
- var TextEditChangeImpl = /** @class */ (function () {
672
- function TextEditChangeImpl(edits, changeAnnotations) {
673
- this.edits = edits;
674
- this.changeAnnotations = changeAnnotations;
675
- }
676
- TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
677
- var edit;
678
- var id;
679
- if (annotation === undefined) {
680
- edit = TextEdit.insert(position, newText);
681
- }
682
- else if (ChangeAnnotationIdentifier.is(annotation)) {
683
- id = annotation;
684
- edit = AnnotatedTextEdit.insert(position, newText, annotation);
685
- }
686
- else {
687
- this.assertChangeAnnotations(this.changeAnnotations);
688
- id = this.changeAnnotations.manage(annotation);
689
- edit = AnnotatedTextEdit.insert(position, newText, id);
690
- }
691
- this.edits.push(edit);
692
- if (id !== undefined) {
693
- return id;
694
- }
695
- };
696
- TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
697
- var edit;
698
- var id;
699
- if (annotation === undefined) {
700
- edit = TextEdit.replace(range, newText);
701
- }
702
- else if (ChangeAnnotationIdentifier.is(annotation)) {
703
- id = annotation;
704
- edit = AnnotatedTextEdit.replace(range, newText, annotation);
705
- }
706
- else {
707
- this.assertChangeAnnotations(this.changeAnnotations);
708
- id = this.changeAnnotations.manage(annotation);
709
- edit = AnnotatedTextEdit.replace(range, newText, id);
710
- }
711
- this.edits.push(edit);
712
- if (id !== undefined) {
713
- return id;
714
- }
715
- };
716
- TextEditChangeImpl.prototype.delete = function (range, annotation) {
717
- var edit;
718
- var id;
719
- if (annotation === undefined) {
720
- edit = TextEdit.del(range);
721
- }
722
- else if (ChangeAnnotationIdentifier.is(annotation)) {
723
- id = annotation;
724
- edit = AnnotatedTextEdit.del(range, annotation);
725
- }
726
- else {
727
- this.assertChangeAnnotations(this.changeAnnotations);
728
- id = this.changeAnnotations.manage(annotation);
729
- edit = AnnotatedTextEdit.del(range, id);
730
- }
731
- this.edits.push(edit);
732
- if (id !== undefined) {
733
- return id;
734
- }
735
- };
736
- TextEditChangeImpl.prototype.add = function (edit) {
737
- this.edits.push(edit);
738
- };
739
- TextEditChangeImpl.prototype.all = function () {
740
- return this.edits;
741
- };
742
- TextEditChangeImpl.prototype.clear = function () {
743
- this.edits.splice(0, this.edits.length);
744
- };
745
- TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
746
- if (value === undefined) {
747
- throw new Error("Text edit change is not configured to manage change annotations.");
748
- }
749
- };
750
- return TextEditChangeImpl;
751
- }());
752
- /**
753
- * A helper class
754
- */
755
- var ChangeAnnotations = /** @class */ (function () {
756
- function ChangeAnnotations(annotations) {
757
- this._annotations = annotations === undefined ? Object.create(null) : annotations;
758
- this._counter = 0;
759
- this._size = 0;
760
- }
761
- ChangeAnnotations.prototype.all = function () {
762
- return this._annotations;
763
- };
764
- Object.defineProperty(ChangeAnnotations.prototype, "size", {
765
- get: function () {
766
- return this._size;
767
- },
768
- enumerable: false,
769
- configurable: true
770
- });
771
- ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
772
- var id;
773
- if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
774
- id = idOrAnnotation;
775
- }
776
- else {
777
- id = this.nextId();
778
- annotation = idOrAnnotation;
779
- }
780
- if (this._annotations[id] !== undefined) {
781
- throw new Error("Id ".concat(id, " is already in use."));
782
- }
783
- if (annotation === undefined) {
784
- throw new Error("No annotation provided for id ".concat(id));
785
- }
786
- this._annotations[id] = annotation;
787
- this._size++;
788
- return id;
789
- };
790
- ChangeAnnotations.prototype.nextId = function () {
791
- this._counter++;
792
- return this._counter.toString();
793
- };
794
- return ChangeAnnotations;
795
- }());
796
- /**
797
- * A workspace change helps constructing changes to a workspace.
798
- */
799
- var WorkspaceChange = /** @class */ (function () {
800
- function WorkspaceChange(workspaceEdit) {
801
- var _this = this;
802
- this._textEditChanges = Object.create(null);
803
- if (workspaceEdit !== undefined) {
804
- this._workspaceEdit = workspaceEdit;
805
- if (workspaceEdit.documentChanges) {
806
- this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
807
- workspaceEdit.changeAnnotations = this._changeAnnotations.all();
808
- workspaceEdit.documentChanges.forEach(function (change) {
809
- if (TextDocumentEdit.is(change)) {
810
- var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
811
- _this._textEditChanges[change.textDocument.uri] = textEditChange;
812
- }
813
- });
814
- }
815
- else if (workspaceEdit.changes) {
816
- Object.keys(workspaceEdit.changes).forEach(function (key) {
817
- var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
818
- _this._textEditChanges[key] = textEditChange;
819
- });
820
- }
821
- }
822
- else {
823
- this._workspaceEdit = {};
824
- }
825
- }
826
- Object.defineProperty(WorkspaceChange.prototype, "edit", {
827
- /**
828
- * Returns the underlying {@link WorkspaceEdit} literal
829
- * use to be returned from a workspace edit operation like rename.
830
- */
831
- get: function () {
832
- this.initDocumentChanges();
833
- if (this._changeAnnotations !== undefined) {
834
- if (this._changeAnnotations.size === 0) {
835
- this._workspaceEdit.changeAnnotations = undefined;
836
- }
837
- else {
838
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
839
- }
840
- }
841
- return this._workspaceEdit;
842
- },
843
- enumerable: false,
844
- configurable: true
845
- });
846
- WorkspaceChange.prototype.getTextEditChange = function (key) {
847
- if (OptionalVersionedTextDocumentIdentifier.is(key)) {
848
- this.initDocumentChanges();
849
- if (this._workspaceEdit.documentChanges === undefined) {
850
- throw new Error('Workspace edit is not configured for document changes.');
851
- }
852
- var textDocument = { uri: key.uri, version: key.version };
853
- var result = this._textEditChanges[textDocument.uri];
854
- if (!result) {
855
- var edits = [];
856
- var textDocumentEdit = {
857
- textDocument: textDocument,
858
- edits: edits
859
- };
860
- this._workspaceEdit.documentChanges.push(textDocumentEdit);
861
- result = new TextEditChangeImpl(edits, this._changeAnnotations);
862
- this._textEditChanges[textDocument.uri] = result;
863
- }
864
- return result;
865
- }
866
- else {
867
- this.initChanges();
868
- if (this._workspaceEdit.changes === undefined) {
869
- throw new Error('Workspace edit is not configured for normal text edit changes.');
870
- }
871
- var result = this._textEditChanges[key];
872
- if (!result) {
873
- var edits = [];
874
- this._workspaceEdit.changes[key] = edits;
875
- result = new TextEditChangeImpl(edits);
876
- this._textEditChanges[key] = result;
877
- }
878
- return result;
879
- }
880
- };
881
- WorkspaceChange.prototype.initDocumentChanges = function () {
882
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
883
- this._changeAnnotations = new ChangeAnnotations();
884
- this._workspaceEdit.documentChanges = [];
885
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
886
- }
887
- };
888
- WorkspaceChange.prototype.initChanges = function () {
889
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
890
- this._workspaceEdit.changes = Object.create(null);
891
- }
892
- };
893
- WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
894
- this.initDocumentChanges();
895
- if (this._workspaceEdit.documentChanges === undefined) {
896
- throw new Error('Workspace edit is not configured for document changes.');
897
- }
898
- var annotation;
899
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
900
- annotation = optionsOrAnnotation;
901
- }
902
- else {
903
- options = optionsOrAnnotation;
904
- }
905
- var operation;
906
- var id;
907
- if (annotation === undefined) {
908
- operation = CreateFile.create(uri, options);
909
- }
910
- else {
911
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
912
- operation = CreateFile.create(uri, options, id);
913
- }
914
- this._workspaceEdit.documentChanges.push(operation);
915
- if (id !== undefined) {
916
- return id;
917
- }
918
- };
919
- WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
920
- this.initDocumentChanges();
921
- if (this._workspaceEdit.documentChanges === undefined) {
922
- throw new Error('Workspace edit is not configured for document changes.');
923
- }
924
- var annotation;
925
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
926
- annotation = optionsOrAnnotation;
927
- }
928
- else {
929
- options = optionsOrAnnotation;
930
- }
931
- var operation;
932
- var id;
933
- if (annotation === undefined) {
934
- operation = RenameFile.create(oldUri, newUri, options);
935
- }
936
- else {
937
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
938
- operation = RenameFile.create(oldUri, newUri, options, id);
939
- }
940
- this._workspaceEdit.documentChanges.push(operation);
941
- if (id !== undefined) {
942
- return id;
943
- }
944
- };
945
- WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
946
- this.initDocumentChanges();
947
- if (this._workspaceEdit.documentChanges === undefined) {
948
- throw new Error('Workspace edit is not configured for document changes.');
949
- }
950
- var annotation;
951
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
952
- annotation = optionsOrAnnotation;
953
- }
954
- else {
955
- options = optionsOrAnnotation;
956
- }
957
- var operation;
958
- var id;
959
- if (annotation === undefined) {
960
- operation = DeleteFile.create(uri, options);
961
- }
962
- else {
963
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
964
- operation = DeleteFile.create(uri, options, id);
965
- }
966
- this._workspaceEdit.documentChanges.push(operation);
967
- if (id !== undefined) {
968
- return id;
969
- }
970
- };
971
- return WorkspaceChange;
972
- }());
973
- exports.WorkspaceChange = WorkspaceChange;
974
- /**
975
- * The TextDocumentIdentifier namespace provides helper functions to work with
976
- * {@link TextDocumentIdentifier} literals.
977
- */
978
- var TextDocumentIdentifier;
979
- (function (TextDocumentIdentifier) {
980
- /**
981
- * Creates a new TextDocumentIdentifier literal.
982
- * @param uri The document's uri.
983
- */
984
- function create(uri) {
985
- return { uri: uri };
986
- }
987
- TextDocumentIdentifier.create = create;
988
- /**
989
- * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
990
- */
991
- function is(value) {
992
- var candidate = value;
993
- return Is.defined(candidate) && Is.string(candidate.uri);
994
- }
995
- TextDocumentIdentifier.is = is;
996
- })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {}));
997
- /**
998
- * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
999
- * {@link VersionedTextDocumentIdentifier} literals.
1000
- */
1001
- var VersionedTextDocumentIdentifier;
1002
- (function (VersionedTextDocumentIdentifier) {
1003
- /**
1004
- * Creates a new VersionedTextDocumentIdentifier literal.
1005
- * @param uri The document's uri.
1006
- * @param version The document's version.
1007
- */
1008
- function create(uri, version) {
1009
- return { uri: uri, version: version };
1010
- }
1011
- VersionedTextDocumentIdentifier.create = create;
1012
- /**
1013
- * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
1014
- */
1015
- function is(value) {
1016
- var candidate = value;
1017
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
1018
- }
1019
- VersionedTextDocumentIdentifier.is = is;
1020
- })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));
1021
- /**
1022
- * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
1023
- * {@link OptionalVersionedTextDocumentIdentifier} literals.
1024
- */
1025
- var OptionalVersionedTextDocumentIdentifier;
1026
- (function (OptionalVersionedTextDocumentIdentifier) {
1027
- /**
1028
- * Creates a new OptionalVersionedTextDocumentIdentifier literal.
1029
- * @param uri The document's uri.
1030
- * @param version The document's version.
1031
- */
1032
- function create(uri, version) {
1033
- return { uri: uri, version: version };
1034
- }
1035
- OptionalVersionedTextDocumentIdentifier.create = create;
1036
- /**
1037
- * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
1038
- */
1039
- function is(value) {
1040
- var candidate = value;
1041
- return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
1042
- }
1043
- OptionalVersionedTextDocumentIdentifier.is = is;
1044
- })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));
1045
- /**
1046
- * The TextDocumentItem namespace provides helper functions to work with
1047
- * {@link TextDocumentItem} literals.
1048
- */
1049
- var TextDocumentItem;
1050
- (function (TextDocumentItem) {
1051
- /**
1052
- * Creates a new TextDocumentItem literal.
1053
- * @param uri The document's uri.
1054
- * @param languageId The document's language identifier.
1055
- * @param version The document's version number.
1056
- * @param text The document's text.
1057
- */
1058
- function create(uri, languageId, version, text) {
1059
- return { uri: uri, languageId: languageId, version: version, text: text };
1060
- }
1061
- TextDocumentItem.create = create;
1062
- /**
1063
- * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
1064
- */
1065
- function is(value) {
1066
- var candidate = value;
1067
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
1068
- }
1069
- TextDocumentItem.is = is;
1070
- })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {}));
1071
- /**
1072
- * Describes the content type that a client supports in various
1073
- * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
1074
- *
1075
- * Please note that `MarkupKinds` must not start with a `$`. This kinds
1076
- * are reserved for internal usage.
1077
- */
1078
- var MarkupKind;
1079
- (function (MarkupKind) {
1080
- /**
1081
- * Plain text is supported as a content format
1082
- */
1083
- MarkupKind.PlainText = 'plaintext';
1084
- /**
1085
- * Markdown is supported as a content format
1086
- */
1087
- MarkupKind.Markdown = 'markdown';
1088
- /**
1089
- * Checks whether the given value is a value of the {@link MarkupKind} type.
1090
- */
1091
- function is(value) {
1092
- var candidate = value;
1093
- return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
1094
- }
1095
- MarkupKind.is = is;
1096
- })(MarkupKind || (exports.MarkupKind = MarkupKind = {}));
1097
- var MarkupContent;
1098
- (function (MarkupContent) {
1099
- /**
1100
- * Checks whether the given value conforms to the {@link MarkupContent} interface.
1101
- */
1102
- function is(value) {
1103
- var candidate = value;
1104
- return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
1105
- }
1106
- MarkupContent.is = is;
1107
- })(MarkupContent || (exports.MarkupContent = MarkupContent = {}));
1108
- /**
1109
- * The kind of a completion entry.
1110
- */
1111
- var CompletionItemKind;
1112
- (function (CompletionItemKind) {
1113
- CompletionItemKind.Text = 1;
1114
- CompletionItemKind.Method = 2;
1115
- CompletionItemKind.Function = 3;
1116
- CompletionItemKind.Constructor = 4;
1117
- CompletionItemKind.Field = 5;
1118
- CompletionItemKind.Variable = 6;
1119
- CompletionItemKind.Class = 7;
1120
- CompletionItemKind.Interface = 8;
1121
- CompletionItemKind.Module = 9;
1122
- CompletionItemKind.Property = 10;
1123
- CompletionItemKind.Unit = 11;
1124
- CompletionItemKind.Value = 12;
1125
- CompletionItemKind.Enum = 13;
1126
- CompletionItemKind.Keyword = 14;
1127
- CompletionItemKind.Snippet = 15;
1128
- CompletionItemKind.Color = 16;
1129
- CompletionItemKind.File = 17;
1130
- CompletionItemKind.Reference = 18;
1131
- CompletionItemKind.Folder = 19;
1132
- CompletionItemKind.EnumMember = 20;
1133
- CompletionItemKind.Constant = 21;
1134
- CompletionItemKind.Struct = 22;
1135
- CompletionItemKind.Event = 23;
1136
- CompletionItemKind.Operator = 24;
1137
- CompletionItemKind.TypeParameter = 25;
1138
- })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));
1139
- /**
1140
- * Defines whether the insert text in a completion item should be interpreted as
1141
- * plain text or a snippet.
1142
- */
1143
- var InsertTextFormat;
1144
- (function (InsertTextFormat) {
1145
- /**
1146
- * The primary text to be inserted is treated as a plain string.
1147
- */
1148
- InsertTextFormat.PlainText = 1;
1149
- /**
1150
- * The primary text to be inserted is treated as a snippet.
1151
- *
1152
- * A snippet can define tab stops and placeholders with `$1`, `$2`
1153
- * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
1154
- * the end of the snippet. Placeholders with equal identifiers are linked,
1155
- * that is typing in one will update others too.
1156
- *
1157
- * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
1158
- */
1159
- InsertTextFormat.Snippet = 2;
1160
- })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {}));
1161
- /**
1162
- * Completion item tags are extra annotations that tweak the rendering of a completion
1163
- * item.
1164
- *
1165
- * @since 3.15.0
1166
- */
1167
- var CompletionItemTag;
1168
- (function (CompletionItemTag) {
1169
- /**
1170
- * Render a completion as obsolete, usually using a strike-out.
1171
- */
1172
- CompletionItemTag.Deprecated = 1;
1173
- })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {}));
1174
- /**
1175
- * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
1176
- *
1177
- * @since 3.16.0
1178
- */
1179
- var InsertReplaceEdit;
1180
- (function (InsertReplaceEdit) {
1181
- /**
1182
- * Creates a new insert / replace edit
1183
- */
1184
- function create(newText, insert, replace) {
1185
- return { newText: newText, insert: insert, replace: replace };
1186
- }
1187
- InsertReplaceEdit.create = create;
1188
- /**
1189
- * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
1190
- */
1191
- function is(value) {
1192
- var candidate = value;
1193
- return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
1194
- }
1195
- InsertReplaceEdit.is = is;
1196
- })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {}));
1197
- /**
1198
- * How whitespace and indentation is handled during completion
1199
- * item insertion.
1200
- *
1201
- * @since 3.16.0
1202
- */
1203
- var InsertTextMode;
1204
- (function (InsertTextMode) {
1205
- /**
1206
- * The insertion or replace strings is taken as it is. If the
1207
- * value is multi line the lines below the cursor will be
1208
- * inserted using the indentation defined in the string value.
1209
- * The client will not apply any kind of adjustments to the
1210
- * string.
1211
- */
1212
- InsertTextMode.asIs = 1;
1213
- /**
1214
- * The editor adjusts leading whitespace of new lines so that
1215
- * they match the indentation up to the cursor of the line for
1216
- * which the item is accepted.
1217
- *
1218
- * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
1219
- * multi line completion item is indented using 2 tabs and all
1220
- * following lines inserted will be indented using 2 tabs as well.
1221
- */
1222
- InsertTextMode.adjustIndentation = 2;
1223
- })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {}));
1224
- var CompletionItemLabelDetails;
1225
- (function (CompletionItemLabelDetails) {
1226
- function is(value) {
1227
- var candidate = value;
1228
- return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&
1229
- (Is.string(candidate.description) || candidate.description === undefined);
1230
- }
1231
- CompletionItemLabelDetails.is = is;
1232
- })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));
1233
- /**
1234
- * The CompletionItem namespace provides functions to deal with
1235
- * completion items.
1236
- */
1237
- var CompletionItem;
1238
- (function (CompletionItem) {
1239
- /**
1240
- * Create a completion item and seed it with a label.
1241
- * @param label The completion item's label
1242
- */
1243
- function create(label) {
1244
- return { label: label };
1245
- }
1246
- CompletionItem.create = create;
1247
- })(CompletionItem || (exports.CompletionItem = CompletionItem = {}));
1248
- /**
1249
- * The CompletionList namespace provides functions to deal with
1250
- * completion lists.
1251
- */
1252
- var CompletionList;
1253
- (function (CompletionList) {
1254
- /**
1255
- * Creates a new completion list.
1256
- *
1257
- * @param items The completion items.
1258
- * @param isIncomplete The list is not complete.
1259
- */
1260
- function create(items, isIncomplete) {
1261
- return { items: items ? items : [], isIncomplete: !!isIncomplete };
1262
- }
1263
- CompletionList.create = create;
1264
- })(CompletionList || (exports.CompletionList = CompletionList = {}));
1265
- var MarkedString;
1266
- (function (MarkedString) {
1267
- /**
1268
- * Creates a marked string from plain text.
1269
- *
1270
- * @param plainText The plain text.
1271
- */
1272
- function fromPlainText(plainText) {
1273
- return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
1274
- }
1275
- MarkedString.fromPlainText = fromPlainText;
1276
- /**
1277
- * Checks whether the given value conforms to the {@link MarkedString} type.
1278
- */
1279
- function is(value) {
1280
- var candidate = value;
1281
- return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
1282
- }
1283
- MarkedString.is = is;
1284
- })(MarkedString || (exports.MarkedString = MarkedString = {}));
1285
- var Hover;
1286
- (function (Hover) {
1287
- /**
1288
- * Checks whether the given value conforms to the {@link Hover} interface.
1289
- */
1290
- function is(value) {
1291
- var candidate = value;
1292
- return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
1293
- MarkedString.is(candidate.contents) ||
1294
- Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
1295
- }
1296
- Hover.is = is;
1297
- })(Hover || (exports.Hover = Hover = {}));
1298
- /**
1299
- * The ParameterInformation namespace provides helper functions to work with
1300
- * {@link ParameterInformation} literals.
1301
- */
1302
- var ParameterInformation;
1303
- (function (ParameterInformation) {
1304
- /**
1305
- * Creates a new parameter information literal.
1306
- *
1307
- * @param label A label string.
1308
- * @param documentation A doc string.
1309
- */
1310
- function create(label, documentation) {
1311
- return documentation ? { label: label, documentation: documentation } : { label: label };
1312
- }
1313
- ParameterInformation.create = create;
1314
- })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {}));
1315
- /**
1316
- * The SignatureInformation namespace provides helper functions to work with
1317
- * {@link SignatureInformation} literals.
1318
- */
1319
- var SignatureInformation;
1320
- (function (SignatureInformation) {
1321
- function create(label, documentation) {
1322
- var parameters = [];
1323
- for (var _i = 2; _i < arguments.length; _i++) {
1324
- parameters[_i - 2] = arguments[_i];
1325
- }
1326
- var result = { label: label };
1327
- if (Is.defined(documentation)) {
1328
- result.documentation = documentation;
1329
- }
1330
- if (Is.defined(parameters)) {
1331
- result.parameters = parameters;
1332
- }
1333
- else {
1334
- result.parameters = [];
1335
- }
1336
- return result;
1337
- }
1338
- SignatureInformation.create = create;
1339
- })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {}));
1340
- /**
1341
- * A document highlight kind.
1342
- */
1343
- var DocumentHighlightKind;
1344
- (function (DocumentHighlightKind) {
1345
- /**
1346
- * A textual occurrence.
1347
- */
1348
- DocumentHighlightKind.Text = 1;
1349
- /**
1350
- * Read-access of a symbol, like reading a variable.
1351
- */
1352
- DocumentHighlightKind.Read = 2;
1353
- /**
1354
- * Write-access of a symbol, like writing to a variable.
1355
- */
1356
- DocumentHighlightKind.Write = 3;
1357
- })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {}));
1358
- /**
1359
- * DocumentHighlight namespace to provide helper functions to work with
1360
- * {@link DocumentHighlight} literals.
1361
- */
1362
- var DocumentHighlight;
1363
- (function (DocumentHighlight) {
1364
- /**
1365
- * Create a DocumentHighlight object.
1366
- * @param range The range the highlight applies to.
1367
- * @param kind The highlight kind
1368
- */
1369
- function create(range, kind) {
1370
- var result = { range: range };
1371
- if (Is.number(kind)) {
1372
- result.kind = kind;
1373
- }
1374
- return result;
1375
- }
1376
- DocumentHighlight.create = create;
1377
- })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {}));
1378
- /**
1379
- * A symbol kind.
1380
- */
1381
- var SymbolKind;
1382
- (function (SymbolKind) {
1383
- SymbolKind.File = 1;
1384
- SymbolKind.Module = 2;
1385
- SymbolKind.Namespace = 3;
1386
- SymbolKind.Package = 4;
1387
- SymbolKind.Class = 5;
1388
- SymbolKind.Method = 6;
1389
- SymbolKind.Property = 7;
1390
- SymbolKind.Field = 8;
1391
- SymbolKind.Constructor = 9;
1392
- SymbolKind.Enum = 10;
1393
- SymbolKind.Interface = 11;
1394
- SymbolKind.Function = 12;
1395
- SymbolKind.Variable = 13;
1396
- SymbolKind.Constant = 14;
1397
- SymbolKind.String = 15;
1398
- SymbolKind.Number = 16;
1399
- SymbolKind.Boolean = 17;
1400
- SymbolKind.Array = 18;
1401
- SymbolKind.Object = 19;
1402
- SymbolKind.Key = 20;
1403
- SymbolKind.Null = 21;
1404
- SymbolKind.EnumMember = 22;
1405
- SymbolKind.Struct = 23;
1406
- SymbolKind.Event = 24;
1407
- SymbolKind.Operator = 25;
1408
- SymbolKind.TypeParameter = 26;
1409
- })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));
1410
- /**
1411
- * Symbol tags are extra annotations that tweak the rendering of a symbol.
1412
- *
1413
- * @since 3.16
1414
- */
1415
- var SymbolTag;
1416
- (function (SymbolTag) {
1417
- /**
1418
- * Render a symbol as obsolete, usually using a strike-out.
1419
- */
1420
- SymbolTag.Deprecated = 1;
1421
- })(SymbolTag || (exports.SymbolTag = SymbolTag = {}));
1422
- var SymbolInformation;
1423
- (function (SymbolInformation) {
1424
- /**
1425
- * Creates a new symbol information literal.
1426
- *
1427
- * @param name The name of the symbol.
1428
- * @param kind The kind of the symbol.
1429
- * @param range The range of the location of the symbol.
1430
- * @param uri The resource of the location of symbol.
1431
- * @param containerName The name of the symbol containing the symbol.
1432
- */
1433
- function create(name, kind, range, uri, containerName) {
1434
- var result = {
1435
- name: name,
1436
- kind: kind,
1437
- location: { uri: uri, range: range }
1438
- };
1439
- if (containerName) {
1440
- result.containerName = containerName;
1441
- }
1442
- return result;
1443
- }
1444
- SymbolInformation.create = create;
1445
- })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {}));
1446
- var WorkspaceSymbol;
1447
- (function (WorkspaceSymbol) {
1448
- /**
1449
- * Create a new workspace symbol.
1450
- *
1451
- * @param name The name of the symbol.
1452
- * @param kind The kind of the symbol.
1453
- * @param uri The resource of the location of the symbol.
1454
- * @param range An options range of the location.
1455
- * @returns A WorkspaceSymbol.
1456
- */
1457
- function create(name, kind, uri, range) {
1458
- return range !== undefined
1459
- ? { name: name, kind: kind, location: { uri: uri, range: range } }
1460
- : { name: name, kind: kind, location: { uri: uri } };
1461
- }
1462
- WorkspaceSymbol.create = create;
1463
- })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {}));
1464
- var DocumentSymbol;
1465
- (function (DocumentSymbol) {
1466
- /**
1467
- * Creates a new symbol information literal.
1468
- *
1469
- * @param name The name of the symbol.
1470
- * @param detail The detail of the symbol.
1471
- * @param kind The kind of the symbol.
1472
- * @param range The range of the symbol.
1473
- * @param selectionRange The selectionRange of the symbol.
1474
- * @param children Children of the symbol.
1475
- */
1476
- function create(name, detail, kind, range, selectionRange, children) {
1477
- var result = {
1478
- name: name,
1479
- detail: detail,
1480
- kind: kind,
1481
- range: range,
1482
- selectionRange: selectionRange
1483
- };
1484
- if (children !== undefined) {
1485
- result.children = children;
1486
- }
1487
- return result;
1488
- }
1489
- DocumentSymbol.create = create;
1490
- /**
1491
- * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
1492
- */
1493
- function is(value) {
1494
- var candidate = value;
1495
- return candidate &&
1496
- Is.string(candidate.name) && Is.number(candidate.kind) &&
1497
- Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
1498
- (candidate.detail === undefined || Is.string(candidate.detail)) &&
1499
- (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
1500
- (candidate.children === undefined || Array.isArray(candidate.children)) &&
1501
- (candidate.tags === undefined || Array.isArray(candidate.tags));
1502
- }
1503
- DocumentSymbol.is = is;
1504
- })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {}));
1505
- /**
1506
- * A set of predefined code action kinds
1507
- */
1508
- var CodeActionKind;
1509
- (function (CodeActionKind) {
1510
- /**
1511
- * Empty kind.
1512
- */
1513
- CodeActionKind.Empty = '';
1514
- /**
1515
- * Base kind for quickfix actions: 'quickfix'
1516
- */
1517
- CodeActionKind.QuickFix = 'quickfix';
1518
- /**
1519
- * Base kind for refactoring actions: 'refactor'
1520
- */
1521
- CodeActionKind.Refactor = 'refactor';
1522
- /**
1523
- * Base kind for refactoring extraction actions: 'refactor.extract'
1524
- *
1525
- * Example extract actions:
1526
- *
1527
- * - Extract method
1528
- * - Extract function
1529
- * - Extract variable
1530
- * - Extract interface from class
1531
- * - ...
1532
- */
1533
- CodeActionKind.RefactorExtract = 'refactor.extract';
1534
- /**
1535
- * Base kind for refactoring inline actions: 'refactor.inline'
1536
- *
1537
- * Example inline actions:
1538
- *
1539
- * - Inline function
1540
- * - Inline variable
1541
- * - Inline constant
1542
- * - ...
1543
- */
1544
- CodeActionKind.RefactorInline = 'refactor.inline';
1545
- /**
1546
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'
1547
- *
1548
- * Example rewrite actions:
1549
- *
1550
- * - Convert JavaScript function to class
1551
- * - Add or remove parameter
1552
- * - Encapsulate field
1553
- * - Make method static
1554
- * - Move method to base class
1555
- * - ...
1556
- */
1557
- CodeActionKind.RefactorRewrite = 'refactor.rewrite';
1558
- /**
1559
- * Base kind for source actions: `source`
1560
- *
1561
- * Source code actions apply to the entire file.
1562
- */
1563
- CodeActionKind.Source = 'source';
1564
- /**
1565
- * Base kind for an organize imports source action: `source.organizeImports`
1566
- */
1567
- CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
1568
- /**
1569
- * Base kind for auto-fix source actions: `source.fixAll`.
1570
- *
1571
- * Fix all actions automatically fix errors that have a clear fix that do not require user input.
1572
- * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
1573
- *
1574
- * @since 3.15.0
1575
- */
1576
- CodeActionKind.SourceFixAll = 'source.fixAll';
1577
- })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {}));
1578
- /**
1579
- * The reason why code actions were requested.
1580
- *
1581
- * @since 3.17.0
1582
- */
1583
- var CodeActionTriggerKind;
1584
- (function (CodeActionTriggerKind) {
1585
- /**
1586
- * Code actions were explicitly requested by the user or by an extension.
1587
- */
1588
- CodeActionTriggerKind.Invoked = 1;
1589
- /**
1590
- * Code actions were requested automatically.
1591
- *
1592
- * This typically happens when current selection in a file changes, but can
1593
- * also be triggered when file content changes.
1594
- */
1595
- CodeActionTriggerKind.Automatic = 2;
1596
- })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {}));
1597
- /**
1598
- * The CodeActionContext namespace provides helper functions to work with
1599
- * {@link CodeActionContext} literals.
1600
- */
1601
- var CodeActionContext;
1602
- (function (CodeActionContext) {
1603
- /**
1604
- * Creates a new CodeActionContext literal.
1605
- */
1606
- function create(diagnostics, only, triggerKind) {
1607
- var result = { diagnostics: diagnostics };
1608
- if (only !== undefined && only !== null) {
1609
- result.only = only;
1610
- }
1611
- if (triggerKind !== undefined && triggerKind !== null) {
1612
- result.triggerKind = triggerKind;
1613
- }
1614
- return result;
1615
- }
1616
- CodeActionContext.create = create;
1617
- /**
1618
- * Checks whether the given literal conforms to the {@link CodeActionContext} interface.
1619
- */
1620
- function is(value) {
1621
- var candidate = value;
1622
- return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)
1623
- && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))
1624
- && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
1625
- }
1626
- CodeActionContext.is = is;
1627
- })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {}));
1628
- var CodeAction;
1629
- (function (CodeAction) {
1630
- function create(title, kindOrCommandOrEdit, kind) {
1631
- var result = { title: title };
1632
- var checkKind = true;
1633
- if (typeof kindOrCommandOrEdit === 'string') {
1634
- checkKind = false;
1635
- result.kind = kindOrCommandOrEdit;
1636
- }
1637
- else if (Command.is(kindOrCommandOrEdit)) {
1638
- result.command = kindOrCommandOrEdit;
1639
- }
1640
- else {
1641
- result.edit = kindOrCommandOrEdit;
1642
- }
1643
- if (checkKind && kind !== undefined) {
1644
- result.kind = kind;
1645
- }
1646
- return result;
1647
- }
1648
- CodeAction.create = create;
1649
- function is(value) {
1650
- var candidate = value;
1651
- return candidate && Is.string(candidate.title) &&
1652
- (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
1653
- (candidate.kind === undefined || Is.string(candidate.kind)) &&
1654
- (candidate.edit !== undefined || candidate.command !== undefined) &&
1655
- (candidate.command === undefined || Command.is(candidate.command)) &&
1656
- (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
1657
- (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
1658
- }
1659
- CodeAction.is = is;
1660
- })(CodeAction || (exports.CodeAction = CodeAction = {}));
1661
- /**
1662
- * The CodeLens namespace provides helper functions to work with
1663
- * {@link CodeLens} literals.
1664
- */
1665
- var CodeLens;
1666
- (function (CodeLens) {
1667
- /**
1668
- * Creates a new CodeLens literal.
1669
- */
1670
- function create(range, data) {
1671
- var result = { range: range };
1672
- if (Is.defined(data)) {
1673
- result.data = data;
1674
- }
1675
- return result;
1676
- }
1677
- CodeLens.create = create;
1678
- /**
1679
- * Checks whether the given literal conforms to the {@link CodeLens} interface.
1680
- */
1681
- function is(value) {
1682
- var candidate = value;
1683
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1684
- }
1685
- CodeLens.is = is;
1686
- })(CodeLens || (exports.CodeLens = CodeLens = {}));
1687
- /**
1688
- * The FormattingOptions namespace provides helper functions to work with
1689
- * {@link FormattingOptions} literals.
1690
- */
1691
- var FormattingOptions;
1692
- (function (FormattingOptions) {
1693
- /**
1694
- * Creates a new FormattingOptions literal.
1695
- */
1696
- function create(tabSize, insertSpaces) {
1697
- return { tabSize: tabSize, insertSpaces: insertSpaces };
1698
- }
1699
- FormattingOptions.create = create;
1700
- /**
1701
- * Checks whether the given literal conforms to the {@link FormattingOptions} interface.
1702
- */
1703
- function is(value) {
1704
- var candidate = value;
1705
- return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1706
- }
1707
- FormattingOptions.is = is;
1708
- })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {}));
1709
- /**
1710
- * The DocumentLink namespace provides helper functions to work with
1711
- * {@link DocumentLink} literals.
1712
- */
1713
- var DocumentLink;
1714
- (function (DocumentLink) {
1715
- /**
1716
- * Creates a new DocumentLink literal.
1717
- */
1718
- function create(range, target, data) {
1719
- return { range: range, target: target, data: data };
1720
- }
1721
- DocumentLink.create = create;
1722
- /**
1723
- * Checks whether the given literal conforms to the {@link DocumentLink} interface.
1724
- */
1725
- function is(value) {
1726
- var candidate = value;
1727
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1728
- }
1729
- DocumentLink.is = is;
1730
- })(DocumentLink || (exports.DocumentLink = DocumentLink = {}));
1731
- /**
1732
- * The SelectionRange namespace provides helper function to work with
1733
- * SelectionRange literals.
1734
- */
1735
- var SelectionRange;
1736
- (function (SelectionRange) {
1737
- /**
1738
- * Creates a new SelectionRange
1739
- * @param range the range.
1740
- * @param parent an optional parent.
1741
- */
1742
- function create(range, parent) {
1743
- return { range: range, parent: parent };
1744
- }
1745
- SelectionRange.create = create;
1746
- function is(value) {
1747
- var candidate = value;
1748
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
1749
- }
1750
- SelectionRange.is = is;
1751
- })(SelectionRange || (exports.SelectionRange = SelectionRange = {}));
1752
- /**
1753
- * A set of predefined token types. This set is not fixed
1754
- * an clients can specify additional token types via the
1755
- * corresponding client capabilities.
1756
- *
1757
- * @since 3.16.0
1758
- */
1759
- var SemanticTokenTypes;
1760
- (function (SemanticTokenTypes) {
1761
- SemanticTokenTypes["namespace"] = "namespace";
1762
- /**
1763
- * Represents a generic type. Acts as a fallback for types which can't be mapped to
1764
- * a specific type like class or enum.
1765
- */
1766
- SemanticTokenTypes["type"] = "type";
1767
- SemanticTokenTypes["class"] = "class";
1768
- SemanticTokenTypes["enum"] = "enum";
1769
- SemanticTokenTypes["interface"] = "interface";
1770
- SemanticTokenTypes["struct"] = "struct";
1771
- SemanticTokenTypes["typeParameter"] = "typeParameter";
1772
- SemanticTokenTypes["parameter"] = "parameter";
1773
- SemanticTokenTypes["variable"] = "variable";
1774
- SemanticTokenTypes["property"] = "property";
1775
- SemanticTokenTypes["enumMember"] = "enumMember";
1776
- SemanticTokenTypes["event"] = "event";
1777
- SemanticTokenTypes["function"] = "function";
1778
- SemanticTokenTypes["method"] = "method";
1779
- SemanticTokenTypes["macro"] = "macro";
1780
- SemanticTokenTypes["keyword"] = "keyword";
1781
- SemanticTokenTypes["modifier"] = "modifier";
1782
- SemanticTokenTypes["comment"] = "comment";
1783
- SemanticTokenTypes["string"] = "string";
1784
- SemanticTokenTypes["number"] = "number";
1785
- SemanticTokenTypes["regexp"] = "regexp";
1786
- SemanticTokenTypes["operator"] = "operator";
1787
- /**
1788
- * @since 3.17.0
1789
- */
1790
- SemanticTokenTypes["decorator"] = "decorator";
1791
- })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {}));
1792
- /**
1793
- * A set of predefined token modifiers. This set is not fixed
1794
- * an clients can specify additional token types via the
1795
- * corresponding client capabilities.
1796
- *
1797
- * @since 3.16.0
1798
- */
1799
- var SemanticTokenModifiers;
1800
- (function (SemanticTokenModifiers) {
1801
- SemanticTokenModifiers["declaration"] = "declaration";
1802
- SemanticTokenModifiers["definition"] = "definition";
1803
- SemanticTokenModifiers["readonly"] = "readonly";
1804
- SemanticTokenModifiers["static"] = "static";
1805
- SemanticTokenModifiers["deprecated"] = "deprecated";
1806
- SemanticTokenModifiers["abstract"] = "abstract";
1807
- SemanticTokenModifiers["async"] = "async";
1808
- SemanticTokenModifiers["modification"] = "modification";
1809
- SemanticTokenModifiers["documentation"] = "documentation";
1810
- SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
1811
- })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {}));
1812
- /**
1813
- * @since 3.16.0
1814
- */
1815
- var SemanticTokens;
1816
- (function (SemanticTokens) {
1817
- function is(value) {
1818
- var candidate = value;
1819
- return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
1820
- Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
1821
- }
1822
- SemanticTokens.is = is;
1823
- })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {}));
1824
- /**
1825
- * The InlineValueText namespace provides functions to deal with InlineValueTexts.
1826
- *
1827
- * @since 3.17.0
1828
- */
1829
- var InlineValueText;
1830
- (function (InlineValueText) {
1831
- /**
1832
- * Creates a new InlineValueText literal.
1833
- */
1834
- function create(range, text) {
1835
- return { range: range, text: text };
1836
- }
1837
- InlineValueText.create = create;
1838
- function is(value) {
1839
- var candidate = value;
1840
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
1841
- }
1842
- InlineValueText.is = is;
1843
- })(InlineValueText || (exports.InlineValueText = InlineValueText = {}));
1844
- /**
1845
- * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.
1846
- *
1847
- * @since 3.17.0
1848
- */
1849
- var InlineValueVariableLookup;
1850
- (function (InlineValueVariableLookup) {
1851
- /**
1852
- * Creates a new InlineValueText literal.
1853
- */
1854
- function create(range, variableName, caseSensitiveLookup) {
1855
- return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };
1856
- }
1857
- InlineValueVariableLookup.create = create;
1858
- function is(value) {
1859
- var candidate = value;
1860
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)
1861
- && (Is.string(candidate.variableName) || candidate.variableName === undefined);
1862
- }
1863
- InlineValueVariableLookup.is = is;
1864
- })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {}));
1865
- /**
1866
- * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.
1867
- *
1868
- * @since 3.17.0
1869
- */
1870
- var InlineValueEvaluatableExpression;
1871
- (function (InlineValueEvaluatableExpression) {
1872
- /**
1873
- * Creates a new InlineValueEvaluatableExpression literal.
1874
- */
1875
- function create(range, expression) {
1876
- return { range: range, expression: expression };
1877
- }
1878
- InlineValueEvaluatableExpression.create = create;
1879
- function is(value) {
1880
- var candidate = value;
1881
- return candidate !== undefined && candidate !== null && Range.is(candidate.range)
1882
- && (Is.string(candidate.expression) || candidate.expression === undefined);
1883
- }
1884
- InlineValueEvaluatableExpression.is = is;
1885
- })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));
1886
- /**
1887
- * The InlineValueContext namespace provides helper functions to work with
1888
- * {@link InlineValueContext} literals.
1889
- *
1890
- * @since 3.17.0
1891
- */
1892
- var InlineValueContext;
1893
- (function (InlineValueContext) {
1894
- /**
1895
- * Creates a new InlineValueContext literal.
1896
- */
1897
- function create(frameId, stoppedLocation) {
1898
- return { frameId: frameId, stoppedLocation: stoppedLocation };
1899
- }
1900
- InlineValueContext.create = create;
1901
- /**
1902
- * Checks whether the given literal conforms to the {@link InlineValueContext} interface.
1903
- */
1904
- function is(value) {
1905
- var candidate = value;
1906
- return Is.defined(candidate) && Range.is(value.stoppedLocation);
1907
- }
1908
- InlineValueContext.is = is;
1909
- })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {}));
1910
- /**
1911
- * Inlay hint kinds.
1912
- *
1913
- * @since 3.17.0
1914
- */
1915
- var InlayHintKind;
1916
- (function (InlayHintKind) {
1917
- /**
1918
- * An inlay hint that for a type annotation.
1919
- */
1920
- InlayHintKind.Type = 1;
1921
- /**
1922
- * An inlay hint that is for a parameter.
1923
- */
1924
- InlayHintKind.Parameter = 2;
1925
- function is(value) {
1926
- return value === 1 || value === 2;
1927
- }
1928
- InlayHintKind.is = is;
1929
- })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {}));
1930
- var InlayHintLabelPart;
1931
- (function (InlayHintLabelPart) {
1932
- function create(value) {
1933
- return { value: value };
1934
- }
1935
- InlayHintLabelPart.create = create;
1936
- function is(value) {
1937
- var candidate = value;
1938
- return Is.objectLiteral(candidate)
1939
- && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
1940
- && (candidate.location === undefined || Location.is(candidate.location))
1941
- && (candidate.command === undefined || Command.is(candidate.command));
1942
- }
1943
- InlayHintLabelPart.is = is;
1944
- })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {}));
1945
- var InlayHint;
1946
- (function (InlayHint) {
1947
- function create(position, label, kind) {
1948
- var result = { position: position, label: label };
1949
- if (kind !== undefined) {
1950
- result.kind = kind;
1951
- }
1952
- return result;
1953
- }
1954
- InlayHint.create = create;
1955
- function is(value) {
1956
- var candidate = value;
1957
- return Is.objectLiteral(candidate) && Position.is(candidate.position)
1958
- && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))
1959
- && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))
1960
- && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)
1961
- && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
1962
- && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))
1963
- && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));
1964
- }
1965
- InlayHint.is = is;
1966
- })(InlayHint || (exports.InlayHint = InlayHint = {}));
1967
- var StringValue;
1968
- (function (StringValue) {
1969
- function createSnippet(value) {
1970
- return { kind: 'snippet', value: value };
1971
- }
1972
- StringValue.createSnippet = createSnippet;
1973
- })(StringValue || (exports.StringValue = StringValue = {}));
1974
- var InlineCompletionItem;
1975
- (function (InlineCompletionItem) {
1976
- function create(insertText, filterText, range, command) {
1977
- return { insertText: insertText, filterText: filterText, range: range, command: command };
1978
- }
1979
- InlineCompletionItem.create = create;
1980
- })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {}));
1981
- var InlineCompletionList;
1982
- (function (InlineCompletionList) {
1983
- function create(items) {
1984
- return { items: items };
1985
- }
1986
- InlineCompletionList.create = create;
1987
- })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {}));
1988
- /**
1989
- * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
1990
- *
1991
- * @since 3.18.0
1992
- * @proposed
1993
- */
1994
- var InlineCompletionTriggerKind;
1995
- (function (InlineCompletionTriggerKind) {
1996
- /**
1997
- * Completion was triggered explicitly by a user gesture.
1998
- */
1999
- InlineCompletionTriggerKind.Invoked = 0;
2000
- /**
2001
- * Completion was triggered automatically while editing.
2002
- */
2003
- InlineCompletionTriggerKind.Automatic = 1;
2004
- })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {}));
2005
- var SelectedCompletionInfo;
2006
- (function (SelectedCompletionInfo) {
2007
- function create(range, text) {
2008
- return { range: range, text: text };
2009
- }
2010
- SelectedCompletionInfo.create = create;
2011
- })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {}));
2012
- var InlineCompletionContext;
2013
- (function (InlineCompletionContext) {
2014
- function create(triggerKind, selectedCompletionInfo) {
2015
- return { triggerKind: triggerKind, selectedCompletionInfo: selectedCompletionInfo };
2016
- }
2017
- InlineCompletionContext.create = create;
2018
- })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {}));
2019
- var WorkspaceFolder;
2020
- (function (WorkspaceFolder) {
2021
- function is(value) {
2022
- var candidate = value;
2023
- return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
2024
- }
2025
- WorkspaceFolder.is = is;
2026
- })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {}));
2027
- exports.EOL = ['\n', '\r\n', '\r'];
2028
- /**
2029
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
2030
- */
2031
- var TextDocument;
2032
- (function (TextDocument) {
2033
- /**
2034
- * Creates a new ITextDocument literal from the given uri and content.
2035
- * @param uri The document's uri.
2036
- * @param languageId The document's language Id.
2037
- * @param version The document's version.
2038
- * @param content The document's content.
2039
- */
2040
- function create(uri, languageId, version, content) {
2041
- return new FullTextDocument(uri, languageId, version, content);
2042
- }
2043
- TextDocument.create = create;
2044
- /**
2045
- * Checks whether the given literal conforms to the {@link ITextDocument} interface.
2046
- */
2047
- function is(value) {
2048
- var candidate = value;
2049
- return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
2050
- && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
2051
- }
2052
- TextDocument.is = is;
2053
- function applyEdits(document, edits) {
2054
- var text = document.getText();
2055
- var sortedEdits = mergeSort(edits, function (a, b) {
2056
- var diff = a.range.start.line - b.range.start.line;
2057
- if (diff === 0) {
2058
- return a.range.start.character - b.range.start.character;
2059
- }
2060
- return diff;
2061
- });
2062
- var lastModifiedOffset = text.length;
2063
- for (var i = sortedEdits.length - 1; i >= 0; i--) {
2064
- var e = sortedEdits[i];
2065
- var startOffset = document.offsetAt(e.range.start);
2066
- var endOffset = document.offsetAt(e.range.end);
2067
- if (endOffset <= lastModifiedOffset) {
2068
- text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
2069
- }
2070
- else {
2071
- throw new Error('Overlapping edit');
2072
- }
2073
- lastModifiedOffset = startOffset;
2074
- }
2075
- return text;
2076
- }
2077
- TextDocument.applyEdits = applyEdits;
2078
- function mergeSort(data, compare) {
2079
- if (data.length <= 1) {
2080
- // sorted
2081
- return data;
2082
- }
2083
- var p = (data.length / 2) | 0;
2084
- var left = data.slice(0, p);
2085
- var right = data.slice(p);
2086
- mergeSort(left, compare);
2087
- mergeSort(right, compare);
2088
- var leftIdx = 0;
2089
- var rightIdx = 0;
2090
- var i = 0;
2091
- while (leftIdx < left.length && rightIdx < right.length) {
2092
- var ret = compare(left[leftIdx], right[rightIdx]);
2093
- if (ret <= 0) {
2094
- // smaller_equal -> take left to preserve order
2095
- data[i++] = left[leftIdx++];
2096
- }
2097
- else {
2098
- // greater -> take right
2099
- data[i++] = right[rightIdx++];
2100
- }
2101
- }
2102
- while (leftIdx < left.length) {
2103
- data[i++] = left[leftIdx++];
2104
- }
2105
- while (rightIdx < right.length) {
2106
- data[i++] = right[rightIdx++];
2107
- }
2108
- return data;
2109
- }
2110
- })(TextDocument || (exports.TextDocument = TextDocument = {}));
2111
- /**
2112
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
2113
- */
2114
- var FullTextDocument = /** @class */ (function () {
2115
- function FullTextDocument(uri, languageId, version, content) {
2116
- this._uri = uri;
2117
- this._languageId = languageId;
2118
- this._version = version;
2119
- this._content = content;
2120
- this._lineOffsets = undefined;
2121
- }
2122
- Object.defineProperty(FullTextDocument.prototype, "uri", {
2123
- get: function () {
2124
- return this._uri;
2125
- },
2126
- enumerable: false,
2127
- configurable: true
2128
- });
2129
- Object.defineProperty(FullTextDocument.prototype, "languageId", {
2130
- get: function () {
2131
- return this._languageId;
2132
- },
2133
- enumerable: false,
2134
- configurable: true
2135
- });
2136
- Object.defineProperty(FullTextDocument.prototype, "version", {
2137
- get: function () {
2138
- return this._version;
2139
- },
2140
- enumerable: false,
2141
- configurable: true
2142
- });
2143
- FullTextDocument.prototype.getText = function (range) {
2144
- if (range) {
2145
- var start = this.offsetAt(range.start);
2146
- var end = this.offsetAt(range.end);
2147
- return this._content.substring(start, end);
2148
- }
2149
- return this._content;
2150
- };
2151
- FullTextDocument.prototype.update = function (event, version) {
2152
- this._content = event.text;
2153
- this._version = version;
2154
- this._lineOffsets = undefined;
2155
- };
2156
- FullTextDocument.prototype.getLineOffsets = function () {
2157
- if (this._lineOffsets === undefined) {
2158
- var lineOffsets = [];
2159
- var text = this._content;
2160
- var isLineStart = true;
2161
- for (var i = 0; i < text.length; i++) {
2162
- if (isLineStart) {
2163
- lineOffsets.push(i);
2164
- isLineStart = false;
2165
- }
2166
- var ch = text.charAt(i);
2167
- isLineStart = (ch === '\r' || ch === '\n');
2168
- if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
2169
- i++;
2170
- }
2171
- }
2172
- if (isLineStart && text.length > 0) {
2173
- lineOffsets.push(text.length);
2174
- }
2175
- this._lineOffsets = lineOffsets;
2176
- }
2177
- return this._lineOffsets;
2178
- };
2179
- FullTextDocument.prototype.positionAt = function (offset) {
2180
- offset = Math.max(Math.min(offset, this._content.length), 0);
2181
- var lineOffsets = this.getLineOffsets();
2182
- var low = 0, high = lineOffsets.length;
2183
- if (high === 0) {
2184
- return Position.create(0, offset);
2185
- }
2186
- while (low < high) {
2187
- var mid = Math.floor((low + high) / 2);
2188
- if (lineOffsets[mid] > offset) {
2189
- high = mid;
2190
- }
2191
- else {
2192
- low = mid + 1;
2193
- }
2194
- }
2195
- // low is the least x for which the line offset is larger than the current offset
2196
- // or array.length if no line offset is larger than the current offset
2197
- var line = low - 1;
2198
- return Position.create(line, offset - lineOffsets[line]);
2199
- };
2200
- FullTextDocument.prototype.offsetAt = function (position) {
2201
- var lineOffsets = this.getLineOffsets();
2202
- if (position.line >= lineOffsets.length) {
2203
- return this._content.length;
2204
- }
2205
- else if (position.line < 0) {
2206
- return 0;
2207
- }
2208
- var lineOffset = lineOffsets[position.line];
2209
- var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
2210
- return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
2211
- };
2212
- Object.defineProperty(FullTextDocument.prototype, "lineCount", {
2213
- get: function () {
2214
- return this.getLineOffsets().length;
2215
- },
2216
- enumerable: false,
2217
- configurable: true
2218
- });
2219
- return FullTextDocument;
2220
- }());
2221
- var Is;
2222
- (function (Is) {
2223
- var toString = Object.prototype.toString;
2224
- function defined(value) {
2225
- return typeof value !== 'undefined';
2226
- }
2227
- Is.defined = defined;
2228
- function undefined(value) {
2229
- return typeof value === 'undefined';
2230
- }
2231
- Is.undefined = undefined;
2232
- function boolean(value) {
2233
- return value === true || value === false;
2234
- }
2235
- Is.boolean = boolean;
2236
- function string(value) {
2237
- return toString.call(value) === '[object String]';
2238
- }
2239
- Is.string = string;
2240
- function number(value) {
2241
- return toString.call(value) === '[object Number]';
2242
- }
2243
- Is.number = number;
2244
- function numberRange(value, min, max) {
2245
- return toString.call(value) === '[object Number]' && min <= value && value <= max;
2246
- }
2247
- Is.numberRange = numberRange;
2248
- function integer(value) {
2249
- return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
2250
- }
2251
- Is.integer = integer;
2252
- function uinteger(value) {
2253
- return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
2254
- }
2255
- Is.uinteger = uinteger;
2256
- function func(value) {
2257
- return toString.call(value) === '[object Function]';
2258
- }
2259
- Is.func = func;
2260
- function objectLiteral(value) {
2261
- // Strictly speaking class instances pass this check as well. Since the LSP
2262
- // doesn't use classes we ignore this for now. If we do we need to add something
2263
- // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
2264
- return value !== null && typeof value === 'object';
2265
- }
2266
- Is.objectLiteral = objectLiteral;
2267
- function typedArray(value, check) {
2268
- return Array.isArray(value) && value.every(check);
2269
- }
2270
- Is.typedArray = typedArray;
2271
- })(Is || (Is = {}));
2272
- });