brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50

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 (715) hide show
  1. package/README.md +76 -138
  2. package/bsconfig.schema.json +121 -5
  3. package/dist/ActionPipeline.d.ts +10 -0
  4. package/dist/ActionPipeline.js +40 -0
  5. package/dist/ActionPipeline.js.map +1 -0
  6. package/dist/AstValidationSegmenter.d.ts +45 -0
  7. package/dist/AstValidationSegmenter.js +322 -0
  8. package/dist/AstValidationSegmenter.js.map +1 -0
  9. package/dist/BsConfig.d.ts +72 -39
  10. package/dist/BusyStatusTracker.d.ts +61 -0
  11. package/dist/BusyStatusTracker.js +148 -0
  12. package/dist/BusyStatusTracker.js.map +1 -0
  13. package/dist/Cache.d.ts +3 -8
  14. package/dist/Cache.js +9 -14
  15. package/dist/Cache.js.map +1 -1
  16. package/dist/CacheVerifier.d.ts +7 -0
  17. package/dist/CacheVerifier.js +20 -0
  18. package/dist/CacheVerifier.js.map +1 -0
  19. package/dist/CodeActionUtil.d.ts +12 -4
  20. package/dist/CodeActionUtil.js +22 -5
  21. package/dist/CodeActionUtil.js.map +1 -1
  22. package/dist/CommentFlagProcessor.d.ts +7 -6
  23. package/dist/CommentFlagProcessor.js +11 -8
  24. package/dist/CommentFlagProcessor.js.map +1 -1
  25. package/dist/CrossScopeValidator.d.ts +68 -0
  26. package/dist/CrossScopeValidator.js +642 -0
  27. package/dist/CrossScopeValidator.js.map +1 -0
  28. package/dist/DependencyGraph.d.ts +8 -3
  29. package/dist/DependencyGraph.js +49 -16
  30. package/dist/DependencyGraph.js.map +1 -1
  31. package/dist/DiagnosticCollection.d.ts +21 -5
  32. package/dist/DiagnosticCollection.js +77 -24
  33. package/dist/DiagnosticCollection.js.map +1 -1
  34. package/dist/DiagnosticFilterer.d.ts +27 -6
  35. package/dist/DiagnosticFilterer.js +273 -60
  36. package/dist/DiagnosticFilterer.js.map +1 -1
  37. package/dist/DiagnosticManager.d.ts +82 -0
  38. package/dist/DiagnosticManager.js +406 -0
  39. package/dist/DiagnosticManager.js.map +1 -0
  40. package/dist/DiagnosticMessages.d.ts +558 -196
  41. package/dist/DiagnosticMessages.js +870 -340
  42. package/dist/DiagnosticMessages.js.map +1 -1
  43. package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
  44. package/dist/DiagnosticSeverityAdjuster.js +45 -0
  45. package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
  46. package/dist/FunctionScope.d.ts +28 -0
  47. package/dist/FunctionScope.js +52 -0
  48. package/dist/FunctionScope.js.map +1 -0
  49. package/dist/KeyedThrottler.d.ts +3 -3
  50. package/dist/KeyedThrottler.js +3 -3
  51. package/dist/KeyedThrottler.js.map +1 -1
  52. package/dist/LanguageServer.d.ts +100 -105
  53. package/dist/LanguageServer.js +444 -745
  54. package/dist/LanguageServer.js.map +1 -1
  55. package/dist/Logger.d.ts +17 -13
  56. package/dist/Logger.js +64 -34
  57. package/dist/Logger.js.map +1 -1
  58. package/dist/PluginInterface.d.ts +32 -10
  59. package/dist/PluginInterface.js +117 -7
  60. package/dist/PluginInterface.js.map +1 -1
  61. package/dist/Program.d.ts +241 -98
  62. package/dist/Program.js +1432 -717
  63. package/dist/Program.js.map +1 -1
  64. package/dist/ProgramBuilder.d.ts +47 -23
  65. package/dist/ProgramBuilder.js +224 -178
  66. package/dist/ProgramBuilder.js.map +1 -1
  67. package/dist/Scope.d.ts +149 -109
  68. package/dist/Scope.js +557 -550
  69. package/dist/Scope.js.map +1 -1
  70. package/dist/SemanticTokenUtils.js +5 -1
  71. package/dist/SemanticTokenUtils.js.map +1 -1
  72. package/dist/Stopwatch.d.ts +4 -0
  73. package/dist/Stopwatch.js +8 -1
  74. package/dist/Stopwatch.js.map +1 -1
  75. package/dist/SymbolTable.d.ts +136 -24
  76. package/dist/SymbolTable.js +565 -64
  77. package/dist/SymbolTable.js.map +1 -1
  78. package/dist/SymbolTypeFlag.d.ts +9 -0
  79. package/dist/SymbolTypeFlag.js +14 -0
  80. package/dist/SymbolTypeFlag.js.map +1 -0
  81. package/dist/Throttler.d.ts +12 -0
  82. package/dist/Throttler.js +39 -0
  83. package/dist/Throttler.js.map +1 -1
  84. package/dist/Watcher.d.ts +0 -3
  85. package/dist/Watcher.js +0 -3
  86. package/dist/Watcher.js.map +1 -1
  87. package/dist/XmlScope.d.ts +5 -15
  88. package/dist/XmlScope.js +34 -90
  89. package/dist/XmlScope.js.map +1 -1
  90. package/dist/astUtils/CachedLookups.d.ts +50 -0
  91. package/dist/astUtils/CachedLookups.js +334 -0
  92. package/dist/astUtils/CachedLookups.js.map +1 -0
  93. package/dist/astUtils/CachedLookups.spec.js +39 -0
  94. package/dist/astUtils/CachedLookups.spec.js.map +1 -0
  95. package/dist/astUtils/Editor.d.ts +69 -0
  96. package/dist/astUtils/Editor.js +245 -0
  97. package/dist/astUtils/Editor.js.map +1 -0
  98. package/dist/astUtils/Editor.spec.js +258 -0
  99. package/dist/astUtils/Editor.spec.js.map +1 -0
  100. package/dist/astUtils/creators.d.ts +54 -19
  101. package/dist/astUtils/creators.js +242 -42
  102. package/dist/astUtils/creators.js.map +1 -1
  103. package/dist/astUtils/creators.spec.js +5 -5
  104. package/dist/astUtils/creators.spec.js.map +1 -1
  105. package/dist/astUtils/reflection.d.ts +196 -85
  106. package/dist/astUtils/reflection.js +497 -144
  107. package/dist/astUtils/reflection.js.map +1 -1
  108. package/dist/astUtils/reflection.spec.js +267 -167
  109. package/dist/astUtils/reflection.spec.js.map +1 -1
  110. package/dist/astUtils/stackedVisitor.js.map +1 -1
  111. package/dist/astUtils/stackedVisitor.spec.js +14 -14
  112. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  113. package/dist/astUtils/visitors.d.ts +116 -53
  114. package/dist/astUtils/visitors.js +95 -15
  115. package/dist/astUtils/visitors.js.map +1 -1
  116. package/dist/astUtils/visitors.spec.js +629 -51
  117. package/dist/astUtils/visitors.spec.js.map +1 -1
  118. package/dist/astUtils/xml.d.ts +9 -8
  119. package/dist/astUtils/xml.js +12 -7
  120. package/dist/astUtils/xml.js.map +1 -1
  121. package/dist/bscPlugin/BscPlugin.d.ts +24 -4
  122. package/dist/bscPlugin/BscPlugin.js +88 -4
  123. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  124. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  125. package/dist/bscPlugin/CallExpressionInfo.js +143 -0
  126. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  127. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  128. package/dist/bscPlugin/FileWriter.js +24 -0
  129. package/dist/bscPlugin/FileWriter.js.map +1 -0
  130. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  131. package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
  132. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  133. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +6 -5
  134. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
  135. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  136. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
  137. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  138. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
  139. package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
  140. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
  141. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -0
  142. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  143. package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
  144. package/dist/bscPlugin/definition/DefinitionProvider.js +212 -0
  145. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  146. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
  147. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  148. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  149. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  150. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  151. package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
  152. package/dist/bscPlugin/hover/HoverProcessor.js +230 -0
  153. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
  154. package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -0
  155. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
  156. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  157. package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
  158. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  159. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  160. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  161. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  162. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
  163. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +164 -0
  164. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
  165. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
  166. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +564 -0
  167. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
  168. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  169. package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
  170. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  171. package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
  172. package/dist/bscPlugin/serialize/BslibManager.js +46 -0
  173. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  174. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  175. package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
  176. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  177. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
  178. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
  179. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
  180. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
  181. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
  182. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
  183. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
  184. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
  185. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
  186. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
  187. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
  188. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
  189. package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
  190. package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
  191. package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
  192. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
  193. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -0
  194. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  195. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  196. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -0
  197. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  198. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  199. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  200. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  201. package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
  202. package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
  203. package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
  204. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +37 -0
  205. package/dist/bscPlugin/validation/BrsFileValidator.js +638 -0
  206. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
  207. package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
  208. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1517 -0
  209. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
  210. package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
  211. package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
  212. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  213. package/dist/bscPlugin/validation/ScopeValidator.d.ts +141 -0
  214. package/dist/bscPlugin/validation/ScopeValidator.js +1323 -0
  215. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
  216. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  217. package/dist/bscPlugin/validation/ScopeValidator.spec.js +6135 -0
  218. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  219. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  220. package/dist/bscPlugin/validation/XmlFileValidator.js +36 -0
  221. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  222. package/dist/cli.js +126 -27
  223. package/dist/cli.js.map +1 -1
  224. package/dist/common/Sequencer.d.ts +53 -0
  225. package/dist/common/Sequencer.js +233 -0
  226. package/dist/common/Sequencer.js.map +1 -0
  227. package/dist/common/Sequencer.spec.d.ts +1 -0
  228. package/dist/common/Sequencer.spec.js +75 -0
  229. package/dist/common/Sequencer.spec.js.map +1 -0
  230. package/dist/deferred.d.ts +5 -3
  231. package/dist/deferred.js +10 -0
  232. package/dist/deferred.js.map +1 -1
  233. package/dist/diagnosticUtils.d.ts +10 -3
  234. package/dist/diagnosticUtils.js +64 -25
  235. package/dist/diagnosticUtils.js.map +1 -1
  236. package/dist/examples/plugins/removePrint.d.ts +2 -2
  237. package/dist/examples/plugins/removePrint.js +8 -12
  238. package/dist/examples/plugins/removePrint.js.map +1 -1
  239. package/dist/files/AssetFile.d.ts +24 -0
  240. package/dist/files/AssetFile.js +25 -0
  241. package/dist/files/AssetFile.js.map +1 -0
  242. package/dist/files/BrsFile.Class.spec.js +1213 -259
  243. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  244. package/dist/files/BrsFile.d.ts +145 -87
  245. package/dist/files/BrsFile.js +836 -934
  246. package/dist/files/BrsFile.js.map +1 -1
  247. package/dist/files/BrsFile.spec.js +4226 -902
  248. package/dist/files/BrsFile.spec.js.map +1 -1
  249. package/dist/files/BscFile.d.ts +102 -0
  250. package/dist/files/BscFile.js +15 -0
  251. package/dist/files/BscFile.js.map +1 -0
  252. package/dist/files/Factory.d.ts +25 -0
  253. package/dist/files/Factory.js +22 -0
  254. package/dist/files/Factory.js.map +1 -0
  255. package/dist/files/LazyFileData.d.ts +21 -0
  256. package/dist/files/LazyFileData.js +54 -0
  257. package/dist/files/LazyFileData.js.map +1 -0
  258. package/dist/files/LazyFileData.spec.d.ts +1 -0
  259. package/dist/files/LazyFileData.spec.js +27 -0
  260. package/dist/files/LazyFileData.spec.js.map +1 -0
  261. package/dist/files/XmlFile.d.ts +80 -41
  262. package/dist/files/XmlFile.js +161 -137
  263. package/dist/files/XmlFile.js.map +1 -1
  264. package/dist/files/XmlFile.spec.js +444 -336
  265. package/dist/files/XmlFile.spec.js.map +1 -1
  266. package/dist/files/tests/imports.spec.js +62 -52
  267. package/dist/files/tests/imports.spec.js.map +1 -1
  268. package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
  269. package/dist/files/tests/optionalChaning.spec.js +152 -0
  270. package/dist/files/tests/optionalChaning.spec.js.map +1 -0
  271. package/dist/globalCallables.d.ts +3 -1
  272. package/dist/globalCallables.js +424 -184
  273. package/dist/globalCallables.js.map +1 -1
  274. package/dist/index.d.ts +32 -4
  275. package/dist/index.js +54 -7
  276. package/dist/index.js.map +1 -1
  277. package/dist/interfaces.d.ts +942 -125
  278. package/dist/interfaces.js +21 -0
  279. package/dist/interfaces.js.map +1 -1
  280. package/dist/lexer/Character.spec.js +5 -5
  281. package/dist/lexer/Character.spec.js.map +1 -1
  282. package/dist/lexer/Lexer.d.ts +51 -12
  283. package/dist/lexer/Lexer.js +215 -65
  284. package/dist/lexer/Lexer.js.map +1 -1
  285. package/dist/lexer/Lexer.spec.js +812 -568
  286. package/dist/lexer/Lexer.spec.js.map +1 -1
  287. package/dist/lexer/Token.d.ts +27 -11
  288. package/dist/lexer/Token.js +10 -2
  289. package/dist/lexer/Token.js.map +1 -1
  290. package/dist/lexer/TokenKind.d.ts +40 -2
  291. package/dist/lexer/TokenKind.js +147 -10
  292. package/dist/lexer/TokenKind.js.map +1 -1
  293. package/dist/logging.d.ts +14 -0
  294. package/dist/logging.js +29 -0
  295. package/dist/logging.js.map +1 -0
  296. package/dist/lsp/ActionQueue.d.ts +35 -0
  297. package/dist/lsp/ActionQueue.js +115 -0
  298. package/dist/lsp/ActionQueue.js.map +1 -0
  299. package/dist/lsp/ActionQueue.spec.d.ts +1 -0
  300. package/dist/lsp/ActionQueue.spec.js +80 -0
  301. package/dist/lsp/ActionQueue.spec.js.map +1 -0
  302. package/dist/lsp/DocumentManager.d.ts +63 -0
  303. package/dist/lsp/DocumentManager.js +122 -0
  304. package/dist/lsp/DocumentManager.js.map +1 -0
  305. package/dist/lsp/DocumentManager.spec.d.ts +1 -0
  306. package/dist/lsp/DocumentManager.spec.js +103 -0
  307. package/dist/lsp/DocumentManager.spec.js.map +1 -0
  308. package/dist/lsp/LspProject.d.ts +239 -0
  309. package/dist/lsp/LspProject.js +3 -0
  310. package/dist/lsp/LspProject.js.map +1 -0
  311. package/dist/lsp/PathFilterer.d.ts +75 -0
  312. package/dist/lsp/PathFilterer.js +196 -0
  313. package/dist/lsp/PathFilterer.js.map +1 -0
  314. package/dist/lsp/PathFilterer.spec.d.ts +1 -0
  315. package/dist/lsp/PathFilterer.spec.js +182 -0
  316. package/dist/lsp/PathFilterer.spec.js.map +1 -0
  317. package/dist/lsp/Project.d.ts +168 -0
  318. package/dist/lsp/Project.js +437 -0
  319. package/dist/lsp/Project.js.map +1 -0
  320. package/dist/lsp/Project.spec.d.ts +1 -0
  321. package/dist/lsp/Project.spec.js +267 -0
  322. package/dist/lsp/Project.spec.js.map +1 -0
  323. package/dist/lsp/ProjectManager.d.ts +242 -0
  324. package/dist/lsp/ProjectManager.js +824 -0
  325. package/dist/lsp/ProjectManager.js.map +1 -0
  326. package/dist/lsp/ProjectManager.spec.d.ts +1 -0
  327. package/dist/lsp/ProjectManager.spec.js +913 -0
  328. package/dist/lsp/ProjectManager.spec.js.map +1 -0
  329. package/dist/lsp/ReaderWriterManager.d.ts +21 -0
  330. package/dist/lsp/ReaderWriterManager.js +60 -0
  331. package/dist/lsp/ReaderWriterManager.js.map +1 -0
  332. package/dist/lsp/worker/MessageHandler.d.ts +99 -0
  333. package/dist/lsp/worker/MessageHandler.js +138 -0
  334. package/dist/lsp/worker/MessageHandler.js.map +1 -0
  335. package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
  336. package/dist/lsp/worker/MessageHandler.spec.js +64 -0
  337. package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
  338. package/dist/lsp/worker/WorkerPool.d.ts +38 -0
  339. package/dist/lsp/worker/WorkerPool.js +78 -0
  340. package/dist/lsp/worker/WorkerPool.js.map +1 -0
  341. package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
  342. package/dist/lsp/worker/WorkerPool.spec.js +59 -0
  343. package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
  344. package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
  345. package/dist/lsp/worker/WorkerThreadProject.js +189 -0
  346. package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
  347. package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
  348. package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
  349. package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
  350. package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
  351. package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
  352. package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
  353. package/dist/lsp/worker/run.d.ts +1 -0
  354. package/dist/lsp/worker/run.js +14 -0
  355. package/dist/lsp/worker/run.js.map +1 -0
  356. package/dist/parser/AstNode.d.ts +203 -0
  357. package/dist/parser/AstNode.js +303 -0
  358. package/dist/parser/AstNode.js.map +1 -0
  359. package/dist/parser/AstNode.spec.d.ts +1 -0
  360. package/dist/parser/AstNode.spec.js +1455 -0
  361. package/dist/parser/AstNode.spec.js.map +1 -0
  362. package/dist/parser/BrightScriptDocParser.d.ts +56 -0
  363. package/dist/parser/BrightScriptDocParser.js +294 -0
  364. package/dist/parser/BrightScriptDocParser.js.map +1 -0
  365. package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
  366. package/dist/parser/BrightScriptDocParser.spec.js +310 -0
  367. package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
  368. package/dist/parser/BrsTranspileState.d.ts +22 -3
  369. package/dist/parser/BrsTranspileState.js +19 -0
  370. package/dist/parser/BrsTranspileState.js.map +1 -1
  371. package/dist/parser/Expression.d.ts +553 -221
  372. package/dist/parser/Expression.js +1414 -505
  373. package/dist/parser/Expression.js.map +1 -1
  374. package/dist/parser/Expression.spec.d.ts +1 -0
  375. package/dist/parser/Expression.spec.js +40 -0
  376. package/dist/parser/Expression.spec.js.map +1 -0
  377. package/dist/parser/Parser.Class.spec.js +255 -125
  378. package/dist/parser/Parser.Class.spec.js.map +1 -1
  379. package/dist/parser/Parser.d.ts +117 -124
  380. package/dist/parser/Parser.js +1669 -982
  381. package/dist/parser/Parser.js.map +1 -1
  382. package/dist/parser/Parser.spec.d.ts +3 -1
  383. package/dist/parser/Parser.spec.js +2111 -525
  384. package/dist/parser/Parser.spec.js.map +1 -1
  385. package/dist/parser/SGParser.d.ts +29 -13
  386. package/dist/parser/SGParser.js +85 -56
  387. package/dist/parser/SGParser.js.map +1 -1
  388. package/dist/parser/SGParser.spec.js +30 -45
  389. package/dist/parser/SGParser.spec.js.map +1 -1
  390. package/dist/parser/SGTypes.d.ts +134 -46
  391. package/dist/parser/SGTypes.js +206 -115
  392. package/dist/parser/SGTypes.js.map +1 -1
  393. package/dist/parser/Statement.d.ts +849 -267
  394. package/dist/parser/Statement.js +2412 -625
  395. package/dist/parser/Statement.js.map +1 -1
  396. package/dist/parser/Statement.spec.js +133 -36
  397. package/dist/parser/Statement.spec.js.map +1 -1
  398. package/dist/parser/TranspileState.d.ts +26 -12
  399. package/dist/parser/TranspileState.js +115 -24
  400. package/dist/parser/TranspileState.js.map +1 -1
  401. package/dist/parser/tests/Parser.spec.d.ts +3 -9
  402. package/dist/parser/tests/Parser.spec.js +7 -13
  403. package/dist/parser/tests/Parser.spec.js.map +1 -1
  404. package/dist/parser/tests/controlFlow/For.spec.js +83 -75
  405. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  406. package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
  407. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  408. package/dist/parser/tests/controlFlow/If.spec.js +382 -239
  409. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  410. package/dist/parser/tests/controlFlow/While.spec.js +52 -45
  411. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  412. package/dist/parser/tests/expression/Additive.spec.js +51 -43
  413. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  414. package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
  415. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  416. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
  417. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  418. package/dist/parser/tests/expression/Boolean.spec.js +41 -34
  419. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  420. package/dist/parser/tests/expression/Call.spec.js +173 -55
  421. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  422. package/dist/parser/tests/expression/Exponential.spec.js +20 -20
  423. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  424. package/dist/parser/tests/expression/Function.spec.js +291 -282
  425. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  426. package/dist/parser/tests/expression/Indexing.spec.js +193 -110
  427. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  428. package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
  429. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  430. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
  431. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  432. package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
  433. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  434. package/dist/parser/tests/expression/Primary.spec.js +76 -60
  435. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  436. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  437. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
  438. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  439. package/dist/parser/tests/expression/Relational.spec.js +50 -50
  440. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  441. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
  442. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  443. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +281 -94
  444. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  445. package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
  446. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  447. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  448. package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
  449. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  450. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  451. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  452. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  453. package/dist/parser/tests/statement/AssignmentOperators.spec.js +44 -44
  454. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  455. package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
  456. package/dist/parser/tests/statement/ConstStatement.spec.js +500 -0
  457. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
  458. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  459. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  460. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  461. package/dist/parser/tests/statement/Declaration.spec.js +61 -55
  462. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  463. package/dist/parser/tests/statement/Dim.spec.js +29 -22
  464. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  465. package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
  466. package/dist/parser/tests/statement/Enum.spec.js +744 -0
  467. package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
  468. package/dist/parser/tests/statement/For.spec.d.ts +1 -0
  469. package/dist/parser/tests/statement/For.spec.js +45 -0
  470. package/dist/parser/tests/statement/For.spec.js.map +1 -0
  471. package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
  472. package/dist/parser/tests/statement/ForEach.spec.js +36 -0
  473. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
  474. package/dist/parser/tests/statement/Function.spec.js +226 -215
  475. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  476. package/dist/parser/tests/statement/Goto.spec.js +16 -15
  477. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  478. package/dist/parser/tests/statement/Increment.spec.js +64 -61
  479. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  480. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  481. package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
  482. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  483. package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
  484. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  485. package/dist/parser/tests/statement/Misc.spec.js +127 -168
  486. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  487. package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
  488. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  489. package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
  490. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  491. package/dist/parser/tests/statement/Set.spec.js +131 -117
  492. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  493. package/dist/parser/tests/statement/Stop.spec.js +14 -13
  494. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  495. package/dist/parser/tests/statement/Throw.spec.js +11 -8
  496. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  497. package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
  498. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  499. package/dist/preprocessor/Manifest.d.ts +6 -6
  500. package/dist/preprocessor/Manifest.js +17 -38
  501. package/dist/preprocessor/Manifest.js.map +1 -1
  502. package/dist/preprocessor/Manifest.spec.d.ts +1 -0
  503. package/dist/preprocessor/Manifest.spec.js +78 -103
  504. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  505. package/dist/roku-types/data.json +20347 -0
  506. package/dist/roku-types/index.d.ts +5726 -0
  507. package/dist/roku-types/index.js +11 -0
  508. package/dist/roku-types/index.js.map +1 -0
  509. package/dist/types/ArrayType.d.ts +12 -5
  510. package/dist/types/ArrayType.js +89 -24
  511. package/dist/types/ArrayType.js.map +1 -1
  512. package/dist/types/ArrayType.spec.js +39 -11
  513. package/dist/types/ArrayType.spec.js.map +1 -1
  514. package/dist/types/AssociativeArrayType.d.ts +15 -0
  515. package/dist/types/AssociativeArrayType.js +64 -0
  516. package/dist/types/AssociativeArrayType.js.map +1 -0
  517. package/dist/types/BaseFunctionType.d.ts +10 -0
  518. package/dist/types/BaseFunctionType.js +26 -0
  519. package/dist/types/BaseFunctionType.js.map +1 -0
  520. package/dist/types/BooleanType.d.ts +9 -5
  521. package/dist/types/BooleanType.js +19 -8
  522. package/dist/types/BooleanType.js.map +1 -1
  523. package/dist/types/BooleanType.spec.js +10 -4
  524. package/dist/types/BooleanType.spec.js.map +1 -1
  525. package/dist/types/BscType.d.ts +41 -3
  526. package/dist/types/BscType.js +152 -0
  527. package/dist/types/BscType.js.map +1 -1
  528. package/dist/types/BscTypeKind.d.ts +28 -0
  529. package/dist/types/BscTypeKind.js +33 -0
  530. package/dist/types/BscTypeKind.js.map +1 -0
  531. package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
  532. package/dist/types/BuiltInInterfaceAdder.js +212 -0
  533. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  534. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  535. package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
  536. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  537. package/dist/types/CallFuncableType.d.ts +24 -0
  538. package/dist/types/CallFuncableType.js +91 -0
  539. package/dist/types/CallFuncableType.js.map +1 -0
  540. package/dist/types/ClassType.d.ts +17 -0
  541. package/dist/types/ClassType.js +60 -0
  542. package/dist/types/ClassType.js.map +1 -0
  543. package/dist/types/ClassType.spec.d.ts +1 -0
  544. package/dist/types/ClassType.spec.js +76 -0
  545. package/dist/types/ClassType.spec.js.map +1 -0
  546. package/dist/types/ComponentType.d.ts +22 -0
  547. package/dist/types/ComponentType.js +107 -0
  548. package/dist/types/ComponentType.js.map +1 -0
  549. package/dist/types/DoubleType.d.ts +10 -5
  550. package/dist/types/DoubleType.js +21 -17
  551. package/dist/types/DoubleType.js.map +1 -1
  552. package/dist/types/DoubleType.spec.js +12 -4
  553. package/dist/types/DoubleType.spec.js.map +1 -1
  554. package/dist/types/DynamicType.d.ts +13 -5
  555. package/dist/types/DynamicType.js +26 -5
  556. package/dist/types/DynamicType.js.map +1 -1
  557. package/dist/types/DynamicType.spec.js +16 -5
  558. package/dist/types/DynamicType.spec.js.map +1 -1
  559. package/dist/types/EnumType.d.ts +42 -0
  560. package/dist/types/EnumType.js +98 -0
  561. package/dist/types/EnumType.js.map +1 -0
  562. package/dist/types/EnumType.spec.d.ts +1 -0
  563. package/dist/types/EnumType.spec.js +33 -0
  564. package/dist/types/EnumType.spec.js.map +1 -0
  565. package/dist/types/FloatType.d.ts +10 -5
  566. package/dist/types/FloatType.js +21 -17
  567. package/dist/types/FloatType.js.map +1 -1
  568. package/dist/types/FloatType.spec.js +4 -4
  569. package/dist/types/FloatType.spec.js.map +1 -1
  570. package/dist/types/FunctionType.d.ts +8 -22
  571. package/dist/types/FunctionType.js +25 -63
  572. package/dist/types/FunctionType.js.map +1 -1
  573. package/dist/types/InheritableType.d.ts +29 -0
  574. package/dist/types/InheritableType.js +173 -0
  575. package/dist/types/InheritableType.js.map +1 -0
  576. package/dist/types/InlineInterfaceType.d.ts +5 -0
  577. package/dist/types/InlineInterfaceType.js +17 -0
  578. package/dist/types/InlineInterfaceType.js.map +1 -0
  579. package/dist/types/IntegerType.d.ts +10 -5
  580. package/dist/types/IntegerType.js +21 -17
  581. package/dist/types/IntegerType.js.map +1 -1
  582. package/dist/types/IntegerType.spec.js +8 -4
  583. package/dist/types/IntegerType.spec.js.map +1 -1
  584. package/dist/types/InterfaceType.d.ts +14 -6
  585. package/dist/types/InterfaceType.js +30 -15
  586. package/dist/types/InterfaceType.js.map +1 -1
  587. package/dist/types/InterfaceType.spec.d.ts +1 -0
  588. package/dist/types/InterfaceType.spec.js +227 -0
  589. package/dist/types/InterfaceType.spec.js.map +1 -0
  590. package/dist/types/IntersectionType.d.ts +29 -0
  591. package/dist/types/IntersectionType.js +253 -0
  592. package/dist/types/IntersectionType.js.map +1 -0
  593. package/dist/types/IntersectionType.spec.d.ts +1 -0
  594. package/dist/types/IntersectionType.spec.js +150 -0
  595. package/dist/types/IntersectionType.spec.js.map +1 -0
  596. package/dist/types/InvalidType.d.ts +10 -5
  597. package/dist/types/InvalidType.js +21 -9
  598. package/dist/types/InvalidType.js.map +1 -1
  599. package/dist/types/InvalidType.spec.js +8 -4
  600. package/dist/types/InvalidType.spec.js.map +1 -1
  601. package/dist/types/LongIntegerType.d.ts +10 -5
  602. package/dist/types/LongIntegerType.js +21 -17
  603. package/dist/types/LongIntegerType.js.map +1 -1
  604. package/dist/types/LongIntegerType.spec.js +10 -4
  605. package/dist/types/LongIntegerType.spec.js.map +1 -1
  606. package/dist/types/NamespaceType.d.ts +12 -0
  607. package/dist/types/NamespaceType.js +28 -0
  608. package/dist/types/NamespaceType.js.map +1 -0
  609. package/dist/types/ObjectType.d.ts +12 -5
  610. package/dist/types/ObjectType.js +25 -8
  611. package/dist/types/ObjectType.js.map +1 -1
  612. package/dist/types/ObjectType.spec.js +3 -3
  613. package/dist/types/ObjectType.spec.js.map +1 -1
  614. package/dist/types/ReferenceType.d.ts +123 -0
  615. package/dist/types/ReferenceType.js +720 -0
  616. package/dist/types/ReferenceType.js.map +1 -0
  617. package/dist/types/ReferenceType.spec.d.ts +1 -0
  618. package/dist/types/ReferenceType.spec.js +151 -0
  619. package/dist/types/ReferenceType.spec.js.map +1 -0
  620. package/dist/types/StringType.d.ts +12 -5
  621. package/dist/types/StringType.js +23 -8
  622. package/dist/types/StringType.js.map +1 -1
  623. package/dist/types/StringType.spec.js +3 -3
  624. package/dist/types/StringType.spec.js.map +1 -1
  625. package/dist/types/TypeStatementType.d.ts +18 -0
  626. package/dist/types/TypeStatementType.js +45 -0
  627. package/dist/types/TypeStatementType.js.map +1 -0
  628. package/dist/types/TypedFunctionType.d.ts +34 -0
  629. package/dist/types/TypedFunctionType.js +147 -0
  630. package/dist/types/TypedFunctionType.js.map +1 -0
  631. package/dist/types/TypedFunctionType.spec.d.ts +1 -0
  632. package/dist/types/TypedFunctionType.spec.js +122 -0
  633. package/dist/types/TypedFunctionType.spec.js.map +1 -0
  634. package/dist/types/UninitializedType.d.ts +11 -6
  635. package/dist/types/UninitializedType.js +20 -11
  636. package/dist/types/UninitializedType.js.map +1 -1
  637. package/dist/types/UnionType.d.ts +27 -0
  638. package/dist/types/UnionType.js +193 -0
  639. package/dist/types/UnionType.js.map +1 -0
  640. package/dist/types/UnionType.spec.d.ts +1 -0
  641. package/dist/types/UnionType.spec.js +205 -0
  642. package/dist/types/UnionType.spec.js.map +1 -0
  643. package/dist/types/VoidType.d.ts +11 -5
  644. package/dist/types/VoidType.js +22 -8
  645. package/dist/types/VoidType.js.map +1 -1
  646. package/dist/types/VoidType.spec.js +3 -3
  647. package/dist/types/VoidType.spec.js.map +1 -1
  648. package/dist/types/helper.spec.d.ts +1 -0
  649. package/dist/types/helper.spec.js +174 -0
  650. package/dist/types/helper.spec.js.map +1 -0
  651. package/dist/types/helpers.d.ts +51 -0
  652. package/dist/types/helpers.js +323 -0
  653. package/dist/types/helpers.js.map +1 -0
  654. package/dist/types/index.d.ts +22 -0
  655. package/dist/types/index.js +39 -0
  656. package/dist/types/index.js.map +1 -0
  657. package/dist/types/roFunctionType.d.ts +11 -0
  658. package/dist/types/roFunctionType.js +37 -0
  659. package/dist/types/roFunctionType.js.map +1 -0
  660. package/dist/types/roFunctionType.spec.d.ts +1 -0
  661. package/dist/types/roFunctionType.spec.js +20 -0
  662. package/dist/types/roFunctionType.spec.js.map +1 -0
  663. package/dist/util.d.ts +288 -187
  664. package/dist/util.js +2018 -575
  665. package/dist/util.js.map +1 -1
  666. package/dist/validators/ClassValidator.d.ts +9 -15
  667. package/dist/validators/ClassValidator.js +93 -138
  668. package/dist/validators/ClassValidator.js.map +1 -1
  669. package/package.json +185 -138
  670. package/CHANGELOG.md +0 -1188
  671. package/dist/astUtils/index.d.ts +0 -7
  672. package/dist/astUtils/index.js +0 -26
  673. package/dist/astUtils/index.js.map +0 -1
  674. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
  675. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
  676. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
  677. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
  678. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
  679. package/dist/lexer/index.d.ts +0 -3
  680. package/dist/lexer/index.js +0 -17
  681. package/dist/lexer/index.js.map +0 -1
  682. package/dist/parser/SGTypes.spec.js +0 -351
  683. package/dist/parser/SGTypes.spec.js.map +0 -1
  684. package/dist/parser/index.d.ts +0 -3
  685. package/dist/parser/index.js +0 -16
  686. package/dist/parser/index.js.map +0 -1
  687. package/dist/preprocessor/Chunk.d.ts +0 -82
  688. package/dist/preprocessor/Chunk.js +0 -77
  689. package/dist/preprocessor/Chunk.js.map +0 -1
  690. package/dist/preprocessor/Preprocessor.d.ts +0 -60
  691. package/dist/preprocessor/Preprocessor.js +0 -156
  692. package/dist/preprocessor/Preprocessor.js.map +0 -1
  693. package/dist/preprocessor/Preprocessor.spec.js +0 -152
  694. package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
  695. package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
  696. package/dist/preprocessor/PreprocessorParser.js +0 -194
  697. package/dist/preprocessor/PreprocessorParser.js.map +0 -1
  698. package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
  699. package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
  700. package/dist/preprocessor/index.d.ts +0 -3
  701. package/dist/preprocessor/index.js +0 -16
  702. package/dist/preprocessor/index.js.map +0 -1
  703. package/dist/types/CustomType.d.ts +0 -10
  704. package/dist/types/CustomType.js +0 -35
  705. package/dist/types/CustomType.js.map +0 -1
  706. package/dist/types/FunctionType.spec.js +0 -29
  707. package/dist/types/FunctionType.spec.js.map +0 -1
  708. package/dist/types/LazyType.d.ts +0 -15
  709. package/dist/types/LazyType.js +0 -32
  710. package/dist/types/LazyType.js.map +0 -1
  711. /package/dist/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
  712. /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
  713. /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
  714. /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
  715. /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
