brighterscript 1.0.0-alpha.24 → 1.0.0-alpha.25

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 (530) hide show
  1. package/CHANGELOG.md +493 -233
  2. package/README.md +45 -139
  3. package/bsconfig.schema.json +41 -0
  4. package/dist/ActionPipeline.d.ts +10 -0
  5. package/dist/ActionPipeline.js +40 -0
  6. package/dist/ActionPipeline.js.map +1 -0
  7. package/dist/AstValidationSegmenter.d.ts +25 -0
  8. package/dist/AstValidationSegmenter.js +152 -0
  9. package/dist/AstValidationSegmenter.js.map +1 -0
  10. package/dist/BsConfig.d.ts +39 -4
  11. package/dist/BusyStatusTracker.d.ts +31 -0
  12. package/dist/BusyStatusTracker.js +83 -0
  13. package/dist/BusyStatusTracker.js.map +1 -0
  14. package/dist/Cache.js +3 -3
  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 +3 -3
  20. package/dist/CodeActionUtil.js.map +1 -1
  21. package/dist/CommentFlagProcessor.d.ts +3 -2
  22. package/dist/CommentFlagProcessor.js +5 -4
  23. package/dist/CommentFlagProcessor.js.map +1 -1
  24. package/dist/DependencyGraph.d.ts +3 -2
  25. package/dist/DependencyGraph.js +11 -10
  26. package/dist/DependencyGraph.js.map +1 -1
  27. package/dist/DiagnosticCollection.js +9 -5
  28. package/dist/DiagnosticCollection.js.map +1 -1
  29. package/dist/DiagnosticFilterer.d.ts +1 -0
  30. package/dist/DiagnosticFilterer.js +5 -3
  31. package/dist/DiagnosticFilterer.js.map +1 -1
  32. package/dist/DiagnosticMessages.d.ts +61 -13
  33. package/dist/DiagnosticMessages.js +116 -19
  34. package/dist/DiagnosticMessages.js.map +1 -1
  35. package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
  36. package/dist/DiagnosticSeverityAdjuster.js +41 -0
  37. package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
  38. package/dist/FunctionScope.d.ts +28 -0
  39. package/dist/FunctionScope.js +52 -0
  40. package/dist/FunctionScope.js.map +1 -0
  41. package/dist/KeyedThrottler.d.ts +3 -3
  42. package/dist/KeyedThrottler.js +3 -3
  43. package/dist/KeyedThrottler.js.map +1 -1
  44. package/dist/LanguageServer.d.ts +23 -11
  45. package/dist/LanguageServer.js +150 -69
  46. package/dist/LanguageServer.js.map +1 -1
  47. package/dist/Logger.d.ts +3 -2
  48. package/dist/Logger.js +11 -3
  49. package/dist/Logger.js.map +1 -1
  50. package/dist/PluginInterface.d.ts +21 -3
  51. package/dist/PluginInterface.js +74 -6
  52. package/dist/PluginInterface.js.map +1 -1
  53. package/dist/Program.d.ts +158 -79
  54. package/dist/Program.js +831 -695
  55. package/dist/Program.js.map +1 -1
  56. package/dist/ProgramBuilder.d.ts +22 -12
  57. package/dist/ProgramBuilder.js +130 -103
  58. package/dist/ProgramBuilder.js.map +1 -1
  59. package/dist/Scope.d.ts +87 -133
  60. package/dist/Scope.js +450 -510
  61. package/dist/Scope.js.map +1 -1
  62. package/dist/Stopwatch.js +1 -1
  63. package/dist/Stopwatch.js.map +1 -1
  64. package/dist/SymbolTable.d.ts +89 -34
  65. package/dist/SymbolTable.js +239 -114
  66. package/dist/SymbolTable.js.map +1 -1
  67. package/dist/Throttler.d.ts +12 -0
  68. package/dist/Throttler.js +39 -0
  69. package/dist/Throttler.js.map +1 -1
  70. package/dist/Watcher.d.ts +0 -3
  71. package/dist/Watcher.js +0 -3
  72. package/dist/Watcher.js.map +1 -1
  73. package/dist/XmlScope.d.ts +4 -6
  74. package/dist/XmlScope.js +74 -69
  75. package/dist/XmlScope.js.map +1 -1
  76. package/dist/astUtils/CachedLookups.d.ts +48 -0
  77. package/dist/astUtils/CachedLookups.js +323 -0
  78. package/dist/astUtils/CachedLookups.js.map +1 -0
  79. package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
  80. package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
  81. package/dist/astUtils/Editor.js.map +1 -0
  82. package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +68 -64
  83. package/dist/astUtils/Editor.spec.js.map +1 -0
  84. package/dist/astUtils/creators.d.ts +10 -10
  85. package/dist/astUtils/creators.js +26 -16
  86. package/dist/astUtils/creators.js.map +1 -1
  87. package/dist/astUtils/creators.spec.js +5 -5
  88. package/dist/astUtils/creators.spec.js.map +1 -1
  89. package/dist/astUtils/reflection.d.ts +132 -104
  90. package/dist/astUtils/reflection.js +220 -174
  91. package/dist/astUtils/reflection.js.map +1 -1
  92. package/dist/astUtils/reflection.spec.js +208 -126
  93. package/dist/astUtils/reflection.spec.js.map +1 -1
  94. package/dist/astUtils/stackedVisitor.spec.js +12 -12
  95. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  96. package/dist/astUtils/visitors.d.ts +53 -35
  97. package/dist/astUtils/visitors.js +29 -3
  98. package/dist/astUtils/visitors.js.map +1 -1
  99. package/dist/astUtils/visitors.spec.js +178 -33
  100. package/dist/astUtils/visitors.spec.js.map +1 -1
  101. package/dist/astUtils/xml.d.ts +9 -9
  102. package/dist/astUtils/xml.js +9 -9
  103. package/dist/astUtils/xml.js.map +1 -1
  104. package/dist/bscPlugin/BscPlugin.d.ts +10 -2
  105. package/dist/bscPlugin/BscPlugin.js +33 -3
  106. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  107. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  108. package/dist/bscPlugin/CallExpressionInfo.js +131 -0
  109. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  110. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  111. package/dist/bscPlugin/FileWriter.js +24 -0
  112. package/dist/bscPlugin/FileWriter.js.map +1 -0
  113. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  114. package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
  115. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  116. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +14 -11
  117. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  118. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +16 -16
  119. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  120. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +52 -1
  121. package/dist/bscPlugin/completions/CompletionsProcessor.js +517 -26
  122. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
  123. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
  124. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  125. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  126. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  127. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  128. package/dist/bscPlugin/hover/HoverProcessor.d.ts +7 -7
  129. package/dist/bscPlugin/hover/HoverProcessor.js +123 -125
  130. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
  131. package/dist/bscPlugin/hover/HoverProcessor.spec.js +371 -53
  132. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
  133. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +2 -1
  134. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +85 -23
  135. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
  136. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +83 -6
  137. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
  138. package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
  139. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  140. package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
  141. package/dist/bscPlugin/serialize/BslibManager.js +40 -0
  142. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  143. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  144. package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
  145. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  146. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
  147. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +33 -9
  148. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  149. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  150. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
  151. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  152. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  153. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  154. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  155. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +13 -5
  156. package/dist/bscPlugin/validation/BrsFileValidator.js +259 -49
  157. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  158. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +230 -14
  159. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
  160. package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
  161. package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
  162. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  163. package/dist/bscPlugin/validation/ScopeValidator.d.ts +54 -27
  164. package/dist/bscPlugin/validation/ScopeValidator.js +483 -286
  165. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  166. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  167. package/dist/bscPlugin/validation/ScopeValidator.spec.js +2454 -0
  168. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  169. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  170. package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
  171. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  172. package/dist/cli.js +104 -13
  173. package/dist/cli.js.map +1 -1
  174. package/dist/deferred.d.ts +3 -3
  175. package/dist/deferred.js.map +1 -1
  176. package/dist/diagnosticUtils.d.ts +8 -2
  177. package/dist/diagnosticUtils.js +47 -17
  178. package/dist/diagnosticUtils.js.map +1 -1
  179. package/dist/examples/plugins/removePrint.js +8 -10
  180. package/dist/examples/plugins/removePrint.js.map +1 -1
  181. package/dist/files/AssetFile.d.ts +26 -0
  182. package/dist/files/AssetFile.js +26 -0
  183. package/dist/files/AssetFile.js.map +1 -0
  184. package/dist/files/BrsFile.Class.spec.js +523 -493
  185. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  186. package/dist/files/BrsFile.d.ts +112 -111
  187. package/dist/files/BrsFile.js +741 -1032
  188. package/dist/files/BrsFile.js.map +1 -1
  189. package/dist/files/BrsFile.spec.js +1728 -1232
  190. package/dist/files/BrsFile.spec.js.map +1 -1
  191. package/dist/files/BscFile.d.ts +104 -0
  192. package/dist/files/BscFile.js +16 -0
  193. package/dist/files/BscFile.js.map +1 -0
  194. package/dist/files/Factory.d.ts +25 -0
  195. package/dist/files/Factory.js +22 -0
  196. package/dist/files/Factory.js.map +1 -0
  197. package/dist/files/LazyFileData.d.ts +20 -0
  198. package/dist/files/LazyFileData.js +54 -0
  199. package/dist/files/LazyFileData.js.map +1 -0
  200. package/dist/files/LazyFileData.spec.d.ts +1 -0
  201. package/dist/files/LazyFileData.spec.js +27 -0
  202. package/dist/files/LazyFileData.spec.js.map +1 -0
  203. package/dist/files/XmlFile.d.ts +70 -32
  204. package/dist/files/XmlFile.js +106 -118
  205. package/dist/files/XmlFile.js.map +1 -1
  206. package/dist/files/XmlFile.spec.js +325 -262
  207. package/dist/files/XmlFile.spec.js.map +1 -1
  208. package/dist/files/tests/imports.spec.js +48 -40
  209. package/dist/files/tests/imports.spec.js.map +1 -1
  210. package/dist/files/tests/optionalChaning.spec.js +84 -24
  211. package/dist/files/tests/optionalChaning.spec.js.map +1 -1
  212. package/dist/globalCallables.js +16 -21
  213. package/dist/globalCallables.js.map +1 -1
  214. package/dist/index.d.ts +12 -1
  215. package/dist/index.js +12 -1
  216. package/dist/index.js.map +1 -1
  217. package/dist/interfaces.d.ts +389 -161
  218. package/dist/interfaces.js +27 -0
  219. package/dist/interfaces.js.map +1 -1
  220. package/dist/lexer/Character.spec.js +5 -5
  221. package/dist/lexer/Character.spec.js.map +1 -1
  222. package/dist/lexer/Lexer.d.ts +12 -5
  223. package/dist/lexer/Lexer.js +28 -13
  224. package/dist/lexer/Lexer.js.map +1 -1
  225. package/dist/lexer/Lexer.spec.js +181 -135
  226. package/dist/lexer/Lexer.spec.js.map +1 -1
  227. package/dist/lexer/Token.d.ts +9 -1
  228. package/dist/lexer/Token.js +9 -1
  229. package/dist/lexer/Token.js.map +1 -1
  230. package/dist/lexer/TokenKind.d.ts +8 -0
  231. package/dist/lexer/TokenKind.js +24 -4
  232. package/dist/lexer/TokenKind.js.map +1 -1
  233. package/dist/parser/AstNode.d.ts +162 -0
  234. package/dist/parser/AstNode.js +225 -0
  235. package/dist/parser/AstNode.js.map +1 -0
  236. package/dist/parser/AstNode.spec.d.ts +1 -0
  237. package/dist/parser/AstNode.spec.js +165 -0
  238. package/dist/parser/AstNode.spec.js.map +1 -0
  239. package/dist/parser/BrsTranspileState.d.ts +4 -7
  240. package/dist/parser/BrsTranspileState.js +4 -12
  241. package/dist/parser/BrsTranspileState.js.map +1 -1
  242. package/dist/parser/Expression.d.ts +126 -176
  243. package/dist/parser/Expression.js +523 -405
  244. package/dist/parser/Expression.js.map +1 -1
  245. package/dist/parser/Parser.Class.spec.js +151 -145
  246. package/dist/parser/Parser.Class.spec.js.map +1 -1
  247. package/dist/parser/Parser.d.ts +43 -201
  248. package/dist/parser/Parser.js +446 -962
  249. package/dist/parser/Parser.js.map +1 -1
  250. package/dist/parser/Parser.spec.d.ts +3 -1
  251. package/dist/parser/Parser.spec.js +1002 -846
  252. package/dist/parser/Parser.spec.js.map +1 -1
  253. package/dist/parser/SGParser.d.ts +9 -8
  254. package/dist/parser/SGParser.js +10 -8
  255. package/dist/parser/SGParser.js.map +1 -1
  256. package/dist/parser/SGParser.spec.js +27 -38
  257. package/dist/parser/SGParser.spec.js.map +1 -1
  258. package/dist/parser/SGTypes.d.ts +98 -35
  259. package/dist/parser/SGTypes.js +169 -99
  260. package/dist/parser/SGTypes.js.map +1 -1
  261. package/dist/parser/Statement.d.ts +183 -131
  262. package/dist/parser/Statement.js +549 -387
  263. package/dist/parser/Statement.js.map +1 -1
  264. package/dist/parser/Statement.spec.js +45 -21
  265. package/dist/parser/Statement.spec.js.map +1 -1
  266. package/dist/parser/TranspileState.d.ts +1 -1
  267. package/dist/parser/TranspileState.js +7 -12
  268. package/dist/parser/TranspileState.js.map +1 -1
  269. package/dist/parser/tests/Parser.spec.js +3 -2
  270. package/dist/parser/tests/Parser.spec.js.map +1 -1
  271. package/dist/parser/tests/controlFlow/For.spec.js +33 -23
  272. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  273. package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
  274. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  275. package/dist/parser/tests/controlFlow/If.spec.js +96 -94
  276. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  277. package/dist/parser/tests/controlFlow/While.spec.js +22 -16
  278. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  279. package/dist/parser/tests/expression/Additive.spec.js +8 -8
  280. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  281. package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
  282. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  283. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +61 -20
  284. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  285. package/dist/parser/tests/expression/Boolean.spec.js +8 -8
  286. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  287. package/dist/parser/tests/expression/Call.spec.js +129 -21
  288. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  289. package/dist/parser/tests/expression/Exponential.spec.js +5 -5
  290. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  291. package/dist/parser/tests/expression/Function.spec.js +36 -36
  292. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  293. package/dist/parser/tests/expression/Indexing.spec.js +67 -22
  294. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  295. package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
  296. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  297. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -59
  298. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  299. package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
  300. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  301. package/dist/parser/tests/expression/Primary.spec.js +12 -12
  302. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  303. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
  304. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
  305. package/dist/parser/tests/expression/Relational.spec.js +13 -13
  306. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  307. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
  308. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  309. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +96 -57
  310. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  311. package/dist/parser/tests/expression/TernaryExpression.spec.js +89 -89
  312. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  313. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  314. package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
  315. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  316. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  317. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  318. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  319. package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
  320. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  321. package/dist/parser/tests/statement/ConstStatement.spec.js +82 -33
  322. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
  323. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  324. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  325. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  326. package/dist/parser/tests/statement/Declaration.spec.js +19 -19
  327. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  328. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  329. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  330. package/dist/parser/tests/statement/Enum.spec.js +98 -302
  331. package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
  332. package/dist/parser/tests/statement/For.spec.js +9 -10
  333. package/dist/parser/tests/statement/For.spec.js.map +1 -1
  334. package/dist/parser/tests/statement/ForEach.spec.js +8 -9
  335. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
  336. package/dist/parser/tests/statement/Function.spec.js +44 -35
  337. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  338. package/dist/parser/tests/statement/Goto.spec.js +5 -5
  339. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  340. package/dist/parser/tests/statement/Increment.spec.js +20 -20
  341. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  342. package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
  343. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
  344. package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
  345. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  346. package/dist/parser/tests/statement/Misc.spec.js +16 -78
  347. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  348. package/dist/parser/tests/statement/PrintStatement.spec.js +35 -33
  349. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  350. package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
  351. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  352. package/dist/parser/tests/statement/Set.spec.js +48 -35
  353. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  354. package/dist/parser/tests/statement/Stop.spec.js +6 -6
  355. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  356. package/dist/parser/tests/statement/Throw.spec.js +6 -6
  357. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  358. package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
  359. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  360. package/dist/preprocessor/Manifest.d.ts +1 -1
  361. package/dist/preprocessor/Manifest.js +2 -2
  362. package/dist/preprocessor/Manifest.js.map +1 -1
  363. package/dist/preprocessor/Manifest.spec.js +8 -8
  364. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  365. package/dist/preprocessor/Preprocessor.d.ts +5 -6
  366. package/dist/preprocessor/Preprocessor.js +5 -5
  367. package/dist/preprocessor/Preprocessor.js.map +1 -1
  368. package/dist/preprocessor/Preprocessor.spec.js +25 -25
  369. package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
  370. package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
  371. package/dist/preprocessor/PreprocessorParser.js +7 -1
  372. package/dist/preprocessor/PreprocessorParser.js.map +1 -1
  373. package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
  374. package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
  375. package/dist/roku-types/data.json +5892 -10081
  376. package/dist/roku-types/index.d.ts +622 -1719
  377. package/dist/types/ArrayType.d.ts +10 -9
  378. package/dist/types/ArrayType.js +65 -60
  379. package/dist/types/ArrayType.js.map +1 -1
  380. package/dist/types/ArrayType.spec.js +36 -68
  381. package/dist/types/ArrayType.spec.js.map +1 -1
  382. package/dist/types/AssociativeArrayType.d.ts +11 -0
  383. package/dist/types/AssociativeArrayType.js +52 -0
  384. package/dist/types/AssociativeArrayType.js.map +1 -0
  385. package/dist/types/BaseFunctionType.d.ts +9 -0
  386. package/dist/types/BaseFunctionType.js +25 -0
  387. package/dist/types/BaseFunctionType.js.map +1 -0
  388. package/dist/types/BooleanType.d.ts +8 -5
  389. package/dist/types/BooleanType.js +14 -7
  390. package/dist/types/BooleanType.js.map +1 -1
  391. package/dist/types/BooleanType.spec.js +10 -6
  392. package/dist/types/BooleanType.spec.js.map +1 -1
  393. package/dist/types/BscType.d.ts +32 -21
  394. package/dist/types/BscType.js +118 -21
  395. package/dist/types/BscType.js.map +1 -1
  396. package/dist/types/BscTypeKind.d.ts +25 -0
  397. package/dist/types/BscTypeKind.js +30 -0
  398. package/dist/types/BscTypeKind.js.map +1 -0
  399. package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
  400. package/dist/types/BuiltInInterfaceAdder.js +164 -0
  401. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  402. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  403. package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
  404. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  405. package/dist/types/ClassType.d.ts +17 -0
  406. package/dist/types/ClassType.js +58 -0
  407. package/dist/types/ClassType.js.map +1 -0
  408. package/dist/types/ClassType.spec.d.ts +1 -0
  409. package/dist/types/ClassType.spec.js +77 -0
  410. package/dist/types/ClassType.spec.js.map +1 -0
  411. package/dist/types/ComponentType.d.ts +26 -0
  412. package/dist/types/ComponentType.js +83 -0
  413. package/dist/types/ComponentType.js.map +1 -0
  414. package/dist/types/DoubleType.d.ts +8 -5
  415. package/dist/types/DoubleType.js +18 -16
  416. package/dist/types/DoubleType.js.map +1 -1
  417. package/dist/types/DoubleType.spec.js +12 -6
  418. package/dist/types/DoubleType.spec.js.map +1 -1
  419. package/dist/types/DynamicType.d.ts +9 -5
  420. package/dist/types/DynamicType.js +15 -4
  421. package/dist/types/DynamicType.js.map +1 -1
  422. package/dist/types/DynamicType.spec.js +16 -5
  423. package/dist/types/DynamicType.spec.js.map +1 -1
  424. package/dist/types/EnumType.d.ts +30 -12
  425. package/dist/types/EnumType.js +43 -17
  426. package/dist/types/EnumType.js.map +1 -1
  427. package/dist/types/EnumType.spec.d.ts +1 -0
  428. package/dist/types/EnumType.spec.js +33 -0
  429. package/dist/types/EnumType.spec.js.map +1 -0
  430. package/dist/types/FloatType.d.ts +8 -5
  431. package/dist/types/FloatType.js +18 -16
  432. package/dist/types/FloatType.js.map +1 -1
  433. package/dist/types/FloatType.spec.js +4 -6
  434. package/dist/types/FloatType.spec.js.map +1 -1
  435. package/dist/types/FunctionType.d.ts +13 -8
  436. package/dist/types/FunctionType.js +30 -14
  437. package/dist/types/FunctionType.js.map +1 -1
  438. package/dist/types/InheritableType.d.ts +28 -0
  439. package/dist/types/InheritableType.js +152 -0
  440. package/dist/types/InheritableType.js.map +1 -0
  441. package/dist/types/IntegerType.d.ts +8 -5
  442. package/dist/types/IntegerType.js +18 -16
  443. package/dist/types/IntegerType.js.map +1 -1
  444. package/dist/types/IntegerType.spec.js +8 -6
  445. package/dist/types/IntegerType.spec.js.map +1 -1
  446. package/dist/types/InterfaceType.d.ts +12 -13
  447. package/dist/types/InterfaceType.js +20 -48
  448. package/dist/types/InterfaceType.js.map +1 -1
  449. package/dist/types/InterfaceType.spec.js +90 -56
  450. package/dist/types/InterfaceType.spec.js.map +1 -1
  451. package/dist/types/InvalidType.d.ts +7 -5
  452. package/dist/types/InvalidType.js +13 -7
  453. package/dist/types/InvalidType.js.map +1 -1
  454. package/dist/types/InvalidType.spec.js +8 -6
  455. package/dist/types/InvalidType.spec.js.map +1 -1
  456. package/dist/types/LongIntegerType.d.ts +8 -5
  457. package/dist/types/LongIntegerType.js +17 -15
  458. package/dist/types/LongIntegerType.js.map +1 -1
  459. package/dist/types/LongIntegerType.spec.js +10 -6
  460. package/dist/types/LongIntegerType.spec.js.map +1 -1
  461. package/dist/types/NamespaceType.d.ts +12 -0
  462. package/dist/types/NamespaceType.js +28 -0
  463. package/dist/types/NamespaceType.js.map +1 -0
  464. package/dist/types/ObjectType.d.ts +9 -8
  465. package/dist/types/ObjectType.js +21 -11
  466. package/dist/types/ObjectType.js.map +1 -1
  467. package/dist/types/ObjectType.spec.js +3 -3
  468. package/dist/types/ObjectType.spec.js.map +1 -1
  469. package/dist/types/ReferenceType.d.ts +63 -0
  470. package/dist/types/ReferenceType.js +423 -0
  471. package/dist/types/ReferenceType.js.map +1 -0
  472. package/dist/types/ReferenceType.spec.d.ts +1 -0
  473. package/dist/types/ReferenceType.spec.js +137 -0
  474. package/dist/types/ReferenceType.spec.js.map +1 -0
  475. package/dist/types/StringType.d.ts +11 -5
  476. package/dist/types/StringType.js +18 -7
  477. package/dist/types/StringType.js.map +1 -1
  478. package/dist/types/StringType.spec.js +3 -5
  479. package/dist/types/StringType.spec.js.map +1 -1
  480. package/dist/types/TypedFunctionType.d.ts +22 -17
  481. package/dist/types/TypedFunctionType.js +78 -60
  482. package/dist/types/TypedFunctionType.js.map +1 -1
  483. package/dist/types/TypedFunctionType.spec.js +105 -20
  484. package/dist/types/TypedFunctionType.spec.js.map +1 -1
  485. package/dist/types/UninitializedType.d.ts +8 -6
  486. package/dist/types/UninitializedType.js +13 -7
  487. package/dist/types/UninitializedType.js.map +1 -1
  488. package/dist/types/UnionType.d.ts +20 -0
  489. package/dist/types/UnionType.js +123 -0
  490. package/dist/types/UnionType.js.map +1 -0
  491. package/dist/types/UnionType.spec.d.ts +1 -0
  492. package/dist/types/UnionType.spec.js +130 -0
  493. package/dist/types/UnionType.spec.js.map +1 -0
  494. package/dist/types/VoidType.d.ts +8 -5
  495. package/dist/types/VoidType.js +14 -7
  496. package/dist/types/VoidType.js.map +1 -1
  497. package/dist/types/VoidType.spec.js +3 -3
  498. package/dist/types/VoidType.spec.js.map +1 -1
  499. package/dist/types/helper.spec.d.ts +1 -0
  500. package/dist/types/helper.spec.js +145 -0
  501. package/dist/types/helper.spec.js.map +1 -0
  502. package/dist/types/helpers.d.ts +19 -37
  503. package/dist/types/helpers.js +159 -99
  504. package/dist/types/helpers.js.map +1 -1
  505. package/dist/types/index.d.ts +22 -0
  506. package/dist/types/index.js +39 -0
  507. package/dist/types/index.js.map +1 -0
  508. package/dist/util.d.ts +132 -137
  509. package/dist/util.js +796 -362
  510. package/dist/util.js.map +1 -1
  511. package/dist/validators/ClassValidator.d.ts +8 -25
  512. package/dist/validators/ClassValidator.js +96 -176
  513. package/dist/validators/ClassValidator.js.map +1 -1
  514. package/package.json +165 -152
  515. package/dist/astUtils/AstEditor.js.map +0 -1
  516. package/dist/astUtils/AstEditor.spec.js.map +0 -1
  517. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
  518. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
  519. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
  520. package/dist/parser/SGTypes.spec.js +0 -351
  521. package/dist/parser/SGTypes.spec.js.map +0 -1
  522. package/dist/types/CustomType.d.ts +0 -12
  523. package/dist/types/CustomType.js +0 -44
  524. package/dist/types/CustomType.js.map +0 -1
  525. package/dist/types/LazyType.d.ts +0 -16
  526. package/dist/types/LazyType.js +0 -44
  527. package/dist/types/LazyType.js.map +0 -1
  528. /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
  529. /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
  530. /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/serialize/BslibInjector.spec.d.ts} +0 -0
