brighterscript 1.0.0-alpha.24 → 1.0.0-alpha.26

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 (536) hide show
  1. package/CHANGELOG.md +521 -233
  2. package/README.md +45 -139
  3. package/bsconfig.schema.json +46 -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 +40 -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 +841 -706
  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 +86 -137
  60. package/dist/Scope.js +453 -519
  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 -11
  74. package/dist/XmlScope.js +75 -88
  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} +69 -65
  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 +54 -24
  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 +256 -157
  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 +208 -52
  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 +11 -2
  105. package/dist/bscPlugin/BscPlugin.js +37 -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 +136 -0
  115. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  116. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +16 -13
  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/definition/DefinitionProvider.d.ts +13 -0
  126. package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
  127. package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
  128. package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
  129. package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
  130. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  131. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  132. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  133. package/dist/bscPlugin/hover/HoverProcessor.d.ts +7 -7
  134. package/dist/bscPlugin/hover/HoverProcessor.js +123 -125
  135. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
  136. package/dist/bscPlugin/hover/HoverProcessor.spec.js +371 -53
  137. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
  138. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +2 -1
  139. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +83 -23
  140. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
  141. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +83 -6
  142. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
  143. package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
  144. package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
  145. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  146. package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
  147. package/dist/bscPlugin/serialize/BslibManager.js +40 -0
  148. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  149. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  150. package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
  151. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  152. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
  153. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +38 -12
  154. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  155. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  156. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
  157. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  158. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
  159. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
  160. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
  161. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +13 -5
  162. package/dist/bscPlugin/validation/BrsFileValidator.js +262 -52
  163. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  164. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +230 -14
  165. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
  166. package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
  167. package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
  168. package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
  169. package/dist/bscPlugin/validation/ScopeValidator.d.ts +58 -27
  170. package/dist/bscPlugin/validation/ScopeValidator.js +514 -286
  171. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  172. package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
  173. package/dist/bscPlugin/validation/ScopeValidator.spec.js +2527 -0
  174. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
  175. package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
  176. package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
  177. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
  178. package/dist/cli.js +104 -13
  179. package/dist/cli.js.map +1 -1
  180. package/dist/deferred.d.ts +3 -3
  181. package/dist/deferred.js.map +1 -1
  182. package/dist/diagnosticUtils.d.ts +8 -2
  183. package/dist/diagnosticUtils.js +47 -17
  184. package/dist/diagnosticUtils.js.map +1 -1
  185. package/dist/examples/plugins/removePrint.js +8 -10
  186. package/dist/examples/plugins/removePrint.js.map +1 -1
  187. package/dist/files/AssetFile.d.ts +26 -0
  188. package/dist/files/AssetFile.js +26 -0
  189. package/dist/files/AssetFile.js.map +1 -0
  190. package/dist/files/BrsFile.Class.spec.js +523 -493
  191. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  192. package/dist/files/BrsFile.d.ts +111 -117
  193. package/dist/files/BrsFile.js +684 -1142
  194. package/dist/files/BrsFile.js.map +1 -1
  195. package/dist/files/BrsFile.spec.js +1783 -1233
  196. package/dist/files/BrsFile.spec.js.map +1 -1
  197. package/dist/files/BscFile.d.ts +104 -0
  198. package/dist/files/BscFile.js +16 -0
  199. package/dist/files/BscFile.js.map +1 -0
  200. package/dist/files/Factory.d.ts +25 -0
  201. package/dist/files/Factory.js +22 -0
  202. package/dist/files/Factory.js.map +1 -0
  203. package/dist/files/LazyFileData.d.ts +20 -0
  204. package/dist/files/LazyFileData.js +54 -0
  205. package/dist/files/LazyFileData.js.map +1 -0
  206. package/dist/files/LazyFileData.spec.d.ts +1 -0
  207. package/dist/files/LazyFileData.spec.js +27 -0
  208. package/dist/files/LazyFileData.spec.js.map +1 -0
  209. package/dist/files/XmlFile.d.ts +70 -32
  210. package/dist/files/XmlFile.js +106 -118
  211. package/dist/files/XmlFile.js.map +1 -1
  212. package/dist/files/XmlFile.spec.js +325 -262
  213. package/dist/files/XmlFile.spec.js.map +1 -1
  214. package/dist/files/tests/imports.spec.js +48 -40
  215. package/dist/files/tests/imports.spec.js.map +1 -1
  216. package/dist/files/tests/optionalChaning.spec.js +84 -24
  217. package/dist/files/tests/optionalChaning.spec.js.map +1 -1
  218. package/dist/globalCallables.js +16 -21
  219. package/dist/globalCallables.js.map +1 -1
  220. package/dist/index.d.ts +12 -1
  221. package/dist/index.js +12 -1
  222. package/dist/index.js.map +1 -1
  223. package/dist/interfaces.d.ts +421 -162
  224. package/dist/interfaces.js +27 -0
  225. package/dist/interfaces.js.map +1 -1
  226. package/dist/lexer/Character.spec.js +5 -5
  227. package/dist/lexer/Character.spec.js.map +1 -1
  228. package/dist/lexer/Lexer.d.ts +12 -5
  229. package/dist/lexer/Lexer.js +28 -13
  230. package/dist/lexer/Lexer.js.map +1 -1
  231. package/dist/lexer/Lexer.spec.js +181 -135
  232. package/dist/lexer/Lexer.spec.js.map +1 -1
  233. package/dist/lexer/Token.d.ts +9 -1
  234. package/dist/lexer/Token.js +9 -1
  235. package/dist/lexer/Token.js.map +1 -1
  236. package/dist/lexer/TokenKind.d.ts +8 -0
  237. package/dist/lexer/TokenKind.js +24 -4
  238. package/dist/lexer/TokenKind.js.map +1 -1
  239. package/dist/parser/AstNode.d.ts +162 -0
  240. package/dist/parser/AstNode.js +225 -0
  241. package/dist/parser/AstNode.js.map +1 -0
  242. package/dist/parser/AstNode.spec.d.ts +1 -0
  243. package/dist/parser/AstNode.spec.js +165 -0
  244. package/dist/parser/AstNode.spec.js.map +1 -0
  245. package/dist/parser/BrsTranspileState.d.ts +4 -7
  246. package/dist/parser/BrsTranspileState.js +4 -12
  247. package/dist/parser/BrsTranspileState.js.map +1 -1
  248. package/dist/parser/Expression.d.ts +376 -283
  249. package/dist/parser/Expression.js +742 -585
  250. package/dist/parser/Expression.js.map +1 -1
  251. package/dist/parser/Parser.Class.spec.js +151 -145
  252. package/dist/parser/Parser.Class.spec.js.map +1 -1
  253. package/dist/parser/Parser.d.ts +48 -201
  254. package/dist/parser/Parser.js +705 -1026
  255. package/dist/parser/Parser.js.map +1 -1
  256. package/dist/parser/Parser.spec.d.ts +3 -1
  257. package/dist/parser/Parser.spec.js +861 -848
  258. package/dist/parser/Parser.spec.js.map +1 -1
  259. package/dist/parser/SGParser.d.ts +9 -8
  260. package/dist/parser/SGParser.js +10 -8
  261. package/dist/parser/SGParser.js.map +1 -1
  262. package/dist/parser/SGParser.spec.js +27 -38
  263. package/dist/parser/SGParser.spec.js.map +1 -1
  264. package/dist/parser/SGTypes.d.ts +98 -35
  265. package/dist/parser/SGTypes.js +169 -99
  266. package/dist/parser/SGTypes.js.map +1 -1
  267. package/dist/parser/Statement.d.ts +468 -272
  268. package/dist/parser/Statement.js +904 -631
  269. package/dist/parser/Statement.js.map +1 -1
  270. package/dist/parser/Statement.spec.js +47 -23
  271. package/dist/parser/Statement.spec.js.map +1 -1
  272. package/dist/parser/TranspileState.d.ts +1 -1
  273. package/dist/parser/TranspileState.js +7 -12
  274. package/dist/parser/TranspileState.js.map +1 -1
  275. package/dist/parser/tests/Parser.spec.js +3 -2
  276. package/dist/parser/tests/Parser.spec.js.map +1 -1
  277. package/dist/parser/tests/controlFlow/For.spec.js +33 -23
  278. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  279. package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
  280. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  281. package/dist/parser/tests/controlFlow/If.spec.js +96 -94
  282. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  283. package/dist/parser/tests/controlFlow/While.spec.js +22 -16
  284. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  285. package/dist/parser/tests/expression/Additive.spec.js +8 -8
  286. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  287. package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
  288. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  289. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +62 -21
  290. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  291. package/dist/parser/tests/expression/Boolean.spec.js +8 -8
  292. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  293. package/dist/parser/tests/expression/Call.spec.js +129 -21
  294. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  295. package/dist/parser/tests/expression/Exponential.spec.js +5 -5
  296. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  297. package/dist/parser/tests/expression/Function.spec.js +36 -36
  298. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  299. package/dist/parser/tests/expression/Indexing.spec.js +92 -22
  300. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  301. package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
  302. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  303. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -59
  304. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  305. package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
  306. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  307. package/dist/parser/tests/expression/Primary.spec.js +12 -12
  308. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  309. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
  310. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
  311. package/dist/parser/tests/expression/Relational.spec.js +13 -13
  312. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  313. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
  314. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  315. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +96 -57
  316. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  317. package/dist/parser/tests/expression/TernaryExpression.spec.js +89 -89
  318. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  319. package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
  320. package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
  321. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
  322. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  323. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  324. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  325. package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
  326. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  327. package/dist/parser/tests/statement/ConstStatement.spec.js +82 -33
  328. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
  329. package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
  330. package/dist/parser/tests/statement/Continue.spec.js +119 -0
  331. package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
  332. package/dist/parser/tests/statement/Declaration.spec.js +19 -19
  333. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  334. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  335. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  336. package/dist/parser/tests/statement/Enum.spec.js +98 -302
  337. package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
  338. package/dist/parser/tests/statement/For.spec.js +9 -10
  339. package/dist/parser/tests/statement/For.spec.js.map +1 -1
  340. package/dist/parser/tests/statement/ForEach.spec.js +8 -9
  341. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
  342. package/dist/parser/tests/statement/Function.spec.js +44 -35
  343. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  344. package/dist/parser/tests/statement/Goto.spec.js +5 -5
  345. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  346. package/dist/parser/tests/statement/Increment.spec.js +20 -20
  347. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  348. package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
  349. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
  350. package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
  351. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  352. package/dist/parser/tests/statement/Misc.spec.js +16 -78
  353. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  354. package/dist/parser/tests/statement/PrintStatement.spec.js +36 -34
  355. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  356. package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
  357. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  358. package/dist/parser/tests/statement/Set.spec.js +48 -35
  359. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  360. package/dist/parser/tests/statement/Stop.spec.js +6 -6
  361. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  362. package/dist/parser/tests/statement/Throw.spec.js +6 -6
  363. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  364. package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
  365. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  366. package/dist/preprocessor/Manifest.d.ts +1 -1
  367. package/dist/preprocessor/Manifest.js +2 -2
  368. package/dist/preprocessor/Manifest.js.map +1 -1
  369. package/dist/preprocessor/Manifest.spec.js +8 -8
  370. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  371. package/dist/preprocessor/Preprocessor.d.ts +5 -6
  372. package/dist/preprocessor/Preprocessor.js +5 -5
  373. package/dist/preprocessor/Preprocessor.js.map +1 -1
  374. package/dist/preprocessor/Preprocessor.spec.js +25 -25
  375. package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
  376. package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
  377. package/dist/preprocessor/PreprocessorParser.js +7 -1
  378. package/dist/preprocessor/PreprocessorParser.js.map +1 -1
  379. package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
  380. package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
  381. package/dist/roku-types/data.json +5892 -10081
  382. package/dist/roku-types/index.d.ts +622 -1719
  383. package/dist/types/ArrayType.d.ts +10 -9
  384. package/dist/types/ArrayType.js +65 -60
  385. package/dist/types/ArrayType.js.map +1 -1
  386. package/dist/types/ArrayType.spec.js +36 -68
  387. package/dist/types/ArrayType.spec.js.map +1 -1
  388. package/dist/types/AssociativeArrayType.d.ts +11 -0
  389. package/dist/types/AssociativeArrayType.js +52 -0
  390. package/dist/types/AssociativeArrayType.js.map +1 -0
  391. package/dist/types/BaseFunctionType.d.ts +9 -0
  392. package/dist/types/BaseFunctionType.js +25 -0
  393. package/dist/types/BaseFunctionType.js.map +1 -0
  394. package/dist/types/BooleanType.d.ts +8 -5
  395. package/dist/types/BooleanType.js +14 -7
  396. package/dist/types/BooleanType.js.map +1 -1
  397. package/dist/types/BooleanType.spec.js +10 -6
  398. package/dist/types/BooleanType.spec.js.map +1 -1
  399. package/dist/types/BscType.d.ts +32 -21
  400. package/dist/types/BscType.js +118 -21
  401. package/dist/types/BscType.js.map +1 -1
  402. package/dist/types/BscTypeKind.d.ts +25 -0
  403. package/dist/types/BscTypeKind.js +30 -0
  404. package/dist/types/BscTypeKind.js.map +1 -0
  405. package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
  406. package/dist/types/BuiltInInterfaceAdder.js +171 -0
  407. package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
  408. package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
  409. package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
  410. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
  411. package/dist/types/ClassType.d.ts +17 -0
  412. package/dist/types/ClassType.js +58 -0
  413. package/dist/types/ClassType.js.map +1 -0
  414. package/dist/types/ClassType.spec.d.ts +1 -0
  415. package/dist/types/ClassType.spec.js +77 -0
  416. package/dist/types/ClassType.spec.js.map +1 -0
  417. package/dist/types/ComponentType.d.ts +26 -0
  418. package/dist/types/ComponentType.js +83 -0
  419. package/dist/types/ComponentType.js.map +1 -0
  420. package/dist/types/DoubleType.d.ts +8 -5
  421. package/dist/types/DoubleType.js +18 -16
  422. package/dist/types/DoubleType.js.map +1 -1
  423. package/dist/types/DoubleType.spec.js +12 -6
  424. package/dist/types/DoubleType.spec.js.map +1 -1
  425. package/dist/types/DynamicType.d.ts +9 -5
  426. package/dist/types/DynamicType.js +15 -4
  427. package/dist/types/DynamicType.js.map +1 -1
  428. package/dist/types/DynamicType.spec.js +16 -5
  429. package/dist/types/DynamicType.spec.js.map +1 -1
  430. package/dist/types/EnumType.d.ts +30 -12
  431. package/dist/types/EnumType.js +43 -17
  432. package/dist/types/EnumType.js.map +1 -1
  433. package/dist/types/EnumType.spec.d.ts +1 -0
  434. package/dist/types/EnumType.spec.js +33 -0
  435. package/dist/types/EnumType.spec.js.map +1 -0
  436. package/dist/types/FloatType.d.ts +8 -5
  437. package/dist/types/FloatType.js +18 -16
  438. package/dist/types/FloatType.js.map +1 -1
  439. package/dist/types/FloatType.spec.js +4 -6
  440. package/dist/types/FloatType.spec.js.map +1 -1
  441. package/dist/types/FunctionType.d.ts +13 -8
  442. package/dist/types/FunctionType.js +30 -14
  443. package/dist/types/FunctionType.js.map +1 -1
  444. package/dist/types/InheritableType.d.ts +28 -0
  445. package/dist/types/InheritableType.js +152 -0
  446. package/dist/types/InheritableType.js.map +1 -0
  447. package/dist/types/IntegerType.d.ts +8 -5
  448. package/dist/types/IntegerType.js +18 -16
  449. package/dist/types/IntegerType.js.map +1 -1
  450. package/dist/types/IntegerType.spec.js +8 -6
  451. package/dist/types/IntegerType.spec.js.map +1 -1
  452. package/dist/types/InterfaceType.d.ts +12 -13
  453. package/dist/types/InterfaceType.js +20 -48
  454. package/dist/types/InterfaceType.js.map +1 -1
  455. package/dist/types/InterfaceType.spec.js +90 -56
  456. package/dist/types/InterfaceType.spec.js.map +1 -1
  457. package/dist/types/InvalidType.d.ts +7 -5
  458. package/dist/types/InvalidType.js +13 -7
  459. package/dist/types/InvalidType.js.map +1 -1
  460. package/dist/types/InvalidType.spec.js +8 -6
  461. package/dist/types/InvalidType.spec.js.map +1 -1
  462. package/dist/types/LongIntegerType.d.ts +8 -5
  463. package/dist/types/LongIntegerType.js +17 -15
  464. package/dist/types/LongIntegerType.js.map +1 -1
  465. package/dist/types/LongIntegerType.spec.js +10 -6
  466. package/dist/types/LongIntegerType.spec.js.map +1 -1
  467. package/dist/types/NamespaceType.d.ts +12 -0
  468. package/dist/types/NamespaceType.js +28 -0
  469. package/dist/types/NamespaceType.js.map +1 -0
  470. package/dist/types/ObjectType.d.ts +9 -8
  471. package/dist/types/ObjectType.js +21 -11
  472. package/dist/types/ObjectType.js.map +1 -1
  473. package/dist/types/ObjectType.spec.js +3 -3
  474. package/dist/types/ObjectType.spec.js.map +1 -1
  475. package/dist/types/ReferenceType.d.ts +63 -0
  476. package/dist/types/ReferenceType.js +423 -0
  477. package/dist/types/ReferenceType.js.map +1 -0
  478. package/dist/types/ReferenceType.spec.d.ts +1 -0
  479. package/dist/types/ReferenceType.spec.js +137 -0
  480. package/dist/types/ReferenceType.spec.js.map +1 -0
  481. package/dist/types/StringType.d.ts +11 -5
  482. package/dist/types/StringType.js +18 -7
  483. package/dist/types/StringType.js.map +1 -1
  484. package/dist/types/StringType.spec.js +3 -5
  485. package/dist/types/StringType.spec.js.map +1 -1
  486. package/dist/types/TypedFunctionType.d.ts +22 -17
  487. package/dist/types/TypedFunctionType.js +78 -60
  488. package/dist/types/TypedFunctionType.js.map +1 -1
  489. package/dist/types/TypedFunctionType.spec.js +105 -20
  490. package/dist/types/TypedFunctionType.spec.js.map +1 -1
  491. package/dist/types/UninitializedType.d.ts +8 -6
  492. package/dist/types/UninitializedType.js +13 -7
  493. package/dist/types/UninitializedType.js.map +1 -1
  494. package/dist/types/UnionType.d.ts +20 -0
  495. package/dist/types/UnionType.js +123 -0
  496. package/dist/types/UnionType.js.map +1 -0
  497. package/dist/types/UnionType.spec.d.ts +1 -0
  498. package/dist/types/UnionType.spec.js +130 -0
  499. package/dist/types/UnionType.spec.js.map +1 -0
  500. package/dist/types/VoidType.d.ts +8 -5
  501. package/dist/types/VoidType.js +14 -7
  502. package/dist/types/VoidType.js.map +1 -1
  503. package/dist/types/VoidType.spec.js +3 -3
  504. package/dist/types/VoidType.spec.js.map +1 -1
  505. package/dist/types/helper.spec.d.ts +1 -0
  506. package/dist/types/helper.spec.js +145 -0
  507. package/dist/types/helper.spec.js.map +1 -0
  508. package/dist/types/helpers.d.ts +19 -37
  509. package/dist/types/helpers.js +159 -99
  510. package/dist/types/helpers.js.map +1 -1
  511. package/dist/types/index.d.ts +22 -0
  512. package/dist/types/index.js +39 -0
  513. package/dist/types/index.js.map +1 -0
  514. package/dist/util.d.ts +143 -139
  515. package/dist/util.js +864 -385
  516. package/dist/util.js.map +1 -1
  517. package/dist/validators/ClassValidator.d.ts +8 -25
  518. package/dist/validators/ClassValidator.js +99 -179
  519. package/dist/validators/ClassValidator.js.map +1 -1
  520. package/package.json +165 -152
  521. package/dist/astUtils/AstEditor.js.map +0 -1
  522. package/dist/astUtils/AstEditor.spec.js.map +0 -1
  523. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
  524. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
  525. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
  526. package/dist/parser/SGTypes.spec.js +0 -351
  527. package/dist/parser/SGTypes.spec.js.map +0 -1
  528. package/dist/types/CustomType.d.ts +0 -12
  529. package/dist/types/CustomType.js +0 -44
  530. package/dist/types/CustomType.js.map +0 -1
  531. package/dist/types/LazyType.d.ts +0 -16
  532. package/dist/types/LazyType.js +0 -44
  533. package/dist/types/LazyType.js.map +0 -1
  534. /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
  535. /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
  536. /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