package/dist/util.d.ts CHANGED
@@ -1,33 +1,52 @@
1
- import * as rokuDeploy from 'roku-deploy';
2
- import type { Diagnostic, Position, Range } from 'vscode-languageserver';
3
- import type { BsConfig } from './BsConfig';
4
- import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, CompilerPlugin, ExpressionInfo, FunctionCall, CallableParam, TranspileResult } from './interfaces';
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { Diagnostic, Position } from 'vscode-languageserver';
4
+ import { Range, Location } from 'vscode-languageserver';
5
+ import type { BsConfig, FinalizedBsConfig } from './BsConfig';
6
+ import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, Plugin, ExpressionInfo, TranspileResult, MaybePromise, DisposableLike, GetTypeOptions, TypeChainProcessResult, TypeCircularReferenceInfo } from './interfaces';
7
+ import { TypeChainEntry } from './interfaces';
5
8
  import { BooleanType } from './types/BooleanType';
6
9
  import { DoubleType } from './types/DoubleType';
7
10
  import { DynamicType } from './types/DynamicType';
8
11
  import { FloatType } from './types/FloatType';
9
- import { FunctionType } from './types/FunctionType';
10
12
  import { IntegerType } from './types/IntegerType';
11
- import { InvalidType } from './types/InvalidType';
12
13
  import { LongIntegerType } from './types/LongIntegerType';
