brighterscript 0.66.0-alpha.6 → 0.66.0-alpha.8

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 (288) hide show
  1. package/CHANGELOG.md +88 -10
  2. package/README.md +16 -0
  3. package/bsconfig.schema.json +15 -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 +150 -0
  9. package/dist/AstValidationSegmenter.js.map +1 -0
  10. package/dist/BsConfig.d.ts +15 -1
  11. package/dist/CommentFlagProcessor.d.ts +4 -3
  12. package/dist/CommentFlagProcessor.js.map +1 -1
  13. package/dist/DiagnosticMessages.d.ts +8 -1
  14. package/dist/DiagnosticMessages.js +30 -13
  15. package/dist/DiagnosticMessages.js.map +1 -1
  16. package/dist/LanguageServer.js +7 -1
  17. package/dist/LanguageServer.js.map +1 -1
  18. package/dist/PluginInterface.d.ts +11 -2
  19. package/dist/PluginInterface.js +69 -10
  20. package/dist/PluginInterface.js.map +1 -1
  21. package/dist/Program.d.ts +107 -38
  22. package/dist/Program.js +502 -270
  23. package/dist/Program.js.map +1 -1
  24. package/dist/ProgramBuilder.d.ts +10 -4
  25. package/dist/ProgramBuilder.js +44 -54
  26. package/dist/ProgramBuilder.js.map +1 -1
  27. package/dist/Scope.d.ts +26 -38
  28. package/dist/Scope.js +153 -174
  29. package/dist/Scope.js.map +1 -1
  30. package/dist/SymbolTable.d.ts +4 -1
  31. package/dist/SymbolTable.js +19 -7
  32. package/dist/SymbolTable.js.map +1 -1
  33. package/dist/XmlScope.d.ts +5 -4
  34. package/dist/XmlScope.js +16 -14
  35. package/dist/XmlScope.js.map +1 -1
  36. package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +6 -1
  37. package/dist/astUtils/{AstEditor.js → Editor.js} +9 -3
  38. package/dist/astUtils/Editor.js.map +1 -0
  39. package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +10 -6
  40. package/dist/astUtils/Editor.spec.js.map +1 -0
  41. package/dist/astUtils/reflection.d.ts +9 -4
  42. package/dist/astUtils/reflection.js +23 -7
  43. package/dist/astUtils/reflection.js.map +1 -1
  44. package/dist/astUtils/reflection.spec.js +2 -2
  45. package/dist/astUtils/reflection.spec.js.map +1 -1
  46. package/dist/astUtils/visitors.d.ts +14 -3
  47. package/dist/astUtils/visitors.js +22 -2
  48. package/dist/astUtils/visitors.js.map +1 -1
  49. package/dist/astUtils/visitors.spec.js +58 -7
  50. package/dist/astUtils/visitors.spec.js.map +1 -1
  51. package/dist/bscPlugin/BscPlugin.d.ts +10 -2
  52. package/dist/bscPlugin/BscPlugin.js +24 -4
  53. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  54. package/dist/bscPlugin/FileWriter.d.ts +6 -0
  55. package/dist/bscPlugin/FileWriter.js +24 -0
  56. package/dist/bscPlugin/FileWriter.js.map +1 -0
  57. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +8 -8
  58. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  59. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  60. package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +7 -2
  61. package/dist/bscPlugin/completions/CompletionsProcessor.js +112 -44
  62. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
  63. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +212 -6
  64. package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -1
  65. package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
  66. package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
  67. package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
  68. package/dist/bscPlugin/hover/HoverProcessor.d.ts +1 -7
  69. package/dist/bscPlugin/hover/HoverProcessor.js +10 -8
  70. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
  71. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +1 -0
  72. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +43 -0
  73. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
  74. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +22 -0
  75. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
  76. package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
  77. package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
  78. package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
  79. package/dist/bscPlugin/serialize/BslibManager.js +40 -0
  80. package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
  81. package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
  82. package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
  83. package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
  84. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
  85. package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +29 -5
  86. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
  87. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
  88. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
  89. package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
  90. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +2 -2
  91. package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -1
  92. package/dist/bscPlugin/validation/BrsFileValidator.js +8 -3
  93. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  94. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1 -1
  95. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
  96. package/dist/bscPlugin/validation/ScopeValidator.d.ts +5 -9
  97. package/dist/bscPlugin/validation/ScopeValidator.js +214 -222
  98. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  99. package/dist/bscPlugin/validation/ScopeValidator.spec.js +669 -0
  100. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
  101. package/dist/bscPlugin/validation/XmlFileValidator.js +2 -2
  102. package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
  103. package/dist/cli.js +1 -0
  104. package/dist/cli.js.map +1 -1
  105. package/dist/deferred.d.ts +2 -2
  106. package/dist/deferred.js.map +1 -1
  107. package/dist/diagnosticUtils.d.ts +1 -0
  108. package/dist/diagnosticUtils.js +4 -3
  109. package/dist/diagnosticUtils.js.map +1 -1
  110. package/dist/examples/plugins/removePrint.js +1 -1
  111. package/dist/examples/plugins/removePrint.js.map +1 -1
  112. package/dist/files/AssetFile.d.ts +26 -0
  113. package/dist/files/AssetFile.js +26 -0
  114. package/dist/files/AssetFile.js.map +1 -0
  115. package/dist/files/BrsFile.Class.spec.js +241 -40
  116. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  117. package/dist/files/BrsFile.d.ts +66 -16
  118. package/dist/files/BrsFile.js +330 -80
  119. package/dist/files/BrsFile.js.map +1 -1
  120. package/dist/files/BrsFile.spec.js +1134 -167
  121. package/dist/files/BrsFile.spec.js.map +1 -1
  122. package/dist/files/Factory.d.ts +25 -0
  123. package/dist/files/Factory.js +22 -0
  124. package/dist/files/Factory.js.map +1 -0
  125. package/dist/files/File.d.ts +106 -0
  126. package/dist/files/File.js +16 -0
  127. package/dist/files/File.js.map +1 -0
  128. package/dist/files/LazyFileData.d.ts +20 -0
  129. package/dist/files/LazyFileData.js +54 -0
  130. package/dist/files/LazyFileData.js.map +1 -0
  131. package/dist/files/LazyFileData.spec.d.ts +1 -0
  132. package/dist/files/LazyFileData.spec.js +27 -0
  133. package/dist/files/LazyFileData.spec.js.map +1 -0
  134. package/dist/files/XmlFile.d.ts +55 -17
  135. package/dist/files/XmlFile.js +88 -47
  136. package/dist/files/XmlFile.js.map +1 -1
  137. package/dist/files/XmlFile.spec.js +64 -57
  138. package/dist/files/XmlFile.spec.js.map +1 -1
  139. package/dist/files/tests/imports.spec.js +21 -8
  140. package/dist/files/tests/imports.spec.js.map +1 -1
  141. package/dist/files/tests/optionalChaning.spec.js +14 -14
  142. package/dist/files/tests/optionalChaning.spec.js.map +1 -1
  143. package/dist/globalCallables.js +1 -1
  144. package/dist/globalCallables.js.map +1 -1
  145. package/dist/index.d.ts +6 -1
  146. package/dist/index.js +6 -1
  147. package/dist/index.js.map +1 -1
  148. package/dist/interfaces.d.ts +357 -89
  149. package/dist/interfaces.js +10 -2
  150. package/dist/interfaces.js.map +1 -1
  151. package/dist/lexer/Lexer.js +1 -1
  152. package/dist/lexer/TokenKind.d.ts +1 -0
  153. package/dist/lexer/TokenKind.js +4 -1
  154. package/dist/lexer/TokenKind.js.map +1 -1
  155. package/dist/parser/AstNode.d.ts +2 -2
  156. package/dist/parser/AstNode.js +1 -1
  157. package/dist/parser/AstNode.js.map +1 -1
  158. package/dist/parser/BrsTranspileState.d.ts +3 -2
  159. package/dist/parser/BrsTranspileState.js +3 -2
  160. package/dist/parser/BrsTranspileState.js.map +1 -1
  161. package/dist/parser/Expression.d.ts +2 -2
  162. package/dist/parser/Expression.js +23 -19
  163. package/dist/parser/Expression.js.map +1 -1
  164. package/dist/parser/Parser.Class.spec.js +103 -0
  165. package/dist/parser/Parser.Class.spec.js.map +1 -1
  166. package/dist/parser/Parser.js +61 -13
  167. package/dist/parser/Parser.js.map +1 -1
  168. package/dist/parser/Parser.spec.js +227 -1
  169. package/dist/parser/Parser.spec.js.map +1 -1
  170. package/dist/parser/SGParser.d.ts +2 -2
  171. package/dist/parser/SGParser.js +3 -3
  172. package/dist/parser/SGParser.js.map +1 -1
  173. package/dist/parser/SGParser.spec.js +2 -2
  174. package/dist/parser/SGParser.spec.js.map +1 -1
  175. package/dist/parser/SGTypes.d.ts +1 -1
  176. package/dist/parser/Statement.d.ts +12 -5
  177. package/dist/parser/Statement.js +56 -26
  178. package/dist/parser/Statement.js.map +1 -1
  179. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +16 -16
  180. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  181. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
  182. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
  183. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
  184. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  185. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +64 -36
  186. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  187. package/dist/parser/tests/expression/TernaryExpression.spec.js +34 -34
  188. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  189. package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
  190. package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
  191. package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
  192. package/dist/parser/tests/statement/ConstStatement.spec.js +90 -16
  193. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
  194. package/dist/parser/tests/statement/Continue.spec.js +2 -2
  195. package/dist/parser/tests/statement/Continue.spec.js.map +1 -1
  196. package/dist/parser/tests/statement/Enum.spec.js +35 -26
  197. package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
  198. package/dist/parser/tests/statement/For.spec.js +6 -6
  199. package/dist/parser/tests/statement/For.spec.js.map +1 -1
  200. package/dist/parser/tests/statement/ForEach.spec.js +4 -4
  201. package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
  202. package/dist/parser/tests/statement/InterfaceStatement.spec.js +20 -12
  203. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
  204. package/dist/parser/tests/statement/PrintStatement.spec.js +10 -10
  205. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  206. package/dist/preprocessor/Manifest.d.ts +1 -1
  207. package/dist/preprocessor/Manifest.js +2 -2
  208. package/dist/preprocessor/Manifest.js.map +1 -1
  209. package/dist/roku-types/data.json +98 -193
  210. package/dist/roku-types/index.d.ts +15 -11
  211. package/dist/types/ArrayType.d.ts +1 -1
  212. package/dist/types/ArrayType.js +4 -0
  213. package/dist/types/ArrayType.js.map +1 -1
  214. package/dist/types/ArrayType.spec.js +1 -1
  215. package/dist/types/ArrayType.spec.js.map +1 -1
  216. package/dist/types/AssociativeArrayType.d.ts +1 -1
  217. package/dist/types/AssociativeArrayType.js +1 -1
  218. package/dist/types/AssociativeArrayType.js.map +1 -1
  219. package/dist/types/BooleanType.d.ts +1 -1
  220. package/dist/types/BooleanType.js +2 -1
  221. package/dist/types/BooleanType.js.map +1 -1
  222. package/dist/types/BscType.d.ts +2 -2
  223. package/dist/types/BscType.js +30 -9
  224. package/dist/types/BscType.js.map +1 -1
  225. package/dist/types/BuiltInInterfaceAdder.d.ts +3 -0
  226. package/dist/types/BuiltInInterfaceAdder.js +37 -16
  227. package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
  228. package/dist/types/BuiltInInterfaceAdder.spec.js +7 -0
  229. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -1
  230. package/dist/types/ClassType.d.ts +4 -3
  231. package/dist/types/ClassType.js +6 -3
  232. package/dist/types/ClassType.js.map +1 -1
  233. package/dist/types/ClassType.spec.js +5 -3
  234. package/dist/types/ClassType.spec.js.map +1 -1
  235. package/dist/types/ComponentType.d.ts +1 -1
  236. package/dist/types/ComponentType.js +3 -0
  237. package/dist/types/ComponentType.js.map +1 -1
  238. package/dist/types/DoubleType.js +3 -1
  239. package/dist/types/DoubleType.js.map +1 -1
  240. package/dist/types/EnumType.d.ts +1 -1
  241. package/dist/types/EnumType.js +7 -2
  242. package/dist/types/EnumType.js.map +1 -1
  243. package/dist/types/FloatType.js +3 -1
  244. package/dist/types/FloatType.js.map +1 -1
  245. package/dist/types/InheritableType.d.ts +7 -4
  246. package/dist/types/InheritableType.js +67 -3
  247. package/dist/types/InheritableType.js.map +1 -1
  248. package/dist/types/IntegerType.js +3 -1
  249. package/dist/types/IntegerType.js.map +1 -1
  250. package/dist/types/InterfaceType.d.ts +5 -4
  251. package/dist/types/InterfaceType.js +5 -12
  252. package/dist/types/InterfaceType.js.map +1 -1
  253. package/dist/types/InterfaceType.spec.js +23 -0
  254. package/dist/types/InterfaceType.spec.js.map +1 -1
  255. package/dist/types/LongIntegerType.js +3 -1
  256. package/dist/types/LongIntegerType.js.map +1 -1
  257. package/dist/types/NamespaceType.d.ts +2 -1
  258. package/dist/types/NamespaceType.js +3 -0
  259. package/dist/types/NamespaceType.js.map +1 -1
  260. package/dist/types/ObjectType.d.ts +1 -1
  261. package/dist/types/ReferenceType.js +40 -6
  262. package/dist/types/ReferenceType.js.map +1 -1
  263. package/dist/types/StringType.js +2 -2
  264. package/dist/types/StringType.js.map +1 -1
  265. package/dist/types/TypedFunctionType.d.ts +6 -1
  266. package/dist/types/TypedFunctionType.js +46 -16
  267. package/dist/types/TypedFunctionType.js.map +1 -1
  268. package/dist/types/TypedFunctionType.spec.js +99 -0
  269. package/dist/types/TypedFunctionType.spec.js.map +1 -1
  270. package/dist/types/UnionType.js +8 -0
  271. package/dist/types/UnionType.js.map +1 -1
  272. package/dist/types/helper.spec.js +15 -0
  273. package/dist/types/helper.spec.js.map +1 -1
  274. package/dist/types/helpers.d.ts +3 -0
  275. package/dist/types/helpers.js +33 -1
  276. package/dist/types/helpers.js.map +1 -1
  277. package/dist/util.d.ts +25 -9
  278. package/dist/util.js +165 -72
  279. package/dist/util.js.map +1 -1
  280. package/dist/validators/ClassValidator.js.map +1 -1
  281. package/package.json +2 -2
  282. package/dist/astUtils/AstEditor.js.map +0 -1
  283. package/dist/astUtils/AstEditor.spec.js.map +0 -1
  284. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
  285. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -31
  286. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
  287. /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
  288. /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → serialize/BslibInjector.spec.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
 
