css-variable-lsp 1.0.0 → 1.0.2

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