13
14
  import { ObjectType } from './types/ObjectType';
14
15
  import { StringType } from './types/StringType';
15
16
  import { VoidType } from './types/VoidType';
16
- import type { DottedGetExpression, Expression, VariableExpression } from './parser/Expression';
17
- import type { Locatable, Token } from './lexer';
18
- import { CustomType } from './types/CustomType';
17
+ import { ParseMode } from './parser/Parser';
18
+ import type { CallExpression, CallfuncExpression, DottedGetExpression, VariableExpression } from './parser/Expression';
19
+ import { type Identifier, type Token } from './lexer/Token';
19
20
  import { SourceNode } from 'source-map';
20
- import { SGAttribute } from './parser/SGTypes';
21
+ import type { BrsFile } from './files/BrsFile';
22
+ import type { XmlFile } from './files/XmlFile';
23
+ import type { AstNode, Expression, Statement } from './parser/AstNode';
24
+ import type { UnresolvedSymbol } from './AstValidationSegmenter';
25
+ import type { GetSymbolTypeOptions, SymbolTable } from './SymbolTable';
26
+ import { SymbolTypeFlag } from './SymbolTypeFlag';
27
+ import type { BscType } from './types/BscType';
28
+ import { UnionType } from './types/UnionType';
29
+ import { FunctionType } from './types/FunctionType';
30
+ import type { NamespaceStatement } from './parser/Statement';
31
+ import type { BscFile } from './files/BscFile';
32
+ import { InvalidType } from './types/InvalidType';
33
+ import { IntersectionType } from './types/IntersectionType';
21
34
  export declare class Util {
22
35
  clearConsole(): void;
36
+ /**
37
+ * Get the version of brighterscript
38
+ */
39
+ getBrighterScriptVersion(): any;
40
+ /**
41
+ * Returns the number of parent directories in the filPath
42
+ */
43
+ getParentDirectoryCount(filePath: string | undefined): number;
23
44
  /**
24
45
  * Determine if the file exists
25
- * @param filePath
26
46
  */
27
47
  pathExists(filePath: string | undefined): Promise<boolean>;
28
48
  /**
29
49
  * Determine if the file exists
30
- * @param filePath
31
50
  */
32
51
  pathExistsSync(filePath: string | undefined): boolean;
33
52
  /**
@@ -35,170 +54,157 @@ export declare class Util {
35
54
  */
36
55
  isDirectorySync(dirPath: string | undefined): boolean;
37
56
  /**
38
- * Given a pkg path of any kind, transform it to a roku-specific pkg path (i.e. "pkg:/some/path.brs")
39
- */
40
- sanitizePkgPath(pkgPath: string): string;
41
- /**
42
- * Determine if the given path starts with a protocol
57
+ * Read a file from disk. If a failure occurrs, simply return undefined
58
+ * @param filePath path to the file
59
+ * @returns the string contents, or undefined if the file doesn't exist
43
60
  */
44
- startsWithProtocol(path: string): boolean;
61
+ readFileSync(filePath: string): Buffer | undefined;
45
62
  /**
46
- * Given a path to a file/directory, replace all path separators with the current system's version.
47
- * @param filePath
63
+ * Given a pkg path of any kind, transform it to a roku-specific pkg path (i.e. "pkg:/some/path.brs")
48
64
  */
49
- pathSepNormalize(filePath: string, separator?: string): string;
65
+ sanitizePkgPath(pkgPath: string): string;
50
66
  /**
51
67
  * Find the path to the config file.
52
68
  * If the config file path doesn't exist
53
- * @param configFilePath
69
+ * @param cwd the current working directory where the search for configs should begin
54
70
  */
55
71
  getConfigFilePath(cwd?: string): string;
56
72
  getRangeFromOffsetLength(text: string, offset: number, length: number): Range;
57
73
  /**
58
74
  * Load the contents of a config file.
59
75
  * If the file extends another config, this will load the base config as well.
60
- * @param configFilePath
61
- * @param parentProjectPaths
76
+ * @param configFilePath the relative or absolute path to a brighterscript config json file
77
+ * @param parentProjectPaths a list of parent config files. This is used by this method to recursively build the config list
62
78
  */
63
- loadConfigFile(configFilePath: string, parentProjectPaths?: string[], cwd?: string): BsConfig;
79
+ loadConfigFile(configFilePath: string | undefined, parentProjectPaths?: string[], cwd?: string): BsConfig | undefined;
64
80
  /**
65
- * Relative paths to scripts in plugins should be resolved relatively to the bsconfig file
66
- * and de-duplicated
67
- * @param config Parsed configuration
68
- * @param configFilePath Path of the configuration file
81
+ * Convert relative paths to absolute paths, relative to the given directory. Also de-dupes the paths. Modifies the array in-place
82
+ * @param collection usually a bsconfig.
83
+ * @param key a key of the config to read paths from (usually this is `'plugins'` or `'require'`)
84
+ * @param relativeDir the path to the folder where the paths should be resolved relative to. This should be an absolute path
69
85
  */
70
- resolvePluginPaths(config: BsConfig, configFilePath: string): void;
71
- /**
72
- * Do work within the scope of a changed current working directory
73
- * @param targetCwd
74
- * @param callback
75
- */
76
- cwdWork<T>(targetCwd: string | null | undefined, callback: () => T): T;
86
+ resolvePathsRelativeTo(collection: any, key: string, relativeDir: string): void;
77
87
  /**
78
88
  * Given a BsConfig object, start with defaults,
79
89
  * merge with bsconfig.json and the provided options.
80
- * @param config
90
+ * @param config a bsconfig object to use as the baseline for the resulting config
81
91
  */
82
- normalizeAndResolveConfig(config: BsConfig): BsConfig;
92
+ normalizeAndResolveConfig(config: BsConfig | undefined): FinalizedBsConfig;
83
93
  /**
84
94
  * Set defaults for any missing items
85
- * @param config
95
+ * @param config a bsconfig object to use as the baseline for the resulting config
86
96
  */
87
- normalizeConfig(config: BsConfig): BsConfig;
97
+ normalizeConfig(config: BsConfig | undefined): FinalizedBsConfig;
88
98
  /**
89
99
  * Get the root directory from options.
90
100
  * Falls back to options.cwd.
91
101
  * Falls back to process.cwd
92
- * @param options
102
+ * @param options a bsconfig object
93
103
  */
94
104
  getRootDir(options: BsConfig): string;
95
- /**
96
- * Format a string with placeholders replaced by argument indexes
97
- * @param subject
98
- * @param params
99
- */
100
- stringFormat(subject: string, ...args: any[]): string;
101
105
  /**
102
106
  * Given a list of callables as a dictionary indexed by their full name (namespace included, transpiled to underscore-separated.
103
- * @param callables
104
107
  */
105
108
  getCallableContainersByLowerName(callables: CallableContainer[]): CallableContainerMap;
106
109
  /**
107
- * Split a file by newline characters (LF or CRLF)
108
- * @param text
109
- */
110
- getLines(text: string): string[];
111
- /**
112
- * Compute the pkg path for the target relative to the source file's location
113
- * @param sourcePkgPath The pkgPath of the file that contains the target path
114
- * @param targetPath a full pkgPath, or a path relative to the containing file
110
+ * Given an absolute path to a source file, and a target path,
111
+ * compute the pkg path for the target relative to the source file's location
115
112
  */
116
- getPkgPathFromTarget(sourcePkgPath: string, targetPath: string): string;
113
+ getPkgPathFromTarget(containingFilePathAbsolute: string, targetPath: string): string;
117
114
  /**
118
115
  * Compute the relative path from the source file to the target file
119
- * @param pkgSourcePathAbsolute - the absolute path to the source relative to the package location
120
- * @param pkgTargetPathAbsolute - the absolute path ro the target relative to the package location
116
+ * @param pkgSrcPath - the absolute path to the source, where cwd is the package location
117
+ * @param pkgTargetPath - the absolute path to the target, where cwd is the package location
121
118
  */
122
- getRelativePath(pkgSourcePathAbsolute: string, pkgTargetPathAbsolute: string): string;
119
+ getRelativePath(pkgSrcPath: string, pkgTargetPath: string): string;
120
+ getImportPackagePath(srcPath: string, pkgTargetPath: string): string;
123
121
  /**
124
122
  * Walks left in a DottedGetExpression and returns a VariableExpression if found, or undefined if not found
125
123
  */
126
124
  findBeginningVariableExpression(dottedGet: DottedGetExpression): VariableExpression | undefined;
127
125
  /**
128
- * Does a touch b in any way?
126
+ * Do `a` and `b` overlap by at least one character. This returns false if they are at the edges. Here's some examples:
127
+ * ```
128
+ * | true | true | true | true | true | false | false | false | false |
129
+ * |------|------|------|------|------|-------|-------|-------|-------|
130
+ * | aa | aaa | aaa | aaa | a | aa | aa | a | a |
131
+ * | bbb | bb | bbb | b | bbb | bb | bb | b | a |
132
+ * ```
133
+ */
134
+ rangesIntersect(a: Range | undefined, b: Range | undefined): boolean;
135
+ /**
136
+ * Do `a` and `b` overlap by at least one character or touch at the edges
137
+ * ```
138
+ * | true | true | true | true | true | true | true | false | false |
139
+ * |------|------|------|------|------|-------|-------|-------|-------|
140
+ * | aa | aaa | aaa | aaa | a | aa | aa | a | a |
141
+ * | bbb | bb | bbb | b | bbb | bb | bb | b | a |
142
+ * ```
129
143
  */
130
- rangesIntersect(a: Range, b: Range): boolean;
144
+ rangesIntersectOrTouch(a: Range | undefined, b: Range | undefined): boolean;
131
145
  /**
132
146
  * Test if `position` is in `range`. If the position is at the edges, will return true.
133
147
  * Adapted from core vscode
134
- * @param range
135
- * @param position
136
148
  */
137
- rangeContains(range: Range, position: Position): boolean;
138
- comparePositionToRange(position: Position, range: Range): 1 | -1 | 0;
149
+ rangeContains(range: Range | undefined, position: Position | undefined): boolean;
150
+ comparePositionToRange(position: Position | undefined, range: Range | undefined): 1 | -1 | 0;
151
+ comparePosition(a: Position | undefined, b: Position): 1 | -1 | 0;
139
152
  /**
140
- * Parse an xml file and get back a javascript object containing its results
141
- * @param text
153
+ * Is the inner range completely enclosed in the outer range
142
154
  */
143
- parseXml(text: string): Promise<any>;
144
- propertyCount(object: Record<string, unknown>): number;
145
- padLeft(subject: string, totalLength: number, char: string): string;
155
+ isRangeInRange(inner: Range, outer: Range): boolean;
146
156
  /**
147
- * Given a URI, convert that to a regular fs path
148
- * @param uri
157
+ * Combine all the documentation for a node - uses the AstNode's leadingTrivia property
158
+ * @param node the node to get the documentation for
159
+ * @param options extra options
160
+ * @param options.prettyPrint if true, will format the comment text for markdown
161
+ * @param options.commentTokens out Array of tokens that match the comment lines
149
162
  */
150
- uriToPath(uri: string): string;
163
+ getNodeDocumentation(node: AstNode, options?: {
164
+ prettyPrint?: boolean;
165
+ commentTokens?: Token[];
166
+ }): string;
167
+ /**
168
+ * Prefixes a component name so it can be used as type in the symbol table, without polluting available symbols
169
+ *
170
+ * @param sgNodeName the Name of the component
171
+ * @returns the node name, prefixed with `roSGNode`
172
+ */
173
+ getSgNodeTypeName(sgNodeName: string): string;
151
174
  /**
152
175
  * Force the drive letter to lower case
153
- * @param fullPath
154
176
  */
155
177
  driveLetterToLower(fullPath: string): string;
156
178
  /**
157
- * Determine if two arrays containing primitive values are equal.
158
- * This considers order and compares by equality.
179
+ * Replace the first instance of `search` in `subject` with `replacement`
180
+ */
181
+ replaceCaseInsensitive(subject: string, search: string, replacement: string): string;
182
+ /**
183
+ * Does the string appear to be a uri (i.e. does it start with `file:`)
159
184
  */
160
- areArraysEqual(arr1: any[], arr2: any[]): boolean;
185
+ isUriLike(filePath: string): boolean;
161
186
  /**
162
187
  * Given a file path, convert it to a URI string
163
- * @param srcPath The absolute path to the source file on disk
164
188
  */
165
- pathToUri(srcPath: string): string;
189
+ pathToUri(filePath: string): string;
166
190
  /**
167
- * Get the outDir from options, taking into account cwd and absolute outFile paths
168
- * @param options
191
+ * Given a URI, convert that to a regular fs path
169
192
  */
170
- getOutDir(options: BsConfig): string;
193
+ uriToPath(uri: string): string;
171
194
  /**
172
195
  * Get paths to all files on disc that match this project's source list
173
196
  */
174
- getFilePaths(options: BsConfig): Promise<rokuDeploy.StandardizedFileEntry[]>;
197
+ getFilePaths(options: FinalizedBsConfig): Promise<import("roku-deploy").StandardizedFileEntry[]>;
175
198
  /**
176
199
  * Given a path to a brs file, compute the path to a theoretical d.bs file.
177
- * Only `.brs` files can have a typedef, so return undefined for everything else
178
- * @param brsSrcPath The absolute path to the .brs source file on disk
200
+ * Only `.brs` files can have typedef path, so return undefined for everything else
179
201
  */
180
202
  getTypedefPath(brsSrcPath: string): string;
181
- /**
182
- * Determine whether this diagnostic should be supressed or not, based on brs comment-flags
183
- * @param diagnostic
184
- */
185
- diagnosticIsSuppressed(diagnostic: BsDiagnostic): boolean;
186
- /**
187
- * Walks up the chain
188
- * @param currentPath
189
- */
190
- findClosestConfigFile(currentPath: string): Promise<string>;
191
203
  /**
192
204
  * Set a timeout for the specified milliseconds, and resolve the promise once the timeout is finished.
193
- * @param milliseconds
205
+ * @param milliseconds the minimum number of milliseconds to sleep for
194
206
  */
195
207
  sleep(milliseconds: number): Promise<unknown>;
196
- /**
197
- * Given an array, map and then flatten
198
- * @param arr
199
- * @param cb
200
- */
201
- flatMap<T, R>(array: T[], cb: (arg: T) => R): R;
202
208
  /**
203
209
  * Determines if the position is greater than the range. This means
204
210
  * the position does not touch the range, and has a position greater than the end
@@ -207,40 +213,17 @@ export declare class Util {
207
213
  */
208
214
  positionIsGreaterThanRange(position: Position, range: Range): boolean;
209
215
  /**
210
- * Get a location object back by extracting location information from other objects that contain location
211
- */
212
- getRange(startObj: {
213
- range: Range;
214
- }, endObj: {
215
- range: Range;
216
- }): Range;
217
- /**
218
- * If the two items both start on the same line
216
+ * Get a range back from an object that contains (or is) a range
219
217
  */
220
- sameStartLine(first: {
221
- range: Range;
222
- }, second: {
223
- range: Range;
224
- }): boolean;
218
+ extractRange(rangeIsh: RangeLike): Range | undefined;
225
219
  /**
226
220
  * If the two items have lines that touch
227
- * @param first
228
- * @param second
229
221
  */
230
- linesTouch(first: {
231
- range: Range;
232
- }, second: {
233
- range: Range;
234
- }): boolean;
235
- /**
236
- * Given text with (or without) dots separating text, get the rightmost word.
237
- * (i.e. given "A.B.C", returns "C". or "B" returns "B because there's no dot)
238
- */
239
- getTextAfterFinalDot(name: string): string;
222
+ linesTouch(first: RangeLike, second: RangeLike): boolean;
240
223
  /**
241
224
  * Find a script import that the current position touches, or undefined if not found
242
225
  */
243
- getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference;
226
+ getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference | undefined;
244
227
  /**
245
228
  * Given the class name text, return a namespace-prefixed name.
246
229
  * If the name already has a period in it, or the namespaceName was not provided, return the class name as is.
@@ -251,117 +234,235 @@ export declare class Util {
251
234
  splitIntoLines(string: string): string[];
252
235
  getTextForRange(string: string | string[], range: Range): string;
253
236
  /**
254
- * Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `util.createRange()` is significantly slower
237
+ * Helper for creating `Location` objects. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
238
+ */
239
+ createLocationFromRange(uri: string, range: Range): Location;
240
+ /**
241
+ * Helper for creating `Location` objects from a file and range
242
+ */
243
+ createLocationFromFileRange(file: BscFile, range: Range): Location;
244
+ /**
245
+ * Helper for creating `Location` objects by passing each range value in directly. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
246
+ */
247
+ createLocation(startLine: number, startCharacter: number, endLine: number, endCharacter: number, uri?: string): Location;
248
+ /**
249
+ * Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `Range.create()` is significantly slower.
255
250
  */
256
251
  createRange(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range;
257
252
  /**
258
253
  * Create a `Range` from two `Position`s
259
254
  */
260
- createRangeFromPositions(startPosition: Position, endPosition: Position): Range;
255
+ createRangeFromPositions(startPosition: Position, endPosition: Position): Range | undefined;
261
256
  /**
262
- * Given a list of ranges, create a range that starts with the first non-null lefthand range, and ends with the first non-null
263
- * righthand range. Returns undefined if none of the items have a range.
257
+ * Clone a range
264
258
  */
265
- createBoundingRange(...locatables: Array<{
259
+ cloneLocation(location: Location): Location;
260
+ /**
261
+ * Clone every token
262
+ */
263
+ cloneToken<T extends Token>(token: T): T;
264
+ /**
265
+ * Gets the bounding range of a bunch of ranges or objects that have ranges
266
+ * TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
267
+ */
268
+ createBoundingLocation(...locatables: Array<{
269
+ location?: Location;
270
+ } | Location | {
266
271
  range?: Range;
267
- }>): Range;
272
+ } | Range | undefined>): Location | undefined;
273
+ /**
274
+ * Gets the bounding range of a bunch of ranges or objects that have ranges
275
+ * TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
276
+ */
277
+ createBoundingRange(...locatables: Array<RangeLike>): Range | undefined;
278
+ /**
279
+ * Gets the bounding range of an object that contains a bunch of tokens
280
+ * @param tokens Object with tokens in it
281
+ * @returns Range containing all the tokens
282
+ */
283
+ createBoundingLocationFromTokens(tokens: Record<string, {
284
+ location?: Location;
285
+ }>): Location | undefined;
268
286
  /**
269
- * Create a `Position` object. Prefer this over `Position.create` for performance reasons
287
+ * Create a `Position` object. Prefer this over `Position.create` for performance reasons.
270
288
  */
271
289
  createPosition(line: number, character: number): {
272
290
  line: number;
273
291
  character: number;
274
292
  };
275
293
  /**
276
- * Convert a list of tokens into a string, including their leading whitespace
294
+ * Convert a token into a BscType
277
295
  */
278
- tokensToString(tokens: Token[]): string;
296
+ tokenToBscType(token: Token): DynamicType | ObjectType | VoidType | InvalidType | BooleanType | DoubleType | FloatType | FunctionType | IntegerType | LongIntegerType | StringType;
279
297
  /**
280
- * Convert a token into a BscType
298
+ * Deciphers the correct types for fields based on docs
299
+ * https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md
300
+ * @param typeDescriptor the type descriptor from the docs
301
+ * @returns {BscType} the known type, or dynamic
302
+ */
303
+ getNodeFieldType(typeDescriptor: string, lookupTable?: SymbolTable): BscType;
304
+ /**
305
+ * Return the type of the result of a binary operator
306
+ * Note: compound assignments (eg. +=) internally use a binary expression, so that's why TokenKind.PlusEqual, etc. are here too
307
+ */
308
+ binaryOperatorResultType(leftType: BscType, operator: Token, rightType: BscType): BscType;
309
+ getHighestPriorityType(types: BscType[], depth?: number): BscType;
310
+ /**
311
+ * Return the type of the result of a unary operator
281
312
  */
282
- tokenToBscType(token: Token, allowCustomType?: boolean): DynamicType | ObjectType | CustomType | BooleanType | DoubleType | FloatType | FunctionType | IntegerType | InvalidType | LongIntegerType | StringType | VoidType;
313
+ unaryOperatorResultType(operator: Token, exprType: BscType): BscType;
314
+ getUnboxedType(boxedType: BscType): BscType;
283
315
  /**
284
316
  * Get the extension for the given file path. Basically the part after the final dot, except for
285
317
  * `d.bs` which is treated as single extension
318
+ * @returns the file extension (i.e. ".d.bs", ".bs", ".brs", ".xml", ".jpg", etc...)
286
319
  */
287
320
  getExtension(filePath: string): string;
288
321
  /**
289
322
  * Load and return the list of plugins
290
323
  */
291
- loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void): CompilerPlugin[];
292
- resolveRequire(cwd: string, pathOrModule: string): any;
324
+ loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void): Plugin[];
293
325
  /**
294
326
  * Gathers expressions, variables, and unique names from an expression.
295
327
  * This is mostly used for the ternary expression
296
328
  */
