brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.51

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