package/README.md CHANGED
@@ -1,22 +1,22 @@
1
- # BrighterScript [v1 branch]
1
+ # BrighterScript
2
2
 
3
3
  A superset of Roku's BrightScript language. Compiles to standard BrightScript.
4
4
 
5
- [![build status](https://img.shields.io/github/workflow/status/rokucommunity/brighterscript/build/v1.svg?logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=branch%3Av1+)
6
- [![coverage status](https://img.shields.io/coveralls/github/rokucommunity/brighterscript/v1?logo=coveralls)](https://coveralls.io/github/rokucommunity/brighterscript?branch=v1)
5
+ [![build status](https://img.shields.io/github/actions/workflow/status/rokucommunity/brighterscript/build.yml?branch=master&logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=branch%3Amaster+workflow%3Abuild)
6
+ [![coverage status](https://img.shields.io/coveralls/github/rokucommunity/brighterscript?logo=coveralls)](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
7
7
  [![monthly downloads](https://img.shields.io/npm/dm/brighterscript.svg?sanitize=true&logo=npm&logoColor=)](https://npmcharts.com/compare/brighterscript?minimal=true)
8
- [![npm version](https://img.shields.io/npm/v/brighterscript.svg?logo=npm)](https://www.npmjs.com/package/brighterscript/v/next)
8
+ [![npm version](https://img.shields.io/npm/v/brighterscript.svg?logo=npm)](https://www.npmjs.com/package/brighterscript)
9
9
  [![license](https://img.shields.io/npm/l/brighterscript.svg)](LICENSE)
10
10
  [![Slack](https://img.shields.io/badge/Slack-RokuCommunity-4A154B?logo=slack)](https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA)
11
11
 
12
- This is the v1 branch. Unless you're specifically looking for v1, you probably want to view [the master branch](https://github.com/rokucommunity/brighterscript).
13
-
14
12
  ## Overview
15
13
 
14
+ **WARNING: this is the v0.66.0 branch with experimental features**
15
+
16
16
  The BrighterScript language provides new features and syntax enhancements to Roku's BrightScript language. Because the language is a superset of BrightScript, the parser and associated tools (VSCode integration, cli, etc...) work with standard BrightScript (.brs) files. This means you will get benefits (as described in the following section) from using the BrighterScript compiler, whether your project contains BrighterScript (.bs) files or not. The BrighterScript language transpiles to standard BrightScript, so your code is fully compatible with all roku devices.
17
17
 
18
18
  ## Features
19
- BrighterScript adds several new features to the BrightScript language such as Namespaces, classes, import statements, and more. Take a look at the language specification docs for more information.
19
+ BrighterScript adds several new features to the BrightScript language such as namespaces, classes, import statements, and more. Take a look at the language specification docs for more information.
20
20
 
21
21
  [BrighterScript Language Specification](https://github.com/rokucommunity/BrighterScript/blob/master/docs/readme.md)
22
22
 
@@ -65,25 +65,37 @@ BrighterScript adds several new features to the BrightScript language such as Na
65
65
  ## Who uses Brighterscript?
66
66
  <br/>
67
67
  <p align="center">
68
+ <a href="https://www.fubo.tv/">
69
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192530108-eb470b85-e687-4575-af69-254aab13428c.png">
70
+ </a>&nbsp;&nbsp;&nbsp;
71
+ <a href="mailto:chris@inverted-solutions.com">
72
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197794500-2bac4903-ed00-463a-b243-24c68fba7962.png">
73
+ </a>&nbsp;&nbsp;&nbsp;
68
74
  <a href="https://www.applicaster.com/">
69
- <img src="https://user-images.githubusercontent.com/2544493/96571912-377af280-129a-11eb-8295-49eb12e54aeb.png">
75
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192591901-20441fc8-3c6c-45ea-8851-b22430e6fb8e.png">
70
76
  </a>&nbsp;&nbsp;&nbsp;
71
- <a href="https://www.miraclechannel.ca/corcoplus">
72
- <img src="https://user-images.githubusercontent.com/2544493/157429644-ba0d574a-d3c3-425f-8e68-98103fb8f707.png">
77
+ <a href="https://www.redspace.com/">
78
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/195908446-8d9652f8-9877-426f-b3c6-09119d788fd8.png">
73
79
  </a>&nbsp;&nbsp;&nbsp;
74
- <a href="https://www.nba.com/">
75
- <img src="https://user-images.githubusercontent.com/2544493/157430017-a27b62d0-63de-4e87-a6df-8448007bd24d.png">
80
+ <br/><br/>
81
+ <a href="https://tantawowa.com/">
82
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/197795138-2ec870db-71fe-49e3-a014-692a3f31e6aa.png">
83
+ </a>&nbsp;&nbsp;&nbsp;
84
+ <a href="https://www.miraclechannel.ca/corcoplus">
85
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192593254-f2a32cd4-0482-40de-830d-c1d09690c46b.png">
76
86
  </a>&nbsp;&nbsp;&nbsp;
77
87
  <a href="https://channelstore.roku.com/details/222212/phototv">
78
- <img height="34" src="https://user-images.githubusercontent.com/2544493/169118062-81d94da5-2323-4e31-b19d-7db3f9c88dff.png">
88
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/169118062-81d94da5-2323-4e31-b19d-7db3f9c88dff.png">
89
+ </a>&nbsp;&nbsp;&nbsp;
90
+ <a href="https://www.haystack.tv/">
91
+ <img height="38" src="https://user-images.githubusercontent.com/2544493/192610056-d1b5a382-edf4-47b9-a6a5-d2d3ee9094cb.png">
79
92
  </a>&nbsp;&nbsp;&nbsp;
80
93
  </p>
81
94
  <br/>
82
95
 
83
-
84
96
  The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=rokucommunity.brightscript) VSCode extension, the [maestro framework](https://github.com/georgejecook/maestro/blob/master/docs/index.md), and more.
85
97
 
86
- [Contact us](https://github.com/rokucommunity/brighterscript/issues/new) if you use BrighterScript on your project and would like your logo listed above. More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler in their build pipeline.
98
+ [Contact us](https://github.com/rokucommunity/brighterscript/issues/new) if you use BrighterScript in your project and would like your logo listed above. More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler in their build pipeline.
87
99
 
88
100
  ## What's with the name?
89
101
  The name BrighterScript is a compliment to everything that is great about Roku's awesome BrightScript language. Naming things is hard, and discoverability and recognizability are both very important. Here are the reasons we chose this name:
@@ -152,133 +164,27 @@ If you need to configure `bsc`, you can do so in two ways:
152
164
  ## bsconfig.json
153
165
 
154
166
  ### Overview
155
- The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project.
156
-
157
- ### Configuration inheritance with `extends`
158
-
159
- A `bsconfig.json` file can inherit configurations from another file using the `extends` property.
160
-
161
- The extends is a top-level property in `bsconfig.json`. `extends`’ value is a string containing a path to another configuration file to inherit from.
162
-
163
- The configuration from the base file are loaded first, then overridden by those in the inheriting config file. If a circularity is encountered, we report an error.
164
-
165
- The `files` property from the inheriting config file overwrite those from the base config file.
166
-
167
- All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.
168
-
169
- ### Optional `extends` and `project`
170
- There are situations where you want to store some compiler settings in a config file, but not fail if that config file doesn't exist. To do this, you can denote that your `extends` or `project` path is optional by prefixing it with a question mark (`?`). For example:
171
-
172
- - **bsconfig.json** `extends`
173
- ```json
174
- {
175
- "extends": "?path/to/optional/bsconfig.json"
176
- }
177
- ```
178
- - CLI "extends"
179
- ```
180
- bsc --extends "?path/to/optional/bsconfig.json"
181
- ```
182
-
183
- - CLI `project` argument
184
- ```
185
- bsc --project "?path/to/optional/bsconfig.json"
186
- ```
187
- - Node.js API `extends`
188
- ```
189
- var programBuilder = new ProgramBuilder({
190
- "extends": "?path/to/optional/bsconfig.json"
191
- });
192
- ```
193
- - Node.js API `project`
194
- ```
195
- var programBuilder = new ProgramBuilder({
196
- "project": "?path/to/optional/bsconfig.json"
197
- });
198
- ```
199
-
200
- ### bsconfig.json options
201
-
202
- These are the options available in the `bsconfig.json` file.
203
-
204
- - **project**: `string` - A path to a project file. This is really only passed in from the command line or the NodeJS API, and should not be present in `bsconfig.json` files. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
205
-
206
- - **extends**: `string` - Relative or absolute path to another `bsconfig.json` file that this `bsconfig.json` file should import and then override. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
207
-
208
- - **cwd**: `string` - Override the current working directory
209
-
210
- - **rootDir**: `string` - The root directory of your roku project. Defaults to current directory
211
-
212
- - **files**: ` (string | string[] | { src: string | string[]; dest?: string })[]` - The list file globs used to find all files for the project. If using the {src;dest;} format, you can specify a different destination directory for the matched files in src.
213
-
214
- - **outFile**: `string` - The path (including filename) where the output file should be placed (defaults to `"./out/[WORKSPACE_FOLDER_NAME].zip"`).
215
-
216
- - **createPackage**: `boolean` - Creates a zip package. Defaults to true. This setting is ignored when `deploy` is enabled.
217
-
218
- - **watch**: `boolean` - If true, the server will keep running and will watch and recompile on every file change.
219
-
220
- - **deploy**: `boolean` - If true, after a successful build, the project will be deployed to the Roku specified in host.
221
-
222
- - **host**: `string` - The host of the Roku that this project will deploy to.
223
-
224
- - **username**: `string` - the username to use when deploying to a Roku device.
225
-
226
- - **password**: `string` - The password to use when deploying to a roku device.
227
-
228
- - **emitFullPaths**: `boolean` - Emit full paths to files when printing diagnostics to the console. Defaults to false
229
-
230
- - **diagnosticFilters**: `Array<string | number | {src: string; codes: number[]}` - A list of filters used to hide diagnostics.
231
- - A `string` value should be a relative-to-root-dir or absolute file path or glob pattern of the files that should be excluded. Any file matching this pattern will have all diagnostics supressed.
232
- - A `number` value should be a diagnostic code. This will supress all diagnostics with that code for the whole project.
233
- - An object can also be provided to filter specific diagnostic codes for a file pattern. For example,
234
- ```jsonc
235
- "diagnosticFilters": [{
236
- "src": "vendor/**/*",
237
- "codes": [1000, 1011] //ignore these specific codes from vendor libraries
238
- }]
239
- ```
240
- - **diagnosticLevel**: `'hint' | 'info' | 'warn' | 'error'` - Specify what diagnostic levels are printed to the console. This has no effect on what diagnostics are reported in the LanguageServer. Defaults to 'warn'
241
-
242
- - **autoImportComponentScript**: `bool` - BrighterScript only: will automatically import a script at transpile-time for a component with the same name if it exists.
243
-
244
- - **sourceRoot**: `string` - Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.
245
-
246
- - **plugins**: `Array<string>` - List of node scripts or npm modules to load as plugins to the BrighterScript compiler.
247
-
248
- - **require**: `Array<string>` - List of node scripts or npm modules to load during the startup sequence. Useful for running things like `ts-node/require`
249
-
250
- - **allowBrighterScriptInBrightScript**: `boolean` - Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.
251
-
252
-
253
- ## Ignore errors and warnings on a per-line basis
254
- In addition to disabling an entire class of errors in `bsconfig.json` by using `ignoreErrorCodes`, you may also disable errors for a subset of the complier rules within a file with the following comment flags:
255
- - `bs:disable-next-line`
256
- - `bs:disable-next-line: code1 code2 code3`
257
- - `bs:disable-line`
258
- - `bs:disable-line: code1 code2 code3`
259
-
260
- Here are some examples:
261
-
262
- ```BrightScript
263
- sub Main()
264
- 'disable errors about invalid syntax here
265
- 'bs:disable-next-line
266
- DoSomething(
267
-
268
- DoSomething( 'bs:disable-line
269
-
270
- 'disable errors about wrong parameter count
271
- DoSomething(1,2,3) 'bs:disable-next-line
272
-
273
- DoSomething(1,2,3) 'bs:disable-next-line:1002
274
- end sub
275
-
276
- sub DoSomething()
277
- end sub
167
+ The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project. Here is a minimal example, which is recommended for new projects:
168
+
169
+ ```jsonc
170
+ {
171
+ "rootDir": "src",
172
+ "files": [
173
+ "**/*"
174
+ ],
175
+ "stagingFolderPath": "dist",
176
+ "retainStagingFolder": true,
177
+ //this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
178
+ "autoImportComponentScript": true,
179
+ "sourceMap": true
180
+ }
278
181
  ```
279
182
 
280
- The primary motivation for this feature was to provide a stopgap measure to hide incorrectly-thrown errors on legitimate BrightScript code due to parser bugs. This is still a new project and it is likely to be missing support for certain BrightScript syntaxes. It is recommended that you only use these comments when absolutely necessary.
183
+ More information on the config file format may be found in the [bsconfig.json documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/bsconfig.md).
184
+
185
+ ## Suppressing compiler messages
281
186
 
187
+ The BrighterScript compiler emits errors and warnings when it encounters potentially invalid code. Errors and warnings may also be emitted by compiler plugins, such as by [the BrighterScript linter](https://github.com/rokucommunity/bslint). These messages can be suppressed if needed; see [the documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/suppressing-compiler-messages.md).
282
188
 
283
189
  ## ropm support
284
190
  In order for BrighterScript-transpiled projects to work as ropm modules, they need a reference to [bslib](https://github.com/rokucommunity/bslib/blob/master/source/bslib.brs) (the BrightScript runtime library for BrighterScript features) in their package. As `ropm` and `brighterscript` become more popular, this could result in many duplicate copies of `bslib.brs`.
@@ -21,6 +21,21 @@
21
21
  "description": "The root directory of your Roku project. Defaults to the current working directory (or cwd property)",
22
22
  "type": "string"
23
23
  },
24
+ "manifest": {
25
+ "description": "A entry to modify manifest values",
26
+ "type": "object",
27
+ "properties": {
28
+ "bs_const": {
29
+ "description": "A dictionary of bs_consts to change or add to the manifest. Each entry ",
30
+ "type": "object",
31
+ "patternProperties": {
32
+ "^.+$": {
33
+ "type": ["boolean", "null"]
34
+ }
35
+ }
36
+ }
37
+ }
38
+ },
24
39
  "files": {
25
40
  "description": "The list of files that should be used in this project. Supports globs. Optionally, you can specify an object with `src` and `dest` properties to move files from one location into a different destination location",
26
41
  "default": [
@@ -105,13 +120,24 @@
105
120
  "description": " The password to use when deploying to a Roku device",
106
121
  "type": "string"
107
122
  },
123
+ "retainStagingDir": {
124
+ "type": "boolean",
125
+ "description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
126
+ "default": false
127
+ },
108
128
  "retainStagingFolder": {
109
129
  "type": "boolean",
130
+ "deprecated": true,
110
131
  "description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
111
132
  "default": false
112
133
  },
134
+ "stagingDir": {
135
+ "type": "string",
136
+ "description": "The path to the staging folder (where all files are copied before creating the zip package)"
137
+ },
113
138
  "stagingFolderPath": {
114
139
  "type": "string",
140
+ "deprecated": true,
115
141
  "description": "The path to the staging folder (where all files are copied before creating the zip package)"
116
142
  },
117
143
  "ignoreErrorCodes": {
@@ -128,6 +154,16 @@
128
154
  ]
129
155
  }
130
156
  },
157
+ "diagnosticSeverityOverrides": {
158
+ "description": "A map of error codes with their severity level override (error|warn|info)",
159
+ "type": "object",
160
+ "patternProperties": {
161
+ ".{1,}": {
162
+ "type": ["number", "string"],
163
+ "enum": ["error", "warn", "info", "hint"]
164
+ }
165
+ }
166
+ },
131
167
  "emitFullPaths": {
132
168
  "description": "Emit full paths to files when printing diagnostics to the console.",
133
169
  "type": "boolean",
@@ -138,6 +174,11 @@
138
174
  "type": "boolean",
139
175
  "default": false
140
176
  },
177
+ "removeParameterTypes": {
178
+ "description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
179
+ "type": "boolean",
180
+ "default": false
181
+ },
141
182
  "diagnosticFilters": {
142
183
  "description": "A collection of filters used to hide diagnostics for certain files",
143
184
  "type": "array",
@@ -240,6 +281,11 @@
240
281
  "description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
241
282
  "type": "boolean",
242
283
  "default": false
284
+ },
285
+ "legacyCallfuncHandling": {
286
+ "description": "Legacy RokuOS versions required at least one argument in callfunc() invocations. Previous brighterscript versions handled this by inserting invalid as an argument when no other args are present. This is not necessary in modern RokuOS versions.",
287
+ "type": "boolean",
288
+ "default": false
243
289
  }
244
290
  }
245
291
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Enforces that a single action can be running at a time
3
+ */
4
+ export declare class ActionPipeline {
5
+ private workQueue;
6
+ run<T extends Action<any>, R extends Awaited<PromiseLike<ReturnType<T>>>>(action: T): Promise<R>;
7
+ private process;
8
+ private isProcessing;
9
+ }
10
+ export declare type Action<T> = () => T | PromiseLike<T>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionPipeline = void 0;
4
+ const deferred_1 = require("./deferred");
5
+ /**
6
+ * Enforces that a single action can be running at a time
7
+ */
8
+ class ActionPipeline {
9
+ constructor() {
10
+ this.workQueue = [];
11
+ this.isProcessing = false;
12
+ }
13
+ run(action) {
14
+ const work = {
15
+ action: action,
16
+ deferred: new deferred_1.Deferred()
17
+ };
18
+ this.workQueue.push(work);
19
+ this.process();
20
+ return work.deferred.promise;
21
+ }
22
+ process() {
23
+ //if we're already processing,
24
+ if (this.isProcessing) {
25
+ return;
26
+ }
27
+ while (this.workQueue.length > 0) {
28
+ const work = this.workQueue.shift();
29
+ try {
30
+ const result = Promise.resolve(work.action());
31
+ work.deferred.resolve(result);
32
+ }
33
+ catch (e) {
34
+ work.deferred.reject(e);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ exports.ActionPipeline = ActionPipeline;
40
+ //# sourceMappingURL=ActionPipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionPipeline.js","sourceRoot":"","sources":["../src/ActionPipeline.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAA3B;QACY,cAAS,GAAqB,EAAE,CAAC;QA6BjC,iBAAY,GAAG,KAAK,CAAC;IACjC,CAAC;IA5BU,GAAG,CAAuE,MAAS;QACtF,MAAM,IAAI,GAAG;YACT,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI,mBAAQ,EAAO;SAChC,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IACjC,CAAC;IAEO,OAAO;QACX,8BAA8B;QAC9B,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,OAAO;SACV;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACpC,IAAI;gBACA,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAC1B,IAAI,CAAC,MAAM,EAAE,CAChB,CAAC;gBACF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aACjC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC3B;SACJ;IACL,CAAC;CAEJ;AA/BD,wCA+BC"}
@@ -0,0 +1,25 @@
1
+ import type { DottedGetExpression, TypeExpression, VariableExpression } from './parser/Expression';
2
+ import { SymbolTypeFlag } from './SymbolTable';
3
+ import type { TypeChainEntry } from './interfaces';
4
+ import type { AstNode } from './parser/AstNode';
5
+ export declare const InsideSegmentWalkMode: number;
6
+ export interface UnresolvedSymbol {
7
+ typeChain: TypeChainEntry[];
8
+ flags: SymbolTypeFlag;
9
+ endChainFlags: SymbolTypeFlag;
10
+ containingNamespaces: string[];
11
+ }
12
+ export declare class AstValidationSegmenter {
13
+ validatedSegments: Map<AstNode, boolean>;
14
+ segmentsForValidation: AstNode[];
15
+ singleValidationSegments: Set<AstNode>;
16
+ unresolvedSegmentsSymbols: Map<AstNode, Set<UnresolvedSymbol>>;
17
+ ast: AstNode;
18
+ reset(): void;
19
+ processTree(ast: AstNode): void;
20
+ checkExpressionForUnresolved(segment: AstNode, expression: VariableExpression | DottedGetExpression | TypeExpression, assignedSymbols?: Set<string>): boolean;
21
+ private currentNamespaceStatement;
22
+ checkSegmentWalk(segment: AstNode): void;
23
+ getSegments(changedSymbols: Map<SymbolTypeFlag, Set<string>>): AstNode[];
24
+ markSegmentAsValidated(segment: AstNode): void;
25
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AstValidationSegmenter = exports.InsideSegmentWalkMode = void 0;
4
+ const SymbolTable_1 = require("./SymbolTable");
5
+ const reflection_1 = require("./astUtils/reflection");
6
+ const visitors_1 = require("./astUtils/visitors");
7
+ const util_1 = require("./util");
8
+ // eslint-disable-next-line no-bitwise
9
+ exports.InsideSegmentWalkMode = visitors_1.WalkMode.visitStatements | visitors_1.WalkMode.visitExpressions | visitors_1.WalkMode.recurseChildFunctions;
10
+ class AstValidationSegmenter {
11
+ constructor() {
12
+ this.validatedSegments = new Map();
13
+ this.segmentsForValidation = new Array();
14
+ this.singleValidationSegments = new Set();
15
+ this.unresolvedSegmentsSymbols = new Map();
16
+ }
17
+ reset() {
18
+ this.validatedSegments.clear();
19
+ this.singleValidationSegments.clear();
20
+ this.unresolvedSegmentsSymbols.clear();
21
+ this.segmentsForValidation = [];
22
+ }
23
+ processTree(ast) {
24
+ this.reset();
25
+ ast === null || ast === void 0 ? void 0 : ast.walk((segment) => {
26
+ this.checkSegmentWalk(segment);
27
+ }, {
28
+ walkMode: visitors_1.WalkMode.visitStatements
29
+ });
30
+ }
31
+ checkExpressionForUnresolved(segment, expression, assignedSymbols) {
32
+ var _a, _b;
33
+ if (!expression || (0, reflection_1.isCommentStatement)(expression)) {
34
+ return false;
35
+ }
36
+ if ((0, reflection_1.isVariableExpression)(expression) && expression.tokens.name.text.toLowerCase() === 'm') {
37
+ return false;
38
+ }
39
+ const flag = util_1.util.isInTypeExpression(expression) ? SymbolTable_1.SymbolTypeFlag.typetime : SymbolTable_1.SymbolTypeFlag.runtime;
40
+ const typeChain = [];
41
+ const options = { flags: flag, onlyCacheResolvedTypes: true, typeChain: typeChain, data: {} };
42
+ const nodeType = expression.getType(options);
43
+ if (!(nodeType === null || nodeType === void 0 ? void 0 : nodeType.isResolvable())) {
44
+ let symbolsSet;
45
+ if (!(assignedSymbols === null || assignedSymbols === void 0 ? void 0 : assignedSymbols.has(typeChain[0].name.toLowerCase()))) {
46
+ if (!this.unresolvedSegmentsSymbols.has(segment)) {
47
+ symbolsSet = new Set();
48
+ this.unresolvedSegmentsSymbols.set(segment, symbolsSet);
49
+ }
50
+ else {
51
+ symbolsSet = this.unresolvedSegmentsSymbols.get(segment);
52
+ }
53
+ symbolsSet.add({ typeChain: typeChain, flags: typeChain[0].data.flags, endChainFlags: flag, containingNamespaces: (_b = (_a = this.currentNamespaceStatement) === null || _a === void 0 ? void 0 : _a.getNameParts()) === null || _b === void 0 ? void 0 : _b.map(t => t.text) });
54
+ }
55
+ return true;
56
+ }
57
+ return false;
58
+ }
59
+ checkSegmentWalk(segment) {
60
+ if ((0, reflection_1.isNamespaceStatement)(segment) || (0, reflection_1.isBody)(segment) || (0, reflection_1.isCommentStatement)(segment)) {
61
+ return;
62
+ }
63
+ if ((0, reflection_1.isClassStatement)(segment)) {
64
+ if (segment.parentClassName) {
65
+ this.segmentsForValidation.push(segment.parentClassName);
66
+ this.validatedSegments.set(segment.parentClassName, false);
67
+ let foundUnresolvedInSegment = this.checkExpressionForUnresolved(segment.parentClassName, segment.parentClassName);
68
+ if (!foundUnresolvedInSegment) {
69
+ this.singleValidationSegments.add(segment.parentClassName);
70
+ }
71
+ }
72
+ return;
73
+ }
74
+ if ((0, reflection_1.isInterfaceStatement)(segment)) {
75
+ if (segment.parentInterfaceName) {
76
+ this.segmentsForValidation.push(segment.parentInterfaceName);
77
+ this.validatedSegments.set(segment.parentInterfaceName, false);
78
+ let foundUnresolvedInSegment = this.checkExpressionForUnresolved(segment.parentInterfaceName, segment.parentInterfaceName);
79
+ if (!foundUnresolvedInSegment) {
80
+ this.singleValidationSegments.add(segment.parentInterfaceName);
81
+ }
82
+ }
83
+ return;
84
+ }
85
+ this.segmentsForValidation.push(segment);
86
+ this.validatedSegments.set(segment, false);
87
+ let foundUnresolvedInSegment = false;
88
+ const skipper = new visitors_1.ChildrenSkipper();
89
+ const assignedSymbols = new Set();
90
+ this.currentNamespaceStatement = segment.findAncestor(reflection_1.isNamespaceStatement);
91
+ segment.walk((0, visitors_1.createVisitor)({
92
+ AssignmentStatement: (stmt) => {
93
+ assignedSymbols.add(stmt.tokens.name.text.toLowerCase());
94
+ },
95
+ FunctionParameterExpression: (expr) => {
96
+ assignedSymbols.add(expr.tokens.name.text.toLowerCase());
97
+ },
98
+ VariableExpression: (expr) => {
99
+ if (!assignedSymbols.has(expr.tokens.name.text.toLowerCase())) {
100
+ const expressionIsUnresolved = this.checkExpressionForUnresolved(segment, expr, assignedSymbols);
101
+ foundUnresolvedInSegment = expressionIsUnresolved || foundUnresolvedInSegment;
102
+ }
103
+ skipper.skip();
104
+ },
105
+ DottedGetExpression: (expr) => {
106
+ const expressionIsUnresolved = this.checkExpressionForUnresolved(segment, expr, assignedSymbols);
107
+ foundUnresolvedInSegment = expressionIsUnresolved || foundUnresolvedInSegment;
108
+ skipper.skip();
109
+ },
110
+ TypeExpression: (expr) => {
111
+ const expressionIsUnresolved = this.checkExpressionForUnresolved(segment, expr, assignedSymbols);
112
+ foundUnresolvedInSegment = expressionIsUnresolved || foundUnresolvedInSegment;
113
+ skipper.skip();
114
+ }
115
+ }), {
116
+ walkMode: exports.InsideSegmentWalkMode,
117
+ skipChildren: skipper
118
+ });
119
+ if (!foundUnresolvedInSegment) {
120
+ this.singleValidationSegments.add(segment);
121
+ }
122
+ }
123
+ getSegments(changedSymbols) {
124
+ const segmentsToWalkForValidation = [];
125
+ for (const segment of this.segmentsForValidation) {
126
+ const symbolsRequired = this.unresolvedSegmentsSymbols.get(segment);
127
+ const isSingleValidationSegment = this.singleValidationSegments.has(segment);
128
+ const singleValidationSegmentAlreadyValidated = isSingleValidationSegment ? this.validatedSegments.get(segment) : false;
129
+ let segmentNeedsRevalidation = !singleValidationSegmentAlreadyValidated;
130
+ if (symbolsRequired) {
131
+ for (const requiredSymbol of symbolsRequired.values()) {
132
+ // eslint-disable-next-line no-bitwise
133
+ const runTimeOrTypeTimeSymbolFlag = requiredSymbol.flags & (SymbolTable_1.SymbolTypeFlag.runtime | SymbolTable_1.SymbolTypeFlag.typetime);
134
+ const changeSymbolSetForFlag = changedSymbols.get(runTimeOrTypeTimeSymbolFlag);
135
+ if (util_1.util.setContainsUnresolvedSymbol(changeSymbolSetForFlag, requiredSymbol)) {
136
+ segmentsToWalkForValidation.push(segment);
137
+ break;
138
+ }
139
+ }
140
+ }
141
+ else if (segmentNeedsRevalidation) {
142
+ segmentsToWalkForValidation.push(segment);
143
+ }
144
+ }
145
+ return segmentsToWalkForValidation;
146
+ }
147
+ markSegmentAsValidated(segment) {
148
+ this.validatedSegments.set(segment, true);
149
+ }
150
+ }
151
+ exports.AstValidationSegmenter = AstValidationSegmenter;
152
+ //# sourceMappingURL=AstValidationSegmenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AstValidationSegmenter.js","sourceRoot":"","sources":["../src/AstValidationSegmenter.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAC/C,sDAAuJ;AACvJ,kDAA+E;AAG/E,iCAA8B;AAG9B,sCAAsC;AACzB,QAAA,qBAAqB,GAAG,mBAAQ,CAAC,eAAe,GAAG,mBAAQ,CAAC,gBAAgB,GAAG,mBAAQ,CAAC,qBAAqB,CAAC;AAS3H,MAAa,sBAAsB;IAAnC;QAEW,sBAAiB,GAAG,IAAI,GAAG,EAAoB,CAAC;QAChD,0BAAqB,GAAG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jC,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC7C;SACJ;QACD,OAAO,2BAA2B,CAAC;IACvC,CAAC;IAED,sBAAsB,CAAC,OAAgB;QACnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;CACJ;AAzJD,wDAyJC"}
@@ -9,6 +9,13 @@ export interface BsConfig {
9
9
  * Prefix with a question mark (?) to prevent throwing an exception if the file does not exist.
10
10
  */
11
11
  project?: string;
12
+ manifest?: {
13
+ bs_const?: Record<string, boolean | null>;
14
+ };
15
+ /**
16
+ * when set, bsconfig.json loading is disabled
17
+ */
18
+ noProject?: boolean;
12
19
  /**
13
20
  * Relative or absolute path to another bsconfig.json file that this file should import and then override.
14
21
  * Prefix with a question mark (?) to prevent throwing an exception if the file does not exist.
@@ -69,24 +76,33 @@ export interface BsConfig {
69
76
  * Prevent the staging folder from being deleted after creating the package
70
77
  * @default false
71
78
  */
72
- retainStagingFolder?: boolean;
79
+ retainStagingDir?: boolean;
73
80
  /**
74
- * The path to the staging folder (where all files are copied to right before creating the zip package)
81
+ * The path to the staging directory (wehre the output files are copied immediately before creating the zip)
75
82
  */
76
- stagingFolderPath?: string;
83
+ stagingDir?: string;
77
84
  /**
78
85
  * A list of error codes the compiler should NOT emit, even if encountered.
79
86
  */
80
87
  ignoreErrorCodes?: (number | string)[];
88
+ /**
89
+ * A map of error codes with their severity level override (error|warn|info)
90
+ */
91
+ diagnosticSeverityOverrides?: Record<number | string, 'error' | 'warn' | 'info' | 'hint'>;
81
92
  /**
82
93
  * Emit full paths to files when printing diagnostics to the console. Defaults to false
83
94
  */
84
95
  emitFullPaths?: boolean;
85
96
  /**
86
97
  * Emit type definition files (`d.bs`)
87
- * @default true
98
+ * @default false
88
99
  */
89
100
  emitDefinitions?: boolean;
101
+ /**
102
+ * If true, removes the explicit type to function's parameters and return (i.e. the `as type` syntax); otherwise keep this information.
103
+ * @default false
104
+ */
105
+ removeParameterTypes?: boolean;
90
106
  /**
91
107
  * A list of filters used to exclude diagnostics from the output
92
108
  */
@@ -138,9 +154,29 @@ export interface BsConfig {
138
154
  * @default true
139
155
  */
140
156
  sourceMap?: boolean;
157
+ /**
158
+ * Excludes empty files from being included in the output. Some Brighterscript files
159
+ * are left empty or with only comments after transpilation to Brightscript.
160
+ * The default behavior is to write these to disk after transpilation.
161
+ * Setting this flag to `true` will prevent empty files being written and will
162
+ * remove associated script tags from XML
163
+ * @default false
164
+ */
165
+ pruneEmptyCodeFiles?: boolean;
141
166
  /**
142
167
  * Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.
143
168
  * @default false
144
169
  */
145
170
  allowBrighterScriptInBrightScript?: boolean;
171
+ /**
172
+ * Override the destination directory for the bslib.brs file. Use this if
173
+ * you want to customize where the bslib.brs file is located in the staging
174
+ * directory. Note that using a location outside of `source` will break
175
+ * scripts inside `source` that depend on bslib.brs. Defaults to `source`.
176
+ */
177
+ bslibDestinationDir?: string;
178
+ legacyCallfuncHandling?: boolean;
146
179
  }
180
+ declare type OptionalBsConfigFields = '_ancestors' | 'sourceRoot' | 'project' | 'manifest' | 'noProject' | 'extends' | 'host' | 'password' | 'require' | 'stagingDir' | 'diagnosticLevel' | 'rootDir' | 'stagingDir';
181
+ export declare type FinalizedBsConfig = Omit<Required<BsConfig>, OptionalBsConfigFields> & Pick<BsConfig, OptionalBsConfigFields>;
182
+ export {};