297
- getExpressionInfo(expression: Expression): ExpressionInfo;
329
+ getExpressionInfo(expression: Expression, file: BrsFile): ExpressionInfo;
330
+ concatAnnotationLeadingTrivia(stmt: Statement): Token[];
298
331
  /**
299
332
  * Create a SourceNode that maps every line to itself. Useful for creating maps for files
300
333
  * that haven't changed at all, but we still need the map
301
334
  */
302
335
  simpleMap(source: string, src: string): SourceNode;
336
+ private isWindows;
337
+ private standardizePathCache;
303
338
  /**
304
- * Creates a new SGAttribute object, but keeps the existing Range references (since those should be immutable)
339
+ * Converts a path into a standardized format (drive letter to lower, remove extra slashes, use single slash type, resolve relative parts, etc...)
305
340
  */
306
- cloneSGAttribute(attr: SGAttribute, value: string): SGAttribute;
341
+ standardizePath(thePath: string): string;
307
342
  /**
308
- * Shorthand for creating a new source node
343
+ * Given a Diagnostic or BsDiagnostic, return a deep clone of the diagnostic.
344
+ * @param diagnostic the diagnostic to clone
345
+ * @param relatedInformationFallbackLocation a default location to use for all `relatedInformation` entries that are missing a location
309
346
  */