package/dist/Scope.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import type { CompletionItem, Position, Range, Location } from 'vscode-languageserver';
2
- import type { CallableContainer, BsDiagnostic, BscFile, CallableContainerMap, FileLink, InheritableStatement, InheritableType, NamedTypeStatement } from './interfaces';
1
+ import type { Position, Location } from 'vscode-languageserver';
2
+ import { type CallableContainer, type BsDiagnosticWithOrigin, type CallableContainerMap, type FileLink, type Callable, type NamespaceContainer, type ScopeValidationOptions, type BsDiagnostic } from './interfaces';
3
3
  import type { Program } from './Program';
4
- import type { NamespaceStatement, Statement, FunctionStatement, ClassStatement, EnumStatement, InterfaceStatement, EnumMemberStatement, ConstStatement } from './parser/Statement';
5
- import type { FunctionExpression, NewExpression } from './parser/Expression';
6
- import { ParseMode } from './parser/Parser';
4
+ import type { NamespaceStatement, ClassStatement, EnumStatement, InterfaceStatement, EnumMemberStatement, ConstStatement } from './parser/Statement';
5
+ import { type NewExpression } from './parser/Expression';
7
6
  import { Cache } from './Cache';
8
- import type { BrsFile, TokenSymbolLookup } from './files/BrsFile';
7
+ import type { BrsFile } from './files/BrsFile';
9
8
  import type { DependencyGraph, DependencyChangedEvent } from './DependencyGraph';
