brighterscript 1.0.0-alpha.4 → 1.0.0-alpha.41

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 (620) hide show
  1. package/CHANGELOG.md +1393 -291
  2. package/README.md +72 -131
  3. package/bsconfig.schema.json +85 -1
  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 +42 -0
  8. package/dist/AstValidationSegmenter.js +237 -0
  9. package/dist/AstValidationSegmenter.js.map +1 -0
  10. package/dist/BsConfig.d.ts +56 -6
  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.d.ts +5 -6
  15. package/dist/Cache.js +12 -11
  16. package/dist/Cache.js.map +1 -1
  17. package/dist/CacheVerifier.d.ts +7 -0
  18. package/dist/CacheVerifier.js +20 -0
  19. package/dist/CacheVerifier.js.map +1 -0
  20. package/dist/CodeActionUtil.d.ts +6 -3
  21. package/dist/CodeActionUtil.js +19 -5
  22. package/dist/CodeActionUtil.js.map +1 -1
  23. package/dist/CommentFlagProcessor.d.ts +7 -6
  24. package/dist/CommentFlagProcessor.js +11 -8
  25. package/dist/CommentFlagProcessor.js.map +1 -1
  26. package/dist/CrossScopeValidator.d.ts +67 -0
  27. package/dist/CrossScopeValidator.js +617 -0
  28. package/dist/CrossScopeValidator.js.map +1 -0
  29. package/dist/DependencyGraph.d.ts +8 -3
  30. package/dist/DependencyGraph.js +49 -16
  31. package/dist/DependencyGraph.js.map +1 -1
  32. package/dist/DiagnosticCollection.d.ts +5 -3
  33. package/dist/DiagnosticCollection.js +21 -16
  34. package/dist/DiagnosticCollection.js.map +1 -1
  35. package/dist/DiagnosticFilterer.d.ts +8 -4
  36. package/dist/DiagnosticFilterer.js +90 -54
  37. package/dist/DiagnosticFilterer.js.map +1 -1
  38. package/dist/DiagnosticManager.d.ts +61 -0
  39. package/dist/DiagnosticManager.js +238 -0
  40. package/dist/DiagnosticManager.js.map +1 -0
  41. package/dist/DiagnosticMessages.d.ts +204 -24
  42. package/dist/DiagnosticMessages.js +266 -33
  43. package/dist/DiagnosticMessages.js.map +1 -1
  44. package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
  45. package/dist/DiagnosticSeverityAdjuster.js +41 -0
  46. package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
  47. package/dist/FunctionScope.d.ts +28 -0
  48. package/dist/FunctionScope.js +52 -0
  49. package/dist/FunctionScope.js.map +1 -0
  50. package/dist/KeyedThrottler.d.ts +3 -3
  51. package/dist/KeyedThrottler.js +3 -3
  52. package/dist/KeyedThrottler.js.map +1 -1
  53. package/dist/LanguageServer.d.ts +72 -47
  54. package/dist/LanguageServer.js +545 -314
  55. package/dist/LanguageServer.js.map +1 -1
  56. package/dist/Logger.d.ts +9 -10
  57. package/dist/Logger.js +36 -30
  58. package/dist/Logger.js.map +1 -1
  59. package/dist/PluginInterface.d.ts +29 -7
  60. package/dist/PluginInterface.js +90 -7
  61. package/dist/PluginInterface.js.map +1 -1
  62. package/dist/Program.d.ts +201 -100
  63. package/dist/Program.js +1079 -700
  64. package/dist/Program.js.map +1 -1
  65. package/dist/ProgramBuilder.d.ts +29 -18
  66. package/dist/ProgramBuilder.js +178 -141
  67. package/dist/ProgramBuilder.js.map +1 -1
  68. package/dist/Scope.d.ts +144 -109
  69. package/dist/Scope.js +533 -552
  70. package/dist/Scope.js.map +1 -1
  71. package/dist/SemanticTokenUtils.d.ts +14 -0
  72. package/dist/SemanticTokenUtils.js +85 -0
  73. package/dist/SemanticTokenUtils.js.map +1 -0
  74. package/dist/Stopwatch.d.ts +4 -0
  75. package/dist/Stopwatch.js +8 -1
  76. package/dist/Stopwatch.js.map +1 -1
  77. package/dist/SymbolTable.d.ts +91 -24
  78. package/dist/SymbolTable.js +291 -64
  79. package/dist/SymbolTable.js.map +1 -1
  80. package/dist/SymbolTypeFlag.d.ts +9 -0
  81. package/dist/SymbolTypeFlag.js +14 -0
  82. package/dist/SymbolTypeFlag.js.map +1 -0
  83. package/dist/Throttler.d.ts +12 -0
  84. package/dist/Throttler.js +39 -0
  85. package/dist/Throttler.js.map +1 -1
  86. package/dist/Watcher.d.ts +0 -3
  87. package/dist/Watcher.js +0 -3
  88. package/dist/Watcher.js.map +1 -1
  89. package/dist/XmlScope.d.ts +5 -15
  90. package/dist/XmlScope.js +35 -87
  91. package/dist/XmlScope.js.map +1 -1
  92. package/dist/astUtils/CachedLookups.d.ts +50 -0
  93. package/dist/astUtils/CachedLookups.js +335 -0
  94. package/dist/astUtils/CachedLookups.js.map +1 -0
  95. package/dist/astUtils/CachedLookups.spec.js +39 -0
  96. package/dist/astUtils/CachedLookups.spec.js.map +1 -0
  97. package/dist/astUtils/Editor.d.ts +69 -0
  98. package/dist/astUtils/Editor.js +245 -0
  99. package/dist/astUtils/Editor.js.map +1 -0
  100. package/dist/astUtils/Editor.spec.js +258 -0
  101. package/dist/astUtils/Editor.spec.js.map +1 -0
  102. package/dist/astUtils/creators.d.ts +36 -19
  103. package/dist/astUtils/creators.js +222 -43
  104. package/dist/astUtils/creators.js.map +1 -1
  105. package/dist/astUtils/creators.spec.js +5 -5
  106. package/dist/astUtils/creators.spec.js.map +1 -1
  107. package/dist/astUtils/reflection.d.ts +148 -82
  108. package/dist/astUtils/reflection.js +324 -137
  109. package/dist/astUtils/reflection.js.map +1 -1
  110. package/dist/astUtils/reflection.spec.js +267 -167
  111. package/dist/astUtils/reflection.spec.js.map +1 -1
  112. package/dist/astUtils/stackedVisitor.js.map +1 -1
  113. package/dist/astUtils/stackedVisitor.spec.js +14 -14
  114. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  115. package/dist/astUtils/visitors.d.ts +114 -53
  116. package/dist/astUtils/visitors.js +70 -13
  117. package/dist/astUtils/visitors.js.map +1 -1
  118. package/dist/astUtils/visitors.spec.js +463 -51
  119. package/dist/astUtils/visitors.spec.js.map +1 -1
  120. package/dist/astUtils/xml.d.ts +9 -8
  121. package/dist/astUtils/xml.js +10 -5
  122. package/dist/astUtils/xml.js.map +1 -1
  123. package/dist/bscPlugin/BscPlugin.d.ts +22 -1
  124. package/dist/bscPlugin/BscPlugin.js +88 -0
  125. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  126. package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
  127. package/dist/bscPlugin/CallExpressionInfo.js +135 -0
  128. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  129. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  130. package/dist/bscPlugin/FileWriter.js +24 -0
  131. package/dist/bscPlugin/FileWriter.js.map +1 -0
  132. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  133. package/dist/bscPlugin/SignatureHelpUtil.js +137 -0
  134. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  135. package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
  136. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +30 -18
  137. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  138. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +94 -21
  139. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  140. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +64 -0
  141. package/dist/bscPlugin/completions/CompletionsProcessor.js +626 -0
  142. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
  143. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2188 -0
  144. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
  145. package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
  146. package/dist/bscPlugin/definition/DefinitionProvider.js +212 -0
  147. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  148. package/dist/bscPlugin/definition/DefinitionProvider.spec.d.ts +1 -0
  149. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
  150. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  151. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  152. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  153. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  154. package/dist/bscPlugin/hover/HoverProcessor.d.ts +18 -0
  155. package/dist/bscPlugin/hover/HoverProcessor.js +218 -0
  156. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
  157. package/dist/bscPlugin/hover/HoverProcessor.spec.d.ts +1 -0
  158. package/dist/bscPlugin/hover/HoverProcessor.spec.js +786 -0
  159. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
  160. package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
  161. package/dist/bscPlugin/references/ReferencesProvider.js +57 -0
  162. package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
  163. package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
  164. package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
  165. package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
  166. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
  167. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +154 -0
  168. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
  169. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
  170. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +530 -0
  171. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
  172. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  173. package/dist/bscPlugin/serialize/BslibInjector.spec.js +33 -0
  174. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  175. package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
  176. package/dist/bscPlugin/serialize/BslibManager.js +46 -0
  177. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  178. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  179. package/dist/bscPlugin/serialize/FileSerializer.js +75 -0
  180. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  181. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
  182. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
  183. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
  184. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
  185. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
  186. package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
  187. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
  188. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
  189. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
  190. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
  191. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
  192. package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
  193. package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
  194. package/dist/bscPlugin/symbols/symbolUtils.js +141 -0
  195. package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
  196. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +21 -0
  197. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +201 -0
  198. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  199. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  200. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +75 -0
  201. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  202. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  203. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  204. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  205. package/dist/bscPlugin/validation/BrsFileAfterValidator.d.ts +7 -0
  206. package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
  207. package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
  208. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +36 -0
  209. package/dist/bscPlugin/validation/BrsFileValidator.js +534 -0
  210. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
  211. package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
  212. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1118 -0
  213. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
  214. package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
  215. package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
  216. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  217. package/dist/bscPlugin/validation/ScopeValidator.d.ts +128 -0
  218. package/dist/bscPlugin/validation/ScopeValidator.js +1045 -0
  219. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
  220. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  221. package/dist/bscPlugin/validation/ScopeValidator.spec.js +3380 -0
  222. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  223. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  224. package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
  225. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  226. package/dist/cli.js +117 -11
  227. package/dist/cli.js.map +1 -1
  228. package/dist/deferred.d.ts +3 -3
  229. package/dist/deferred.js.map +1 -1
  230. package/dist/diagnosticUtils.d.ts +10 -3
  231. package/dist/diagnosticUtils.js +62 -24
  232. package/dist/diagnosticUtils.js.map +1 -1
  233. package/dist/examples/plugins/removePrint.js +8 -12
  234. package/dist/examples/plugins/removePrint.js.map +1 -1
  235. package/dist/files/AssetFile.d.ts +24 -0
  236. package/dist/files/AssetFile.js +25 -0
  237. package/dist/files/AssetFile.js.map +1 -0
  238. package/dist/files/BrsFile.Class.spec.js +912 -153
  239. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  240. package/dist/files/BrsFile.d.ts +142 -85
  241. package/dist/files/BrsFile.js +845 -935
  242. package/dist/files/BrsFile.js.map +1 -1
  243. package/dist/files/BrsFile.spec.js +3778 -862
  244. package/dist/files/BrsFile.spec.js.map +1 -1
  245. package/dist/files/BscFile.d.ts +101 -0
  246. package/dist/files/BscFile.js +15 -0
  247. package/dist/files/BscFile.js.map +1 -0
  248. package/dist/files/Factory.d.ts +25 -0
  249. package/dist/files/Factory.js +22 -0
  250. package/dist/files/Factory.js.map +1 -0
  251. package/dist/files/LazyFileData.d.ts +20 -0
  252. package/dist/files/LazyFileData.js +54 -0
  253. package/dist/files/LazyFileData.js.map +1 -0
  254. package/dist/files/LazyFileData.spec.d.ts +1 -0
  255. package/dist/files/LazyFileData.spec.js +27 -0
  256. package/dist/files/LazyFileData.spec.js.map +1 -0
  257. package/dist/files/XmlFile.d.ts +73 -41
  258. package/dist/files/XmlFile.js +128 -138
  259. package/dist/files/XmlFile.js.map +1 -1
  260. package/dist/files/XmlFile.spec.js +451 -324
  261. package/dist/files/XmlFile.spec.js.map +1 -1
  262. package/dist/files/tests/imports.spec.js +62 -52
  263. package/dist/files/tests/imports.spec.js.map +1 -1
  264. package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
  265. package/dist/files/tests/optionalChaning.spec.js +152 -0
  266. package/dist/files/tests/optionalChaning.spec.js.map +1 -0
  267. package/dist/globalCallables.d.ts +3 -1
  268. package/dist/globalCallables.js +417 -163
  269. package/dist/globalCallables.js.map +1 -1
  270. package/dist/index.d.ts +26 -3
  271. package/dist/index.js +44 -5
  272. package/dist/index.js.map +1 -1
  273. package/dist/interfaces.d.ts +783 -122
  274. package/dist/interfaces.js +21 -0
  275. package/dist/interfaces.js.map +1 -1
  276. package/dist/lexer/Character.spec.js +5 -5
  277. package/dist/lexer/Character.spec.js.map +1 -1
  278. package/dist/lexer/Lexer.d.ts +51 -12
  279. package/dist/lexer/Lexer.js +201 -57
  280. package/dist/lexer/Lexer.js.map +1 -1
  281. package/dist/lexer/Lexer.spec.js +781 -565
  282. package/dist/lexer/Lexer.spec.js.map +1 -1
  283. package/dist/lexer/Token.d.ts +27 -11
  284. package/dist/lexer/Token.js +10 -2
  285. package/dist/lexer/Token.js.map +1 -1
  286. package/dist/lexer/TokenKind.d.ts +31 -2
  287. package/dist/lexer/TokenKind.js +134 -10
  288. package/dist/lexer/TokenKind.js.map +1 -1
  289. package/dist/logging.d.ts +9 -0
  290. package/dist/logging.js +16 -0
  291. package/dist/logging.js.map +1 -0
  292. package/dist/parser/AstNode.d.ts +191 -0
  293. package/dist/parser/AstNode.js +269 -0
  294. package/dist/parser/AstNode.js.map +1 -0
  295. package/dist/parser/AstNode.spec.d.ts +1 -0
  296. package/dist/parser/AstNode.spec.js +1455 -0
  297. package/dist/parser/AstNode.spec.js.map +1 -0
  298. package/dist/parser/BrightScriptDocParser.d.ts +56 -0
  299. package/dist/parser/BrightScriptDocParser.js +294 -0
  300. package/dist/parser/BrightScriptDocParser.js.map +1 -0
  301. package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
  302. package/dist/parser/BrightScriptDocParser.spec.js +310 -0
  303. package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
  304. package/dist/parser/BrsTranspileState.d.ts +22 -3
  305. package/dist/parser/BrsTranspileState.js +19 -0
  306. package/dist/parser/BrsTranspileState.js.map +1 -1
  307. package/dist/parser/Expression.d.ts +489 -221
  308. package/dist/parser/Expression.js +1206 -506
  309. package/dist/parser/Expression.js.map +1 -1
  310. package/dist/parser/Expression.spec.d.ts +1 -0
  311. package/dist/parser/Expression.spec.js +40 -0
  312. package/dist/parser/Expression.spec.js.map +1 -0
  313. package/dist/parser/Parser.Class.spec.js +230 -125
  314. package/dist/parser/Parser.Class.spec.js.map +1 -1
  315. package/dist/parser/Parser.d.ts +113 -124
  316. package/dist/parser/Parser.js +1510 -983
  317. package/dist/parser/Parser.js.map +1 -1
  318. package/dist/parser/Parser.spec.d.ts +3 -1
  319. package/dist/parser/Parser.spec.js +1533 -517
  320. package/dist/parser/Parser.spec.js.map +1 -1
  321. package/dist/parser/SGParser.d.ts +60 -7
  322. package/dist/parser/SGParser.js +225 -185
  323. package/dist/parser/SGParser.js.map +1 -1
  324. package/dist/parser/SGParser.spec.js +29 -32
  325. package/dist/parser/SGParser.spec.js.map +1 -1
  326. package/dist/parser/SGTypes.d.ts +295 -52
  327. package/dist/parser/SGTypes.js +540 -187
  328. package/dist/parser/SGTypes.js.map +1 -1
  329. package/dist/parser/Statement.d.ts +808 -261
  330. package/dist/parser/Statement.js +2232 -588
  331. package/dist/parser/Statement.js.map +1 -1
  332. package/dist/parser/Statement.spec.js +133 -36
  333. package/dist/parser/Statement.spec.js.map +1 -1
  334. package/dist/parser/TranspileState.d.ts +26 -12
  335. package/dist/parser/TranspileState.js +114 -15
  336. package/dist/parser/TranspileState.js.map +1 -1
  337. package/dist/parser/tests/Parser.spec.d.ts +3 -9
  338. package/dist/parser/tests/Parser.spec.js +7 -13
  339. package/dist/parser/tests/Parser.spec.js.map +1 -1
  340. package/dist/parser/tests/controlFlow/For.spec.js +83 -75
  341. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  342. package/dist/parser/tests/controlFlow/ForEach.spec.js +58 -51
  343. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  344. package/dist/parser/tests/controlFlow/If.spec.js +382 -239
  345. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  346. package/dist/parser/tests/controlFlow/While.spec.js +52 -45
  347. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  348. package/dist/parser/tests/expression/Additive.spec.js +51 -43
  349. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  350. package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
  351. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  352. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
  353. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  354. package/dist/parser/tests/expression/Boolean.spec.js +41 -34
  355. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  356. package/dist/parser/tests/expression/Call.spec.js +173 -55
  357. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  358. package/dist/parser/tests/expression/Exponential.spec.js +20 -20
  359. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  360. package/dist/parser/tests/expression/Function.spec.js +291 -282
  361. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  362. package/dist/parser/tests/expression/Indexing.spec.js +193 -110
  363. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  364. package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
  365. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  366. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +213 -115
  367. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  368. package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
  369. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  370. package/dist/parser/tests/expression/Primary.spec.js +76 -60
  371. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  372. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  373. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
  374. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  375. package/dist/parser/tests/expression/Relational.spec.js +50 -50
  376. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  377. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
  378. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  379. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +235 -94
  380. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  381. package/dist/parser/tests/expression/TernaryExpression.spec.js +403 -174
  382. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  383. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  384. package/dist/parser/tests/expression/TypeExpression.spec.js +126 -0
  385. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  386. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  387. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  388. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  389. package/dist/parser/tests/statement/AssignmentOperators.spec.js +44 -44
  390. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  391. package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
  392. package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
  393. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
  394. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  395. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  396. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  397. package/dist/parser/tests/statement/Declaration.spec.js +61 -55
  398. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  399. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  400. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  401. package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
  402. package/dist/parser/tests/statement/Enum.spec.js +744 -0
  403. package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
  404. package/dist/parser/tests/statement/For.spec.d.ts +1 -0
  405. package/dist/parser/tests/statement/For.spec.js +45 -0
  406. package/dist/parser/tests/statement/For.spec.js.map +1 -0
  407. package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
  408. package/dist/parser/tests/statement/ForEach.spec.js +36 -0
  409. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
  410. package/dist/parser/tests/statement/Function.spec.js +226 -215
  411. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  412. package/dist/parser/tests/statement/Goto.spec.js +16 -15
  413. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  414. package/dist/parser/tests/statement/Increment.spec.js +64 -59
  415. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  416. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  417. package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
  418. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  419. package/dist/parser/tests/statement/LibraryStatement.spec.js +22 -22
  420. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  421. package/dist/parser/tests/statement/Misc.spec.js +127 -168
  422. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  423. package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
  424. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  425. package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
  426. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  427. package/dist/parser/tests/statement/Set.spec.js +131 -117
  428. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  429. package/dist/parser/tests/statement/Stop.spec.js +14 -13
  430. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  431. package/dist/parser/tests/statement/Throw.spec.js +11 -8
  432. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  433. package/dist/parser/tests/statement/TryCatch.spec.js +26 -15
  434. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  435. package/dist/preprocessor/Manifest.d.ts +6 -6
  436. package/dist/preprocessor/Manifest.js +17 -38
  437. package/dist/preprocessor/Manifest.js.map +1 -1
  438. package/dist/preprocessor/Manifest.spec.d.ts +1 -0
  439. package/dist/preprocessor/Manifest.spec.js +78 -103
  440. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  441. package/dist/roku-types/data.json +19452 -0
  442. package/dist/roku-types/index.d.ts +5533 -0
  443. package/dist/roku-types/index.js +11 -0
  444. package/dist/roku-types/index.js.map +1 -0
  445. package/dist/types/ArrayType.d.ts +9 -5
  446. package/dist/types/ArrayType.js +73 -24
  447. package/dist/types/ArrayType.js.map +1 -1
  448. package/dist/types/ArrayType.spec.js +39 -11
  449. package/dist/types/ArrayType.spec.js.map +1 -1
  450. package/dist/types/AssociativeArrayType.d.ts +14 -0
  451. package/dist/types/AssociativeArrayType.js +60 -0
  452. package/dist/types/AssociativeArrayType.js.map +1 -0
  453. package/dist/types/BaseFunctionType.d.ts +9 -0
  454. package/dist/types/BaseFunctionType.js +25 -0
  455. package/dist/types/BaseFunctionType.js.map +1 -0
  456. package/dist/types/BooleanType.d.ts +10 -5
  457. package/dist/types/BooleanType.js +21 -9
  458. package/dist/types/BooleanType.js.map +1 -1
  459. package/dist/types/BooleanType.spec.js +10 -4
  460. package/dist/types/BooleanType.spec.js.map +1 -1
  461. package/dist/types/BscType.d.ts +29 -3
  462. package/dist/types/BscType.js +121 -0
  463. package/dist/types/BscType.js.map +1 -1
  464. package/dist/types/BscTypeKind.d.ts +25 -0
  465. package/dist/types/BscTypeKind.js +30 -0
  466. package/dist/types/BscTypeKind.js.map +1 -0
  467. package/dist/types/BuiltInInterfaceAdder.d.ts +25 -0
  468. package/dist/types/BuiltInInterfaceAdder.js +201 -0
  469. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  470. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  471. package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
  472. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  473. package/dist/types/ClassType.d.ts +16 -0
  474. package/dist/types/ClassType.js +57 -0
  475. package/dist/types/ClassType.js.map +1 -0
  476. package/dist/types/ClassType.spec.d.ts +1 -0
  477. package/dist/types/ClassType.spec.js +76 -0
  478. package/dist/types/ClassType.spec.js.map +1 -0
  479. package/dist/types/ComponentType.d.ts +27 -0
  480. package/dist/types/ComponentType.js +83 -0
  481. package/dist/types/ComponentType.js.map +1 -0
  482. package/dist/types/DoubleType.d.ts +10 -5
  483. package/dist/types/DoubleType.js +25 -18
  484. package/dist/types/DoubleType.js.map +1 -1
  485. package/dist/types/DoubleType.spec.js +12 -4
  486. package/dist/types/DoubleType.spec.js.map +1 -1
  487. package/dist/types/DynamicType.d.ts +12 -5
  488. package/dist/types/DynamicType.js +22 -6
  489. package/dist/types/DynamicType.js.map +1 -1
  490. package/dist/types/DynamicType.spec.js +16 -5
  491. package/dist/types/DynamicType.spec.js.map +1 -1
  492. package/dist/types/EnumType.d.ts +40 -0
  493. package/dist/types/EnumType.js +80 -0
  494. package/dist/types/EnumType.js.map +1 -0
  495. package/dist/types/EnumType.spec.d.ts +1 -0
  496. package/dist/types/EnumType.spec.js +33 -0
  497. package/dist/types/EnumType.spec.js.map +1 -0
  498. package/dist/types/FloatType.d.ts +10 -5
  499. package/dist/types/FloatType.js +25 -18
  500. package/dist/types/FloatType.js.map +1 -1
  501. package/dist/types/FloatType.spec.js +4 -4
  502. package/dist/types/FloatType.spec.js.map +1 -1
  503. package/dist/types/FunctionType.d.ts +10 -22
  504. package/dist/types/FunctionType.js +26 -63
  505. package/dist/types/FunctionType.js.map +1 -1
  506. package/dist/types/InheritableType.d.ts +29 -0
  507. package/dist/types/InheritableType.js +162 -0
  508. package/dist/types/InheritableType.js.map +1 -0
  509. package/dist/types/IntegerType.d.ts +10 -5
  510. package/dist/types/IntegerType.js +25 -18
  511. package/dist/types/IntegerType.js.map +1 -1
  512. package/dist/types/IntegerType.spec.js +8 -4
  513. package/dist/types/IntegerType.spec.js.map +1 -1
  514. package/dist/types/InterfaceType.d.ts +14 -6
  515. package/dist/types/InterfaceType.js +26 -15
  516. package/dist/types/InterfaceType.js.map +1 -1
  517. package/dist/types/InterfaceType.spec.d.ts +1 -0
  518. package/dist/types/InterfaceType.spec.js +227 -0
  519. package/dist/types/InterfaceType.spec.js.map +1 -0
  520. package/dist/types/InvalidType.d.ts +9 -5
  521. package/dist/types/InvalidType.js +20 -9
  522. package/dist/types/InvalidType.js.map +1 -1
  523. package/dist/types/InvalidType.spec.js +8 -4
  524. package/dist/types/InvalidType.spec.js.map +1 -1
  525. package/dist/types/LongIntegerType.d.ts +10 -5
  526. package/dist/types/LongIntegerType.js +25 -18
  527. package/dist/types/LongIntegerType.js.map +1 -1
  528. package/dist/types/LongIntegerType.spec.js +10 -4
  529. package/dist/types/LongIntegerType.spec.js.map +1 -1
  530. package/dist/types/NamespaceType.d.ts +12 -0
  531. package/dist/types/NamespaceType.js +28 -0
  532. package/dist/types/NamespaceType.js.map +1 -0
  533. package/dist/types/ObjectType.d.ts +10 -5
  534. package/dist/types/ObjectType.js +23 -9
  535. package/dist/types/ObjectType.js.map +1 -1
  536. package/dist/types/ObjectType.spec.js +3 -3
  537. package/dist/types/ObjectType.spec.js.map +1 -1
  538. package/dist/types/ReferenceType.d.ts +79 -0
  539. package/dist/types/ReferenceType.js +522 -0
  540. package/dist/types/ReferenceType.js.map +1 -0
  541. package/dist/types/ReferenceType.spec.d.ts +1 -0
  542. package/dist/types/ReferenceType.spec.js +151 -0
  543. package/dist/types/ReferenceType.spec.js.map +1 -0
  544. package/dist/types/StringType.d.ts +13 -5
  545. package/dist/types/StringType.js +25 -9
  546. package/dist/types/StringType.js.map +1 -1
  547. package/dist/types/StringType.spec.js +3 -3
  548. package/dist/types/StringType.spec.js.map +1 -1
  549. package/dist/types/TypedFunctionType.d.ts +33 -0
  550. package/dist/types/TypedFunctionType.js +106 -0
  551. package/dist/types/TypedFunctionType.js.map +1 -0
  552. package/dist/types/TypedFunctionType.spec.d.ts +1 -0
  553. package/dist/types/TypedFunctionType.spec.js +122 -0
  554. package/dist/types/TypedFunctionType.spec.js.map +1 -0
  555. package/dist/types/UninitializedType.d.ts +8 -6
  556. package/dist/types/UninitializedType.js +15 -9
  557. package/dist/types/UninitializedType.js.map +1 -1
  558. package/dist/types/UnionType.d.ts +20 -0
  559. package/dist/types/UnionType.js +127 -0
  560. package/dist/types/UnionType.js.map +1 -0
  561. package/dist/types/UnionType.spec.d.ts +1 -0
  562. package/dist/types/UnionType.spec.js +129 -0
  563. package/dist/types/UnionType.spec.js.map +1 -0
  564. package/dist/types/VoidType.d.ts +10 -5
  565. package/dist/types/VoidType.js +20 -9
  566. package/dist/types/VoidType.js.map +1 -1
  567. package/dist/types/VoidType.spec.js +3 -3
  568. package/dist/types/VoidType.spec.js.map +1 -1
  569. package/dist/types/helper.spec.d.ts +1 -0
  570. package/dist/types/helper.spec.js +144 -0
  571. package/dist/types/helper.spec.js.map +1 -0
  572. package/dist/types/helpers.d.ts +26 -0
  573. package/dist/types/helpers.js +191 -0
  574. package/dist/types/helpers.js.map +1 -0
  575. package/dist/types/index.d.ts +22 -0
  576. package/dist/types/index.js +39 -0
  577. package/dist/types/index.js.map +1 -0
  578. package/dist/util.d.ts +272 -117
  579. package/dist/util.js +1583 -343
  580. package/dist/util.js.map +1 -1
  581. package/dist/validators/ClassValidator.d.ts +9 -15
  582. package/dist/validators/ClassValidator.js +85 -138
  583. package/dist/validators/ClassValidator.js.map +1 -1
  584. package/package.json +174 -138
  585. package/dist/astUtils/index.d.ts +0 -7
  586. package/dist/astUtils/index.js +0 -26
  587. package/dist/astUtils/index.js.map +0 -1
  588. package/dist/lexer/index.d.ts +0 -3
  589. package/dist/lexer/index.js +0 -17
  590. package/dist/lexer/index.js.map +0 -1
  591. package/dist/parser/index.d.ts +0 -3
  592. package/dist/parser/index.js +0 -16
  593. package/dist/parser/index.js.map +0 -1
  594. package/dist/preprocessor/Chunk.d.ts +0 -82
  595. package/dist/preprocessor/Chunk.js +0 -77
  596. package/dist/preprocessor/Chunk.js.map +0 -1
  597. package/dist/preprocessor/Preprocessor.d.ts +0 -60
  598. package/dist/preprocessor/Preprocessor.js +0 -156
  599. package/dist/preprocessor/Preprocessor.js.map +0 -1
  600. package/dist/preprocessor/Preprocessor.spec.js +0 -152
  601. package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
  602. package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
  603. package/dist/preprocessor/PreprocessorParser.js +0 -194
  604. package/dist/preprocessor/PreprocessorParser.js.map +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/CustomType.d.ts +0 -10
  611. package/dist/types/CustomType.js +0 -35
  612. package/dist/types/CustomType.js.map +0 -1
  613. package/dist/types/FunctionType.spec.js +0 -29
  614. package/dist/types/FunctionType.spec.js.map +0 -1
  615. package/dist/types/LazyType.d.ts +0 -15
  616. package/dist/types/LazyType.js +0 -32
  617. package/dist/types/LazyType.js.map +0 -1
  618. /package/dist/{preprocessor/Preprocessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
  619. /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
  620. /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const chai_1 = require("chai");
4
+ const LazyFileData_1 = require("./LazyFileData");
5
+ describe('LazyFileData', () => {
6
+ it('lazy loads string data', () => {
7
+ var _a;
8
+ const data = new LazyFileData_1.LazyFileData('cat');
9
+ (0, chai_1.expect)(data['initialData']).to.eql('cat');
10
+ (0, chai_1.expect)(data['resolvedData']).to.be.undefined;
11
+ (0, chai_1.expect)(data.isValueLoaded).to.be.false;
12
+ //now lazy-load the data
13
+ (0, chai_1.expect)(Buffer.isBuffer(data.value)).to.be.true;
14
+ (0, chai_1.expect)(data['initialData']).to.be.undefined;
15
+ (0, chai_1.expect)((_a = data['resolvedData']) === null || _a === void 0 ? void 0 : _a.toString()).to.eql('cat');
16
+ (0, chai_1.expect)(data.isValueLoaded).to.be.true;
17
+ });
18
+ it('supports LazyFileData as initialData', () => {
19
+ var _a;
20
+ const data = new LazyFileData_1.LazyFileData(new LazyFileData_1.LazyFileData('cat'));
21
+ (0, chai_1.expect)((_a = data.value) === null || _a === void 0 ? void 0 : _a.toString()).to.eql('cat');
22
+ });
23
+ it('supports Buffer', () => {
24
+ (0, chai_1.expect)(new LazyFileData_1.LazyFileData(Buffer.from('cat')).value.toString()).to.eql('cat');
25
+ });
26
+ });
27
+ //# sourceMappingURL=LazyFileData.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LazyFileData.spec.js","sourceRoot":"","sources":["../../src/files/LazyFileData.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,iDAA8C;AAE9C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;;QAC9B,MAAM,IAAI,GAAG,IAAI,2BAAY,CAAC,KAAK,CAAC,CAAC;QACrC,IAAA,aAAM,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAA,aAAM,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;QAC7C,IAAA,aAAM,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QAEvC,wBAAwB;QACxB,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAC/C,IAAA,aAAM,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;QAC5C,IAAA,aAAM,EAAC,MAAA,IAAI,CAAC,cAAc,CAAC,0CAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvD,IAAA,aAAM,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;;QAC5C,MAAM,IAAI,GAAG,IAAI,2BAAY,CACzB,IAAI,2BAAY,CAAC,KAAK,CAAC,CAC1B,CAAC;QACF,IAAA,aAAM,EAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACvB,IAAA,aAAM,EACF,IAAI,2BAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CACxD,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,52 +1,87 @@
1
1
  import type { CodeWithSourceMap } from 'source-map';
2
- import type { CompletionItem, Hover, Location, Position, Range } from 'vscode-languageserver';
3
- import type { Callable, BsDiagnostic, FileReference, FunctionCall, CommentFlag, BscFile } from '../interfaces';
2
+ import type { Location, Position, Range } from 'vscode-languageserver';
3
+ import type { Callable, FileReference, CommentFlag, SerializedCodeFile } from '../interfaces';
4
4
  import type { Program } from '../Program';
5
5
  import SGParser from '../parser/SGParser';
6
- import type { DependencyGraph } from '../DependencyGraph';
7
- import type { SGAst, SGToken } from '../parser/SGTypes';
6
+ import type { DependencyChangedEvent, DependencyGraph } from '../DependencyGraph';
7
+ import type { SGToken } from '../parser/SGTypes';
8
8
  import type { IToken, TokenType } from 'chevrotain';
9
- import type { FunctionExpression } from '../parser/Expression';
10
- export declare class XmlFile {
9
+ import type { BscFile } from './BscFile';
10
+ import type { Editor } from '../astUtils/Editor';
11
+ import type { FunctionScope } from '../FunctionScope';
12
+ export declare class XmlFile implements BscFile {
13
+ /**
14
+ * Create a new instance of BrsFile
15
+ */
16
+ constructor(options: {
17
+ /**
18
+ * The absolute path to the source file on disk (e.g. '/usr/you/projects/RokuApp/source/main.brs' or 'c:/projects/RokuApp/source/main.brs').
19
+ */
20
+ srcPath: string;
21
+ /**
22
+ * The absolute path to the file on-device (i.e. 'source/main.brs') without the leading `pkg:/`
23
+ */
24
+ destPath: string;
25
+ pkgPath?: string;
26
+ program: Program;
27
+ });
28
+ type: string;
11
29
  /**
12
30
  * The absolute path to the source file on disk (e.g. '/usr/you/projects/RokuApp/source/main.brs' or 'c:/projects/RokuApp/source/main.brs').
13
31
  */
14
32
  srcPath: string;
15
33
  /**
16
- * The full pkg path (i.e. `pkg:/path/to/file.brs`)
34
+ * The absolute path to the file on-device (i.e. 'source/main.brs') without the leading `pkg:/`
17
35
  */
36
+ destPath: string;
18
37
  pkgPath: string;
19
38
  program: Program;
20
- constructor(
21
39
  /**
22
- * The absolute path to the source file on disk (e.g. '/usr/you/projects/RokuApp/source/main.brs' or 'c:/projects/RokuApp/source/main.brs').
40
+ * An editor assigned during the build flow that manages edits that will be undone once the build process is complete.
23
41
  */
24
- srcPath: string,
42
+ editor?: Editor;
25
43
  /**
26
- * The full pkg path (i.e. `pkg:/path/to/file.brs`)
44
+ * The absolute path to the source location for this file
45
+ * @deprecated use `srcPath` instead
27
46
  */
28
- pkgPath: string, program: Program);
47
+ get pathAbsolute(): string;
48
+ set pathAbsolute(value: string);
29
49
  private cache;
30
50
  /**
31
51
  * The list of possible autoImport codebehind pkg paths.
52
+ * @deprecated use `possibleCodebehindDestPaths` instead.
53
+ */
54
+ get possibleCodebehindPkgPaths(): string[];
55
+ set possibleCodebehindPkgPaths(value: string[]);
56
+ /**
57
+ * The list of possible autoImport codebehind destPath values
32
58
  */
33
- private possibleCodebehindPkgPaths;
59
+ possibleCodebehindDestPaths: string[];
34
60
  /**
35
61
  * An unsubscribe function for the dependencyGraph subscription
36
62
  */
37
63
  private unsubscribeFromDependencyGraph;
64
+ /**
65
+ * Indicates whether this file needs to be validated.
66
+ * Files are only ever validated a single time
67
+ */
68
+ isValidated: boolean;
38
69
  /**
39
70
  * The extension for this file
40
71
  */
41
72
  extension: string;
42
73
  commentFlags: CommentFlag[];
74
+ /**
75
+ * Will this file result in only comment or whitespace output? If so, it can be excluded from the output if that bsconfig setting is enabled.
76
+ */
77
+ readonly canBePruned = false;
43
78
  /**
44
79
  * The list of script imports delcared in the XML of this file.
45
80
  * This excludes parent imports and auto codebehind imports
46
81
  */
47
82
  get scriptTagImports(): FileReference[];
48
83
  /**
49
- * List of all pkgPaths to scripts that this XmlFile depends, regardless of whether they are loaded in the program or not.
84
+ * List of all `destPath` values pointing to scripts that this XmlFile depends on, regardless of whether they are loaded in the program or not.
50
85
  * This includes own dependencies and all parent compoent dependencies
51
86
  * coming from:
52
87
  * - script tags
@@ -55,7 +90,7 @@ export declare class XmlFile {
55
90
  */
56
91
  getAllDependencies(): string[];
57
92
  /**
58
- * List of all pkgPaths to scripts that this XmlFile depends on directly, regardless of whether they are loaded in the program or not.
93
+ * List of all destPaths to scripts that this XmlFile depends on directly, regardless of whether they are loaded in the program or not.
59
94
  * This does not account for parent component scripts
60
95
  * coming from:
61
96
  * - script tags
@@ -64,7 +99,7 @@ export declare class XmlFile {
64
99
  */
65
100
  getOwnDependencies(): string[];
66
101
  /**
67
- * List of all pkgPaths to scripts that this XmlFile depends on that are actually loaded into the program.
102
+ * List of all destPaths to scripts that this XmlFile depends on that are actually loaded into the program.
68
103
  * This does not account for parent component scripts.
69
104
  * coming from:
70
105
  * - script tags
@@ -72,16 +107,13 @@ export declare class XmlFile {
72
107
  * - import statements from imported scripts or their descendants
73
108
  */
74
109
  getAvailableScriptImports(): string[];
75
- getDiagnostics(): BsDiagnostic[];
76
- addDiagnostics(diagnostics: BsDiagnostic[]): void;
77
110
  /**
78
111
  * The range of the entire file
79
112
  */
80
113
  fileRange: Range;
81
- diagnostics: BsDiagnostic[];
82
114
  parser: SGParser;
83
115
  callables: Callable[];
84
- functionCalls: FunctionCall[];
116
+ functionScopes: FunctionScope[];
85
117
  /**
86
118
  * The name of the component that this component extends.
87
119
  * Available after `parse()`
@@ -94,39 +126,46 @@ export declare class XmlFile {
94
126
  get componentName(): SGToken;
95
127
  /**
96
128
  * Does this file need to be transpiled?
129
+ * @deprecated use the `.editor` property to push changes to the file, which will force transpilation
97
130
  */
98
- needsTranspiled: boolean;
131
+ get needsTranspiled(): boolean;
132
+ set needsTranspiled(value: boolean);
133
+ _needsTranspiled: boolean;
99
134
  /**
100
135
  * The AST for this file
101
136
  */
102
- get ast(): SGAst;
137
+ get ast(): import("../parser/SGTypes").SGAst;
103
138
  /**
104
139
  * The full file contents
105
140
  */
106
141
  fileContents: string;
107
- /**
108
- * Indicates whether this file needs to be validated.
109
- */
110
- isValidated: boolean;
111
142
  /**
112
143
  * Calculate the AST for this file
113
- * @param fileContents
144
+ * @param fileContents the xml source code to parse
114
145
  */
115
146
  parse(fileContents: string): void;
147
+ /**
148
+ * Generate the code, map, and typedef for this file
149
+ */
150
+ serialize(): SerializedCodeFile;
116
151
  /**
117
152
  * Collect all bs: comment flags
118
153
  */
119
154
  getCommentFlags(tokens: Array<IToken & {
120
155
  tokenType: TokenType;
121
156
  }>): void;
122
- validate(): void;
123
- private validateComponent;
124
157
  private dependencyGraph;
158
+ onDependenciesChanged(event: DependencyChangedEvent): void;
125
159
  /**
126
160
  * Attach the file to the dependency graph so it can monitor changes.
127
161
  * Also notify the dependency graph of our current dependencies so other dependents can be notified.
162
+ * @deprecated this does nothing. This functionality is now handled by the file api and will be deleted in v1
128
163
  */
129
164
  attachDependencyGraph(dependencyGraph: DependencyGraph): void;
165
+ /**
166
+ * The list of files that this file depends on
167
+ */
168
+ get dependencies(): string[];
130
169
  /**
131
170
  * A slight hack. Gives the Program a way to support multiple components with the same name
132
171
  * without causing major issues. A value of 0 will be ignored as part of the dependency graph key.
@@ -138,9 +177,10 @@ export declare class XmlFile {
138
177
  /**
139
178
  * The key used in the dependency graph for this file.
140
179
  * If we have a component name, we will use that so we can be discoverable by child components.
141
- * If we don't have a component name, use the pkgPath so at least we can self-validate
180
+ * If we don't have a component name, use the destPath so at least we can self-validate
142
181
  */
143
182
  get dependencyGraphKey(): string;
183
+ set dependencyGraphKey(value: string);
144
184
  /**
145
185
  * The key used in the dependency graph for this component's parent.
146
186
  * If we have aparent, we will use that. If we don't, this will return undefined
@@ -148,26 +188,18 @@ export declare class XmlFile {
148
188
  get parentComponentDependencyGraphKey(): string;
149
189
  /**
150
190
  * Determines if this xml file has a reference to the specified file (or if it's itself)
151
- * @param file
152
191
  */
153
192
  doesReferenceFile(file: BscFile): boolean;
154
- /**
155
- * Get all available completions for the specified position
156
- * @param lineIndex
157
- * @param columnIndex
158
- */
159
- getCompletions(position: Position): CompletionItem[];
160
193
  /**
161
194
  * Get the parent component (the component this component extends)
162
195
  */
163
196
  get parentComponent(): XmlFile;
164
- getHover(position: Position): Hover;
165
197
  getReferences(position: Position): Promise<Location[]>;
166
- getFunctionExpressionAtPosition(position: Position, functionExpressions?: FunctionExpression[]): FunctionExpression;
198
+ getFunctionScopeAtPosition(position: Position, functionScopes?: FunctionScope[]): FunctionScope;
167
199
  /**
168
200
  * Walk up the ancestor chain and aggregate all of the script tag imports
169
201
  */
170
- getAncestorScriptTagImports(): any[];
202
+ getAncestorScriptTagImports(): FileReference[];
171
203
  /**
172
204
  * Remove this file from the dependency graph as a node
173
205
  */
@@ -178,7 +210,7 @@ export declare class XmlFile {
178
210
  * and only includes the ones that are not found on the parent.
179
211
  * If no parent is found, all imports are returned
180
212
  */
181
- private getMissingImportsForTranspile;
213
+ getMissingImportsForTranspile(): string[];
182
214
  private logDebug;
183
215
  /**
184
216
  * Convert the brightscript/brighterscript source code into valid brightscript