310
- sourceNode(source: string, locatable: {
311
- range: Range;
312
- }, code: string | SourceNode | TranspileResult): SourceNode | undefined;
347
+ toDiagnostic(diagnostic: Diagnostic | BsDiagnostic, relatedInformationFallbackLocation: string): Diagnostic;
313
348
  /**
314
- * Remove leading simple protocols from a path (if present)
349
+ * Sort an array of objects that have a Range
315
350
  */
316
- removeProtocol(pkgPath: string): string;
317
- standardizePath(thePath: string): string;
318
- copyBslibToStaging(stagingDir: string): Promise<void>;
319
- /**
320
- * Given a Diagnostic or BsDiagnostic, return a copy of the diagnostic
321
- */
322
- toDiagnostic(diagnostic: Diagnostic | BsDiagnostic): {
323
- severity: import("vscode-languageserver-types").DiagnosticSeverity;
324
- range: Range;
325
- message: string;
326
- relatedInformation: {
327
- location: import("vscode-languageserver-types").Location;
328
- message: string;
329
- }[];
330
- code: string | number;
331
- source: string;
332
- };
351
+ sortByRange<T extends {
352
+ range: Range | undefined;
353
+ }>(locatables: T[]): T[];
333
354
  /**
334
- * Gets the minimum and maximum number of allowed params
335
- * @param params The list of callable parameters to check
336
- * @returns the minimum and maximum number of allowed params
355
+ * Wrap the given code in a markdown code fence (with the language)
337
356
  */