8
8
 
9
+ ## [0.66.0-alpha.8](https://github.com/rokucommunity/brighterscript/compare/v0.66.0-alpha.7...v0.66.0-alpha.8) - 2023-11-27
10
+ ### Added
11
+ - Interface optional properties ([#946](https://github.com/rokucommunity/brighterscript/pull/946))
12
+ - ifDraw2d to reRegion interface ([#960](https://github.com/rokucommunity/brighterscript/pull/960))
13
+ ### Changed
14
+ - cache `range` and `position` to improve performance ([#940](https://github.com/rokucommunity/brighterscript/pull/940))
15
+ - changes to make use with Plugins easier ([#959](https://github.com/rokucommunity/brighterscript/pull/959))
16
+ ### Fixed
17
+ - parsing order for `not` keyword ([#932](https://github.com/rokucommunity/brighterscript/pull/932))
18
+ - class fields using constructors not transpiling correctly ([#933](https://github.com/rokucommunity/brighterscript/pull/933))
19
+ - performance fixes ([#936](https://github.com/rokucommunity/brighterscript/pull/936))
20
+ - validation Performance: File level providedSymbols and `requiredSymbols` ([#944](https://github.com/rokucommunity/brighterscript/pull/944))
21
+ - interface & class support for go-to-definition ([#948](https://github.com/rokucommunity/brighterscript/pull/948))
22
+ - fixes using Enums directly in namespaced situations ([#949](https://github.com/rokucommunity/brighterscript/pull/949))
23
+ - completion performance ([#958](https://github.com/rokucommunity/brighterscript/pull/958))
24
+ - param order for AST class constructors for interface/class members ([#954](https://github.com/rokucommunity/brighterscript/pull/954))
25
+
26
+
27
+
28
+ ## [0.66.0-alpha.7](https://github.com/rokucommunity/brighterscript/compare/v0.66.0-alpha.6...v0.66.0-alpha.7) - 2023-10-16
29
+ ### Changed
30
+ - all changes from [v0.65.6](https://github.com/rokucommunity/brighterscript/compare/v0.65.5...v0.65.6) and [v0.65.7](https://github.com/rokucommunity/brighterscript/compare/v0.65.6...v0.65.7)
31
+ - Better multi-scope messages ([#904](https://github.com/rokucommunity/brighterscript/pull/904))
32
+ - Refine type compatibility message ([#908](https://github.com/rokucommunity/brighterscript/pull/908))
33
+ - Allow classes and native components in Typed Arrays ([#919](https://github.com/rokucommunity/brighterscript/pull/919))
34
+ - Fixes some enum validation stuff ([#920](https://github.com/rokucommunity/brighterscript/pull/920))
35
+ - Fixes compatibility of built in types (roArray -> typed arrays) ([#925](https://github.com/rokucommunity/brighterscript/pull/925))
36
+ - Semantic Tokes for Native Components and Type completion in Type Expressions ([#927](https://github.com/rokucommunity/brighterscript/pull/927))
37
+ - Adds callFunc as member method to Custom Components ([#929](https://github.com/rokucommunity/brighterscript/pull/929))
38
+ - Allows scrape-roku-docs to consolidate overloaded methods ([#930](https://github.com/rokucommunity/brighterscript/pull/930))
39
+ - File api ([#408](https://github.com/rokucommunity/brighterscript/pull/408))
40
+
41
+
42
+
9
43
  ## [0.66.0-alpha.6](https://github.com/rokucommunity/brighterscript/compare/v0.66.0-alpha.5...v0.66.0-alpha.6) - 2023-09-20
10
44
  ### Changed
11
45
  - Validates DottedSetStatements for type compatibility ([#894](https://github.com/rokucommunity/brighterscript/pull/894))
@@ -78,6 +112,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
112
  ## [0.66.0-alpha.0](https://github.com/rokucommunity/brighterscript/compare/v0.65.1...v0.66.0-alpha.0) - 2023-06-09
79
113
  ### Changed
80
114
  - all the type tracking stuff!
115
+ ## [0.65.10](https://github.com/rokucommunity/brighterscript/compare/v0.65.9...v0.65.10) - 2023-11-14
116
+ ### Changed
117
+ - upgrade to [roku-deploy@3.10.5](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#3105---2023-11-14). Notable changes since 3.10.4:
118
+ - Add better device-info docs ([roku-deploy#128](https://github.com/rokucommunity/roku-deploy/pull/128))
119
+ - Added some more message grabbing logic ([roku-deploy#127](https://github.com/rokucommunity/roku-deploy/pull/127))
120
+
121
+
122
+
123
+ ## [0.65.9](https://github.com/rokucommunity/brighterscript/compare/v0.65.8...v0.65.9) - 2023-11-06
124
+ ### Changed
125
+ - upgrade to [roku-deploy@3.10.4](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#3104---2023-11-03). Notable changes since 3.10.3:
126
+ - Enhance getDeviceInfo() method ([roku-deploy#120](https://github.com/rokucommunity/roku-deploy/pull/120))
127
+ ### Fixed
128
+ - issue with unary expression parsing ([#938](https://github.com/rokucommunity/brighterscript/pull/938))
129
+
130
+
131
+
132
+ ## [0.65.8](https://github.com/rokucommunity/brighterscript/compare/v0.65.7...v0.65.8) - 2023-10-06
133
+ ### Added
134
+ - interface parameter support ([#924](https://github.com/rokucommunity/brighterscript/pull/924))
135
+ ### Changed
136
+ - Bump postcss from 8.2.15 to 8.4.31 ([#928](https://github.com/rokucommunity/brighterscript/pull/928))
137
+ ### Fixed
138
+ - chore: fix typescript typing for `Deferred` ([#923](https://github.com/rokucommunity/brighterscript/pull/923))
139
+
140
+
141
+
142
+ ## [0.65.7](https://github.com/rokucommunity/brighterscript/compare/v0.65.6...v0.65.7) - 2023-09-28
143
+ ### Fixed
144
+ - fix bug in --noproject flag logic ([#922](https://github.com/rokucommunity/brighterscript/pull/922))
145
+
146
+
147
+
148
+ ## [0.65.6](https://github.com/rokucommunity/brighterscript/compare/v0.65.5...v0.65.6) - 2023-09-28
149
+ ### Added
150
+ - `noProject` flag to bsc so `bsconfig.json` loading can be skipped entirely even if present ([#868](https://github.com/rokucommunity/brighterscript/pull/868))
151
+ ### Changed
152
+ - docs: add some more details to the plugins ([#913](https://github.com/rokucommunity/brighterscript/pull/913))
153
+ - docs: add missing emitDefinitions ([#893](https://github.com/rokucommunity/brighterscript/pull/893))
154
+ ### Fixed
155
+ - incorrect quasi location in template string ([#921](https://github.com/rokucommunity/brighterscript/pull/921))
156
+ - `UnaryExpression` transpile for namespace and const ([#914](https://github.com/rokucommunity/brighterscript/pull/914))
157
+
158
+
159
+
160
+ ## [0.65.5](https://github.com/rokucommunity/brighterscript/compare/v0.65.4...v0.65.5) - 2023-09-06
161
+ ### Added
162
+ - support overriding bs_const values in bsconfig ([#887](https://github.com/rokucommunity/brighterscript/pull/887))
163
+ - allow optionally specifying bslib destination directory ([#871](https://github.com/rokucommunity/brighterscript/pull/871))
164
+ - Print diagnostic related information ([#867](https://github.com/rokucommunity/brighterscript/pull/867))
165
+ ### Fixed
166
+ - ensure consistent insertion of bslib.brs ([#870](https://github.com/rokucommunity/brighterscript/pull/870))
167
+ - Fix crashes in util for null ranges ([#869](https://github.com/rokucommunity/brighterscript/pull/869))
168
+ - Fix tab issue when printing diagnostics ([#865](https://github.com/rokucommunity/brighterscript/pull/865))
81
169
 
82
170
 
83
171
 
@@ -1719,13 +1807,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1719
1807
  ## [0.1.0](https://github.com/rokucommunity/brighterscript/compare/v0.1.0...v0.1.0) - 2019-08-10
1720
1808
  ### Changed
1721
1809
  - Cloned from [brightscript-language](https://github.com/rokucommunity/brightscript-language)
1722
-
1723
-
1724
-
1725
-
1726
-
1727
-
1728
-
1729
-
1730
-
1731
-
package/README.md CHANGED
@@ -469,6 +469,12 @@ Type: `boolean`
469
469
 
470
470
  Emit full paths to files when printing diagnostics to the console. Defaults to `false`.
471
471
 
472
+ #### `emitDefinitions`
473
+
474
+ Type: `boolean`
475
+
476
+ Emit type definition files (`d.bs`) during transpile. Defaults to `false`.
477
+
472
478
  #### `diagnosticFilters`
473
479
 
474
480
  Type: `Array<string | number | {src: string; codes: number[]}`
@@ -542,6 +548,16 @@ Type: `boolean`
542
548
 
543
549
  Allow BrighterScript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.
544
550
 
551
+ #### `bslibDestinationDir`
552
+
553
+ Type: `string`
554
+
555
+ Override the destination directory for the bslib.brs file. Use this if you want
556
+ to customize where the bslib.brs file is located in the staging directory. Note
557
+ that using a location outside of `source` will break scripts inside `source`
558
+ that depend on bslib.brs. Defaults to `source`.
559
+
560
+
545
561
  ## Ignore errors and warnings on a per-line basis
546
562
  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:
547
563
  - `bs:disable-next-line`
@@ -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": [
@@ -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,150 @@
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.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 };
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].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.name.text.toLowerCase());
94
+ },
95
+ FunctionParameterExpression: (expr) => {
96
+ assignedSymbols.add(expr.name.text.toLowerCase());
97
+ },
98
+ VariableExpression: (expr) => {
99
+ if (!assignedSymbols.has(expr.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
+ const changeSymbolSetForFlag = changedSymbols.get(requiredSymbol.flags);
133
+ if (util_1.util.setContainsUnresolvedSymbol(changeSymbolSetForFlag, requiredSymbol)) {
134
+ segmentsToWalkForValidation.push(segment);
135
+ break;
136
+ }
137
+ }
138
+ }
139
+ else if (segmentNeedsRevalidation) {
140
+ segmentsToWalkForValidation.push(segment);
141
+ }
142
+ }
143
+ return segmentsToWalkForValidation;
144
+ }
145
+ markSegmentAsValidated(segment) {
146
+ this.validatedSegments.set(segment, true);
147
+ }
148
+ }
149
+ exports.AstValidationSegmenter = AstValidationSegmenter;
150
+ //# 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,IAAI,KAAK,EAAW,CAAC;QAC7C,6BAAwB,GAAG,IAAI,GAAG,EAAW,CAAC;QAC9C,8BAAyB,GAAG,IAAI,GAAG,EAAkC,CAAC;IAkJjF,CAAC;IA/IG,KAAK;QACD,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,WAAW,CAAC,GAAY;QACpB,IAAI,CAAC,KAAK,EAAE,CAAC;QAEb,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAClB,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,EAAE;YACC,QAAQ,EAAE,mBAAQ,CAAC,eAAe;SACrC,CAAC,CAAC;IACP,CAAC;IAED,4BAA4B,CAAC,OAAgB,EAAE,UAAqE,EAAE,eAA6B;;QAC/I,IAAI,CAAC,UAAU,IAAI,IAAA,+BAAkB,EAAC,UAAU,CAAC,EAAE;YAC/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AAM,sBAAsB,GAAG,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBACxE,IAAI,WAAI,CAAC,2BAA2B,CAAC,sBAAsB,EAAE,cAAc,CAAC,EAAE;wBAC1E,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBAC1C,MAAM;qBACT;iBACJ;aACJ;iBAAM,IAAI,wBAAwB,EAAE;gBACjC,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;AAvJD,wDAuJC"}
@@ -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.
@@ -88,7 +95,7 @@ export interface BsConfig {
88
95
  emitFullPaths?: boolean;
89
96
  /**
90
97
  * Emit type definition files (`d.bs`)
91
- * @default true
98
+ * @default false
92
99
  */
93
100
  emitDefinitions?: boolean;
94
101
  /**
@@ -152,4 +159,11 @@ export interface BsConfig {
152
159
  * @default false
153
160
  */
154
161
  allowBrighterScriptInBrightScript?: boolean;
162
+ /**
163
+ * Override the destination directory for the bslib.brs file. Use this if
164
+ * you want to customize where the bslib.brs file is located in the staging
165
+ * directory. Note that using a location outside of `source` will break
166
+ * scripts inside `source` that depend on bslib.brs. Defaults to `source`.
167
+ */
168
+ bslibDestinationDir?: string;
155
169
  }
@@ -1,10 +1,11 @@
1
1
  import type { Range } from 'vscode-languageserver';
2
- import type { BscFile, BsDiagnostic, CommentFlag, DiagnosticCode } from './interfaces';
2
+ import type { File } from './files/File';
3
+ import type { BsDiagnostic, CommentFlag, DiagnosticCode } from './interfaces';
3
4
  export declare class CommentFlagProcessor {
4
5
  /**
5
6
  * The file this processor applies to
6
7
  */
7
- file: BscFile;
8
+ file: File;
8
9
  /**
9
10
  * An array of strings containing the types of text that a comment starts with. (i.e. `REM`, `'`, `<!--`)
10
11
  */
@@ -21,7 +22,7 @@ export declare class CommentFlagProcessor {
21
22
  /**
22
23
  * The file this processor applies to
23
24
  */
24
- file: BscFile,
25
+ file: File,
25
26
  /**
26
27
  * An array of strings containing the types of text that a comment starts with. (i.e. `REM`, `'`, `<!--`)
27
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CommentFlagProcessor.js","sourceRoot":"","sources":["../src/CommentFlagProcessor.ts"],"names":[],"mappings":";;;AACA,6DAA0D;AAE1D,iCAA8B;AAE9B,MAAa,oBAAoB;IAC7B;IACI;;OAEG;IACI,IAAa;IACpB;;OAEG;IACI,kBAAkB,EAAc;IACvC;;OAEG;IACI,kBAAkB,EAAsB;IAC/C;;OAEG;IACI,wBAAwB,EAAsB;QAZ9C,SAAI,GAAJ,IAAI,CAAS;QAIb,oBAAe,GAAf,eAAe,CAAiB;QAIhC,oBAAe,GAAf,eAAe,CAAyB;QAIxC,0BAAqB,GAArB,qBAAqB,CAAyB;QAOzD;;WAEG;QACI,iBAAY,GAAG,EAAmB,CAAC;QAE1C;;WAEG;QACI,gBAAW,GAAG,EAAoB,CAAC;QAZtC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3G,CAAC;IAiBM,MAAM,CAAC,IAAY,EAAE,KAAY;;QACpC,MAAM,SAAS,GAAG,IA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I,YAAY,EAAE;oBACd,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBAC1B,YAAY,GAAG,IAAI,CAAC;iBACvB;gBAED,uBAAuB;aAC1B;iBAAM;gBACH,IAAI,CAAC,YAAY,EAAE;oBACf,YAAY,GAAG;wBACX,UAAU,EAAE,CAAC;wBACb,IAAI,EAAE,EAAE;qBACX,CAAC;iBACL;gBACD,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC;aAC7B;SACJ;QACD,IAAI,YAAY,EAAE;YACd,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA1MD,oDA0MC"}
@@ -744,8 +744,15 @@ export declare let DiagnosticMessages: {
744
744
  code: number;
745
745
  severity: 1;
746
746
  };
747
+ incompatibleSymbolDefinition: (symbol: string, scopeName: string) => {
748
+ message: string;
749
+ code: number;
750
+ severity: 1;
751
+ };
747
752
  };
748
- export declare const DiagnosticCodeMap: Record<"genericParserMessage" | "cannotFindName" | "mismatchArgumentCount" | "duplicateFunctionImplementation" | "referencedFileDoesNotExist" | "xmlComponentMissingComponentDeclaration" | "xmlComponentMissingNameAttribute" | "xmlComponentMissingExtendsAttribute" | "xmlGenericParseError" | "unnecessaryScriptImportInChildFromParent" | "overridesAncestorFunction" | "localVarFunctionShadowsParentFunction" | "scriptImportCaseMismatch" | "fileNotReferencedByAnyOtherFile" | "unknownDiagnosticCode" | "scriptSrcCannotBeEmpty" | "expectedIdentifierAfterKeyword" | "missingCallableKeyword" | "expectedValidTypeToFollowAsKeyword" | "bsFeatureNotSupportedInBrsFiles" | "brsConfigJsonIsDeprecated" | "bsConfigJsonHasSyntaxErrors" | "namespacedClassCannotShareNamewithNonNamespacedClass" | "cannotUseOverrideKeywordOnConstructorFunction" | "importStatementMustBeDeclaredAtTopOfFile" | "methodDoesNotExistOnType" | "duplicateIdentifier" | "missingOverrideKeyword" | "duplicateClassDeclaration" | "classCouldNotBeFound" | "expectedClassFieldIdentifier" | "expressionIsNotConstructable" | "expectedKeyword" | "expectedLeftParenAfterCallable" | "expectedNameAfterCallableKeyword" | "expectedLeftParenAfterCallableName" | "tooManyCallableParameters" | "__unused" | "requiredParameterMayNotFollowOptionalParameter" | "expectedNewlineOrColon" | "functionNameCannotEndWithTypeDesignator" | "callableBlockMissingEndKeyword" | "mismatchedEndCallableKeyword" | "expectedParameterNameButFound" | "__unused2" | "cannotUseReservedWordAsIdentifier" | "expectedOperatorAfterIdentifier" | "expectedInlineIfStatement" | "expectedFinalNewline" | "couldNotFindMatchingEndKeyword" | "expectedCatchBlockInTryCatch" | "expectedEndForOrNextToTerminateForLoop" | "expectedInAfterForEach" | "expectedExpressionAfterForEachIn" | "unexpectedColonBeforeIfStatement" | "expectedStringLiteralAfterKeyword" | "keywordMustBeDeclaredAtRootLevel" | "libraryStatementMustBeDeclaredAtTopOfFile" | "expectedEndIfElseIfOrElseToTerminateThenBlock" | "expectedEndTryToTerminateTryCatch" | "expectedEndIfToCloseIfStatement" | "expectedStatementToFollowConditionalCondition" | "expectedStatementToFollowElse" | "consecutiveIncrementDecrementOperatorsAreNotAllowed" | "incrementDecrementOperatorsAreNotAllowedAsResultOfFunctionCall" | "xmlUnexpectedTag" | "expectedStatementOrFunctionCallButReceivedExpression" | "xmlFunctionNotFound" | "xmlInvalidFieldType" | "xmlUnexpectedChildren" | "xmlTagMissingAttribute" | "expectedLabelIdentifierAfterGotoKeyword" | "expectedRightSquareBraceAfterArrayOrObjectIndex" | "expectedPropertyNameAfterPeriod" | "tooManyCallableArguments" | "expectedRightParenAfterFunctionCallArguments" | "unmatchedLeftParenAfterExpression" | "unmatchedLeftSquareBraceAfterArrayLiteral" | "unexpectedAAKey" | "expectedColonBetweenAAKeyAndvalue" | "unmatchedLeftCurlyAfterAALiteral" | "unexpectedToken" | "unexpectedCharacter" | "unterminatedStringAtEndOfLine" | "unterminatedStringAtEndOfFile" | "fractionalHexLiteralsAreNotSupported" | "unexpectedConditionalCompilationString" | "duplicateConstDeclaration" | "constAliasDoesNotExist" | "invalidHashConstValue" | "referencedConstDoesNotExist" | "invalidHashIfValue" | "hashError" | "expectedEqualAfterConstName" | "expectedHashElseIfToCloseHashIf" | "constNameCannotBeReservedWord" | "expectedIdentifier" | "expectedAttributeNameAfterAtSymbol" | "childFieldTypeNotAssignableToBaseProperty" | "classChildMemberDifferentMemberTypeThanAncestor" | "classConstructorMissingSuperCall" | "classConstructorIllegalUseOfMBeforeSuperCall" | "classFieldCannotBeOverridden" | "unusedAnnotation" | "localVarShadowedByScopedFunction" | "scopeFunctionShadowedByBuiltInFunction" | "localVarSameNameAsClass" | "unnecessaryCodebehindScriptImport" | "expectedOpenParenToFollowCallfuncIdentifier" | "expectedToken" | "parameterMayNotHaveSameNameAsNamespace" | "variableMayNotHaveSameNameAsNamespace" | "unterminatedTemplateStringAtEndOfFile" | "unterminatedTemplateExpression" | "duplicateComponentName" | "functionCannotHaveSameNameAsClass" | "missingExceptionVarToFollowCatch" | "missingExceptionExpressionAfterThrowKeyword" | "missingLeftSquareBracketAfterDimIdentifier" | "missingRightSquareBracketAfterDimIdentifier" | "missingExpressionsInDimStatement" | "mismatchedOverriddenMemberVisibility" | "__unused3" | "enumValueMustBeType" | "enumValueIsRequired" | "unknownEnumValue" | "duplicateEnumDeclaration" | "unknownRoSGNode" | "unknownBrightScriptComponent" | "mismatchCreateObjectArgumentCount" | "deprecatedBrightScriptComponent" | "circularReferenceDetected" | "unexpectedStatementOutsideFunction" | "detectedTooDeepFileSource" | "illegalContinueStatement" | "keywordMustBeDeclaredAtNamespaceLevel" | "itemCannotBeUsedAsVariable" | "callfuncHasToManyArgs" | "noOptionalChainingInLeftHandSideOfAssignment" | "itemCannotBeUsedAsType" | "argumentTypeMismatch" | "returnTypeMismatch" | "assignmentTypeMismatch" | "operatorTypeMismatch", number>;
753
+ export declare const defaultMaximumTruncationLength = 160;
754
+ export declare function typeCompatibilityMessage(actualTypeString: string, expectedTypeString: string, data: TypeCompatibilityData): string;
755
+ export declare const DiagnosticCodeMap: Record<"genericParserMessage" | "cannotFindName" | "mismatchArgumentCount" | "duplicateFunctionImplementation" | "referencedFileDoesNotExist" | "xmlComponentMissingComponentDeclaration" | "xmlComponentMissingNameAttribute" | "xmlComponentMissingExtendsAttribute" | "xmlGenericParseError" | "unnecessaryScriptImportInChildFromParent" | "overridesAncestorFunction" | "localVarFunctionShadowsParentFunction" | "scriptImportCaseMismatch" | "fileNotReferencedByAnyOtherFile" | "unknownDiagnosticCode" | "scriptSrcCannotBeEmpty" | "expectedIdentifierAfterKeyword" | "missingCallableKeyword" | "expectedValidTypeToFollowAsKeyword" | "bsFeatureNotSupportedInBrsFiles" | "brsConfigJsonIsDeprecated" | "bsConfigJsonHasSyntaxErrors" | "namespacedClassCannotShareNamewithNonNamespacedClass" | "cannotUseOverrideKeywordOnConstructorFunction" | "importStatementMustBeDeclaredAtTopOfFile" | "methodDoesNotExistOnType" | "duplicateIdentifier" | "missingOverrideKeyword" | "duplicateClassDeclaration" | "classCouldNotBeFound" | "expectedClassFieldIdentifier" | "expressionIsNotConstructable" | "expectedKeyword" | "expectedLeftParenAfterCallable" | "expectedNameAfterCallableKeyword" | "expectedLeftParenAfterCallableName" | "tooManyCallableParameters" | "__unused" | "requiredParameterMayNotFollowOptionalParameter" | "expectedNewlineOrColon" | "functionNameCannotEndWithTypeDesignator" | "callableBlockMissingEndKeyword" | "mismatchedEndCallableKeyword" | "expectedParameterNameButFound" | "__unused2" | "cannotUseReservedWordAsIdentifier" | "expectedOperatorAfterIdentifier" | "expectedInlineIfStatement" | "expectedFinalNewline" | "couldNotFindMatchingEndKeyword" | "expectedCatchBlockInTryCatch" | "expectedEndForOrNextToTerminateForLoop" | "expectedInAfterForEach" | "expectedExpressionAfterForEachIn" | "unexpectedColonBeforeIfStatement" | "expectedStringLiteralAfterKeyword" | "keywordMustBeDeclaredAtRootLevel" | "libraryStatementMustBeDeclaredAtTopOfFile" | "expectedEndIfElseIfOrElseToTerminateThenBlock" | "expectedEndTryToTerminateTryCatch" | "expectedEndIfToCloseIfStatement" | "expectedStatementToFollowConditionalCondition" | "expectedStatementToFollowElse" | "consecutiveIncrementDecrementOperatorsAreNotAllowed" | "incrementDecrementOperatorsAreNotAllowedAsResultOfFunctionCall" | "xmlUnexpectedTag" | "expectedStatementOrFunctionCallButReceivedExpression" | "xmlFunctionNotFound" | "xmlInvalidFieldType" | "xmlUnexpectedChildren" | "xmlTagMissingAttribute" | "expectedLabelIdentifierAfterGotoKeyword" | "expectedRightSquareBraceAfterArrayOrObjectIndex" | "expectedPropertyNameAfterPeriod" | "tooManyCallableArguments" | "expectedRightParenAfterFunctionCallArguments" | "unmatchedLeftParenAfterExpression" | "unmatchedLeftSquareBraceAfterArrayLiteral" | "unexpectedAAKey" | "expectedColonBetweenAAKeyAndvalue" | "unmatchedLeftCurlyAfterAALiteral" | "unexpectedToken" | "unexpectedCharacter" | "unterminatedStringAtEndOfLine" | "unterminatedStringAtEndOfFile" | "fractionalHexLiteralsAreNotSupported" | "unexpectedConditionalCompilationString" | "duplicateConstDeclaration" | "constAliasDoesNotExist" | "invalidHashConstValue" | "referencedConstDoesNotExist" | "invalidHashIfValue" | "hashError" | "expectedEqualAfterConstName" | "expectedHashElseIfToCloseHashIf" | "constNameCannotBeReservedWord" | "expectedIdentifier" | "expectedAttributeNameAfterAtSymbol" | "childFieldTypeNotAssignableToBaseProperty" | "classChildMemberDifferentMemberTypeThanAncestor" | "classConstructorMissingSuperCall" | "classConstructorIllegalUseOfMBeforeSuperCall" | "classFieldCannotBeOverridden" | "unusedAnnotation" | "localVarShadowedByScopedFunction" | "scopeFunctionShadowedByBuiltInFunction" | "localVarSameNameAsClass" | "unnecessaryCodebehindScriptImport" | "expectedOpenParenToFollowCallfuncIdentifier" | "expectedToken" | "parameterMayNotHaveSameNameAsNamespace" | "variableMayNotHaveSameNameAsNamespace" | "unterminatedTemplateStringAtEndOfFile" | "unterminatedTemplateExpression" | "duplicateComponentName" | "functionCannotHaveSameNameAsClass" | "missingExceptionVarToFollowCatch" | "missingExceptionExpressionAfterThrowKeyword" | "missingLeftSquareBracketAfterDimIdentifier" | "missingRightSquareBracketAfterDimIdentifier" | "missingExpressionsInDimStatement" | "mismatchedOverriddenMemberVisibility" | "__unused3" | "enumValueMustBeType" | "enumValueIsRequired" | "unknownEnumValue" | "duplicateEnumDeclaration" | "unknownRoSGNode" | "unknownBrightScriptComponent" | "mismatchCreateObjectArgumentCount" | "deprecatedBrightScriptComponent" | "circularReferenceDetected" | "unexpectedStatementOutsideFunction" | "detectedTooDeepFileSource" | "illegalContinueStatement" | "keywordMustBeDeclaredAtNamespaceLevel" | "itemCannotBeUsedAsVariable" | "callfuncHasToManyArgs" | "noOptionalChainingInLeftHandSideOfAssignment" | "itemCannotBeUsedAsType" | "argumentTypeMismatch" | "returnTypeMismatch" | "assignmentTypeMismatch" | "operatorTypeMismatch" | "incompatibleSymbolDefinition", number>;
749
756
  export declare let diagnosticCodes: number[];
750
757
  export interface DiagnosticInfo {
751
758
  message: string;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.diagnosticCodes = exports.DiagnosticCodeMap = exports.DiagnosticMessages = void 0;
3
+ exports.diagnosticCodes = exports.DiagnosticCodeMap = exports.typeCompatibilityMessage = exports.defaultMaximumTruncationLength = exports.DiagnosticMessages = void 0;
4
4
  const vscode_languageserver_1 = require("vscode-languageserver");
5
+ const util_1 = require("./util");
5
6
  /**
6
7
  * An object that keeps track of all possible error messages.
7
8
  */
@@ -730,19 +731,19 @@ exports.DiagnosticMessages = {
730
731
  severity: vscode_languageserver_1.DiagnosticSeverity.Error
731
732
  }),
732
733
  argumentTypeMismatch: (actualTypeString, expectedTypeString, data) => ({
733
- message: `Argument of type '${actualTypeString}' is not compatible with parameter of type '${expectedTypeString}'${typeCompatibilityMessage(data)}`,
734
+ message: `Argument of type '${actualTypeString}' is not compatible with parameter of type '${expectedTypeString}'${typeCompatibilityMessage(actualTypeString, expectedTypeString, data)}`,
734
735
  data: data,
735
736
  code: 1141,
736
737
  severity: vscode_languageserver_1.DiagnosticSeverity.Error
737
738
  }),
738
739
  returnTypeMismatch: (actualTypeString, expectedTypeString, data) => ({
739
- message: `Type '${actualTypeString}' is not compatible with declared return type '${expectedTypeString}'${typeCompatibilityMessage(data)}'`,
740
+ message: `Type '${actualTypeString}' is not compatible with declared return type '${expectedTypeString}'${typeCompatibilityMessage(actualTypeString, expectedTypeString, data)}'`,
740
741
  data: data,
741
742
  code: 1142,
742
743
  severity: vscode_languageserver_1.DiagnosticSeverity.Error
743
744
  }),
744
745
  assignmentTypeMismatch: (actualTypeString, expectedTypeString, data) => ({
745
- message: `Type '${actualTypeString}' is not compatible with type '${expectedTypeString}'${typeCompatibilityMessage(data)}`,
746
+ message: `Type '${actualTypeString}' is not compatible with type '${expectedTypeString}'${typeCompatibilityMessage(actualTypeString, expectedTypeString, data)}`,
746
747
  data: data,
747
748
  code: 1143,
748
749
  severity: vscode_languageserver_1.DiagnosticSeverity.Error
@@ -751,23 +752,39 @@ exports.DiagnosticMessages = {
751
752
  message: `Operator '${operatorString}' cannot be applied to type${secondType ? 's' : ''} '${firstType}'${secondType ? ` and '${secondType}'` : ''}`,
752
753
  code: 1144,
753
754
  severity: vscode_languageserver_1.DiagnosticSeverity.Error
755
+ }),
756
+ incompatibleSymbolDefinition: (symbol, scopeName) => ({
757
+ message: `'${symbol}' is incompatible across scope group (${scopeName})`,
758
+ code: 1145,
759
+ severity: vscode_languageserver_1.DiagnosticSeverity.Error
754
760
  })
755
761
  };
756
- function typeCompatibilityMessage(data) {
757
- var _a, _b, _c, _d, _e;
762
+ exports.defaultMaximumTruncationLength = 160;
763
+ function typeCompatibilityMessage(actualTypeString, expectedTypeString, data) {
764
+ var _a, _b;
758
765
  let message = '';
759
766
  if (((_a = data === null || data === void 0 ? void 0 : data.missingFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
760
- for (const missingField of data.missingFields) {
761
- message += `\n - Missing member '${missingField.name}' of type ${(_b = missingField.expectedType) === null || _b === void 0 ? void 0 : _b.toString()}`;
762
- }
767
+ message = `\n Type '${actualTypeString}' is missing the following members: ` + util_1.default.truncate({
768
+ leadingText: ``,
769
+ trailingText: '',
770
+ itemSeparator: ', ',
771
+ items: data.missingFields,
772
+ partBuilder: (x) => x.name,
773
+ maxLength: exports.defaultMaximumTruncationLength
774
+ });
763
775
  }
764
- if (((_c = data === null || data === void 0 ? void 0 : data.fieldMismatches) === null || _c === void 0 ? void 0 : _c.length) > 0) {
765
- for (const fieldMismatch of data.fieldMismatches) {
766
- message += `\n - Member '${fieldMismatch.name}' should be of type ${(_d = fieldMismatch.expectedType) === null || _d === void 0 ? void 0 : _d.toString()}, but it is of type ${(_e = fieldMismatch.actualType) === null || _e === void 0 ? void 0 : _e.toString()}`;
767
- }
776
+ else if (((_b = data === null || data === void 0 ? void 0 : data.fieldMismatches) === null || _b === void 0 ? void 0 : _b.length) > 0) {
777
+ message = '. ' + util_1.default.truncate({
778
+ leadingText: `Type '${actualTypeString}' has incompatible members:`,
779
+ items: data.fieldMismatches,
780
+ itemSeparator: '',
781
+ partBuilder: (x) => `\n member "${x.name}" should be '${x.expectedType}' but is '${x.actualType}'`,
782
+ maxLength: exports.defaultMaximumTruncationLength
783
+ });
768
784
  }
769
785
  return message;
770
786
  }
787
+ exports.typeCompatibilityMessage = typeCompatibilityMessage;
771
788
  exports.DiagnosticCodeMap = {};
772
789
  exports.diagnosticCodes = [];
773
790
  for (let key in exports.DiagnosticMessages) {