10
9
  import { SymbolTable } from './SymbolTable';
10
+ import type { BscFile } from './files/BscFile';
11
+ import { type AstNode, type Statement } from './parser/AstNode';
11
12
  import type { Token } from './lexer/Token';
12
- import type { BscType, TypeContext } from './types/BscType';
13
13
  /**
14
14
  * A class to keep track of all declarations within a given scope (like source scope, component scope)
15
15
  */
@@ -22,7 +22,7 @@ export declare class Scope {
22
22
  * Indicates whether this scope needs to be validated.
23
23
  * Will be true when first constructed, or anytime one of its dependencies changes
24
24
  */
25
- isValidated: boolean;
25
+ readonly isValidated: boolean;
26
26
  protected cache: Cache<any, any>;
27
27
  get dependencyGraphKey(): string;
28
28
  /**
@@ -31,6 +31,14 @@ export declare class Scope {
31
31
  * "namea", "namea.nameb", "namea.nameb.namec"
32
32
  */
33
33
  get namespaceLookup(): Map<string, NamespaceContainer>;
34
+ /**
35
+ * Get a NamespaceContainer by its name, looking for a fully qualified version first, then global version next if not found
36
+ */
37
+ getNamespace(name: string, containingNamespace?: string): NamespaceContainer;
38
+ /**
39
+ * Get a NamespaceContainer by its name, looking for a fully qualified version first, then global version next if not found
40
+ */
41
+ getNamespacesWithRoot(rootName: string, containingNamespace?: string): NamespaceContainer[];
34
42
  /**
35
43
  * Get the class with the specified name.
36
44
  * @param className - The class name, including the namespace of the class if possible
@@ -43,18 +51,6 @@ export declare class Scope {
43
51
  * @param containingNamespace - The namespace used to resolve relative interface names. (i.e. the namespace around the current statement trying to find a interface)
44
52
  */
45
53
  getInterface(ifaceName: string, containingNamespace?: string): InterfaceStatement;
46
- /**
47
- * Get either the class or interface, etc. with a given name
48
- * @param name - The name, including the namespace of the interface if possible
49
- * @param containingNamespace - The namespace used to resolve relative names. (i.e. the namespace around the current statement trying to find the interface or class)
50
- */
51
- getNamedTypeStatement(name: string, containingNamespace?: string): NamedTypeStatement;
52
- /**
53
- * A cache of a map of tokens -> TokenSymbolLookups, which are the result of getSymbolTypeFromToken()
54
- * Sometimes the lookup of symbols may take a while if there are lazyTypes or multiple tokens in a chain
55
- * By caching the result of this lookup, subsequent lookups of the same tokens are quicker
56
- */
57
- get symbolCache(): Map<Token, TokenSymbolLookup>;
58
54
  /**
59
55
  * Get the enum with the specified name.
60
56
  * @param enumName - The enum name, including the namespace if possible
@@ -68,10 +64,10 @@ export declare class Scope {
68
64
  */
69
65
  getClassFileLink(className: string, containingNamespace?: string): FileLink<ClassStatement>;
70
66
  /**
71
- * Get an interface and its containing file by the interface name
72
- * @param ifaceName - The interface name, including the namespace of the interface if possible
73
- * @param containingNamespace - The namespace used to resolve relative interface names. (i.e. the namespace around the current statement trying to find a interface)
74
- */
67
+ * Get an interface and its containing file by the interface name
68
+ * @param ifaceName - The interface name, including the namespace of the interface if possible
69
+ * @param containingNamespace - The namespace used to resolve relative interface names. (i.e. the namespace around the current statement trying to find a interface)
70
+ */
75
71
  getInterfaceFileLink(ifaceName: string, containingNamespace?: string): FileLink<InterfaceStatement>;
76
72
  /**
77
73
  * Get an Enum and its containing file by the Enum name
@@ -80,75 +76,52 @@ export declare class Scope {
80
76
  */
81
77
  getEnumFileLink(enumName: string, containingNamespace?: string): FileLink<EnumStatement>;
82
78
  /**
83
- * Get a Named Type (e.g. Class, Interface, Enum) and its containing file by the name
84
- * @param name - The name of the type, including the namespace of the class/interface/enum, etc. if possible
85
- * @param containingNamespace - The namespace used to resolve relative names. (i.e. the namespace around the current statement trying to find a class)
86
- */
87
- getNamedTypeFileLink(name: string, containingNamespace?: string): FileLink<NamedTypeStatement>;
88
- /**
89
- * Get a InheritableStatement and its containing file by the name of the interface or class
90
- * @param name - The name of the interface or class, including the namespace of the class if possible
91
- * @param containingNamespace - The namespace used to resolve relative names. (i.e. the namespace around the current statement trying to find a class)
92
- */
93
- getInheritableFileLink(name: string, containingNamespace?: string): FileLink<InheritableStatement>;
94
- /**
95
- * Gets the parent class of the given class
96
- * @param klass - The class to get the parent of, if possible
79
+ * Get an Enum and its containing file by the Enum name
80
+ * @param enumMemberName - The Enum name, including the namespace of the enum if possible
81
+ * @param containingNamespace - The namespace used to resolve relative enum names. (i.e. the namespace around the current statement trying to find a enum)
97
82
  */
98
- getParentClass(klass: ClassStatement): ClassStatement;
83
+ getEnumMemberFileLink(enumMemberName: string, containingNamespace?: string): FileLink<EnumMemberStatement>;
99
84
  /**
100
85
  * Get a constant and its containing file by the constant name
101
86
  * @param constName - The constant name, including the namespace of the constant if possible
102
87
  * @param containingNamespace - The namespace used to resolve relative constant names. (i.e. the namespace around the current statement trying to find a constant)
103
88
  */
104
89
  getConstFileLink(constName: string, containingNamespace?: string): FileLink<ConstStatement>;
90
+ getAllFileLinks(name: string, containingNamespace?: string): FileLink<Statement>[];
105
91
  /**
106
- * Gets the parent interface of the given interface
107
- * @param iface - The interface to get the parent of, if possible
92
+ * Get a map of all enums by their member name.
93
+ * The keys are lower-case fully-qualified paths to the enum and its member. For example:
94
+ * namespace.enum.value
108
95
  */
109
- getParentInterface(iface: InterfaceStatement): InterfaceStatement;
110
- /**
111
- * Gets the parent of an Interface or Class
112
- * @param stmt - The class or interface to get the parent of, if possible
113
- */
114
- getParentStatement(stmt: InheritableStatement): InheritableStatement;
115
96
  getEnumMemberMap(): Map<string, EnumMemberStatement>;
116
97
  /**
117
- * Tests if a class exists with the specified name
118
- * @param className - the all-lower-case namespace-included class name
119
- * @param namespaceName - the current namespace name
120
- */
98
+ * Tests if a class exists with the specified name
99
+ * @param className - the all-lower-case namespace-included class name
100
+ * @param namespaceName - The namespace used to resolve relative class names. (i.e. the namespace around the current statement trying to find a class)
101
+ */
121
102
  hasClass(className: string, namespaceName?: string): boolean;
122
103
  /**
123
- * Tests if an interface exists with the specified name
124
- * @param ifaceName - the all-lower-case namespace-included interface name
125
- * @param namespaceName - the current namespace name
126
- */
104
+ * Tests if an interface exists with the specified name
105
+ * @param ifaceName - the all-lower-case namespace-included interface name
106
+ * @param namespaceName - the current namespace name
107
+ */
127
108
  hasInterface(ifaceName: string, namespaceName?: string): boolean;
128
109
  /**
129
- * Tests if an enum exists with the specified name
130
- * @param enumName - the all-lower-case namespace-included enum name
131
- * @param namespaceName - the current namespace name
132
- */
133
- hasEnum(enumName: string, namespaceName?: string): boolean;
134
- /**
135
- * Tests if a class OR an interface, etc. exists with the specified name
136
- * @param name - the all-lower-case namespace-included class or interface name
110
+ * Tests if an enum exists with the specified name
111
+ * @param enumName - the all-lower-case namespace-included enum name
137
112
  * @param namespaceName - the current namespace name
138
113
  */
139
- hasNamedType(name: string, namespaceName?: string): boolean;
114
+ hasEnum(enumName: string, namespaceName?: string): boolean;
140
115
  /**
141
116
  * A dictionary of all classes in this scope. This includes namespaced classes always with their full name.
142
117
  * The key is stored in lower case
143
118
  */
144
119
  getClassMap(): Map<string, FileLink<ClassStatement>>;
145
- getAncestorTypeListByContext(thisType: BscType, context?: TypeContext): InheritableType[];
146
120
  /**
147
- * A dictionary of all Interfaces in this scope. This includes namespaced Interfaces always with their full name.
148
- * The key is stored in lower case
149
- */
121
+ * A dictionary of all Interfaces in this scope. This includes namespaced Interfaces always with their full name.
122
+ * The key is stored in lower case
123
+ */
150
124
  getInterfaceMap(): Map<string, FileLink<InterfaceStatement>>;
151
- getAncestorTypeList(className: string, functionExpression?: FunctionExpression): InheritableType[];
152
125
  /**
153
126
  * A dictionary of all enums in this scope. This includes namespaced enums always with their full name.
154
127
  * The key is stored in lower case
@@ -162,7 +135,7 @@ export declare class Scope {
162
135
  /**
163
136
  * The list of diagnostics found specifically for this scope. Individual file diagnostics are stored on the files themselves.
164
137
  */
165
- protected diagnostics: BsDiagnostic[];
138
+ protected diagnostics: BsDiagnosticWithOrigin[];
166
139
  protected onDependenciesChanged(event: DependencyChangedEvent): void;
167
140
  /**
168
141
  * Clean up all event handles
@@ -178,7 +151,7 @@ export declare class Scope {
178
151
  * XmlScope overrides this to return the parent xml scope if available.
179
152
  * For globalScope this will return null.
180
153
  */
181
- getParentScope(): Scope;
154
+ getParentScope(): Scope | null;
182
155
  private dependencyGraph;
183
156
  /**
184
157
  * An unsubscribe function for the dependencyGraph subscription
@@ -186,11 +159,11 @@ export declare class Scope {
186
159
  private unsubscribeFromDependencyGraph;
187
160
  attachDependencyGraph(dependencyGraph: DependencyGraph): void;
188
161
  /**
189
- * Get the file with the specified pkgPath
190
- * @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
162
+ * Get the file from this scope with the given path.
163
+ * @param filePath can be a srcPath or destPath
191
164
  * @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
192
165
  */
193
- getFile(srcPath: string, normalizePath?: boolean): BscFile;
166
+ getFile<TFile extends BscFile>(filePath: string, normalizePath?: boolean): TFile;
194
167
  /**
195
168
  * Get the list of files referenced by this scope that are actually loaded in the program.
196
169
  * Excludes files from ancestor scopes
@@ -202,11 +175,10 @@ export declare class Scope {
202
175
  */
203
176
  getAllFiles(): BscFile[];
204
177
  /**
205
- * Get the list of errors for this scope. It's calculated on the fly, so
206
- * call this sparingly.
178
+ * Get the list of errors for this scope. It's calculated on the fly, so call this sparingly.
207
179
  */
208
180
  getDiagnostics(): BsDiagnostic[];
209
- addDiagnostics(diagnostics: BsDiagnostic[]): void;
181
+ addDiagnostics(diagnostics: BsDiagnosticWithOrigin[]): void;
210
182
  /**
211
183
  * Get the list of callables available in this scope (either declared in this scope or in a parent scope)
212
184
  */
@@ -214,15 +186,9 @@ export declare class Scope {
214
186
  /**
215
187
  * Get the callable with the specified name.
216
188
  * If there are overridden callables with the same name, the closest callable to this scope is returned
217
- * @param name
218
- */
219
- getCallableByName(name: string): import("./interfaces").Callable;
220
- /**
221
- * Get the global callable with the specified name.
222
- * If there are overridden callables with the same name, the closest callable to this scope is returned
223
- * @param name
224
189
  */
225
- getGlobalCallableByName(name: string): import("./interfaces").Callable;
190
+ getCallableByName(name: string): Callable;
191
+ getCallableMap(): Map<string, Callable>;
226
192
  /**
227
193
  * Iterate over Brs files not shadowed by typedefs
228
194
  */
@@ -239,26 +205,46 @@ export declare class Scope {
239
205
  /**
240
206
  * Builds a tree of namespace objects
241
207
  */
242
- buildNamespaceLookup(): Map<string, NamespaceContainer>;
208
+ buildNamespaceLookup(options?: {
209
+ okToCache?: boolean;
210
+ }): Map<string, NamespaceContainer>;
243
211
  getAllNamespaceStatements(): NamespaceStatement[];
244
212
  protected logDebug(...args: any[]): void;
245
213
  private _debugLogComponentName;
246
- validate(): void;
247
- getCallableContainerMap(): CallableContainerMap;
214
+ validate(validationOptions?: ScopeValidationOptions): void;
248
215
  protected _validate(callableContainerMap: CallableContainerMap): void;
216
+ clearAstSegmentDiagnostics(astSegment: AstNode): void;
217
+ clearAstSegmentDiagnosticsByFile(file: BscFile): void;
218
+ clearScopeLevelDiagnostics(): void;
249
219
  /**
250
220
  * Mark this scope as invalid, which means its `validate()` function needs to be called again before use.
251
221
  */
252
222
  invalidate(): void;
253
- get symbolTable(): any;
254
- protected _memberTable: SymbolTable;
255
- get memberTable(): SymbolTable;
256
- protected clearSymbolTable(): void;
257
- /**
258
- * Builds the current symbol table for the scope, by merging the tables for all the files in this scope.
259
- * Also links all file symbols tables to this new table
260
- * This will only rebuilt if the symbol table has not been built before
261
- */
223
+ get symbolTable(): SymbolTable;
224
+ /**
225
+ * A list of functions that will be called whenever `unlinkSymbolTable` is called
226
+ */
227
+ private linkSymbolTableDisposables;
228
+ private symbolsAddedDuringLinking;
229
+ /**
230
+ * Builds the current symbol table for the scope, by merging the tables for all the files in this scope.
231
+ * Also links all file symbols tables to this new table
232
+ * This will only rebuilt if the symbol table has not been built before
233
+ *
234
+ * Tree of symbol tables:
235
+ * ```
236
+ * Global Scope Symbol Table
237
+ * - Source Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
238
+ * - File 1 Symbol Table
239
+ * - File 2 Symbol Table
240
+ * - Component A Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
241
+ * - File 1 Symbol Table
242
+ * - File 2 Symbol Table
243
+ * - Component B Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
244
+ * - File 1 Symbol Table
245
+ * - File 2 Symbol Table
246
+ * ```
247
+ */
262
248
  linkSymbolTable(): void;
263
249
  unlinkSymbolTable(): void;
264
250
  private detectVariableNamespaceCollisions;
@@ -266,21 +252,16 @@ export declare class Scope {
266
252
  * Find various function collisions
267
253
  */
268
254
  private diagnosticDetectFunctionCollisions;
269
- /**
270
- * Find function parameters and function return types that are neither built-in types or known Class references
271
- */
272
- private diagnosticDetectInvalidFunctionExpressionTypes;
255
+ private detectNameCollisions;
256
+ validateNameCollision(file: BrsFile, node: AstNode, nameIdentifier: Token): void;
273
257
  getNewExpressions(): AugmentedNewExpression[];
274
258
  private validateClasses;
275
259
  /**
276
- * Detect local variables (vars declared within a function expression) that have the same name as scope calls
277
- * @param file
278
- * @param callableContainerMap
260
+ * Detect local variables (function scope) that have the same name as scope calls
279
261
  */
280
262
  private diagnosticDetectShadowedLocalVars;
281
263
  /**
282
264
  * Create diagnostics for any duplicate function declarations
283
- * @param callablesByLowerName
284
265
  */
285
266
  private diagnosticFindDuplicateFunctionDeclarations;
286
267
  /**
@@ -293,50 +274,23 @@ export declare class Scope {
293
274
  private diagnosticValidateScriptImportPaths;
294
275
  /**
295
276
  * Find the file with the specified relative path
296
- * @param relativePath
297
277
  */
298
278
  protected getFileByRelativePath(relativePath: string): BscFile;
299
279
  /**
300
280
  * Determine if this file is included in this scope (excluding parent scopes)
301
- * @param file
302
281
  */
303
282
  hasFile(file: BscFile): boolean;
304
- /**
305
- * Get all callables as completionItems
306
- */
307
- getCallablesAsCompletions(parseMode: ParseMode): CompletionItem[];
308
- createCompletionFromCallable(callableContainer: CallableContainer): CompletionItem;
309
- createCompletionFromFunctionStatement(statement: FunctionStatement): CompletionItem;
310
283
  /**
311
284
  * Get the definition (where was this thing first defined) of the symbol under the position
312
285
  */
313
286
  getDefinition(file: BscFile, position: Position): Location[];
314
- /**
315
- * Scan all files for property names, and return them as completions
316
- */
317
- getPropertyNameCompletions(): CompletionItem[];
318
- getAllClassMemberCompletions(): Map<string, CompletionItem>;
319
287
  /**
320
288
  * @param className - The name of the class (including namespace if possible)
321
289
  * @param callsiteNamespace - the name of the namespace where the call site resides (this is NOT the known namespace of the class).
322
- * This is used to help resolve non-namespaced class names that reside in the same namespace as the call site.
290
+ * This is used to help resolve non-namespaced class names that reside in the same namespac as the call site.
323
291
  */
324
292
  getClassHierarchy(className: string, callsiteNamespace?: string): FileLink<ClassStatement>[];
325
293
  }
326
- export interface NamespaceContainer {
327
- file: BscFile;
328
- fullName: string;
329
- nameRange: Range;
330
- lastPartName: string;
331
- statements: Statement[];
332
- classStatements: Record<string, ClassStatement>;
333
- interfaceStatements: Record<string, InterfaceStatement>;
334
- functionStatements: Record<string, FunctionStatement>;
335
- enumStatements: Map<string, EnumStatement>;
336
- constStatements: Map<string, ConstStatement>;
337
- namespaces: Map<string, NamespaceContainer>;
338
- symbolTable: SymbolTable;
339
- }
340
294
  interface AugmentedNewExpression extends NewExpression {
341
295
  file: BscFile;
342
296
  }