338
- getMinMaxParamCount(params: CallableParam[]): {
339
- min: number;
340
- max: number;
341
- };
357
+ mdFence(code: string, language?: string): string;
342
358
  /**
343
- * Finds the array of callables from a container map, taking into account the function from which it was called
344
- * If the callable was called in a function in a namespace, functions in that namespace are preferred
345
- * @return an array with callable containers - could be empty if nothing was found
359
+ * Gets each part of the dotted get.
360
+ * @param node any ast expression
361
+ * @returns an array of the parts of the dotted get. If not fully a dotted get, then returns undefined
346
362
  */
347
- getCallableContainersFromContainerMapByFunctionCall(callablesByLowerName: CallableContainerMap, expCall: FunctionCall): CallableContainer[];
363
+ getAllDottedGetParts(node: AstNode): Identifier[] | undefined;
348
364
  /**
349
- * Sort an array of objects that have a Range
365
+ * Given an expression, return all the DottedGet name parts as a string.
366
+ * Mostly used to convert namespaced item full names to a strings
367
+ */
368
+ getAllDottedGetPartsAsString(node: Expression | Statement, parseMode?: ParseMode, lastSep?: string): string;
369
+ /**
370
+ * Break an expression into each part.
371
+ */
372
+ splitExpression(expression: Expression): Expression[];
373
+ /**
374
+ * Returns an integer if valid, or undefined. Eliminates checking for NaN
375
+ */
376
+ parseInt(value: any): number;
377
+ /**
378
+ * Converts a range to a string in the format 1:2-3:4
379
+ */
380
+ rangeToString(range: Range): string;
381
+ validateTooDeepFile(file: (BrsFile | XmlFile)): void;
382
+ /**
383
+ * Execute dispose for a series of disposable items
384
+ * @param disposables a list of functions or disposables
385
+ */
386
+ applyDispose(disposables: DisposableLike[]): void;
387
+ /**
388
+ * Race a series of promises, and return the first one that resolves AND matches the matcher function.
389
+ * If all of the promises reject, then this will emit an AggregatreError with all of the errors.
390
+ * If at least one promise resolves, then this will log all of the errors to the console
391
+ * If at least one promise resolves but none of them match the matcher, then this will return undefined.
392
+ * @param promises all of the promises to race
393
+ * @param matcher a function that should return true if this value should be kept. Returning any value other than true means `false`
394
+ * @returns the first resolved value that matches the matcher, or undefined if none of them match
350
395
  */
351
- sortByRange(locatables: Locatable[]): Locatable[];
396
+ promiseRaceMatch<T>(promises: MaybePromise<T>[], matcher: (value: T) => boolean): Promise<T>;
352
397
  /**
353
- * Split the given text and return ranges for each chunk.
354
- * Only works for single-line strings
398
+ * Wraps SourceNode's constructor to be compatible with the TranspileResult type
355
399
  */
356
- splitGetRange(separator: string, text: string, range: Range): {
357
- text: string;
358
- range: Range;
359
- }[];
400
+ sourceNodeFromTranspileResult(line: number | null, column: number | null, source: string | null, chunks?: string | SourceNode | TranspileResult, name?: string): SourceNode;
401
+ /**
402
+ * Find the index of the last item in the array that matches.
403
+ */
404
+ findLastIndex<T>(array: T[], matcher: (T: any) => boolean): number;
405
+ processTypeChain(typeChain: TypeChainEntry[]): TypeChainProcessResult;
406
+ getCircularReferenceDiagnosticDetail(circularReferenceInfo: TypeCircularReferenceInfo, defaultName?: string): string[];
407
+ isInTypeExpression(expression: AstNode): boolean;
408
+ isGenericNodeType(type: BscType): boolean;
409
+ hasAnyRequiredSymbolChanged(requiredSymbols: UnresolvedSymbol[], changedSymbols: Map<SymbolTypeFlag, Set<string>>): boolean;
410
+ setContainsUnresolvedSymbol(symbolLowerNameSet: Set<string>, symbol: UnresolvedSymbol): boolean;
411
+ getCustomTypesInSymbolTree(setToFill: Set<BscType>, type: BscType, filter?: (t: BscType) => boolean): void;
412
+ truncate<T>(options: {
413
+ leadingText: string;
414
+ items: T[];
415
+ trailingText?: string;
416
+ maxLength: number;
417
+ itemSeparator?: string;
418
+ partBuilder?: (item: T) => string;
419
+ }): string;
420
+ getAstNodeFriendlyName(node: AstNode): string;
421
+ hasLeadingComments(input: Token | AstNode): boolean;
422
+ getLeadingComments(input: Token | AstNode): Token[];
423
+ isLeadingCommentOnSameLine(line: RangeLike, input: Token | AstNode): boolean;
424
+ isClassUsedAsFunction(potentialClassType: BscType, expression: Expression, options: GetTypeOptions): boolean;
425
+ getSpecialCaseCallExpressionReturnType(callExpr: CallExpression, options: GetSymbolTypeOptions): BscType;
426
+ getCallFuncType(callExpr: CallExpression | CallfuncExpression, methodNameToken: Token | Identifier, options: GetSymbolTypeOptions): BscType;
427
+ isUnionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is UnionType;
428
+ isIntersectionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is IntersectionType;
429
+ getFunctionTypeFromUnion(type: BscType): BscType;
430
+ getFunctionTypeFromIntersection(type: BscType): BscType;
431
+ getReturnTypeOfUnionOfFunctions(type: UnionType): BscType;
432
+ getReturnTypeOfIntersectionOfFunctions(type: IntersectionType): BscType;
433
+ symbolComesFromSameNode(symbolName: string, definingNode: AstNode, symbolTable: SymbolTable): boolean;
434
+ isCalleeMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
435
+ isVariableMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
436
+ isVariableShadowingSomething(symbolName: string, nodeWhereUsed: AstNode): boolean;
437
+ chooseTypeFromCodeOrDocComment(codeType: BscType, docType: BscType, options: GetTypeOptions): BscType;
438
+ /**
439
+ * Gets the type for a default value (eg. as a function param, class member or typed array)
440
+ */
441
+ getDefaultTypeFromValueType(valueType: (BscType | BscType[])): BscType;
442
+ /**
443
+ * Get the default type for an iterator of the given type
444
+ * Used for `for each` loops
445
+ */
446
+ getIteratorDefaultType(iteratorType: BscType): BscType;
447
+ /**
448
+ * Get a short name that can be used to reference the project in logs. (typically something like `prj1`, `prj8`, etc...)
449
+ */
450
+ getProjectLogName(config: {
451
+ projectNumber: number;
452
+ }): string;
360
453
  }
361
454
  /**
362
455
  * A tagged template literal function for standardizing the path. This has to be defined as standalone function since it's a tagged template literal function,
363
456
  * we can't use `object.tag` syntax.
364
457
  */
365
458
  export declare function standardizePath(stringParts: any, ...expressions: any[]): string;
459
+ /**
460
+ * An item that can be coerced into a `Range`
461
+ */
462
+ export declare type RangeLike = {
463
+ location?: Location;
464
+ } | Location | {
465
+ range?: Range;
466
+ } | Range | undefined;
366
467
  export declare let util: Util;
367
468
  export default util;